Use this topic when the symptom or planned change has been narrowed to KVM / QEMU → QCOW2. Establish effective host/runtime state before changing configuration.
QCOW2 · KVM / QEMU
Separate guest logical blocks from QCOW2 metadata/allocation and the host filesystem or storage backend. Backing-file chains add another dependency layer between guest writes and base data.
1. qcow2: thin, snapshots, backing files.
2. preallocation=metadata improves performance.
3. Check after host crashes.
4. Short backing chains.
5. Compress for templates.
qcow2 → QEMU block → guest
Context & applicabilityCommon mistakes · platform/version boundaries
A readable QCOW2 file shows only file access, but it does not show backing files, metadata integrity, free capacity or guest filesystem health.
Operational reference
Fast context before you go deeper.
Verification & 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 qcow2 features and checks Verify boundary
| Feature | Note |
|---|---|
| Thin provisioning | Grows with written data |
| Snapshots | Internal (qemu-img snapshot) or external overlays |
| Backing files | Templates / linked clones |
| Compression / encryption | Optional (LUKS encryption) |
qemu-img info --backing-chain disk.qcow2
qemu-img check disk.qcow2
qemu-img resize disk.qcow2 +20G
Documented example, not captured output. Never open a qcow2 file used by a running VM with another process.
Step 2 Verification path Verify boundary
Guest block I/O → virtual controller/VirtIO → QEMU block layer → QCOW2 metadata/backing chain → host filesystem/storage → physical media
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.
- QCOW2 virtual size ≠ host allocated size.
- Guest free space ≠ host filesystem/datastore free space.
- Image file exists ≠ metadata/backing chain healthy.
- Internal snapshot capability ≠ independent backup.
qemu-img info <disk.qcow2>— format and backingqemu-img check <disk.qcow2>— consistencyqemu-img convert -O qcow2 -o preallocation=metadata src dst— optimise
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
A readable QCOW2 file shows only file access, but it does not show backing files, metadata integrity, free capacity or guest filesystem health.
In depth
qcow2 on KVM hosts: create, inspect, snapshot and convert.
qemu-img create -f qcow2 -b base.qcow2 -F qcow2 web01.qcow2 # overlay on a base image
qemu-img info --backing-chain web01.qcow2
qemu-img snapshot -l web01.qcow2
qemu-img commit web01.qcow2 # merge overlay into base
qemu-img convert -O qcow2 -c web01.qcow2 web01-compact.qcow2
virt-sparsify --in-place web01.qcow2 # reclaim zeroed space (VM off)
Never run qemu-img write operations on an image used by a running VM; use virsh blockcommit/blockpull for live operations.
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 → QCOW2. 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 → QCOW2 reference map
Fast operational boundaries and evidence limits for KVM / QEMU → QCOW2.
| Boundary | What to verify | Evidence limit |
|---|---|---|
| Definition/config | Expected KVM / QEMU → QCOW2 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 |