VirtualBox report “Kernel driver not installed” on Fedora 21
Posted on In QAVitualBox is installed on Fedora 21 by
# yum install VirtualBox
The following packages are installed
kmod-VirtualBox-3.18.7-200.fc21.x86_64-4.3.20-4.fc21.4.x86_64
VirtualBox-4.3.20-3.fc21.x86_64
There is the kernel modules package installed.
However, when running virtualbox
(after reboot), it reports:
[zma@laptop:~]$ virtualbox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (3.18.7-200.fc21.x86_64) or it failed to
load. Please recompile the kernel module and install it by
sudo /etc/init.d/vboxdrv setup
You will not be able to start VMs until this problem is fixed.
How to configure it correctly?
If you can not find vboxdrv module loaded by
lsmod | grep vboxdrv
you may try to manually load it:
sudo modprobe vboxdrv
If you see a message like this:
modprobe: ERROR: could not insert 'vboxdrv': Required key not available
then, modprobe is complaining about required key not being available. You are probably run Linux on a system with UEFI Secure Boot enabled. Want to know more about UEFI SEcure Boot? Please check Fedora’s document.
Now, problem identified and the solution is not that hard. There are some solutions on the Web. Here, I summarize the steps.
$ sudo yum install kernel-devel
$ openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=FcloseDotCom/"
$ sudo /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv)
$ sudo mokutil --import MOK.der
modutil --import
will ask you to set a password.
Then, reboot the system. During booting, the EFI system will ask you to import the key with the password you set following the steps it shows. After your key is imported, you can boot Linux and the vboxdrv module should will be well loaded and you can start VirtualBox.
After reboot, you may also check the imported keys in the system by:
$ sudo keyctl list %:.system_keyring
One more note, each time you upgraded VirtualBox, remember to do the sign-file
step again to sign the modules.
sudo /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv)
Thank you for the great explanation. I was able to follow all the steps except for the part where the EFI system asks to import the key.
I had to go to the boot setup and at the ‘secure boot’ put the system to accept keys, I don’t remember the name of the option now.
Hi Ben, thanks for the note on the boot set up. It will be useful for others.
For me, during rebooting, it automatically boots to the key import interface.
BTW: which OS and version are you using?