未加载 vboxdrv 内核模块。当前内核 (4.13.0-26-generic) 没有可用模块,或者加载失败

未加载 vboxdrv 内核模块。当前内核 (4.13.0-26-generic) 没有可用模块,或者加载失败

我使用 DEB 包安装了 Virtualbox 5.0,完整安装了它,然后创建了 Mac OS Sierra 的虚拟机。

然后我执行了这个命令:

 VBoxManage modifyvm "MacOsSierra" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff

它给了我这个错误:

 The vboxdrv kernel module is not loaded. Either there is no module
     available for the current kernel (4.13.0-26-generic) or it failed to
     load. Please recompile the kernel module and install it by

       sudo /sbin/rcvboxdrv setup

因此,正如错误所说,我执行了建议的命令:

 sudo /sbin/rcvboxdrv setup

它给了我这个错误:

Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMSERROR: 
Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-
5.0.0.crash'
Error! Bad return status for module build on kernel: 4.13.0-26-generic 
(x86_64)
Consult /var/lib/dkms/vboxhost/5.0.6/build/make.log for more 
information.
...failed!
(Failed, trying without DKMS)
  Recompiling VirtualBox kernel modules ...failed!
(Look at /var/log/vbox-install.log to find out what went wrong)

该文件的内容make.log是:

DKMS make.log for vboxhost-5.0.6 for kernel 4.13.0-26-generic (x86_64)
Tue Jan 23 10:26:19 IST 2018
make: Entering directory '/usr/src/linux-headers-4.13.0-26-generic'
AR      /var/lib/dkms/vboxhost/5.0.6/build/built-in.o
AR      /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/built-in.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/linux/SUPDrv-
linux.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/SUPDrv.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/SUPDrvGip.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/SUPDrvSem.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/SUPDrvTracer.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/SUPLibAll.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/alloc-
r0drv.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/initterm-
r0drv.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/memobj-
r0drv.o
CC [M]  
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/mpnotification-
r0drv.o
CC [M]  
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/powernotification-
r0drv.o
CC [M]  /var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/assert-
r0drv-linux.o
CC [M]  
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.o
In file included from 
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.c:31:0:
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.c: In function ‘VBoxHost_RTMemContAlloc’:
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/the-linux-
kernel.h:309:47: error: implicit declaration of function ‘set_pages_x’ 
[-Werror=implicit-function-declaration]
# define MY_SET_PAGES_EXEC(pPages, cPages)    set_pages_x(pPages, 
cPages)
                                           ^
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.c:444:13: note: in expansion of macro ‘MY_SET_PAGES_EXEC’
         MY_SET_PAGES_EXEC(&paPages[iPage], 1);
         ^
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.c: In function ‘VBoxHost_RTMemContFree’:
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/the-linux-
kernel.h:310:47: error: implicit declaration of function 
‘set_pages_nx’ [-Werror=implicit-function-declaration]
 # define MY_SET_PAGES_NOEXEC(pPages, cPages)  set_pages_nx(pPages, 
 cPages)
                                           ^
/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.c:492:13: note: in expansion of macro ‘MY_SET_PAGES_NOEXEC’
         MY_SET_PAGES_NOEXEC(&paPages[iPage], 1);
         ^
cc1: some warnings being treated as errors
scripts/Makefile.build:308: recipe for target 
'/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.o' failed
make[2]: *** 
[/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv/r0drv/linux/alloc-r0drv-
linux.o] Error 1
scripts/Makefile.build:581: recipe for target 
'/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv' failed
make[1]: *** [/var/lib/dkms/vboxhost/5.0.6/build/vboxdrv] Error 2
Makefile:1550: recipe for target 
'_module_/var/lib/dkms/vboxhost/5.0.6/build' failed
make: *** [_module_/var/lib/dkms/vboxhost/5.0.6/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.13.0-26-generic'

答案1

Virtualbox 5.0.40 无法与新内核 (4.13.0-26) 配合使用,但新版本的 VBox (5.2) 可以正常工作。请查看问题和提供的答案。

相关内容