RedHat linux AS 5下VirtualBox3.1.6增强功能的安装

1.    进入VirtualBox下安装的Red Hat Linux AS 5系统,点“设备”菜单下的“安装增强功能”,在linux系统中的光驱中即可看见VBOXADDITIONS_3.1.6_59338.iso
2.    进入光盘,执行安装文件
[root@localhost ~]# cd/media/VBOXADDITIONS_3.1.6_59338
[root@localhost VBOXADDITIONS_3.1.6_59338]# ./autorun.sh
提示权限不够,可将文件夹VBOXADDITIONS_3.1.6_59338复制到硬盘目录,并修改权限。
3.    复制并修改权限
[root@localhost ~]# cp –r /media/ VBOXADDITIONS_3.1.6_59338 /usr/local/ VBOXADDITIONS
[root@localhost ~]# chmod a+x /usr/local/ VBOXADDITIONS
4.    运行安装
[root@localhost VBOXADDITIONS]# ./VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 3.1.4 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version of VirtualBox Guest Additions...
Building the VirtualBox Guest Additions kernel modules     [失败]
(Your system does not seem to be set up to build kernel modules.
Look at /var/log/vboxadd-install.log to find out what went wrong)
5.    查看/var/log/vboxadd-install.log信息
[root@localhost VBOXADDITIONS]# cat /var/log/vboxadd-install.log
Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again.。 停止。
6.    检查kernel-devel和kernel-headers是否安装
[root@localhost VBOXADDITIONS]# rpm –q kernel-devel
[root@localhost VBOXADDITIONS]# rpm –q kernel-headers
7.    安装kernel-devel kernel-headers
放入将RedHat Linux AS 5的安装光盘,并进入Server目录
[root@localhost ~]# cd /media/CDROM/Server
[root@localhost Server]# rpm –ivh kernel-headers-2.6.18-8.el5.i386.rpm
[root@localhost Server]# rpm –ivh kernel-devel-2.6.18-8.el5.i686.rpm
安装kernel-devel和kernel-headers两个软件包,配置编译环境
[root@localhost Server]# yum install kernel-devel kernel-headers
8.    再次进入目录/usr/local/VBOXADDITIONS执行安装文件
[root@localhost VBOXADDITIONS]# ./VBoxLinuxAdditions-x86.run
提示失败,查看错误信息,提示未找到GCC
9.    安装GCC
放入将RedHat Linux AS 5的安装光盘,并进入Server目录
[root@localhost ~]# cd /media/CDROM/Server
[root@localhost Server]# rpm -ivh glibc-headers-2.5-12.i386.rpm
[root@localhost Server]# rpm -ivh glibc-devel-2.5-12.i386.rpm
[root@localhost Server]# rpm -ivh libgomp-4.1.1-52.el5.i386.rpm
[root@localhost Server]# rpm -ivh gcc-4.1.1-52.el5.i386.rpm
[root@localhost Server]# rpm -ivh libstdc++-devel-4.1.1-52.el5.i386.rpm
[root@localhost Server]# rpm -ivh gcc-c++-4.1.1-52.el5.i386.rpm
10.    再次进入目录/usr/local/VBOXADDITIONS安装执行文件
[root@localhost VBOXADDITIONS]# ./VBoxLinuxAdditions-x86.run
最后完成安装。

你可能感兴趣的:(Linux)