Troubleshooting

KVM and libvirt common errors and how to fix them

Fix the most common KVM and libvirt errors: /dev/kvm missing, permission denied on images, network default not active, domain already exists, failed to connect to the hypervisor and more.

IntermediateKVM hosts2 min read

Most KVM problems come down to a handful of messages. This guide lists the KVM and libvirt common errors, what causes them and how to fix each one quickly.

Before you start

  • Root access to the KVM host.
  • Know where logs live: journalctl -u libvirtd (or the virtqemud service on newer systems) and per-VM logs in /var/log/libvirt/qemu/vmname.log.

"Could not access KVM kernel module" or /dev/kvm missing

"Failed to connect socket to /var/run/libvirt/libvirt-sock"

  • The daemon is not running: sudo systemctl enable --now libvirtd (or the modular virtqemud.socket on newer RHEL-family systems).
  • Permission issue: add your user to the libvirt group and log in again.

"Network 'default' is not active"

sudo virsh net-start default && sudo virsh net-autostart default

If it fails because the network is missing, redefine it from /usr/share/libvirt/networks/default.xml with virsh net-define. A conflict with a host subnet also prevents startup.

"Permission denied" opening a disk image or ISO

  • Keep images under /var/lib/libvirt/images.
  • Check that every parent directory is executable for the qemu user.
  • SELinux: restorecon -Rv /path or label a custom path with semanage fcontext -a -t virt_image_t.
  • AppArmor: check dmesg | grep DENIED and adjust the profile.

"Domain already exists" or "operation failed: domain is already active"

The name is taken. Use virsh list --all; remove a stale definition with virsh undefine name (add --nvram for UEFI VMs).

"Cannot get interface MTU on 'br0': No such device"

The bridge does not exist on this host. Create it or change the VM's NIC to an existing bridge. See virtual networking.

"unsupported configuration: guest CPU doesn't match"

Common after migration to different hardware. Use a CPU model both hosts support instead of host-passthrough.

VM starts but shows "No bootable device"

  • Wrong boot order, or the disk was created empty and no ISO is attached.
  • BIOS/UEFI mismatch with an imported disk.

VM is very slow

  • Check that KVM acceleration is used: the VM log should not mention TCG.
  • Switch emulated disks/NICs to VirtIO.
  • Look for host overcommit: CPU pinning and overcommit.

Frequently asked questions

Where do I see why a VM failed to start?

The error from virsh start plus /var/log/libvirt/qemu/vmname.log.

virsh shows no VMs but they exist

You are connected to qemu:///session; use sudo virsh or -c qemu:///system.

How do I reset a stuck VM?

virsh destroy name forces it off (like pulling the plug), then start it again.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.