KVM Snapshots with virsh: Create, List, Revert and Delete

How KVM snapshots work: internal vs external, disk-only vs full system snapshots, and the virsh commands to create, revert and merge them safely.

Published November 27, 2026

Snapshots let you freeze a VM at a known-good point, try a risky upgrade, and roll back in seconds if it goes wrong. KVM supports several snapshot styles, and choosing the wrong one is how people end up with long, slow snapshot chains. This guide explains the types and the exact virsh commands for each.

The concept

An internal snapshot is stored inside the qcow2 file itself. It can include the VM's RAM and device state (a "system checkpoint"), so reverting brings back running programs exactly where they were. Internal snapshots are easy to use but only work with qcow2, and the VM pauses briefly while memory is saved.

An external snapshot freezes the current disk file and creates a new overlay file on top of it. All new writes go to the overlay. External snapshots are the modern, recommended approach: they work live, can be quiesced with the guest agent, and are the basis of most backup tools. The catch is that reverting and deleting them involves merging chains with blockcommit or blockpull.

Snapshot types

TypeStored inIncludes RAM?Best for
Internal (system checkpoint)Same qcow2 fileYesQuick dev/test rollback
Internal disk-onlySame qcow2 fileNoSimple offline restore points
External disk-onlyNew overlay fileNoLive backups, production
External with memoryOverlay + memory fileYesFull state capture of running VMs

External snapshot chains

backingbackingbase.qcow2frozensnap1.qcow2frozensnap2.qcow2active writes
An external snapshot chain. Every read may walk the chain.

Live backup with external snapshots

  1. Create external snapshot: VM now writes to the overlay
  2. Back up the now read-only base image with rsync or qemu-img
  3. blockcommit --active --pivot merges the overlay back into the base
  4. Delete the snapshot metadata and the overlay file
The classic live-backup pattern using external snapshots.

Internal snapshots in four commands

virsh snapshot-create-as web01 pre-upgrade "before apt full-upgrade"
Domain snapshot pre-upgrade created
virsh snapshot-list web01
Name Creation Time State
pre-upgrade 2026-11-27 10:02:11 +0000 running
virsh snapshot-revert web01 pre-upgrade
virsh snapshot-delete web01 pre-upgrade
Domain snapshot pre-upgrade deleted
Internal snapshot round-trip: create, list, revert, delete.

Practical examples

External, disk-only, quiesced snapshot

Needs qemu-guest-agent in the guest to flush filesystems.

virsh snapshot-create-as web01 nightly --disk-only --atomic --quiesce \
  --diskspec vda,file=/var/lib/libvirt/images/web01-nightly.qcow2
virsh domblklist web01   # vda now points to the overlay

Merge the overlay back and clean up

blockcommit copies overlay data into the base and pivots the VM back.

virsh blockcommit web01 vda --active --pivot --verbose
virsh snapshot-delete web01 nightly --metadata
rm /var/lib/libvirt/images/web01-nightly.qcow2

Inspect a chain

qemu-img shows every layer in the backing chain.

qemu-img info --backing-chain -U /var/lib/libvirt/images/web01-nightly.qcow2

Common mistakes

  • Treating snapshots as backups. They live on the same disk; if the disk dies, so do they.
  • Leaving snapshots for months. Long chains slow I/O and make merges take hours.
  • Deleting an overlay file with rm while the VM still uses it.
  • Reverting a database VM with a disk-only snapshot taken without --quiesce, then getting a crash-consistent but dirty database.
  • Mixing internal snapshots with UEFI (pflash) firmware on older libvirt versions, which refused them.

Key takeaways

  • Internal snapshots are simple and include RAM; external snapshots are live-friendly and backup-friendly.
  • External snapshots create overlay chains. Merge them with blockcommit.
  • Use --quiesce with the guest agent for application-consistent snapshots.
  • Snapshots are short-term restore points, not a backup strategy.

FAQ

Can I revert an external snapshot with snapshot-revert?

Recent libvirt versions (9.x and later) support reverting external snapshots. On older versions you edit the VM to point back at the base image manually.

Do snapshots slow the VM down?

Slightly. Each extra layer adds lookup overhead, and the first write to each block must allocate in the overlay. Keep chains short.

How do I snapshot a raw disk?

Use external snapshots (the overlay is qcow2 on top of the raw base) or snapshot at the storage layer with LVM or ZFS.

More Linux articles