Skip to content

Sign vboxdrv for VirtualBox when using Secure Boot

Sign vboxdrv for VirtualBox when using Secure Boot published on

Sign vboxdrv so Secure Boot has no problem with it. (Source AskUbuntu)
Short version:

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ~/.ssh/MOK.priv .ssh/MOK.der $(modinfo -n vboxdrv)

To create the keys MOK.priv and MOK.der, this steps are required:

# create key pair
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Signing Key for Secure Boot/"

# use mokutil to test, if the key is enrolled (should not, if you just created it)
mokutil --test-key .ssh/MOK.der

# import key
sudo mokutil --import .ssh/MOK.der

# sign vboxdrv
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 .ssh/MOK.priv .ssh/MOK.der $(modinfo -n vboxdrv)

# check vboxdrv and activate
sudo modinfo -n vboxdrv
sudo modprobe vboxdrv