VirtualBox 4.1安装失败解决办法

安装环境和所使用的安装包如下:
[root@ ~]# cat /etc/issue
Oracle Linux Server release 5.8
Kernel \r on an \m

[root@ ~]# uname -a
Linux 2.6.39-200.29.2.el5uek #1 SMP Sat Jul 14 10:42:52 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@ ~]# ll soft/app/VirtualBox-4.1-4.1.18_78361_rhel5-1.x86_64.rpm
-rw-r–r– 1 root root 80801380 06-20 23:20 soft/app/VirtualBox-4.1-4.1.18_78361_rhel5-1.x86_64.rpm

分别用从官网下载的安装包直接安装和配置yum进行安装,安装均报错如下:
Stopping VirtualBox kernel modules [确定]
Uninstalling old VirtualBox DKMS kernel modules [确定]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 2.6.39-200.29.2.el5uek cannot be found at
/lib/modules/2.6.39-200.29.2.el5uek/build or /lib/modules/2.6.39-200.29.2.el5uek/source.
[失败]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [失败]
(Look at /var/log/vbox-install.log to find out what went wrong)

Installed:
VirtualBox-4.1.x86_64 0:4.1.18_78361_rhel5-1

google出来的尝试执行如下命令:
root@ yum.repos.d]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [确定]
Uninstalling old VirtualBox DKMS kernel modules            [确定]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 2.6.39-200.29.2.el5uek cannot be found at
/lib/modules/2.6.39-200.29.2.el5uek/build or /lib/modules/2.6.39-200.29.2.el5uek/source.
[失败]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules                      [失败]
(Look at /var/log/vbox-install.log to find out what went wrong)
还是失败

查看日志提示如下“:
[root@ yum.repos.d]# cat /var/log/vbox-install.log
Uninstalling modules from DKMS
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxhost/4.1.18/source ->
/usr/src/vboxhost-4.1.18

DKMS: add completed.
Failed to install using DKMS, attempting to install without
Makefile:172: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again。 停止。

后来经过群友提示和帮助解决了。
原因是缺少了对应内核的对应的包,虽然我之前已经执行过 kernel-devel的安装命令,但是没有安装uek内核的对应的 kernel-devel,正确的应该是kernel-uek-devel。
执行上述命令之后,重新执行下安装/etc/init.d/vboxdrv setup命令即可:
[root@ ~]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [确定]
Uninstalling old VirtualBox DKMS kernel modules            [确定]
Trying to register the VirtualBox kernel modules using DKMS[确定]
Starting VirtualBox kernel modules                         [确定]

再次感谢群友,群众的力量的伟大的,哈哈!
-The End-

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/21227.html