Use this topic when the symptom or planned change has been narrowed to KVM / QEMU → KVM Troubleshooting. Establish effective host/runtime state before changing configuration.
KVM Troubleshooting
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.
1. Read the QEMU log for start failures.
2. Check permissions (SELinux/AppArmor) on disk files.
3. Check storage pool and network active.
4. Use virt-host-validate.
5. Compare XML with working VM.
virsh action → libvirt → QEMU → KVM → guest
Context & applicabilityCommon mistakes · platform/version boundaries
A single log message or status is evidence of a condition, not root cause until timing and the failed dependency path explain the observed symptom.
Operational reference
Fast context before you go deeper.
virsh list --allVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Symptom/time → scope/baseline → host/KVM → QEMU/libvirt → virtual device/backend → guest OS → workload → minimal change → verification
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- 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.
virsh domstate <vm> --reason— statetail -100 /var/log/libvirt/qemu/<vm>.log— QEMU errorsjournalctl -u libvirtd -u virtqemud --since -1h— daemon errors
ReferenceImportant terms & boundaries3 sections · depth on demand
What this shows and what it does not
A single log message or status is evidence of a condition, not root cause until timing and the failed dependency path explain the observed symptom.
In depth
Is KVM available at all?
$ grep -cE 'vmx|svm' /proc/cpuinfo # > 0: CPU supports VT-x / AMD-V
$ lsmod | grep kvm
kvm_intel 409600 12
kvm 1314816 1 kvm_intel
$ ls -l /dev/kvm
crw-rw---- 1 root kvm 10, 232 Nov 27 08:01 /dev/kvm
$ virt-host-validate qemu
QEMU: Checking for hardware virtualization : PASS
QEMU: Checking if device /dev/kvm exists : PASS
QEMU: Checking for device assignment IOMMU support : WARN (No ACPI DMAR table found, IOMMU either disabled in BIOS or not supported)
| Finding | Cause |
|---|---|
vmx/svm count 0 | Disabled in firmware, or running inside a VM without nested virtualisation |
Module loads but /dev/kvm missing | Module error — dmesg \| grep kvm (often "disabled by bios") |
Permission denied on /dev/kvm | User not in kvm group (libvirt session mode) |
What QEMU and libvirt think the host can do
The virsh manual documents capabilities and domcapabilities:
virsh domcapabilities --virttype kvm | grep -E '<mode name|<model'
virsh capabilities | grep -A3 '<host>'
These show supported CPU models, firmware, machine types and device models — useful when a VM definition copied from another host fails with "unsupported configuration".
Per-VM logs
| Platform | Log |
|---|---|
| libvirt | /var/log/libvirt/qemu/<vm>.log (QEMU command line and errors) |
| Proxmox VE | Task log of the start; qm showcmd <vmid> --pretty for the command line |
| Kernel | dmesg / journalctl -k for KVM errors (kvm: ... emulation failure) |
Typical KVM-level problems
KVM internal error. Suberror: 1 — emulation failure: guest executed an instruction KVM could not emulate — usually a guest or CPU-model mismatch; capture the log and try a different CPU model.- Guest clock drift: use
kvm-clockin Linux guests and Hyper-V enlightenments in Windows. - Nested virtualisation needed (labs):
cat /sys/module/kvm_intel/parameters/nested→Y, CPU modelhost.
*The KVM kernel module and device availability checks above are illustrative examples, not captured from a lab or production host.*
Method
| Problem | Check |
|---|---|
Could not access KVM kernel module | VT-x/AMD-V disabled in BIOS, kvm_intel not loaded |
| VM won't start (permission denied on disk) | SELinux/AppArmor labels (restorecon, virt_image_t), file ownership qemu |
| Network down for bridged VM | Bridge membership, netfilter on bridge, VLAN tags |
| Slow VM | Emulated devices, no cache=none, CPU model qemu64, host swapping |
| Migration fails | CPU model, TLS/SSH, storage visibility |
virt-host-validate
tail -50 /var/log/libvirt/qemu/vm1.log
ausearch -m avc -ts recent | grep qemu
ReferenceConfiguration & state1 section · depth on demand
First commands
virsh list --all
virsh dominfo <vm> ; virsh domblklist <vm> ; virsh domiflist <vm>
journalctl -u libvirtd --since "1 hour ago"
less /var/log/libvirt/qemu/<vm>.log
virt-host-validate
Common causes: missing KVM support (/dev/kvm), permissions/SELinux on disk images, network bridge missing, disk image locked by another process.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in KVM / QEMU → KVM Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.qemu.org/docs/master/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
KVM / QEMU → KVM Troubleshooting reference map
Fast operational boundaries and evidence limits for KVM / QEMU → KVM Troubleshooting.
| 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 |