virtualbox 安装出错解决/etc/init.d/vboxdrv setup

在公司用中标普华Linux的时候,难免有些程序或是网站需要IE浏览器或是win平台来进行测试,这样就需要安装一个虚拟主机来进行很好得支持,但是笔者安装得时候老是提示:
运行:/etc/init.d/vboxdrv setup出现下面错误,到网上查看了一下,发现好多网友都遇到同样得问题,于是参考网上得解决方案,记录下自己得实际操作解决这个问题得方法。

---------------------------------------------
安装VirtualBox-3.0.4_50677_fedora9-1.i386.rpm时出错,
[root@Leedd.com Lee]# rpm -ivh VirtualBox-3.0.4_50677_fedora9-1.i386.rpm
Preparing… ########################################### [100%]
1:VirtualBox ########################################### [100%]

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.

Compilation of the kernel module FAILED! VirtualBox will not start until this
problem is fixed. Please consult /var/log/vbox-install.log to find out why the
kernel module does not compile. Most probably the kernel sources are not found.
Install them and execute

/etc/init.d/vboxdrv setup

as root.

—————————————————————————-
启动virtualbox时也会出现如下错误:
出现VERR_VM_DRIVER_NOT_INSTALLED (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded orthere is a permission problem with /dev/vboxdrv. Re-setup the kernelmodule by executing

‘/etc/init.d/vboxdrv setup’

as root. Users of Ubuntu or Fedora should install the DKMS package atfirst. This package keeps track of Linux kernel changes and recompilesthe vboxdrv kernel module if necessary.

运行:/etc/init.d/vboxdrv setup出现下面错误:
3. Run:
# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)根据上面错误以及
/var/log/vbox-install.log日志文件中所提示的错误,应该是内核没编译成功。

---------------------------------------------
到VirtualBox官方网站查看了下,发现需要一些依赖需要安装
请查看系统中是否已安装如下文件:
[root@leedd.com ~]# rpm -qa|grep kernel
kernel-PAE-devel-2.6.18-8.el5
kernel-xen-2.6.18-8.el5
kernel-PAE-2.6.18-8.el5
kernel-devel-2.6.18-8.el5
kernel-doc-2.6.18-8.el5
kernel-headers-2.6.18-8.el5
kernel-2.6.18-8.el5
kernel-xen-devel-2.6.18-8.el5

还有GCC:
[root@leedd.com ~]# rpm -qa|grep gcc
compat-gcc-34-c++-3.4.6-4
gcc-java-4.1.1-52.el5
compat-gcc-34-g77-3.4.6-4
gcc-objc-4.1.1-52.el5
libgcc-4.1.1-52.el5
gcc-gfortran-4.1.1-52.el5
gcc-gnat-4.1.1-52.el5
compat-gcc-34-3.4.6-4
gcc-c++-4.1.1-52.el5
gcc-4.1.1-52.el5
gcc-objc++-4.1.1-52.el5

如果你把上面安装包都装上的话,用rpm -e Virtualbox 卸载原来安装的virtualbox并重新安装即可。

[root@leedd.com Lee]# rpm -ivh VirtualBox-3.0.4_50677_fedora9-1.i386.rpm
Preparing… ########################################### [100%]
1:VirtualBox ########################################### [100%]

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.

Success!

[root@leedd.com Lee]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [确定]
Removing old VirtualBox netadp kernel module [确定]
Removing old VirtualBox netflt kernel module [确定]
Removing old VirtualBox kernel module [确定]
Recompiling VirtualBox kernel module [确定]
Starting VirtualBox kernel module [确定]
[root@leedd.com Lee]#

注释:
本文得实际命令截图是网上收集得,但是经过我亲手验证能实际解决问题,参考了文章

下面是收集得时候找到得一些链接,希望对该问题想深入研究得请查阅:
如还有问题可加群:44927431 (为方便别人,转载请保留此信息)
linux下安装 Virtualbox
linux 系统使用virtualbox虚拟机安装windows系统
virtualbox 网络配置(图)