One of the ways Secure Boot maintains system security is by only allowing trusted kernel extensions to load. You must intervene if you want to run third-party modules like the VirtualBox Kernel Driver (vboxdrv).
OnmacOS, this is very easy to do as you canallow the module to loadfromSystem Preferences.
OnLinuxsystems, you should ensure the kernel and GCC versions are compatible with the vboxdrv module. you may alsomanually sign the moduleusing mokutil.
If such methods fail or you don’t care about Secure Boot, you may alwaysdisable Secure Bootto resolve this error.
How to Fix This Error on MacOS
Allow Module to Load
Users must manually allow the loading of kernel extensions (KEXTs) on macOS 10.13 and newer versions. To do this,
Restart VirtualBoxStartup Service
Use the following one-liner in the terminal to restart the startup service for loading the kernel module.
Repeat the steps from the previous section and reboot. Then, check if you may start your VM in VirtualBox.
Register the vboxdrv Module
Registering the VirtualBox kernel extension directly via the terminal can also help. Enter the following one-liner in the terminal to do this:
Reboot and check if you may launch the VM now.
Approve Oracle’s Dev ID
If manually loading vboxdrv doesn’t work,add Oracle’s developer ID to the security assessment policy. This will allow programs from Oracle (i.e. VirtualBox) to access the kernel.
Also, try the same inRecovery Mode.
Install VirtualBox Extension Pack
The VirtualBox Extension Pack is usually installed to add extra functionality like virtual USB 3.0 devices. In this case, installing it is worth it as that can potentially resolve the kernel driver issue.
Flush Kernel Extension Cache
Use the following command in the terminal to clear the kernel extension cache:
Check if the VM works now. If it doesn’t, restart your Mac and try the command once more.
Try Another VirtualBox Version
Reinstalling VirtualBox is one of the most effective ways to resolve this error. Specifically, try different versions of VirtualBox (the latest one, as well as older stable versions). To do this,
Set Kernel Extension Flag Correctly
If the restricted flag is not set against KernelExtensionManagement, this will affect how System Integrity Protection (SIP) interacts with directories. This can ultimately lead to theVirtualBox Kernel Driver Not Installederror. To resolve this:
Disable Secure Boot
If nothing else works, you may disable Secure Boot as the last resort. With Secure Boot disabled, you’ll have no problems loading unsigned KEXTs like vboxdrv. To do this:
How to Fix This Error on Linux
I’ll provide commands for Debian-based distros for demonstration. Remember to modify the commands (likeapttodnf) according to your distro.
Restart your PC
Linux distros frequently receive minor kernel updates, which can lead to incompatibility between vboxdrv and the updated kernel. Rebooting your PC is often the easiest way to resolve this problem.
Resolve Kernel Version Problems
Sometimes, there won’t be a vboxdrv version compatible with the latest kernel. Other times, you’ll have to manually install the headers and install VirtualBox afterward. You’ll encounter the error unless you do this in this specific order.
To resolve such problems, first tryreinstalling VirtualBoxand the kernel headers:
If the error persists,reinstall the vboxdrv kernel module. Then,reconfigure the VirtualBox packageandload the modulelike so:
Roll Back Kernel
Oracle may take a little while to release a vboxdrv version compatible with the latest kernel version. This is especially likely if you’re running a custom or obscure kernel.
In such cases, you may tryrolling back to an older supported kernel versionto resolve this error.
Download the kernel files from yourdistro’s kernel archiveand install them. After rebooting with the newly installed kernel, the error should be resolved.
Change GCC Version
Users also face this error because the current GCC version is different from the one that was used to compile the module. In such cases,switching to the same compilershould resolve the problem.
For instance, to change the GCC version to GCC 8:
Fix Module Signature Issues
DKMS modules are generally configured at installation to work with Secure Boot. But sometimes modules won’t be allowed to load due to signature issues.
In such cases, you cansign the modules yourselfusing themokutiltool. I recommend checkingthis GitHub postby reillysiemens as it covers this process in detail.
Turn Off Secure Boot
The main problem with manually signing modules is that you have to resign them after each kernel update. And kernel updates on Linux areveryfrequent. So, my preferred solution is to simply disable secure boot: