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 thevirtqemudservice on newer systems) and per-VM logs in/var/log/libvirt/qemu/vmname.log.
"Could not access KVM kernel module" or /dev/kvm missing
- Check CPU flags:
grep -E -c '(vmx|svm)' /proc/cpuinfo. If 0, enable VT-x/AMD-V; see enable hardware virtualization. - Load the module:
sudo modprobe kvm_intelorkvm_amd. - On a VPS this means nested virtualization is not available; see nested virtualization.
"Failed to connect socket to /var/run/libvirt/libvirt-sock"
- The daemon is not running:
sudo systemctl enable --now libvirtd(or the modularvirtqemud.socketon newer RHEL-family systems). - Permission issue: add your user to the
libvirtgroup and log in again.
"Network 'default' is not active"
sudo virsh net-start default && sudo virsh net-autostart defaultIf 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 /pathor label a custom path withsemanage fcontext -a -t virt_image_t. - AppArmor: check
dmesg | grep DENIEDand 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.
