Ubuntu – kernel package linux-headers-4.18.5-041805-generic is not supported

dpkgkernelvirtualbox

I update my kernel from 4.15 to 4.18.5 and then after my VirtualBox shows
folowning errors
Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall virtualbox-dkms package and load the kernel module by executing

'modprobe vboxdrv'

as root.

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

I tried

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

commands but in the Terminal following errors appers
->

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.

Please HELP me

After viewing the make.log file, I found out this, errors are all in capital enter(it's quite large, but please look into it )

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'

I don't know kernel programming, what can I make out of this?

Best Answer

The gist of the messages you're getting is that the kernel version you're using, 4.18.5, is not supported by the version of the VirtualBox tools you're trying to utilize.

To that end, you should go back to the supported kernel in order to use the VBox tools, which is likely the 4.15 that you had before. (Not sure where you got 4.18.5 from, either...)

The other option is to not use VBox Tools and go without them, but that is likely to have its own headaches involved.

Related Question