Pcornel
Virtualization · KVM / QEMU

KVM Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=3804

Back to the Topic

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 — state
  • tail -100 /var/log/libvirt/qemu/<vm>.log — QEMU errors
  • journalctl -u libvirtd -u virtqemud --since -1h — daemon errors

Commands

virsh
qm showcmd <vmid> --pretty
journalctl -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

BoundaryWhat to verifyEvidence limit
Definition/configExpected KVM / QEMU → KVM Troubleshooting definition or configuration is presentConfigured state does not prove runtime behavior
RuntimeRelevant KVM/QEMU/libvirt object or process is active without matching errorsRuntime state does not prove dependencies or guest outcome
DependencyHost CPU/memory, storage, network or device backend required by this path is healthyLocal success does not prove the next boundary
AcceptanceOriginal guest/application test succeeds after the change or observationRequired 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

Confirmation

Confirm action

Continue?