VirtualBox Kernel Driver Not Installed: How to Fix It
In this article
The "kernel driver not installed" error means VirtualBox's kernel modules (vboxdrv, and on some systems vboxnetflt and vboxnetadp) are missing, not loaded, or built against a different kernel than the one currently running. The fix is to rebuild them with the kernel module build tool and load them. On Linux, run sudo /sbin/vboxconfig (or sudo /usr/lib/virtualbox/vboxdrv.sh setup depending on your install) after installing your distro's kernel headers and a compiler, then reboot. On Windows and macOS this error is rare; there it usually means you need to reinstall VirtualBox with the official installer and allow its drivers, or approve the system extension on macOS. The steps below cover the Linux case in detail, since that is where this error almost always appears.
What You'll Need
- Administrator or sudo access on the machine.
- The kernel headers (or "devel") package that matches your running kernel.
- A C compiler and make, usually packaged together as build-essential or similar.
- The official VirtualBox package for your distribution, installed from your distro's repository or the official Oracle download page.
- A reboot or at least the ability to unload and reload kernel modules.
Step-by-Step
- Confirm the exact error and your kernel version. Open a terminal and run
uname -r. That string is the kernel your modules must match. If you recently updated the kernel and have not rebooted, the running kernel and the installed one can differ, which alone causes this error. Reboot first if you updated recently, then check whether the error persists. - Install the matching kernel headers. The package name depends on your distribution. On Debian and Ubuntu-based systems it is typically
linux-headers-$(uname -r); on Fedora and Red Hat-based systems it iskernel-develandkernel-headers; on Arch-based systems it islinux-headers. Install it with your package manager, for examplesudo apt install linux-headers-$(uname -r)on Ubuntu. If your package manager cannot find a headers package for your exact kernel, you are likely running a custom or outdated kernel; install the standard kernel for your distribution or the matching headers from your kernel's source. - Install a compiler and make. On Debian and Ubuntu:
sudo apt install build-essential. On Fedora:sudo dnf groupinstall "Development Tools". On Arch:sudo pacman -S base-devel. Without these, the module build fails silently or with a compiler error. - Rebuild the VirtualBox kernel modules. Run
sudo /sbin/vboxconfig. If that path does not exist on your system, trysudo /usr/lib/virtualbox/vboxdrv.sh setup. This script compiles the modules against the headers you just installed and loads them. Watch the output: it should end with a message that the modules were built and loaded successfully. - Load the modules manually if the script did not. Run
sudo modprobe vboxdrv, thensudo modprobe vboxnetfltandsudo modprobe vboxnetadpif you use host-only or bridged networking. If modprobe reports that the module is not found, the build step did not complete; return to step 4 and read the full error output. - Reboot and test. A reboot ensures the modules load cleanly at boot and that any kernel mismatch is resolved. After rebooting, start VirtualBox and launch a virtual machine. If the error is gone, you are finished.
- On Windows or macOS, reinstall instead. If you see a driver-related error on Windows, close VirtualBox, download the current installer from the official VirtualBox site, run it, and choose Repair or reinstall. Accept the driver installation prompts. On macOS, the installer asks you to allow a system extension in System Settings > Privacy & Security; approve it and restart. On Apple silicon Macs, VirtualBox does not support running x86 virtual machines the way it does on Intel Macs, so check the official documentation for your hardware before troubleshooting further.
Common Mistakes
- Installing headers for the wrong kernel. Using a generic headers package when you booted a different kernel leaves the build failing. Always match
uname -r. - Skipping the reboot after a kernel update. The running kernel and the installed kernel differ, so the modules never match until you restart.
- Ignoring the build log. The vboxconfig script prints the real reason for failure. Read the last lines of output rather than guessing.
- Secure Boot blocking unsigned modules. On many modern Linux systems with Secure Boot enabled, the modules build but refuse to load because they are not signed. Either enroll a Machine Owner Key (MOK) as your distribution documents, or disable Secure Boot in firmware settings if that is acceptable for your machine.
- Mixing install sources. A VirtualBox installed from one source and updated from another can leave mismatched module paths. Stick to one source and update through it.
Tips
- Run
lsmod | grep vboxto confirm the modules are actually loaded after a fix. - After every kernel update, the modules must be rebuilt. Many distributions handle this automatically through DKMS if you installed VirtualBox from their repository; check whether DKMS is active for your install.
- Keep your VirtualBox version and its Guest Additions matched inside each virtual machine to avoid related errors later.
- If you use bridged or host-only networking, the network modules matter as much as vboxdrv; do not stop after loading only the first one.
Troubleshooting
If vboxconfig reports that it cannot find kernel headers, verify the headers package is installed for the exact kernel from uname -r and that the build directory exists under /lib/modules/$(uname -r)/build. If that path is missing, the headers are not installed correctly.
If the build fails with a compiler error, check that gcc and make are present and that your kernel headers version matches the running kernel exactly. A partial upgrade, where the kernel updated but headers did not, is a frequent cause.
If the modules build but will not load, check dmesg for messages about signature verification or module version mismatch. Secure Boot is the usual culprit; the log will say so directly.
If the error returns after a reboot, the modules are not being loaded at boot. Re-run the setup script and check whether your distribution's service for VirtualBox modules is enabled. If you installed from a distribution repository, reinstalling the VirtualBox package often restores the correct service and DKMS hooks.
If nothing works, uninstall VirtualBox completely, reboot, and reinstall from the official source for your platform. This clears stale module files and rebuilds everything cleanly. Back up any virtual machine configurations you care about first; removing the package should not delete your VM files, but confirm before you proceed.
Frequently Asked Questions
Why does this error appear only after a system update?
A kernel update replaces the running kernel, and VirtualBox's modules must be rebuilt against the new one. Until that happens, the old modules do not match and will not load.
Do I need to reinstall VirtualBox to fix this?
Usually no. Rebuilding the kernel modules with the setup script resolves it. Reinstalling is a last resort when the module files are corrupted or the install is mismatched.
What are vboxnetflt and vboxnetadp for?
They support VirtualBox's host-only and bridged networking. If you only use NAT networking, vboxdrv alone may be enough, but loading all three avoids surprises.
Does this happen on Windows?
Rarely. Windows installs drivers through the installer, so a driver error there usually means a failed or blocked installation. Reinstall with the official installer and accept the driver prompts.
Can Secure Boot prevent the fix from working?
Yes. Secure Boot can refuse to load unsigned kernel modules. You either enroll a Machine Owner Key as your distribution documents or disable Secure Boot, depending on your security requirements.
Will rebuilding the modules affect my virtual machines?
No. The modules are part of VirtualBox itself. Your VM files and settings are untouched by the rebuild.