服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

运维之家

 找回密码
 注册
搜索
查看: 4986|回复: 0

解决启动virtualBox失败的问题

[复制链接]
dirtysea 发表于 2009-10-21 17:37:57 | 显示全部楼层 |阅读模式
运行VirtualBox时会出现下面错误。
VirtualBox kernel driver not installed. The vboxdrv kernel module was either not loaded
or /dev/vboxdrv was not created for some reason. Re-setup the kernel module by executing ‘/etc/init.d/vboxdrv setup’ as root.
当我们运行 [OrientSun@localhost ~]$ sudo /etc/init.d/vboxdrv setup //重新编译VirtualBox的内核出现下面的错误 Stopping VirtualBox kernel module: vboxdrv. [确定]
Recompiling VirtualBox kernel module: vboxdrv [失败]
* Look at /var/log/vbox-install.log to find out what went wrong
我就用:cat /var/log/vbox-install.log
显示:Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again
原因是更新的时候升级了Linux kernel,所以vboxdrv需要重新编译。因为是从源里面直接更新的,没有Linux kernel的源文件,显然编译需要这些源文件。(编译需要GCC库文件,如果下面步骤出现失败请更新GCC库文件。命令是yum install gcc )

解决方法:
查看本地内核版本
[OrientSun@localhost ~]$ uname -rm 2.6.9-34.EL
[OrientSun@localhost ~]$ yum update yum upgrade kernel   
(然后升级到最新的内核)
[OrientSun@localhost ~]$ uname -rm 2.6.9-89.0.11.EL i686
下载相应版本文件wget http://mirrors.163.com/centos/4/updates/i386/RPMS/kernel-devel-2.6.9-89.0.11.EL.i686.rpm

只要双击他就可以自动为你解压好,kernel-devel-2.6.23.9-85.fc8 i686.rpm解压的目录是
/usr/src/kernels/2.6.9-89.0.11.EL-i686  

现在我们再来运行
yum install linux-headers-$(uname -r)
yum install linux-restricted-modules-$(uname -r)

[OrientSun@localhost ~]$ sudo /etc/init.d/vboxdrv setup Stopping VirtualBox kernel module [确定]
Recompiling VirtualBox kernel module [确定]
Starting VirtualBox kernel module [确定]
成功了!你现在可以成功运行VirtualBox了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|运维之家

GMT+8, 2024-4-24 09:08 , Processed in 0.075281 second(s), 14 queries .

Powered by Dirtysea

© 2008-2020 Dirtysea.com.

快速回复 返回顶部 返回列表