Guest Additions是VirtualBox提供的增強工具,必須安裝才能實現分辨率自動調整和更多顯示功能。
/run/media/你的用戶名/VBox_GAs_版本號
)。sudo ./VBoxLinuxAdditions.run
sudo reboot
)。若界面設置無法滿足需求,可通過命令行動態調整(需聯網安裝xrandr
工具):
sudo yum install xrandr -y # CentOS 7及以下
sudo dnf install xrandr -y # CentOS 8及以上
xrandr
,輸出會顯示當前顯示器名稱(如Virtual1
)和支持的分辨率列表。cvt 1920 1080
輸出示例:Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
。xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 "1920x1080_60.00"
xrandr --output Virtual1 --mode "1920x1080_60.00"
xrandr
命令添加到~/.bashrc
文件末尾(用文本編輯器打開,如nano ~/.bashrc
),保存后運行source ~/.bashrc
,下次登錄時會自動應用該分辨率。若上述方法無效,可手動創建或修改xorg.conf
文件(需謹慎操作,錯誤的配置可能導致無法進入系統):
sudo Xorg -configure
生成的配置文件通常位于/root/xorg.conf.new
,將其復制到/etc/X11/
目錄:sudo cp /root/xorg.conf.new /etc/X11/xorg.conf
xorg.conf
:sudo nano /etc/X11/xorg.conf
),找到Section "Screen"
部分,修改Modes
行,添加所需分辨率(如"1920x1080"
):Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080" "1024x768" "800x600" # 按優先級排序
EndSubSection
EndSection
/var/log/Xorg.0.log
)排查顯示驅動問題。