解决安装VirtualBox 4.1失败

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

[root@gtlionsdev ~]# uname -a
Linux gtlionsdev 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@gtlionsdev ~]# 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@gtlionsdev 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@gtlionsdev 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@gtlionsdev ~]# /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                         [确定]

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

2012.10.8更新 CentOS6.3 yum安装 VirtualBox

[root@gtlionsdev yum.repos.d]# pwd
/etc/yum.repos.d
[root@gtlionsdev yum.repos.d]# wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
--2012-10-08 10:02:11--  http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
正在解析主机 download.virtualbox.org... 137.254.16.69
正在连接 download.virtualbox.org|137.254.16.69|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:256 [text/plain]
正在保存至: “virtualbox.repo”

100%[=====================================================================================================================================================>] 256         --.-K/s   in 0s      

2012-10-08 10:02:12 (14.2 MB/s) - 已保存 “virtualbox.repo” [256/256])

[root@gtlionsdev yum.repos.d]# vi virtualbox.repo
[root@gtlionsdev yum.repos.d]# yum install VirtualBox-4.2
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package VirtualBox-4.2.i686 0:4.2.0_80737_el6-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================
 Package                                         Arch                                  Version                                               Repository                                   Size
===============================================================================================================================================================================================
Installing:
 VirtualBox-4.2                                  i686                                  4.2.0_80737_el6-1                                     virtualbox                                   65 M

Transaction Summary
===============================================================================================================================================================================================
Install       1 Package(s)

Total download size: 65 M
Installed size: 130 M
Is this ok [y/N]: y
Downloading Packages:
VirtualBox-4.2-4.2.0_80737_el6-1.i686.rpm                                                                                                                               |  65 MB     35:22     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : VirtualBox-4.2-4.2.0_80737_el6-1.i686                                                                                                                                       1/1

Creating group 'vboxusers'. VM users must be member of that group!

No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Stopping VirtualBox kernel modules [确定]
Uninstalling old VirtualBox DKMS kernel modules [确定]
Trying to register the VirtualBox kernel modules using DKMS [失败]
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [确定]
Starting VirtualBox kernel modules [确定]
  Verifying  : VirtualBox-4.2-4.2.0_80737_el6-1.i686                                                                                                                                       1/1

Installed:
  VirtualBox-4.2.i686 0:4.2.0_80737_el6-1                                                                                                                                                      
[root@gtlionsdev ~]# wget http://linux.dell.com/dkms/permalink/dkms-2.2.0.3-1.noarch.rpm
--2012-10-08 11:28:25--  http://linux.dell.com/dkms/permalink/dkms-2.2.0.3-1.noarch.rpm
正在解析主机 linux.dell.com... 143.166.82.43
正在连接 linux.dell.com|143.166.82.43|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:108241 (106K) [application/octet-stream]
正在保存至: “dkms-2.2.0.3-1.noarch.rpm”

100%[=====================================================================================================================================================>] 108,241      119K/s   in 0.9s    

2012-10-08 11:28:27 (119 KB/s) - 已保存 “dkms-2.2.0.3-1.noarch.rpm” [108241/108241])

[root@gtlionsdev ~]# rpm -Uivh dkms-2.2.0.3-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:dkms                   ########################################### [100%]
Complete!
[root@gtlionsdev yum.repos.d]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [确定]
Uninstalling old VirtualBox DKMS kernel modules            [确定]
Removing old VirtualBox pci kernel module                  [确定]
Removing old VirtualBox netadp kernel module               [确定]
Removing old VirtualBox netflt kernel module               [确定]
Removing old VirtualBox kernel module                      [确定]
Trying to register the VirtualBox kernel modules using DKMS[确定]
Starting VirtualBox kernel modules                         [确定]
-The End-

你可能感兴趣的:(linux,server,Google,X86,symlink)