Oracle VM。升级内核头文件后处理 virtualbox-dkms (dpkg) 包时出错

Oracle VM。升级内核头文件后处理 virtualbox-dkms (dpkg) 包时出错

标准升级后,我无法再使用我的虚拟机。我收到以下错误:

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please reinstall virtualbox-dkms package and load the kernel module by executing

'modprobe vboxdrv'

as root.

If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT. 

重新安装 virtualbox-dkms 后,我也收到错误:

Error! Bad return status for module build on kernel: 5.8.0-34-generic ()

有什么想法吗?我知道很多人已经遇到过这个错误,但他们的解决方案对我来说都不起作用。

编辑

Make.log 文件显示以下错误:

DKMS make.log for virtualbox-6.1.10 for kernel 5.8.0-36-generic ()
make: Entering directory '/usr/src/linux-headers-5.8.0-36-generic'
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrv.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrvGip.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrvSem.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPDrvTracer.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/SUPLibAll.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/alloc-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/initterm-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/memobj-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/mpnotification-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/powernotification-r0drv.o
  CC [M]  /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
In file included from ./include/asm-generic/percpu.h:7,
                 from ./arch/x86/include/asm/percpu.h:556,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/spinlock.h:51,
                 from /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/../SUPDrvInternal.h:79,
                 from /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:32:
/var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c: In function ‘supdrvOSChangeCR4’:
/var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:38: error: ‘cpu_tlbstate’ undeclared (first use in this function); did you mean ‘cpuhp_state’?
  760 |     RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4);
      |                                      ^~~~~~~~~~~~
./include/linux/percpu-defs.h:318:9: note: in definition of macro ‘__pcpu_size_call_return’
  318 |  typeof(variable) pscr_ret__;     \
      |         ^~~~~~~~
/var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:24: note: in expansion of macro ‘this_cpu_read’
  760 |     RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4);
      |                        ^~~~~~~~~~~~~
/var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:38: note: each undeclared identifier is reported only once for each function it appears in
  760 |     RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4);
      |                                      ^~~~~~~~~~~~
./include/linux/percpu-defs.h:318:9: note: in definition of macro ‘__pcpu_size_call_return’
  318 |  typeof(variable) pscr_ret__;     \
      |         ^~~~~~~~
/var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.c:760:24: note: in expansion of macro ‘this_cpu_read’
  760 |     RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4);
      |                        ^~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:290: /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv/linux/SUPDrv-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:519: /var/lib/dkms/virtualbox/6.1.10/build/vboxdrv] Error 2
make: *** [Makefile:1780: /var/lib/dkms/virtualbox/6.1.10/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.8.0-36-generic'

答案1

今天有人遇到了同样的问题,如果有人想找到解决方案并首先看到这篇文章,我建议你前往这里:在 Ubuntu 20 上安装 virtualbox-dkms 时出错

答案2

选择最新的可运行的 5.4 内核。

我有 20.04,这对我有用:

sudo grub-reboot "1>4"

sudo reboot

或者只是在启动时手动选择 5.4 内核。

我猜这个错误很快就会在 5.8 版本中被修复。

相关内容