无法在 Ubuntu 19.10 上安装 virtualbox

无法在 Ubuntu 19.10 上安装 virtualbox

我通过执行以下命令来实现:

$ sudo apt-get install virtualbox

这里是 installatino 的输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libgsoap-2.8.75 libqt5opengl5 libvncserver1 virtualbox-dkms virtualbox-qt
Suggested packages:
  vde2 virtualbox-guest-additions-iso
The following NEW packages will be installed:
  libgsoap-2.8.75 libqt5opengl5 libvncserver1 virtualbox virtualbox-dkms virtualbox-qt
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/46,8 MB of archives.
After this operation, 162 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Selecting previously unselected package libgsoap-2.8.75:amd64.
(Reading database ... 201554 files and directories currently installed.)
Preparing to unpack .../0-libgsoap-2.8.75_2.8.75-1_amd64.deb ...
Unpacking libgsoap-2.8.75:amd64 (2.8.75-1) ...
Selecting previously unselected package libqt5opengl5:amd64.
Preparing to unpack .../1-libqt5opengl5_5.12.2+dfsg-4ubuntu1.1_amd64.deb ...
Unpacking libqt5opengl5:amd64 (5.12.2+dfsg-4ubuntu1.1) ...
Selecting previously unselected package libvncserver1:amd64.
Preparing to unpack .../2-libvncserver1_0.9.11+dfsg-1.3_amd64.deb ...
Unpacking libvncserver1:amd64 (0.9.11+dfsg-1.3) ...
Selecting previously unselected package virtualbox-dkms.
Preparing to unpack .../3-virtualbox-dkms_6.0.6-dfsg-1_all.deb ...
Unpacking virtualbox-dkms (6.0.6-dfsg-1) ...
Selecting previously unselected package virtualbox.
Preparing to unpack .../4-virtualbox_6.0.6-dfsg-1_amd64.deb ...
Unpacking virtualbox (6.0.6-dfsg-1) ...
Selecting previously unselected package virtualbox-qt.
Preparing to unpack .../5-virtualbox-qt_6.0.6-dfsg-1_amd64.deb ...
Unpacking virtualbox-qt (6.0.6-dfsg-1) ...
Setting up libvncserver1:amd64 (0.9.11+dfsg-1.3) ...
Setting up libgsoap-2.8.75:amd64 (2.8.75-1) ...
Setting up libqt5opengl5:amd64 (5.12.2+dfsg-4ubuntu1.1) ...
Setting up virtualbox-dkms (6.0.6-dfsg-1) ...
Loading new virtualbox-6.0.6 DKMS files...
Building for 5.0.0-38-generic
Building initial module for 5.0.0-38-generic
Done.

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

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

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

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

depmod....

DKMS: install completed.
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; generated)
   Active: failed (Result: exit-code) since Thu 2020-02-13 01:14:36 MSK; 6ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6428 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)

feb 13 01:14:36 rm-pc systemd[1]: Starting LSB: VirtualBox Linux kernel module...
feb 13 01:14:36 rm-pc virtualbox[6428]:  * Loading VirtualBox kernel modules...
feb 13 01:14:36 rm-pc virtualbox[6428]:  * modprobe vboxdrv failed. Please use 'dmesg' to find out why
feb 13 01:14:36 rm-pc virtualbox[6428]:    ...fail!
feb 13 01:14:36 rm-pc systemd[1]: virtualbox.service: Control process exited, code=exited, status=1/FAILURE
feb 13 01:14:36 rm-pc systemd[1]: virtualbox.service: Failed with result 'exit-code'.
feb 13 01:14:36 rm-pc systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.
Setting up virtualbox (6.0.6-dfsg-1) ...
vboxweb.service is a disabled or a static unit not running, 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; generated)
   Active: failed (Result: exit-code) since Thu 2020-02-13 01:14:38 MSK; 6ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6647 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)

feb 13 01:14:38 rm-pc systemd[1]: Starting LSB: VirtualBox Linux kernel module...
feb 13 01:14:38 rm-pc virtualbox[6647]:  * Loading VirtualBox kernel modules...
feb 13 01:14:38 rm-pc virtualbox[6647]:  * modprobe vboxdrv failed. Please use 'dmesg' to find out why
feb 13 01:14:38 rm-pc virtualbox[6647]:    ...fail!
feb 13 01:14:38 rm-pc systemd[1]: virtualbox.service: Control process exited, code=exited, status=1/FAILURE
feb 13 01:14:38 rm-pc systemd[1]: virtualbox.service: Failed with result 'exit-code'.
feb 13 01:14:38 rm-pc systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.
Setting up virtualbox-qt (6.0.6-dfsg-1) ...
Processing triggers for desktop-file-utils (0.23-4ubuntu1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.32.0-1ubuntu1) ...
Processing triggers for libc-bin (2.29-0ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5.8) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for shared-mime-info (1.10-1) ...

因此,据我所知,错误在于无法启动 LSB:VirtualBox Linux 内核模块。

我的笔记本电脑上的虚拟化功能已启用。

答案1

好吧,我终于能够根据这里提供的说明解决问题了。

https://forums.virtualbox.org/viewtopic.php?f=7&t=91160

答案2

问题源于一些内核模块没有签名,因此无法在设备上加载安全启动设置处于活动状态。

这些内核模块如下:1- vboxnetadp 2- vboxnetflt 3- vboxdrv

为了对它们进行签名并将它们插入到内核中,请将这些命令复制粘贴到您的终端中

第一次,我们需要创建一个新文件夹以保持工作空间整洁

cd ~ mkdir tempkeys cd tempkeys

然后我们将执行以下操作(相应地替换第 2 行中每个模块的 MODULE_NAME)并在每次签署模型后重新启动

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive common name/"
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n MODULE_NAME)
tail $(modinfo -n vboxdrv) | grep "Module signature appended"
sudo mokutil --import MOK.der

完成后,不要忘记通过运行重新安装 virtualbox dmsk

sudo apt install --reinstall linux-headers-$(uname -r) virtualbox-dkms dkms

相关内容