增强功能是实现分辨率自适应和调整的基础,需优先安装。
/run/media/你的用户名/VBox_GAs_版本号),右键以管理员权限运行VBoxLinuxAdditions.run脚本。kernel-devel、gcc等),系统会自动提示或通过yum安装。安装完成后重启虚拟机。安装增强功能后,可直接通过系统设置修改分辨率:
若图形界面无所需分辨率,可通过编辑配置文件手动添加:
sudo Xorg :1 -configure,生成/root/xorg.conf.new文件。sudo cp /root/xorg.conf.new /etc/X11/xorg.conf,将临时配置文件复制到系统目录。vi或nano打开/etc/X11/xorg.conf,找到Section "Screen"下的SubSection "Display",在Depth行后添加Modes字段(需包含常用分辨率,如"1024x768" "1366x768" "1920x1080")。示例如下:Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768" "1366x768" "1920x1080" # 按优先级排序
EndSubSection
EndSection
Esc→输入:wq保存文件,重启虚拟机使配置生效。xrandr是命令行工具,可快速查看和设置分辨率:
xrandr,会列出当前显示器支持的分辨率(如VGA-1 connected primary 1024x768+0+0)。xrandr --output 显示器名称 --mode 目标分辨率(如xrandr --output VGA-1 --mode 1366x768),重启后失效。xrandr命令添加到启动脚本(如~/.bash_profile或/etc/rc.local),实现开机自动应用。xorg.conf文件)。