This is a guide for those using Virtualbox with DKMS.
as well as a bug report.
I often have to
fix Virtualbox by hand after a kernel update or DKMS update.
when you try to launch a VM, you get the message "kernel driver not installed rc1908"
1/first, obvisouly you shall have
virtualbox-host-dkms package installed
2/check/add those lines in /etc/modules-load.d/modules.conf
# List of modules to load at boot
vboxdrv
vboxnetadp
vboxnetflt
vboxpci
3/if virtualbox-host-dkms is installed you shall have code in /usr/src
# ls -1a /usr/src/
vboxhost-6.0.0_OSE/
vboxhost-6.0.4_OSE/
vboxhost-6.0.8_OSE/You shall use the last installed (or the previous but you'll have to revert to it installing the package from /var/cache/pacman/pkg/)
here it is vboxhost-6.0.8_OSE
uname -r -> in order to get the kernel release version
for me it is as of today : 4.19.44-1-lts
3/
Then as root you have to run:
dkms install vboxhost/6.0.8_OSE -k 4.19.44-1-lts> notice it is / after vboxhost not a dash
> replace by the correct version number for the kernel
After compilation (see sample dkms install output below.),
it shall have created virtualbox modules (.ko files ) in /usr/lib/modules/4.19.44-1-lts/kernel/misc/
4/
here's how to load modules (to avoid rebooting):
for i in $(ls /usr/lib/modules/4.19.44-1-lts/kernel/misc/vbox*); do insmod $i; done
5/
Virtualbox Shall now work
sample dkms install output :(command above) Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
make -j4 KERNELRELEASE=4.19.44-1-lts -C /usr/lib/modules/4.19.44-1-lts/build M=/var/lib/dkms/vboxhost/6.0.8_OSE/build........
cleaning build area...
Kernel cleanup unnecessary for this kernel. Skipping...
DKMS: build completed.
vboxdrv.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /usr/lib/modules/4.19.44-1-lts/kernel/misc/
vboxnetflt.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /usr/lib/modules/4.19.44-1-lts/kernel/misc/
vboxnetadp.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /usr/lib/modules/4.19.44-1-lts/kernel/misc/
vboxpci.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /usr/lib/modules/4.19.44-1-lts/kernel/misc/
depmod.....
DKMS: install completed.
Hi,
I get the following error
$ sudo dkms install vboxhost/6.1.2_OSE -k 5.4.19-1-lts
Error! echo
Your kernel headers for kernel 5.4.19-1-lts cannot be found at
/usr/lib/modules/5.4.19-1-lts/build or /usr/lib/modules/5.4.19-1-lts/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
$ ls -l /usr/lib/modules/5.4.19-1-lts
total 12424
drwxr-xr-x 12 root root 4096 Feb 14 20:34 kernel
-rw-r--r-- 1 root root 1511996 Feb 14 20:34 modules.alias
-rw-r--r-- 1 root root 1491356 Feb 14 20:34 modules.alias.bin
-rw-r--r-- 1 root root 5607 Feb 13 04:49 modules.builtin
-rw-r--r-- 1 root root 7314 Feb 14 20:34 modules.builtin.bin
-rw-r--r-- 1 root root 44486 Feb 13 04:49 modules.builtin.modinfo
-rw-r--r-- 1 root root 730019 Feb 14 20:34 modules.dep
-rw-r--r-- 1 root root 978486 Feb 14 20:34 modules.dep.bin
-rw-r--r-- 1 root root 475 Feb 14 20:34 modules.devname
-rw-r--r-- 1 root root 227834 Feb 13 04:49 modules.order
-rw-r--r-- 1 root root 935 Feb 14 20:34 modules.softdep
-rw-r--r-- 1 root root 590557 Feb 14 20:34 modules.symbols
-rw-r--r-- 1 root root 726696 Feb 14 20:34 modules.symbols.bin
-rw-r--r-- 1 root root 10 Feb 13 04:49 pkgbase
-rw-r--r-- 1 root root 6367616 Feb 13 04:49 vmlinuz
Do I need to use --kernalsourcedir to point it to somewhere else like the kernel directory? Sorry, it's been a long time since I've played with this sort of thing and I don't want to break my system guessing.
Thanks
Okay, my bad. I had linux-headers installed instead of linux-lts-headers.
I had to extract the .ko files first before running
#cd /usr/lib/modules/5.4.19-1-lts/kernel/misc/
# for i in $(ls vbox*.ko); do insmod $i; done
Then in worked. Thanks :D