Skip to content

Instantly share code, notes, and snippets.

@jasper-lyons
Last active August 13, 2016 14:12
Show Gist options
  • Save jasper-lyons/fe751f72113794155e29e9c22a1845fc to your computer and use it in GitHub Desktop.
Save jasper-lyons/fe751f72113794155e29e9c22a1845fc to your computer and use it in GitHub Desktop.
Gist containing all of the information I used to solve this issue and the extra things I had to do between.

First is googled the error message "vboxdrv not loaded" and ubuntu 16.04

This lead me to this ask ubuntu answer.

I read this a few times and began to understand that the issue is, vortial box's kernel modules are not signed which means that Ubuntu running secure boot will fail to load those modules. Since I have never signed modules before I figured I would read this enough times to understand. Unfortunately this answer in and of it's self was not informative enough for me to be comfortable with fixing this problem, I must know more.

I decided to take a look at this gist, linked to in the above answer. Again, this was insufficient for me to fully grok what was heppening but I did realise that:

  1. I needed to already have a directory with "keys" in

    > dir=/home/directory/of/keys

  2. I would be signing multiple modules, I think...

    > for module in vboxdrv vboxnetflt vboxnetadp vboxpci; do

Not finding the information I needed in the script I moved onto the first link which, looking back over now does cover an important step in the process but was extremely out of contexts given my understanding of the problem at the time. I needed to know why I was going to be following the commands provided.

I then forced myself to read the whole of the "Ubuntu Implementation" link which gave me a general overview of module signing in Ubuntu. This mainly served to reinforce the existing information I had consumed throughout this adventure, making me feel more comfortable about the actions I would need to take, e.g. generating keys, storing keys, using keys, loading modules.

I then read through this blog post, also linked to in the answer, which was a wonderful walk through of what needs to happen and most importantly WHY! Everything was great until I reached this:

user@localhost:$ mokutil --import MOK.der

and got the error

failed to enroll new key

I promptly googled this and found at the bottom of the thread on virtualbox.org an answer that looks suspiciously like that of the blog post! This provided all of the extra information, specific to Ubuntu 16.04, that I required to solve the issue (and some others that I had already over come). e.g.

PS: on ubuntu 16 you have to use:

    sudo /usr/src/linux-headers-4.4.0-21-generic/scripts/sign-file sha256 ./MOK.priv ./MOK.der /lib/modules/4.4.0-21-generic/updates/dkms/vboxdrv.ko

And now everything works :) though I expect I will have to sign the new modules when they are updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment