Golinmarq
Golinmarq

Reputation: 1006

I can't execute command modprobe vboxdrv

I recently upgraded my laravel vagrant box. Since then, Virtual box is giving me the same error

The provider 'virtualbox' that was requested to back the machine 'default' is reporting that it isn't usable on this system. The reason is shown below:

VirtualBox is complaining that the installation is incomplete. Please run VBoxManage --version to see the error message which should contain instructions on how to fix this error.

So, making a little research I found that the kernel driver is not available. I tried to install it and give me the following error when it tries to execute modprobe vboxdrv.

modprobe: ERROR: could not insert 'vboxdrv': Required key not available

I have 4 days with this error and I don't know what to do. Somebody can help me?

Upvotes: 26

Views: 50943

Answers (3)

Adriana Hernández
Adriana Hernández

Reputation: 1055

This is a solution which doesn't involve disabling the Secure Boot:

The problem is that the vboxdrv module is not signed and therefore not loaded with the kernel. This will happen if your computer has the SecureBoot mode activated, something very common in modern equipment.

That's why I get this error opening any machine in the Virtual Box

Kernel driver not installed (rc=-1908)

Do the following steps to sign a driver, and it is loaded as a kernel module:

1. Install the mokutil package to be able to do signed.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mokutil

2. generate the signature file:

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)

4. Register it for the Secure Boot.

IMPORTANT! That will ask you for a password, put the one you want, 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.

enter image description here

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 you can now use VirtualBox without problem :)

I tested this in Ubuntu, Kubuntu and Debian. Hope this help someone.

Upvotes: 74

Shea
Shea

Reputation: 1

For Ubuntu 24.04LTS just use the folowing command:

sudo apt-get install virtualbox -y

Upvotes: -3

dkakoti
dkakoti

Reputation: 667

I got into same problem

Solved it by disabling secure boot option.

Go to BIOS configuration and disable secure boot.

Upvotes: 9

Related Questions