![内核包 linux-headers-4.18.5-041805-generic 不受支持](https://linux22.com/image/904518/%E5%86%85%E6%A0%B8%E5%8C%85%20linux-headers-4.18.5-041805-generic%20%E4%B8%8D%E5%8F%97%E6%94%AF%E6%8C%81.png)
我将内核从 4.15 更新到 4.18.5,然后我的 VirtualBox 显示以下错误:内核驱动程序未安装(rc=-1908)
VirtualBox Linux 内核驱动程序 (vboxdrv) 未加载,或者 /dev/vboxdrv 存在权限问题。请重新安装 virtualbox-dkms 软件包并通过执行加载内核模块
‘modprobe vboxdrv’
以 root 身份运行。
其中:suplibOsInit 内容:3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - 未安装支持驱动程序。在 Linux 上,open 返回 ENOENT。
我试过
sudo apt-get remove virtualbox-dkms
sudo apt-get remove --purge virtualbox-dkms
sudo apt-get install -y linux-headers-amd64 linux-image-amd64
sudo apt-get install -y virtualbox-dkms
命令,但在终端中出现以下错误->
sudo apt-get install -y virtualbox-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
virtualbox-dkms
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/657 kB of archives.
After this operation, 5,408 kB of additional disk space will be used.
Selecting previously unselected package virtualbox-dkms.
(Reading database ... 284020 files and directories currently installed.)
Preparing to unpack .../virtualbox-dkms_5.2.10-dfsg-6ubuntu18.04.1_all.deb ...
Unpacking virtualbox-dkms (5.2.10-dfsg-6ubuntu18.04.1) ...
Setting up virtualbox-dkms (5.2.10-dfsg-6ubuntu18.04.1) ...
Loading new virtualbox-5.2.10 DKMS files...
Building for 4.18.5-041805-generic
Building initial module for 4.18.5-041805-generic
ERROR (dkms apport): kernel package linux-headers-4.18.5-041805-generic is not supported
Error! Bad return status for module build on kernel: 4.18.5-041805-generic (x86_64)
Consult /var/lib/dkms/virtualbox/5.2.10/build/make.log for more information.
请帮我
查看 make.log 文件后,我发现了这一点,错误都是大写的(它很大,但请仔细查看)
CC [M] /var/lib/dkms/virtualbox/5.2.10/build/vboxpci/SUPR0IdcClientComponent.o CC [M] /var/lib/dkms/virtualbox/5.2.10/build/vboxpci/linux/SUPR0IdcClient-linux.o /var/lib/dkms/virtualbox/5.2.10/build/vboxpci/linux/VBoxPci-linux.c: In function ‘vboxPciLinuxDevDetachHostDriver’: /var/lib/dkms/virtualbox/5.2.10/build/vboxpci/linux/VBoxPci-linux.c:92:40: ERROR: IMPLICIT DECLARATION OF FUNCTION ‘PCI_GET_BUS_AND_SLOT’; DID YOU MEAN ‘PCI_GET_DOMAIN_BUS_AND_SLOT’? [-WERROR=IMPLICIT-FUNCTION-DECLARATION] # DEFINE PCI_DEV_GET_SLOT(BUS, DEVFN) PCI_GET_BUS_AND_SLOT(BUS, DEVFN) ^ /VAR/LIB/DKMS/VIRTUALBOX/5.2.10/BUILD/VBOXPCI/LINUX/VBOXPCI-LINUX.C:397:15: NOTE: IN EXPANSION OF MACRO ‘PCI_DEV_GET_SLOT’ PPCIDEV = PCI_DEV_GET_SLOT(UBUS, UDEVFN); ^~~~~~~~~~~~~~~~ /VAR/LIB/DKMS/VIRTUALBOX/5.2.10/BUILD/VBOXPCI/LINUX/VBOXPCI-LINUX.C:397:13: WARNING: ASSIGNMENT MAKES POINTER FROM INTEGER WITHOUT A CAST [-WINT-CONVERSION] PPCIDEV = PCI_DEV_GET_SLOT(UBUS, UDEVFN); ^ /VAR/LIB/DKMS/VIRTUALBOX/5.2.10/BUILD/VBOXPCI/LINUX/VBOXPCI-LINUX.C: IN FUNCTION ‘VBOXPCIOSDEVINIT’: /VAR/LIB/DKMS/VIRTUALBOX/5.2.10/BUILD/VBOXPCI/LINUX/VBOXPCI-LINUX.C:648:17: WARNING: ASSIGNMENT MAKES POINTER FROM INTEGER WITHOUT A CAST [-WINT-CONVERSION] PPCIDEV = PCI_DEV_GET_SLOT((PINS->HOSTPCIADDRESS) >> 8, ^ CC1: SOME WARNINGS BEING TREATED AS ERRORS scripts/Makefile.build:317: recipe for target '/var/lib/dkms/virtualbox/5.2.10/build/vboxpci/linux/VBoxPci-linux.o' failed make[2]: * [/var/lib/dkms/virtualbox/5.2.10/build/vboxpci/linux/VBoxPci-linux.o] Error 1 scripts/Makefile.build:558: recipe for target '/var/lib/dkms/virtualbox/5.2.10/build/vboxpci' failed make1: * [/var/lib/dkms/virtualbox/5.2.10/build/vboxpci] Error 2 Makefile:1500: recipe for target 'module/var/lib/dkms/virtualbox/5.2.10/build' failed make: *** [module/var/lib/dkms/virtualbox/5.2.10/build] Error 2 make: Leaving directory '/usr/src/linux-headers-4.18.5-041805-generic'
我不懂内核编程,我能从中得到什么呢?
答案1
您收到的消息的要点是,您使用的内核版本 4.18.5 不受您尝试使用的 VirtualBox 工具版本支持。
为此,您应该返回到受支持的内核以使用 VBox 工具,这可能是您之前使用的 4.15。(也不确定您从哪里获得 4.18.5...)
另一种选择是不使用 VBox Tools,但这可能会带来一些麻烦。
答案2
您还可以安装最新的快照版本,该版本已通过 4.18.13 测试!
https://www.virtualbox.org/ticket/17981目前正在跟踪此问题。
您可以获得开发快照在https://www.virtualbox.org/wiki/Testbuilds
在撰写本文时,最新版本是 5.2.97。