Virtualbox vboxdrv kernel module not loaded

I installed Virtualbox version 6.1.26 on Fedora 34. according to this tutorial here

When I now try to start a VM I get the following error:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (5.13.14-200.fc34.x86_64) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /sbin/vboxconfig

         You will not be able to start VMs until this problem is fixed.

I checked the BIOS and there Secureboot is disabled. When I run ‘/sbin/vboxconfig’ I get the following output: Stopping VirtualBox services. Starting VirtualBox services. You must sign these kernel modules before using VirtualBox:
  vboxdrv vboxnetflt vboxnetadp
See the documentation for your Linux distribution.. Building VirtualBox kernel modules. failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
$ systemctl status vboxdrv.service
× vboxdrv.service - VirtualBox Linux kernel module
     Loaded: loaded (/usr/lib/virtualbox/; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Mon 2021-09-13 11:38:40 CEST; 10min ago
        CPU: 1min 8.761s

Sep 13 11:38:11 fedora[21166]: You must sign these kernel modules before using VirtualBox:
Sep 13 11:38:11 fedora[21166]:   vboxdrv vboxnetflt vboxnetadp
Sep 13 11:38:11 fedora[21166]: See the documentation for your Linux distribution..
Sep 13 11:38:11 fedora[21166]: Building VirtualBox kernel modules.
Sep 13 11:38:11 fedora[21210]: Building VirtualBox kernel modules.
Sep 13 11:38:40 fedora[21166]: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.
Sep 13 11:38:40 fedora systemd[1]: vboxdrv.service: Control process exited, code=exited, status=1/FAILURE
Sep 13 11:38:40 fedora systemd[1]: vboxdrv.service: Failed with result 'exit-code'.
Sep 13 11:38:40 fedora systemd[1]: Failed to start VirtualBox Linux kernel module.
Sep 13 11:38:40 fedora systemd[1]: vboxdrv.service: Consumed 1min 8.761s CPU time.

Is there anything else I could do to get Virtualbox working?


Thank you @vgaetera for the recommendation. I’m however quite used to Virtualbox and would prefer to keep using it also I have it running on another machine although the other one is still on Fedora 33.

You might, just possibly, be able to get virtualbox to work by disabling secure boot in the bios. It was the solution for me.

The clue there is the complaint about unsigned modules.

Even though I disabled secureboot in the BIOS, it was still active. Additionally to disabling secureboot in the BIOS I had to boot from the HD where Fedora is installed in legacy mode. now Virtualbox works and I can use the VMs. Thanks!

Vladislav is correct. Fedora focuses on GNOME Boxes for virtualization.

However, you should be able to get Virtual Box running on Fedora. I don’t have experience with it on Fedora, though.

Related… On Ubuntu, you install the linux kernel headers, and then build the Vritual Box driver through dkms. In fact, once the headers are installed, you run sudo apt install virtualbox-dkms and the driver is downloaded and built for you automatically.

You dont have to turn off secure boot, just sign the virtuabox-modules, here a short walkthrough for F34:

  1. Enroll certificates as root:

openssl req -new -x509 -newkey rsa:2048
-nodes -days 36500 -outform DER
-keyout “MOK.priv”
-out “MOK.der”

  1. Import certificates as root (you will have to reboot afterwards):

mokutil --import MOK.der

  1. After installing or upgrading virtualbox, sign the modules and reload them as root, i created the script /usr/local/bin/signmodules:


readonly hash_algo=‘sha256’
readonly key=‘/root/MOK.priv’
readonly x509=‘/root/MOK.der’

readonly name=“$(basename $0)”
readonly esc=‘\e’
readonly reset=“${esc}[0m”

green() { local string=“${1}”; echo “${esc}[32m${string}${reset}”; }
blue() { local string=“${1}”; echo “${esc}[34m${string}${reset}”; }
log() { local string=“${1}”; echo “[$(blue $name)] ${string}”; }

alias sign-file=“/usr/src/kernels/$(uname -r)/scripts/sign-file”

[ -z “${KBUILD_SIGN_PIN}” ] && read -p "Passphrase for ${key}: " KBUILD_SIGN_PIN

sign-file “${hash_algo}” “${key}” “${x509}” “/lib/modules/$(uname -r)/extra/VirtualBox/vboxdrv.ko”
sign-file “${hash_algo}” “${key}” “${x509}” “/lib/modules/$(uname -r)/extra/VirtualBox/vboxnetflt.ko”
sign-file “${hash_algo}” “${key}” “${x509}” “/lib/modules/$(uname -r)/extra/VirtualBox/vboxnetadp.ko”

modprobe vboxdrv
modprobe vboxnetflt
modprobe vboxnetadp

lsmod | grep vbox

  1. the output should be:

lsmod | grep vbox
vboxnetadp 28672 0
vboxnetflt 32768 1
vboxdrv 561152 3 vboxnetadp,vboxnetflt

  1. enjoy

Thanks I’ll give this a try.

Did this work for you?

I haven’t done this yet. I did it on another OS some years ago but then I had to redo it after some updates and I decided to disable it again because it was too annoying for me to do.

I found this, I’ll give it a try later this week:

I’ve the same problem, cannot run vboxdrv service in fedora with secure boot enabled. This tutorial doesn’t work.
I need solution for this, because I won’t to disable secure boot.
Anyone has solved this problem?

Thanks You in Advanced

Look here: Signing VirtualBox Kernel Modules · GitHub