Linux: The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv

By | 03/05/2019

After each new VirtualBox installation – I’m stepping on the same rake again and again and have to go to Google to ask:

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv

Attempt to load vboxdrv manually also provides the error:

sudo modprobe vboxdrv
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.20.13-arch1-1-ARCH

And looks like kernel version is correct, and PC was rebooted:

uname -r

And rcvboxdrv didn’t help (expected, however):

sudo rcvboxdrv
Unloading modules:
Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.20.13-arch1-1-ARCH
modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.20.13-arch1-1-ARCH
modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.20.13-arch1-1-ARCH
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.20.13-arch1-1-ARCH

And each time the same thought – dufuck?!?

The solution is, suddenly – install the linux-headers – always forgetting about it:

sudo pacman -S linux-headers

Which includes all the necessary files:

pacman -Ql linux-headers | grep vbox
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/drivers/staging/vboxvideo/
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/drivers/staging/vboxvideo/Kconfig
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/drivers/virt/vboxguest/
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/drivers/virt/vboxguest/Kconfig
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/include/config/drm/vboxvideo.h
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/include/config/vboxguest.h
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/include/linux/vbox_utils.h
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/include/uapi/linux/vbox_err.h
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/include/uapi/linux/vbox_vmmdev_types.h
linux-headers /usr/lib/modules/4.20.13-arch1-1-ARCH/build/include/uapi/linux/vboxguest.h

Also, it’s set as an optional dependency for virtualbox-guest-dkms and virtualbox-host-dkms packages.

Load modules again:

sudo rcvboxdrv
Unloading modules:
Loading modules: vboxnetadp vboxnetflt vboxpci vboxdrv

And run your VirtualBox.