ubuntu virtualbox启动不了

原文位置http://blog.sina.com.cn/s/blog_8709e3120101czdr.html

今天更新系统,结果busybox起不来了,一顿折腾啊。运行图形界面的busybox,报出来的错误主要内容是下面让执行这句话:
    '/etc/init.d/vboxdrv setup'
结果就是悲剧啊,我根本没找到这个文件,更没什么好执行的了。

命令行运行提示如下:
elta@elta:~$ virtualbox 
WARNING: The character device /dev/vboxdrv does not exist.
         Please install the virtualbox-ose-dkms package and the appropriate
         headers, most likely linux-headers-generic.

         You will not be able to start VMs until this problem is fixed.

提示安装 virtualbox-ose-dkms,后来证明这个包对我来说没有意义,不装也OK。第二句话说很可能是我头文件有问题。事实证明确实是这个样子。

elta@elta:~$ sudo dpkg-reconfigure virtualbox
virtualbox           virtualbox-dkms      virtualbox-ose-dkms  virtualbox-qt
elta@elta:~$ sudo dpkg-reconfigure virtualbox
 * Stopping VirtualBox kernel modules                                                  [ OK ] 
 * Starting VirtualBox kernel modules                     * No suitable module for running kernel found
                                                                                       [fail]
invoke-rc.d: initscript virtualbox, action "restart" failed.
错误提示没有找到相应的内核模块。

在这里我说一下我这边的错误原因,其实就是它提示的,没有找到相应的内核模块。
内核需要有:
linux-headers-版本号
linux-headers-版本号-generic
linux-image-版本号-generic
linux-image-extra-版本号-generic

这里几个文件的版本号要一致才行,之前我这边是版本号不一致,导致了无法找到相应的内核。用 sudo aptitude安装相应的模块,我装的是 3.5.0-20 。 警告:操作有风险,行动须谨慎!初学者切记切记

elta@elta:~$ 
elta@elta:~$ 
elta@elta:~$ sudo aptitude
(Reading database ... 97548 files and directories currently installed.)
Removing linux-headers-3.5.0-17-generic ...
Removing linux-headers-3.5.0-17 ...
Selecting previously unselected package linux-headers-3.5.0-20.
(Reading database ... 74808 files and directories currently installed.)
Unpacking linux-headers-3.5.0-20 (from .../linux-headers-3.5.0-20_3.5.0-20.31_all.deb) ...
Selecting previously unselected package linux-headers-3.5.0-20-generic.
Unpacking linux-headers-3.5.0-20-generic (from .../linux-headers-3.5.0-20-generic_3.5.0-20.31_amd64.deb) ...
Setting up linux-headers-3.5.0-20 (3.5.0-20.31) ...
Setting up linux-headers-3.5.0-20-generic (3.5.0-20.31) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.5.0-20-generic /boot/vmlinuz-3.5.0-20-generic
Press Return to continue.

安装完内核之后,要重新config一下。

elta@elta:~$ sudo dpkg-reconfigure virtualbox-dkms 

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 4.1.18
Kernel:  3.5.0-20-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0-20-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0-20-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0-20-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0-20-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.

------------------------------
Deleting module version: 4.1.18
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-4.1.18 DKMS files...
Building only for 3.5.0-20-generic
Building initial module for 3.5.0-20-generic
Done.

vboxdrv:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0-20-generic/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0-20-generic/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0-20-generic/updates/dkms/

vboxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0-20-generic/updates/dkms/

depmod....

DKMS: install completed.
 * Stopping VirtualBox kernel modules                                                  [ OK ] 
 * Starting VirtualBox kernel modules                                                    [ OK ]

这里可以看到VirtualBox内核模块启动了,Virtualbox可以正常用了。

话说,要是看完了还不理解,可以在下面留言啊~

你可能感兴趣的:(Linux,Ubuntu)