我的 VirtualBox 在启动虚拟机时出现以下错误:
内核驱动程序未安装(rc=-1908)
VirtualBox Linux 内核驱动程序 (vboxdrv) 未加载,或者 /dev/vboxdrv 存在权限问题。请安装 virtualbox-dkms 包并通过执行加载内核模块
‘modprobe vboxdrv’
以 root 身份运行。如果您的发行版中提供 DKMS 包,则应首先安装它。此包会跟踪 Linux 内核更改,并在必要时重新编译 vboxdrv 内核模块。
其中:suplibOsInit 内容:3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - 未安装支持驱动程序。在 Linux 上,open 返回 ENOENT。
我按照说明安装了 DKMS 包,它提示我已安装。执行
sudo modprobe vboxdrv
导致此错误:
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.15.0-041500rc2-lowlatency
我尝试重新安装内核和 virtualbox-dkms
sudo apt install --reinstall linux-headers-$(uname -r) virtualbox-dkms dkms
我得到了这个输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reinstallation of linux-headers-4.15.0-041500rc2-lowlatency is not possible, it cannot be downloaded.
The following additional packages will be installed:
virtualbox virtualbox-qt
Suggested packages:
vde2 virtualbox-guest-additions-iso
The following NEW packages will be installed:
virtualbox virtualbox-dkms virtualbox-qt
0 upgraded, 3 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 66.3 kB/22.4 MB of archives.
After this operation, 95.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ch.archive.ubuntu.com/ubuntu xenial-updates/main amd64 dkms all 2.2.0.3-2ubuntu11.5 [66.3 kB]
Fetched 66.3 kB in 0s (477 kB/s)
(Reading database ... 531094 files and directories currently installed.)
Preparing to unpack .../dkms_2.2.0.3-2ubuntu11.5_all.deb ...
Unpacking dkms (2.2.0.3-2ubuntu11.5) over (2.2.0.3-2ubuntu11.5) ...
Selecting previously unselected package virtualbox-dkms.
Preparing to unpack .../virtualbox-dkms_5.0.40-dfsg-0ubuntu1.16.04.2_all.deb ...
Unpacking virtualbox-dkms (5.0.40-dfsg-0ubuntu1.16.04.2) ...
Selecting previously unselected package virtualbox.
Preparing to unpack .../virtualbox_5.0.40-dfsg-0ubuntu1.16.04.2_amd64.deb ...
Unpacking virtualbox (5.0.40-dfsg-0ubuntu1.16.04.2) ...
Selecting previously unselected package virtualbox-qt.
Preparing to unpack .../virtualbox-qt_5.0.40-dfsg-0ubuntu1.16.04.2_amd64.deb ...
Unpacking virtualbox-qt (5.0.40-dfsg-0ubuntu1.16.04.2) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
Processing triggers for menu (2.1.47ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Setting up dkms (2.2.0.3-2ubuntu11.5) ...
Setting up virtualbox-dkms (5.0.40-dfsg-0ubuntu1.16.04.2) ...
Loading new virtualbox-5.0.40 DKMS files...
First Installation: checking all kernels...
Building only for 4.15.0-041500rc2-lowlatency
Building initial module for 4.15.0-041500rc2-lowlatency
ERROR (dkms apport): kernel package linux-headers-4.15.0-041500rc2-lowlatency is not supported
Error! Bad return status for module build on kernel: 4.15.0-041500rc2-lowlatency (x86_64)
Consult /var/lib/dkms/virtualbox/5.0.40/build/make.log for more information.
Job for virtualbox.service failed because the control process exited with error code. See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Die 2018-02-20 20:50:55 CET; 7ms ago
Docs: man:systemd-sysv-generator(8)
Process: 10139 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
Feb 20 20:50:55 matteo-3 systemd[1]: Starting LSB: VirtualBox Linux kernel .....
Feb 20 20:50:55 matteo-3 virtualbox[10139]: * Loading VirtualBox kernel mod....
Feb 20 20:50:55 matteo-3 virtualbox[10139]: * No suitable module for runnin...d
Feb 20 20:50:55 matteo-3 virtualbox[10139]: ...fail!
Feb 20 20:50:55 matteo-3 systemd[1]: virtualbox.service: Control process ex...=1
Feb 20 20:50:55 matteo-3 systemd[1]: Failed to start LSB: VirtualBox Linux ...e.
Feb 20 20:50:55 matteo-3 systemd[1]: virtualbox.service: Unit entered faile...e.
Feb 20 20:50:55 matteo-3 systemd[1]: virtualbox.service: Failed with result...'.
Hint: Some lines were ellipsized, use -l to show in full.
Setting up virtualbox (5.0.40-dfsg-0ubuntu1.16.04.2) ...
vboxweb.service is a disabled or a static unit, not starting it.
Job for virtualbox.service failed because the control process exited with error code. See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Die 2018-02-20 20:50:57 CET; 7ms ago
Docs: man:systemd-sysv-generator(8)
Process: 10441 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
Feb 20 20:50:56 matteo-3 systemd[1]: Starting LSB: VirtualBox Linux kernel .....
Feb 20 20:50:57 matteo-3 virtualbox[10441]: * Loading VirtualBox kernel mod....
Feb 20 20:50:57 matteo-3 virtualbox[10441]: * No suitable module for runnin...d
Feb 20 20:50:57 matteo-3 virtualbox[10441]: ...fail!
Feb 20 20:50:57 matteo-3 systemd[1]: virtualbox.service: Control process ex...=1
Feb 20 20:50:57 matteo-3 systemd[1]: Failed to start LSB: VirtualBox Linux ...e.
Feb 20 20:50:57 matteo-3 systemd[1]: virtualbox.service: Unit entered faile...e.
Feb 20 20:50:57 matteo-3 systemd[1]: virtualbox.service: Failed with result...'.
Hint: Some lines were ellipsized, use -l to show in full.
Setting up virtualbox-qt (5.0.40-dfsg-0ubuntu1.16.04.2) ...
Processing triggers for menu (2.1.47ubuntu1) ...
其中,以下几行引起了我的注意:
Building initial module for 4.15.0-041500rc2-lowlatency
ERROR (dkms apport): kernel package linux-headers-4.15.0-041500rc2-lowlatency is not supported
Error! Bad return status for module build on kernel: 4.15.0-041500rc2-lowlatency (x86_64)
您对如何修复我的 Virtualbox 有什么想法吗?我的内核是否不受 VirtualBox 支持?如果是,我该如何更改为旧的/受支持的内核?
答案1
我也遇到了同样的问题,删除了我认为过时的内核版本后,却带来了麻烦。
我通过运行以下命令解决了该问题:
sudo apt install --reinstall linux-headers-$(uname -r) virtualbox-dkms dkms
执行该命令后,virtualbox 就能完美运行!
我的设置:
- Ubuntu 16.04 LTS
- VirtualBox 5.1.38
答案2
这是 ubuntu 的安全启动问题。你可以尝试这个帖子:https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/
这使用MOK经理来解决这个问题。
答案3
最近在 Ubuntu 18.04 上遇到了同样的问题。显然,Virtual Box 6.+ 与 gcc-7 存在一些问题。以下步骤对我有用:
删除 virtualbox
sudo apt-get purge virtualbox-*
安装 gcc-8
sudo apt-get install gcc-8 g++-8
将默认 gcc 设置为 gcc-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
并使用 debian 安装程序重新安装 virtualbox 对我来说就完成了!
答案4
其实不用为教程而烦恼:
打开vm
但不要启动它,打开终端并输入:
sudo modprobe vboxdrv
并点击开始在vm
。
尽情享受吧,但不要忘记每次使用时都这样做,vm
尤其是对于 Kali。今天的操作系统没有附带,dir
这很好。所以不要为 headers、uname 和 update 烦恼