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

0
0
Asked By MellowCedar42 On

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?

4 Answers

Answered By QuietOrbit7 On

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.

Answered By RiverQuartz31 On

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.

Answered By SilverPine22 On

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.

Answered By AmberLynx58 On

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.

MellowCedar42 -

I understand that disabling Secure Boot would be easier, but I’d prefer to keep the extra protection if possible.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.