CentOS 6.0 fix for VBoxGuestAdditions installation for VirtualBox

安装virtualbox增强功能的时候,出现

Building the main Guest Additions module                   [FAILED] (Look at /var/log/vboxadd-install.log to find out what went wrong)

的错误,google了一下找到以下解决方案。

原网址:http://vbtechsupport.com/1139/


Virtualbox is a useful tool for testing various Linux and Windows operating systems in a virtualized environment. However, while testing mymodified Centmin Nginx installation script on CentOS 6.0 64bit, I came across an issue with installing VBoxGuestAddition components – the VirtualBox Guest Additions’ kernel modules failed to get built. Prior to CentOS 6.0, you could fix this by ensuring kernel-headers and other prerequisites were installed first.


yum -y install dkms kernel* gcc

The error message:

 sh ./VBoxLinuxAdditions-amd64.run
 
Building the VirtualBox Guest Additions kernel modules[FAILED]
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.  Once you have corrected it, you can
run
 
  /etc/init.d/vboxadd setup
 
to build them.
Doing non-kernel setup of the Guest Additions[  OK  ]
Installing the Window System drivers
Installing X.Org Server 1.7 modules[  OK  ]
Setting up the Window System to use the Guest Additions[  OK  ]
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 components[  OK  ]

If you check log /var/log/vboxadd-install.log you’ll see

*** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again..  Stop.

The Fix

However, with CentOS 6.0 the above solution didn’t work as it seems the YUM mirrors aren’t all updated yet so you have specify the exact kernel-header version during install

yum -y install dkms gcc kernel-headers-`uname -r` kernel-devel-`uname -r`

Once you do that, reinstall the VirtualBox Guest Additions

sh ./VBoxLinuxAdditions-amd64.run
 
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module[  OK  ]
Building the shared folder support module[  OK  ]
Building the OpenGL support module[  OK  ]
Doing non-kernel setup of the Guest Additions[  OK  ]
Starting the VirtualBox Guest Additions [  OK  ]
Installing the Window System drivers
Installing X.Org Server 1.7 modules[  OK  ]
Setting up the Window System to use the Guest Additions[  OK  ]
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 components[  OK  ]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值