1. 程式人生 > >CentOS6 在VirtualBox中實現全屏和根據視窗大小自動調整解析度 | Install Guest additions and run fullscreen mode on VirtualB

CentOS6 在VirtualBox中實現全屏和根據視窗大小自動調整解析度 | Install Guest additions and run fullscreen mode on VirtualB

前一篇文章《CentOS6 Minimal 安裝桌面(GNOME)》寫了如何給CentOS安裝圖形桌面系統,這篇文章說明通過安裝增強包來實現VirtualBox中的CentOS6.x實現全屏和解析度自動調整。

環境 | Enviroment

  • CentOS 6.6
  • VirtualBox 4.3.28

安裝 | Setup

整個過程分為4個步聚,許多人因為沒有安裝顯示卡驅動導致安裝了增強包後無法實現解析度自動調整。
注:所有的安裝必須擁有root許可權。

1、安裝編譯所需的依賴包

yum groupinstall "Development Tools"

2、安裝核心開發包

yum install kernel-devel
yum install kernel-headers

3、安裝ATI/AMD顯示卡驅動

1)增加新的公鑰。

rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org

2)安裝yum-plugin-fastestmirror。

rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
yum -y install yum-plugin-fastestmirror

3)安裝顯示卡驅動。

yum -y install kmod-fglrx

4、安裝VirtualBox增強包

cd /media/VBOXADDITIONS_4.3.28
_100309/ ./VBoxLinuxAdditions.run

系統輸出如下資訊:

Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.28 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.28 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules       [確定
] Building the VirtualBox Guest Additions kernel modules Building the main Guest Additions module [確定] Building the shared folder support module [確定] Building the OpenGL support module [確定] Doing non-kernel setup of the Guest Additions [確定] You should restart your guest to make sure the new modules are actually used Installing the Window System drivers Installing X.Org Server 1.15 modules [確定] Setting up the Window System to use the Guest Additions [確定] You may need to restart the the Window System (or just restart the guest system) to enable the Guest Additions. Installing graphics libraries and desktop services componen[確定]

重啟系統,CentOS就可根據視窗大小自動調整解析度了:
CentOS6根據視窗大小自動調整解析度

附加說明 | Additions

如果沒有安裝顯示卡驅動,安裝了增強包後虛擬機器中的CentOS不能自動根據視窗大小的改變而自動調整解析度,只顯示了兩個解析度:

  • 1024*768 60Hz
  • 800*600 60Hz

<正文結束>