Installing Virtualbox on Ubuntu, if we have an UEFI secure boot enabled computer, it’s not that difficult if we know the right steps to follow. This procedure has been tested with Ubuntu 16.04.
sudo apt-get install virtualbox
(ignore warning and requests about disabling UEFI secure boot)openssl req -new -x509 -newkey rsa:2048 -keyout vboxdrv.priv -outform DER -out vboxdrv.der -nodes -days 36500 -subj "/CN=MySelf/"
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./vboxdrv.priv ./vboxdrv.der $(modinfo -n vboxdrv)
sudo mokutil --import vboxdrv.der
To check that the solution worked, try to run virtualbox from the terminal by simply typing virtualbox
and check that this message is not present:
WARNING: The vboxdrv kernel module is not loaded.
Either there is no module available for the current kernel (3.15.8-200.fc20.x86_64) or it failed to load.
Please recompile the kernel module and install it by sudo /etc/init.d/vboxdrv setup
You will not be able to start VMs until this problem is fixed.