无法在 Ubuntu 上启动 VirtualBox VM - 未安装内核驱动程序

无法在 Ubuntu 上启动 VirtualBox VM - 未安装内核驱动程序

我对 Ubuntu 还不熟悉,想在比使用主机更安全的环境中学习更多知识。我正在运行 Ubuntu 18.04 Kernel 5.3.1,正在努力创建 VirtualBox Ubuntu VM。

当我尝试启动机器时,我得到:

虚拟盒

以 root身份运行modprobe xboxdrv我得到:

modprobe xboxdrv
modprobe: FATAL: Module xboxdrv not found in directory /lib/modules/5.3.1-050301-generic

当我跑步时:

sudo apt install --reinstall virtualbox-dkms

我明白了

Unpacking virtualbox-dkms (5.2.32-dfsg-0~ubuntu18.04.1) over (5.2.32-dfsg-0~ubuntu18.04.1) ...
Setting up virtualbox-dkms (5.2.32-dfsg-0~ubuntu18.04.1) ... 
Loading new virtualbox-5.2.32 DKMS files...
Building for 5.3.1-050301-generic
Building initial module for 5.3.1-050301-generic
ERROR (dkms apport): kernel package linux-headers-5.3.1-050301-generic is not supported
Error! Bad return status for module build on kernel: 5.3.1-050301-generic (x86_64)
Consult /var/lib/dkms/virtualbox/5.2.32/build/make.log for more information.

提到的文件包含以下内容:

CC [M] 
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/mpnotification-r0drv-linux.o
CC [M] 
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/process-r0drv-linux.o
CC [M] 
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/rtStrFormatKernelAddress-r0drv-linux.o
CC [M] 
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/semevent-r0drv-linux.o
CC [M] 
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/semeventmulti-r0drv-linux.o
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/mp-r0drv-linux.c:
In function ‘VBoxHost_RTMpOnAll’:
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/mp-r0drv-linux.c:287:18:
error: void value not ignored as it ought to be
         int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
                  ^~~~~~~~~~~~~~~~~ /var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/mp-r0drv-linux.c:
In function ‘VBoxHost_RTMpOnOthers’:
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/mp-r0drv-linux.c:341:8:
error: void value not ignored as it ought to be
     rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
        ^ scripts/Makefile.build:280: recipe for target '/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/mp-r0drv-linux.o'
failed make[2]: ***
[/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/mp-r0drv-linux.o]
Error 1 make[2]: *** Waiting for unfinished jobs....
   CC [M] 
/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv/r0drv/linux/semfastmutex-r0drv-linux.o
scripts/Makefile.build:497: recipe for target
'/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv' failed
 make[1]: *** [/var/lib/dkms/virtualbox/5.2.32/build/vboxdrv]
 Error 2 Makefile:1624: recipe for target '_module_/var/lib/dkms/virtualbox/5.2.32/build' failed
 make: *** [_module_/var/lib/dkms/virtualbox/5.2.32/build]
 Error 2 make: Leaving directory '/usr/src/linux-headers-5.3.1-050301-generic'

如何让 VirtualBox 在 Ubuntu 上运行?

答案1

VirtualBox 还不能与内核 5.3 兼容,因此要么降级到内核 5.2,要么等待 VirtualBox 更新来修复这个问题(或者自己修补)。

答案2

VirtualBox 6.0.14 现在包含修复:变更日志 升级指南

相关内容