RedHat 5.4安装VirtualBox虚拟机增强包

浏览: 2367

由于工作需要,经常需要在linux下进行环境搭建,我选择的方式是在win7下安装VirtualBox,然后在VirtualBox安装RedHat 5.4。

为了能让虚拟机自动调整显示尺寸以及使用数据空间与宿主系统进行文件共享,必须在RedHat中安装增强包,也就是VBOX Additions。

OK,下面让我们开始安装。

启动虚拟机,以root登录,然后选择 “设备”-“安装增强功能”加载增强功能镜像。

 

打开终端,切换到刚加载的镜像所在的目录,开始安装:

 

由于RedHat是默认安装,缺少内核头文件,安装失败

 

根据提示安装缺少的包

[root@biee11g ~]# yum install kernel-devel

如果有系统DVD光盘可以将光盘配置为yum的源,详细方法可以查看我的另一篇文章

VirtualBox下RedHat 5.4 使用DVD光盘作为yum源

 

 

 

安装完kernel-devel之后,再次运行安装程序

<p>[root@biee11g VBOXADDITIONS_4.1.6_74713]# sh VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.6 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.6 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules           [确定]
Removing existing VirtualBox non-DKMS kernel modules       [确定]
Building the VirtualBox Guest Additions kernel modules
The gcc utility was not found. If the following module compilation fails then
this could be the reason and you should try installing it.</p><p>Not building the VirtualBox advanced graphics driver as this Linux version is
too old to use it.
Building the main Guest Additions module                   [失败]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions              [确定]
Installing the Window System drivers
Installing X.Org 7.1 modules                               [确定]
Setting up the Window System to use the Guest Additions    [确定]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.</p><p>Installing graphics libraries and desktop services componen[确定]
[root@biee11g VBOXADDITIONS_4.1.6_74713]# 
</p>

再次失败,根据提示查看/var/log/vboxadd-install.log发现如下内容:

GCM -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS    -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASEN
AME=KBUILD_STR(VBoxGuest_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxguest)" -c -o /tmp/vbox.0/.t
mp_VBoxGuest-linux.o /tmp/vbox.0/VBoxGuest-linux.c
/bin/sh: gcc: command not found
make[2]: *** [/tmp/vbox.0/VBoxGuest-linux.o] 错误 127
make[1]: *** [_module_/tmp/vbox.0] 错误 2
make: *** [vboxguest] 错误 2
Creating user for the Guest Additions.

原来是没有安装gcc

[root@biee11g ~]# yum install gcc

安装好gcc之后,再次运行安装程序

[root@biee11g VBOXADDITIONS_4.1.6_74713]# sh VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.6 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.6 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules           [确定]
Removing existing VirtualBox non-DKMS kernel modules       [确定]
Building the VirtualBox Guest Additions kernel modules
Not building the VirtualBox advanced graphics driver as this Linux version is
too old to use it.
Building the main Guest Additions module                   [确定]
Building the shared folder support module                  [确定]
Doing non-kernel setup of the Guest Additions              [确定]
Starting the VirtualBox Guest Additions                    [确定]
Installing the Window System drivers
Installing X.Org 7.1 modules                               [确定]
Setting up the Window System to use the Guest Additions    [确定]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services componen[确定]

OK,安装成功,重启。

 

 

 

现在view下的“自动调整显示尺寸”就可用了,至此增强包安装成功。

推荐 0
本文由 风在身后 创作,采用 知识共享署名-相同方式共享 3.0 中国大陆许可协议 进行许可。
转载、引用前需联系作者,并署名作者且注明文章出处。
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责。本站是一个个人学习交流的平台,并不用于任何商业目的,如果有任何问题,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

0 个评论

要回复文章请先登录注册