CentOS6 在VirtualBox中实现全屏和根据窗口大小自动调整分辨率

作者:聂勇 欢迎转载,请保留作者信息并说明文章来源!

前一篇文章《CentOS6 Minimal 安装桌面(GNOME)》写了如何给CentOS安装图形桌面系统,这篇文章说明通过安装增强包来实现VirtualBox中的CentOS6.x实现全屏和分辨率自动调整。

环境 | Enviroment

  • CentOS 6.6
  • VirtualBox 4.3.28

安装 | Setup

整个过程分为4个步聚,许多人因为没有安装显卡驱动导致安装了增强包后无法实现分辨率自动调整。
注:所有的安装必须拥有root权限。

1、安装编译所需的依赖包

1
yum groupinstall "Development Tools"

2、安装内核开发包

1
2
yum install kernel-devel
yum install kernel-headers

3、安装ATI/AMD显卡驱动

1)增加新的公钥。

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

2)安装yum-plugin-fastestmirror。

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

3)安装显卡驱动。

1
yum -y install kmod-fglrx

4、安装VirtualBox增强包

1
2
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就可根据窗口大小自动调整分辨率了:
CentOS桌面

附加说明 | Additions

如果没有安装显卡驱动,安装了增强包后虚拟机中的CentOS不能自动根据窗口大小的改变而自动调整分辨率,只显示了两个分辨率:

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