In this blog, we are going the solve the Error: modprobe: ERROR: could not insert ‘vboxdrv’: Operation not permitted. This error comes when we run the command
sudo modprobe vboxdrv.
The issue is that the vboxdrv module is not signed and therefore does not load with the kernel. This will occur if your computer has the SecureBoot mode enabled, which is quite common on current equipment. Follow the below step to Solve
modprobe: ERROR: could not insert 'vboxdrv': Operation not permitted.
Steps to Solve modprobe: ERROR: could not insert ‘vboxdrv’: Operation not permitted:
1. Install the
mokutil package to be able to do signed. So Open the Terminal and first update and upgrade your system.
sudo apt-get update sudo apt-get upgrade
Now install the
mokutil package by using the command given below.
sudo apt-get install mokutil
2. Generate the signature file by using the command:
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VirtualBox/"
3. Then add it to the kernel:
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv)
Also Read: Command Line Browser on Ubuntu 2021
4. Register it for the Secure Boot.
IMPORTANT! That will ask you for a password. Put the one you want. Then, you will only have to use it once in the next reboot.
sudo mokutil --import MOK.der
5. Finally, restart the computer. A blue screen will appear with a keyboard wait, press the key that asks you to interrupt the boot.
When you are inside the blue screen, select
Enroll MOK > Continue > Yes
And it will ask you for the password that you have previously entered, you will enter it and you will be informed that the operation has been completed successfully.
Now your operating system will start and your Error (modprobe: ERROR: could not insert ‘vboxdrv’: Operation not permitted) will be solved. I tested this in Ubuntu, Kubuntu and Debian. Hope this help someone.