KVM: module verification failed: signature and/or required key missing - taintin

KVM Kernel Module Crash: Fix and Prevention

Server & Cloud Intermediate 👁 7 views 📅 Jun 28, 2026

Your KVM hypervisor crashed? The culprit is almost always a kernel module mismatch. Here's how to fix it fast and stop it from happening again.

Yeah, I know the drill — your KVM hypervisor just locked up, guest VMs are gone, and dmesg is full of scary-looking errors. I've been there more times than I can count. Let's skip the pity party and get this fixed.

The Fix (the one that works 90% of the time)

The real fix is almost always a kernel module mismatch. Specifically, the kvm or kvm_intel/kvm_amd module crashed because it was compiled for a different kernel version than what's running. Check your kernel version first:

uname -r

Now check what modules are loaded:

lsmod | grep kvm

If you see something like kvm: module uses symbol from kernel tainted or a crash in dmesg with BUG: unable to handle kernel paging request, the fix is straightforward: reinstall the KVM modules for your exact kernel.

On Ubuntu/Debian:

sudo apt update
sudo apt install --reinstall qemu-kvm libvirt-daemon-system

On RHEL/CentOS/Rocky 8/9:

sudo dnf reinstall qemu-kvm libvirt

Then reboot:

sudo reboot

If you can't reboot right now (production, I get it), you can unload and reload the modules manually:

sudo modprobe -r kvm_intel
sudo modprobe -r kvm
sudo modprobe kvm
sudo modprobe kvm_intel

Don't bother with systemctl restart libvirtd alone — it won't fix a module crash. The module itself needs to be reloaded.

Why It Works

KVM kernel modules are tied to specific kernel builds. When you do a kernel update via apt upgrade or dnf update, the old modules sometimes stick around. Or worse, a partial upgrade leaves you with modules from a different kernel version. The kernel loads them, and boom — crash. Reinstalling the packages forces the modules to match the running kernel. The manual reload trick works because it clears the broken state and reloads the correct version.

Another common cause: CPU microcode updates that happen silently. If your BIOS or a microcode package changed CPU features (like VMX or SVM), KVM can get confused. The module reload picks up the new CPU flags.

Less Common Variations

1. Nested virtualization crash

If you're running VMs inside VMs (nested KVM), the crash might come from the nested module. Check dmesg for kvm: failed to set EPT or nested: VMX disabled. The fix here is to enable nested virtualization in the host:

echo "options kvm_intel nested=1" | sudo tee /etc/modprobe.d/kvm_nested.conf
sudo modprobe -r kvm_intel && sudo modprobe kvm_intel

2. Secure Boot module signature failure

Newer systems with Secure Boot can block KVM modules if they're not signed. Look for module verification failed: signature and/or required key missing - tainting kernel. The workaround is to sign the modules or disable Secure Boot (not great for security, but works). To sign them:

sudo mokutil --enable-validation
sudo modprobe kvm 2>&1 | grep -i sign

Then use mokutil to import a key. Or just disable Secure Boot in BIOS — faster, but I don't recommend it for production.

3. Memory pressure causing module panic

If the host runs out of memory, KVM can't allocate for new VMs and the module panics. Check free -h and dmesg for oom-killer. Add more RAM or limit VM memory with virsh memtune.

Prevention

Stop this from happening again. Here's what I do on all my KVM hosts:

  • Pin your kernel version in production. Use apt-mark hold linux-image-$(uname -r) or dnf versionlock. Only update kernel during maintenance windows.
  • Check modules after every kernel update. Run dmesg | grep -i kvm after reboot. If you see warnings, reinstall the KVM packages before deploying VMs.
  • Automate module integrity checks. Throw this in a cron script:
#!/bin/bash
if ! lsmod | grep -q kvm_intel; then
  echo "KVM module missing!" | mail -s "KVM Alert" admin@example.com
fi
  • Don't mix kernel sources. If you compile your own kernel, compile KVM modules from the same source. No mixing mainline with distro packages.
  • Test nested virtualization in a lab first. It's brittle — don't enable it on production hosts without testing.

That's it. You've got the fix, the reasons, and the prevention. If this doesn't solve it, check your hardware — failing CPUs or RAM can also cause KVM crashes. But 9 times out of 10, it's a module mismatch. Go fix it.

Was this solution helpful?