我使用硬件支持堆栈升级内核后,Virtualbox 在 12.04 LTS 中停止工作

我使用硬件支持堆栈升级内核后,Virtualbox 在 12.04 LTS 中停止工作

我现在使用的是 Ubuntu 12.04 (Precise),内核是 3.8。Virtualbox 失败并出现以下错误:

Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/etc/init.d/vboxdrv setup'

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

建议的解决方案我看到的是:

sudo apt-get remove virtualbox-dkms
sudo apt-get install virtualbox-dkms

失败并显示以下消息:

sudo apt-get install virtualbox-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  virtualbox-dkms
0 upgraded, 1 newly installed, 0 to remove and 34 not upgraded.
Need to get 676 kB of archives.
After this operation, 3,899 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/universe virtualbox-dkms all 4.1.12-dfsg-2ubuntu0.3 [676 kB]
Fetched 676 kB in 2s (258 kB/s)          
Selecting previously unselected package virtualbox-dkms.
(Reading database ... 458635 files and directories currently installed.)
Unpacking virtualbox-dkms (from .../virtualbox-dkms_4.1.12-dfsg-2ubuntu0.3_all.deb) ...
Setting up virtualbox-dkms (4.1.12-dfsg-2ubuntu0.3) ...
Loading new virtualbox-4.1.12 DKMS files...
First Installation: checking all kernels...
Building only for 3.8.0-29-generic
Building initial module for 3.8.0-29-generic
Error! Bad return status for module build on kernel: 3.8.0-29-generic (x86_64)
Consult /var/lib/dkms/virtualbox/4.1.12/build/make.log for more information.
 * 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.

答案1

应用我的解决方案后https://askubuntu.com/a/342372/36661,在进行其他系统更新(视频驱动程序)后,问题再次出现。我在 IRC 上与 VirtualBox 开发人员聊天,他们告诉我 Ubuntu 不会定期接受 VirtualBox 开发人员的错误修复。他们建议我从 virtualbox.org 安装最新的 VirtualBox 软件包,我照做了。问题就解决了。

Linux 的下载链接是:

https://www.virtualbox.org/wiki/Linux_Downloads

它实际上是一个更简单的安装,因为您不需要单独安装客户附加组件。

答案2

在错误报告中的这个评论中找到了解决方案:

https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1076603/comments/13

解决方法(精确的 Linux 映像 3.8.*)

wget -O /tmp/virtualbox.patch 'http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=99;filename=vbox-wheezy.patch;att=1;bug=696011'
cd /usr/src/virtualbox-4.1.12/
patch -p4 < /tmp/virtualbox.patch
dkms autoinstall

如果您不想重新启动,您可能必须运行此命令:

sudo modprobe vboxdrv

答案3

在它对我有用之前我必须经历很多事情,但最后一部分是 MountainX 的回答:

sudo apt-get remove --purge virtualbox
sudo apt-get autoremove
sudo apt-get install --reinstall linux-headers-$(uname -r)
sudo apt-get install virtualbox
sudo dkms install virtualbox/4.1.12

sudo wget -O /tmp/virtualbox.patch 'http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=99;filename=vbox-wheezy.patch;att=1;bug=696011'
cd /usr/src/virtualbox-4.1.12/
sudo patch -p4 < /tmp/virtualbox.patch
sudo dkms autoinstall
sudo modprobe vboxdrv

由于 eth0 出现与 vboxdrv 相关的错误,我仍不得不重新启动。但现在一切正常。

答案4

在运行 VirtualBox(4.3.34 r104062)的 Ubuntu 12.04 上,最近进行了内核升级(3.2.0-94-generic),遇到了完全相同的问题,并且这对我来说 100%有效:

apt-get --reinstall install dkms
/etc/init.d/vboxdrv setup

相关内容