首先我想说我对 Ubuntu 还很陌生,这也是我第一次在 Ubuntu 上使用 VirtualBox。
我在 Ubuntu 17.10 上安装了 VirtualBox 5.2,安装后,我创建了一个新的虚拟机,当我运行它时出现以下错误:
运行命令“modprobe vboxdrv”后,我得到了以下信息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
kbuild libsdl-ttf2.0-0 linux-headers-4.13.0-16
linux-headers-4.13.0-16-generic linux-headers-4.13.0-32
linux-headers-4.13.0-32-generic linux-image-4.13.0-16-generic
linux-image-4.13.0-32-generic linux-image-extra-4.13.0-16-generic
linux-image-extra-4.13.0-32-generic linux-signed-image-4.13.0-32-generic
module-assistant
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 3 not upgraded.
Need to get 0 B/648 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 332694 files and directories currently installed.)
Preparing to unpack .../virtualbox-dkms_5.1.34-dfsg-0ubuntu1.17.10.2_all.deb ...
Deleting module version: 5.1.34
completely from the DKMS tree.
Done.
Unpacking virtualbox-dkms (5.1.34-dfsg-0ubuntu1.17.10.2) over (5.1.34-dfsg-0ubuntu1.17.10.2) ...
Setting up virtualbox-dkms (5.1.34-dfsg-0ubuntu1.17.10.2) ...
Loading new virtualbox-5.1.34 DKMS files...
Building for 4.14.18-041418-generic
Building initial module for 4.14.18-041418-generic
ERROR (dkms apport): kernel package linux-headers-4.14.18-041418-generic is not supported
Error! Bad return status for module build on kernel: 4.14.18-041418-generic (x86_64)
Consult /var/lib/dkms/virtualbox/5.1.34/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; generated; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-04-22 16:56:13 CST; 11ms ago
Docs: man:systemd-sysv-generator(8)
Process: 7794 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
abr 22 16:56:13 DavidUbuntu systemd[1]: Starting LSB: VirtualBox Linux kernel module...
abr 22 16:56:13 DavidUbuntu virtualbox[7794]: * Loading VirtualBox kernel modules...
abr 22 16:56:13 DavidUbuntu virtualbox[7794]: * No suitable module for running kernel found
abr 22 16:56:13 DavidUbuntu virtualbox[7794]: ...fail!
abr 22 16:56:13 DavidUbuntu systemd[1]: virtualbox.service: Control process exited, code=exited status=1
abr 22 16:56:13 DavidUbuntu systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.
abr 22 16:56:13 DavidUbuntu systemd[1]: virtualbox.service: Unit entered failed state.
abr 22 16:56:13 DavidUbuntu systemd[1]: virtualbox.service: Failed with result 'exit-code'.
这是我不理解的部分:
ERROR (dkms apport): kernel package linux-headers-4.14.18-041418-generic is not supported
Error! Bad return status for module build on kernel: 4.14.18-041418-generic (x86_64)
我在互联网上搜索了这些错误并尝试了很多方法,卸载了几次并重新安装,但仍然收到这些错误。
非常感谢您的宝贵时间。
答案1
我通过将内核从 4.14 更改为 4.15 解决了这个问题
我对 Ubuntu 还很陌生,所以我不明白为什么内核与 Vbox 有关,但这显然解决了这个问题。
感谢花时间回答这个问题的任何人。