当前位置: 首页>>技术教程>>正文


14.10:VirtualBox“找不到合适的模块来运行内核”,找不到内核源

, ,

问题描述

在14.10更新为VirtualBox之后,我不能再运行我的盒子了。值得注意的是,运行sudo service virtualbox status返回VirtualBox kernel module is not loaded,运行sudo service virtualbox restart显示:

 * Stopping VirtualBox kernel modules                                    [ OK ] 
 * Starting VirtualBox kernel modules                                            
 * No suitable module for running kernel found
                                                                         [fail]

当我尝试运行一个框时,VirtualBox GUI会弹出一个对话框,提示我应该运行sudo /etc/init.d/vboxdrv setup,但在14.10安装中没有/etc/init.d/vboxdrv

这让人联想到this question。根据一些答案,我尝试卸载(使用purge)并重新安装VirtualBox。这没有帮助。但是,我无法安装:

linux-headers-`uname -r`

因为没有名为linux-headers-3.13.0-30-generic的软件包。我确实安装了linux-headers-genericlinux-source以及dkms,但是重新安装仍然失败:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  vde2
The following NEW packages will be installed:
  virtualbox virtualbox-dkms virtualbox-qt
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/21.1 MB of archives.
After this operation, 87.6 MB of additional disk space will be used.
Selecting previously unselected package virtualbox.
(Reading database ... 253183 files and directories currently installed.)
Preparing to unpack .../virtualbox_4.3.18-dfsg-2ubuntu1_amd64.deb ...
Unpacking virtualbox (4.3.18-dfsg-2ubuntu1) ...
Selecting previously unselected package virtualbox-dkms.
Preparing to unpack .../virtualbox-dkms_4.3.18-dfsg-2ubuntu1_all.deb ...
Unpacking virtualbox-dkms (4.3.18-dfsg-2ubuntu1) ...
Selecting previously unselected package virtualbox-qt.
Preparing to unpack .../virtualbox-qt_4.3.18-dfsg-2ubuntu1_amd64.deb ...
Unpacking virtualbox-qt (4.3.18-dfsg-2ubuntu1) ...
Processing triggers for man-db (2.7.0.2-2) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for menu (2.1.47ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.10.20140925-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.22-1ubuntu2) ...
Processing triggers for mime-support (3.55ubuntu1.1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Setting up virtualbox (4.3.18-dfsg-2ubuntu1) ...
 * 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.
Processing triggers for ureadahead (0.100.0-16) ...
Setting up virtualbox-dkms (4.3.18-dfsg-2ubuntu1) ...
Loading new virtualbox-4.3.18 DKMS files...
First Installation: checking all kernels...
Building only for 3.13.0-30-generic
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
 * 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.
Setting up virtualbox-qt (4.3.18-dfsg-2ubuntu1) ...
Processing triggers for menu (2.1.47ubuntu1) ...

那么…如何获取“此内核的内核源”(3.13.0-30-generic)或以其他方式使VirtualBox正确安装?

最佳方案

从Ubuntu 14.04升级到14.10似乎有些麻烦。您应该具有3.16.0-30的内核版本

确保您的/etc/apt/sources.list仅包含带有’utopic’的条目,而不包含’trusty’。然后确保已安装以下软件包,或在必要时安装它们:

apt-get install linux-generic linux-image-generic linux-headers-generic linux-signed-generic

之后,您应该可以删除re-install virtualbox并重建内核模块。

次佳方案

对于那些可能有相同问题的人:

我的系统是Linux Mint 17.1(使用Ubuntu 14.04 Trusty存储库)。

我尝试使用以下方法安装VirtualBox:

sudo apt-get install virtualbox

并遇到同样的错误。

解:

使用以下命令卸载VirtualBox的错误版本:

sudo apt-get purge virtualbox

然后从https://www.virtualbox.org/wiki/Linux_Downloads获取安装程序并安装deb软件包。是说您的存储库中存在相同的版本…但是那样就可以了。

第三种方案

我总是发现“删除并重新安装”,所以windows-esque …我用sudo dpkg-reconfigure virtualbox-dkms解决了(当然,如果您还没有安装,可以使用sudo apt install virtualbox-dkms)

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/9105.html,未经允许,请勿转载。