KVM Troubleshooting
Cheat sheet · https://pcornel.dk/topic.php?topic=3804
Answer
KVM troubleshooting checks each layer in turn: host CPU virtualization support, libvirt (virsh, journalctl -u libvirtd), the QEMU process log in /var/log/libvirt/qemu/, then the guest's own boot and logs.
Remember
- libvirt error ≠ libvirt root cause.
- QEMU exit ≠ QEMU bug; backing storage, permissions, device or resource failures may trigger it.
- VM Active ≠ guest healthy.
- Temporary restart success ≠ durable fix.
First checks
virsh domstate <vm> --reason— statetail -100 /var/log/libvirt/qemu/<vm>.log— QEMU errorsjournalctl -u libvirtd -u virtqemud --since -1h— daemon errors
Commands
virshqm showcmd <vmid> --prettyjournalctl -k
Verify in this order
virsh action → libvirt → QEMU → KVM → guest
Where it usually breaks
First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.
KVM / QEMU → KVM Troubleshooting reference map
| Boundary | What to verify | Evidence limit |
|---|---|---|
| Definition/config | Expected KVM / QEMU → KVM Troubleshooting definition or configuration is present | Configured state does not prove runtime behavior |
| Runtime | Relevant KVM/QEMU/libvirt object or process is active without matching errors | Runtime state does not prove dependencies or guest outcome |
| Dependency | Host CPU/memory, storage, network or device backend required by this path is healthy | Local success does not prove the next boundary |
| Acceptance | Original guest/application test succeeds after the change or observation | Required for end-to-end closure |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3804