How can I install VirtualBox on Ubuntu 24.04 with Secure Boot enabled?

August 27, 2026 4 answers
Asked by muffled applause
I'm running Ubuntu 24.04 with Secure Boot enabled and fully updated. I installed VirtualBox 7.2.16 from the Ubuntu Noble .deb package and want to create a Windows 10 virtual machine using an official Microsoft ISO. When I start the VM, I get "VirtualBox Kernel driver not installed (rc=1908)." I tried reinstalling the matching kernel headers, DKMS, and virtualbox-dkms with: sudo apt install --reinstall linux-headers-$(uname -r) virtualbox-dkms dkms After that, modprobe reports that vboxdrv cannot be found under /lib/modules/7.0.0-30-generic. Trying to install the DKMS package also produces: E: Internal Error, No file name for virtualbox-dkms:amd64 What is the correct way to resolve the DKMS and kernel-module problem while keeping Secure Boot enabled?

Answers

~almost audible
If you specifically need VirtualBox, install it from Oracleโ€™s official repository rather than mixing a downloaded .deb with Ubuntuโ€™s DKMS packages. Then enroll a Machine Owner Key and sign the VirtualBox kernel modules, including vboxdrv, vboxnetflt, vboxnetadp, and vboxpci. Secure Boot will refuse to load them unless they are signed. Disabling Secure Boot is another option, but it removes the protection you want to keep.

muffled applause: I understand that disabling Secure Boot would be easier, but Iโ€™d prefer to keep the extra protection if possible.

Reply to this answer
cobalt72
Check that the running kernel, headers, and DKMS installation all match. Compare uname -r with the installed linux-headers package, then rebuild the modules with sudo dkms autoinstall. The โ€œmodule vboxdrv not foundโ€ message usually means the build failed or the module was built for a different kernel. The missing filename error may also indicate a broken or incomplete package source, so refreshing the package lists and using one consistent VirtualBox source is important.
Reply to this answer
wave-particle
QEMU/KVM is a practical fallback if VirtualBox continues to fight Secure Boot. Windows should run reasonably well from a raw virtual disk, but display settings and drivers need to be configured in the guest. For higher resolutions, install the VirtIO or SPICE guest tools and use a SPICE display device rather than relying on the basic default video adapter. Also check that the guest display is set to resize automatically.
Reply to this answer
~potting bench~
The simplest option is to use QEMU/KVM with virt-manager instead of VirtualBox. Its kernel support is already integrated into Linux, so you avoid most of the out-of-tree module and Secure Boot signing problems. For a Windows guest, make sure hardware virtualization is enabled in your firmware settings.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions