Attach a disk to a guest from a storage pool and every snapshot that guest takes afterwards quietly changes shape. Nothing announces it, the snapshot still succeeds, and the only visible clue is a field that stops appearing in a dialog you were not looking at. That one behaviour connects the two halves of this guide, so it is worth knowing before you start clicking.
This walks through the storage side of the Cockpit machines page end to end: creating KVM storage pools on local disks, LVM and NFS, carving volumes out of them, attaching those volumes to guests, taking and reverting snapshots, backing a guest up without stopping it, and live migrating it to a second host. Everything below was run on two Ubuntu 26.04 hosts running cockpit-machines 351 against libvirt 12 in August 2026, and every error message quoted is one the lab actually produced.
If you have not got this far yet, start with installing KVM and QEMU and then the Cockpit web console. The companion pieces cover creating and running the guests and the virtual networks they sit on.
What Cockpit manages and what it hands back to virsh
Cockpit does not expose all of libvirt. Knowing the boundary up front saves you hunting for a button that was never built. Here is what the storage, snapshot and migration features actually cover.
| Task | In Cockpit | Needs virsh |
|---|---|---|
| Define a pool | Six types on this host | scsi, mpath, and anything the host driver lacks |
| Build a pool (partition table, mkfs) | No | virsh pool-build |
| Start, stop, delete a pool | Yes | |
| Create and delete volumes | Yes | |
| Resize or clone a volume | No | virsh vol-resize, vol-clone |
| Snapshot a VM | Yes, mode chosen for you | --disk-only, --quiesce, custom diskspec |
| Merge a snapshot overlay | Only via Delete | virsh blockcommit |
| Clone a VM | Yes, offline only | virt-clone with options |
| Back up or export a VM | No | qemu-img convert, virsh backup-begin |
| Live migrate | Yes | bandwidth caps, postcopy, tunnelled |
| Offline migrate | No | virsh migrate --offline |
The pattern is consistent. Cockpit handles the definition and lifecycle of an object well, and stops short of anything that reformats hardware or rewrites a disk chain. Keep a terminal open next to the browser; you will need it twice in this guide.
One note on that terminal before the first command. Every virsh line below runs without sudo, which works because the login account belongs to the libvirt group and therefore has permission on the system socket. Check where your own shell is pointed before you start:
virsh uri
groups
On this host an unprivileged shell answers with the system URI and lists libvirt among the groups:
qemu:///system
sysadmin adm cdrom sudo dip lxd libvirt kvm
Run the same command as an account outside the group and it stops dead with Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied, which is a permission problem, not a URI problem. If yours answers qemu:///session instead, every pool and guest in this guide will appear to be missing because you are talking to a per-user daemon. Fix both at once:
sudo usermod -aG libvirt "$USER"
export LIBVIRT_DEFAULT_URI=qemu:///system
Group changes only apply to new logins, so log out and back in (or run newgrp libvirt) before you retry virsh uri. For scripts, put the assignment where the script will actually see it: a systemd unit’s Environment=, or a bare LIBVIRT_DEFAULT_URI=qemu:///system line in /etc/environment with no export keyword, which that file does not accept. A stock Ubuntu ~/.bashrc bails out early on non-interactive shells, and cron never reads your shell profile at all, though it does pick up /etc/environment through PAM. Putting the assignment at the top of the crontab itself removes all doubt.
Some commands later on keep their sudo anyway: the ones that run on the second host, the ones that need root’s own SSH identity rather than yours, and every qemu-img call, because libvirt creates volumes owned by libvirt-qemu with no group read bit and being in the libvirt group does not get you past file permissions.
Create a KVM storage pool
Storage pools live on their own page. From the Virtual machines list, click Storage pools in the breadcrumb bar at the top. The table lists every pool libvirt knows about with its allocation, the libvirt connection it belongs to, and its state.

Create storage pool opens a dialog whose fields change with the type you pick. On a stock Ubuntu host the Type dropdown offers six options:
- Filesystem directory maps to libvirt’s
dirtype. One field, a target path. - Network file system maps to
netfs. Target path, host, and the exported directory. - iSCSI target maps to
iscsi. Target path, host, and the target IQN as the source path. - Physical disk device maps to
disk. Adds a Format select offering dos, dvh, gpt and mac. - LVM volume group maps to
logical. A single field for the name of a volume group that must already exist. - Pre-formatted block device maps to
fs. Target path, the block device, and a Format select of auto, ext2, ext3, ext4 and xfs.
Seven is the ceiling. Cockpit carries dialogs for those six plus iscsi-direct, then hides any whose backend the local libvirt cannot do, which is why the seventh is absent here. Everything outside that hardcoded seven has no dialog at all, so installing an extra storage driver package will not conjure a Ceph or ZFS entry into the dropdown. Check what your libvirt supports before you go hunting:
virsh pool-capabilities | grep -oE "type='[a-z-]+' supported='[a-z]+'"
Eight backends work on the lab host. iscsi-direct reports supported='no' because its driver package is not installed by default, which is what keeps it out of the dropdown, while scsi and mpath are perfectly usable through virsh and simply have no dialog:
type='dir' supported='yes'
type='fs' supported='yes'
type='netfs' supported='yes'
type='logical' supported='yes'
type='disk' supported='yes'
type='iscsi' supported='yes'
type='iscsi-direct' supported='no'
type='scsi' supported='yes'
type='mpath' supported='yes'
type='rbd' supported='no'
type='sheepdog' supported='no'
type='gluster' supported='no'
type='zfs' supported='no'
type='vstorage' supported='no'
Target path is a type-ahead picker on every type that has one, which is all of them except LVM, and so is Source path on the disk and pre-formatted block types. That is genuinely useful for block devices because the field lists device nodes under /dev as you type. Picking a suggestion appends a trailing slash. Source path on the NFS and iSCSI types is a plain text box, so do not sit there waiting for it to complete an export name. The Connection radio at the top decides whether the pool belongs to the system libvirt daemon or to your user session; leave it on System unless you are deliberately building a rootless setup.
Start with the plainest useful pool, a directory pool over the standard image path. Name it default, set the target path to /var/lib/libvirt/images, leave Start pool when host boots ticked, and create it. Then look at what libvirt actually stored:
virsh pool-dumpxml --inactive default
The definition is as thin as it gets. No permissions block, so the directory keeps whatever ownership it already had:
<pool type='dir'>
<name>default</name>
<uuid>e09c0f9e-dc52-448f-855d-e7d8e9800b40</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
</source>
<target>
<path>/var/lib/libvirt/images</path>
</target>
</pool>
The number that matters in that output is the capacity, and it reads zero because a pool created in Cockpit is defined but not started. The tick box labelled “Start pool when host boots” sets the autostart flag for future boots; it does not start the pool now. The list shows it as inactive with an Activate button, and the size column stays at 0 / 0 GiB until you press it. Every one of the five pools built for this guide came up inactive.
virsh pool-list --all --details
Autostart is on, the pool is persistent, and nothing is running:
Name State Autostart Persistent Capacity Allocation Available
------------------------------------------------------------------------------------
blockpool inactive yes yes - - -
default inactive yes yes - - -
diskpool inactive yes yes - - -
nfsstore inactive yes yes - - -
vmvg-pool inactive yes yes - - -
The LVM type deserves a warning of its own. Its single field is labelled “Source volume group” with the placeholder “Volume group name”, and Cockpit will not create the group for you. Run pvcreate and vgcreate first, or the pool has nothing to attach to. The LVM pool walkthrough covers the volume group side properly.
Add an NFS pool for shared storage
A network pool is what turns two independent KVM boxes into something you can move guests between in seconds, so it is worth building even in a two host lab. Install the server on whichever machine is exporting the share:
sudo apt install nfs-kernel-server
Create the export directory and hand it to the libvirt user. Those two account names exist because this box also runs libvirt; on a dedicated NAS the UIDs will not line up and you will be matching numeric IDs instead:
sudo mkdir -p /srv/nfs/kvm
sudo chown libvirt-qemu:kvm /srv/nfs/kvm
sudo chmod 0775 /srv/nfs/kvm
Exports on Ubuntu can live in their own file under /etc/exports.d, which keeps the main exports file clean:
sudo vim /etc/exports.d/kvm.exports
One line is enough. no_root_squash is there because libvirt writes disk images as root on the client side, and it is also the reason this export must never face anything wider than a trusted storage segment: any root user on that subnet gets root on these files:
/srv/nfs/kvm 10.0.1.0/24(rw,sync,no_subtree_check,no_root_squash)
Start the server, apply the export, and confirm it is live:
sudo systemctl enable --now nfs-server
sudo exportfs -ra
sudo exportfs -v
On the KVM host, create the mount point first. Cockpit defines the pool but never builds it, and libvirt’s start routine only mounts, so a target path that does not exist is a third way to fail on first activation:
sudo mkdir -p /mnt/nfsstore
Now create a pool of type Network file system. Target path is that local mount point, Host is the NFS server, and Source path is the exported directory. The field even tells you so: its placeholder reads “The directory on the server being exported”.

Cockpit writes a plain netfs pool and libvirt fills in format type='auto', which selects the network filesystem type rather than the NFS protocol version. Pinning the protocol to NFSv3 is a separate <protocol ver='3'/> element that no Cockpit field writes, so that one is a virsh pool-edit job. The equivalent build from the command line is in the NFS pool guide.
Fix a pool stuck in the Failed state
Pressing Activate does not always work, and when it fails the State column turns into a red Failed pill with a “view more” link next to it. That link is the only place the reason appears, and the pill clears itself after a page refresh, so read it before you navigate away.

Two of the five pools in this lab failed on first activation, and both failures are things any reader will hit. Running virsh pool-start by hand gives you the same message in a form you can copy.
Error: “you might need a /sbin/mount.<type> helper program”
The NFS client packages are missing. A minimal Ubuntu server install ships no NFS client, and neither libvirt nor Cockpit pulls one in, so the mount libvirt attempts has no helper to run:
error: Failed to start pool nfsstore
error: internal error: Child process (mount -o nodev,nosuid,noexec kvm02:/srv/nfs/kvm /mnt/nfsstore) unexpected exit status 32: mount: /mnt/nfsstore: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
Install the client and press Activate again:
sudo apt install nfs-common
The mount options in that error tell you something on their own. libvirt mounts network pools nodev,nosuid,noexec whether you asked for it or not.
Error: “Device ‘/dev/vdd’ is unrecognized, requires build”
A physical disk pool needs a partition table before libvirt will touch it, and Cockpit has no button that writes one. This is the clearest gap in the storage page:
error: Failed to start pool diskpool
error: Storage pool probe failed: Device '/dev/vdd' is unrecognized, requires build
Build it once from a terminal, then activate from the browser as normal. Check the device with lsblk and blkid before you run this, because pool-build writes a fresh partition label over the whole device and takes an --overwrite flag precisely because that is destructive:
virsh pool-build diskpool
virsh pool-start diskpool
With both fixed, all five pools report real capacity. The pre-formatted block pool shows 7.78 GiB out of an 8 GiB ext4 partition, the LVM pool the full 6 GiB of its volume group, and the disk pool the raw 5 GiB of the device. The same pool-build caveat applies to the LVM and physical disk types generally.
Create storage volumes
Expanding a pool row reveals two tabs. Overview repeats the definition, showing target path, persistence, autostart and type for every pool plus a source and source format on the types that have one, and Storage volumes lists what is inside. The Used by column is the reason to come here: it maps every volume to the guests holding it open, and it lists more than one name when a volume is shared.

An inactive pool shows the message “Activate the storage pool to administer volumes” instead of the table, so start the pool first.
Create volume opens a three field dialog, and the fields differ per pool type in ways the interface never explains:
| Pool type | Format choices | Name constraint |
|---|---|---|
| Filesystem directory, NFS, pre-formatted block | qcow2, raw | Any filename |
| LVM volume group | No Format field at all | Any logical volume name |
| Physical disk device | none, linux, fat16, fat32, linux-swap, linux-lvm, linux-raid, extended | Must be the next partition device name |
The LVM case is correct rather than broken. Logical volumes are raw block devices, so there is no image format to pick and Cockpit removes the field. The disk pool case is where people get stuck.
Error: “invalid partition name ‘diskvol1’, expected ‘vdd1′”
On a physical disk pool the volume name is not yours to choose. libvirt is creating a partition, and the volume must be named after the device node that partition will become. Type anything else and you get this:

Helpfully, the message names the value it wants. Retype the name as vdd1 and the same dialog succeeds, producing a real 2 GiB partition:
virsh vol-list --pool diskpool --details
The volume is a block device rather than a file, and lsblk now shows the partition on the host:
Name Path Type Capacity Allocation
---------------------------------------------------
vdd1 /dev/vdd1 block 2.00 GiB 2.00 GiB
Two guard rails work well. Ask for more space than the pool holds and the dialog refuses before it calls libvirt, naming the real ceiling: “Storage volume size must not exceed the storage pool’s capacity (6.00 GiB)”. Tick a volume that a guest currently has open and the button reads “Delete 1 volume” but comes up disabled, with a tooltip telling you to detach the disk first.
Where the safety net is missing is the volumes nothing is using. Tick those, press the button, and they are gone with no confirmation prompt. Deleting a whole pool behaves differently again: an inactive pool warns that “Deleting an inactive storage pool will only undefine the pool. Its content will not be deleted”, while an active one adds a checkbox list headed “Also delete all volumes inside this pool:” with every box clear by default. If you need to grow a disk rather than replace it, that is a job for virt-resize.
Attach pool storage to a guest
A pool earns its keep the moment a VM uses it. On the guest’s detail page, Add disk offers three sources, and the choice has consequences well beyond this dialog.

Create new makes a volume in the pool you select and attaches it in one step, with the same qcow2 or raw choice as the volumes tab. Use existing gives you a pool dropdown and a volume dropdown. Custom path takes a bare filesystem path and adds a Device select for disk image versus CD/DVD.
Behind Show additional options are cache mode (default, none, writethrough, writeback, directsync, unsafe), bus type (sata, scsi, usb, virtio) and a Disk identifier field. The Persistence checkbox labelled Always attach only renders when the guest is running, and unlike the network interface dialog it is ticked by default, so a disk added to a running VM survives the next shutdown unless you clear it.
The volume dropdown under Use existing hides volumes already attached to this guest but lists volumes belonging to other guests. Pick one and the field turns amber with the message “This volume is already used by web01.” That is a warning, not a block. The Add button still works, and two guests writing one image will destroy it.

Now the part that matters. Attaching the same file through the two paths produces different XML. On the guest that got the pool attachment:
virsh dumpxml web03 | grep -E "<disk type|<source (file|pool)"
Its install-time disk and its CD-ROM are file references; the volume added from the pool is a pool reference:
<disk type='file' device='disk'>
<source file='/var/lib/libvirt/images/web03.qcow2' index='2'/>
<disk type='volume' device='disk'>
<source pool='default' volume='web03-data.qcow2' index='3'/>
<disk type='file' device='cdrom'>
<source file='/var/lib/libvirt/images/web03-seed.iso' index='1'/>
Attaching that identical qcow2 to a different guest through Custom path gives a file reference instead, with no pool involved:
<disk type='file' device='disk'>
<source file='/var/lib/libvirt/images/web03-data.qcow2'/>
<target dev='vdb' bus='virtio'/>
Both boot the guest identically. They do not snapshot identically, which is the next section.
Take and revert VM snapshots
The Snapshots card sits near the bottom of every guest’s page. Create snapshot prefills the name with a timestamp in 2026-08-11T18:33 form and takes an optional description. On some running guests it also shows a Memory state path field with a live estimate underneath: “Memory snapshot will use about 446 MB. Total space available: 51.5 GB.”

Hold on to the words “some running guests”. That field is the tell for the whole section, and the next heading explains what makes it vanish.
Treat the estimate as a floor while you are here. It is derived from the guest’s current memory usage rather than the size of the file QEMU will write, so it moves between openings of the same dialog and it undershoots. A 2 GiB guest that the dialog costed at 434 MB produced a 654,667,949 byte save file, about half as much again.
Creation looks fast. Two running guests in this lab snapshotted in two and four seconds, and the resulting table records the creation time, name, description, the VM state captured, and the parent snapshot:

Those few seconds are not free, though, and this is the single most useful thing to know before you snapshot anything in production. Cockpit takes a full system snapshot without asking libvirt to keep the guest running while the memory image is written, so the guest is paused for most of the operation. The flag that would avoid it, --live, is only accepted for external full system snapshots anyway, so on the internal path the pause cannot be designed away. Pinging a guest through a snapshot makes it obvious:
ping -i 0.2 192.168.122.121
One sequence number vanishes and the next few replies come back with round-trip times measured in seconds, because those packets sat queued while the guest was frozen and were answered on resume:
64 bytes from 192.168.122.121: icmp_seq=15 ttl=64 time=0.412 ms
64 bytes from 192.168.122.121: icmp_seq=17 ttl=64 time=3824 ms
64 bytes from 192.168.122.121: icmp_seq=18 ttl=64 time=3615 ms
64 bytes from 192.168.122.121: icmp_seq=19 ttl=64 time=3408 ms
64 bytes from 192.168.122.121: icmp_seq=20 ttl=64 time=3200 ms
64 bytes from 192.168.122.121: icmp_seq=21 ttl=64 time=2992 ms
64 bytes from 192.168.122.121: icmp_seq=22 ttl=64 time=2782 ms
The replies keep stepping down by one ping interval each until the queue drains, which puts the freeze at 3.8 seconds at minimum inside a 4.2 second operation on a guest with 3 GiB of RAM. The lost sequence means it may have started up to one interval earlier, so treat the whole operation as downtime. The all-file guest with 2 GiB, whose memory goes to an external save file, froze for about 1.6 seconds inside a 2.0 second operation. The two memory images were almost the same size, so the gap between them is the cost of writing into the existing qcow2 rather than a separate file. Either way the freeze tracks how much RAM has to be written, and a 32 GiB database server is not a three second pause.
Why one guest gets an external snapshot and another gets an internal one
Cockpit never asks which snapshot mode you want. It decides, and the deciding factor is the disk XML from the previous section. A guest whose disks are all type='file' gets an external snapshot. A guest with even one type='volume' disk falls back to an internal one.
The Memory state path field is how you spot which one you are about to get, because it only renders for external snapshots. Open the same dialog on a guest holding a pool-attached disk and the field is simply not there:

Name, Description, Create, Cancel. No memory path, no size estimate, and nothing saying why. Two guests on the same host, snapshotted minutes apart, show what that difference costs. The all-file guest:
virsh snapshot-dumpxml web05 clean-base | head -13
Memory goes to its own save file and the disk gains a qcow2 overlay, leaving the base image frozen and untouched:
<domainsnapshot>
<name>clean-base</name>
<state>running</state>
<creationTime>1786473456</creationTime>
<memory snapshot='external' file='/var/lib/libvirt/images/web05.clean-base.save'/>
<disks>
<disk name='vda' snapshot='external' type='file'>
<driver type='qcow2'/>
<source file='/var/lib/libvirt/images/web05.clean-base'/>
</disk>
<disk name='sda' snapshot='no'/>
</disks>
The guest carrying one pool-attached disk produced this instead:
<domainsnapshot>
<name>pre-upgrade</name>
<description>before the kernel upgrade</description>
<state>running</state>
<creationTime>1786473310</creationTime>
<memory snapshot='internal'/>
<disks>
<disk name='vda' snapshot='internal'/>
<disk name='vdb' snapshot='internal'/>
<disk name='sda' snapshot='no'/>
</disks>
Everything, including the guest’s RAM, went inside the existing qcow2. Cockpit’s own Size column for that volume moved from 2.49 GB to 3.17 GB the instant the snapshot was taken, and it will climb again with every snapshot you add, because the memory image is packed into the same file. The external case wrote a 512 KiB overlay plus a separate save file and left the base at exactly the size it was; that overlay grows as the guest writes, which is why the backing-chain output later in this section shows a slightly different figure.
The rule Cockpit applies has three parts: the hypervisor must advertise the externalSnapshot capability, no disk may carry an explicit internal snapshot preference, and every disk must be type file. A read-only CD-ROM is a file and passes. A pool reference is not and fails. Verify the first condition on your own host if a guest surprises you:
virsh capabilities | grep externalSnapshot
So if snapshot behaviour matters to you, attach pool storage through Custom path rather than Use existing. That third condition is an upstream workaround for a libvirt bug rather than a design decision, so it may relax in a future release, but it is what ships today.
Reverting and deleting
Revert warns you plainly (“Reverting to this snapshot will take the VM back to the time of the snapshot and the current state will be lost, along with any data not captured in a snapshot”) and completes in about three seconds on a running guest, restoring it straight from the memory image. What it does not tell you is that it re-creates the overlay under a new name. After one revert, the active disk chain looked like this:
sudo qemu-img info --backing-chain --force-share /var/lib/libvirt/images/web05.1786473619
A fresh unix-timestamped overlay on top of the original base, and the CD-ROM gained one too:
image: /var/lib/libvirt/images/web05.1786473619
file format: qcow2
virtual size: 20 GiB (21474836480 bytes)
disk size: 456 KiB
backing file: /var/lib/libvirt/images/web05.qcow2
backing file format: qcow2
image: /var/lib/libvirt/images/web05.qcow2
file format: qcow2
virtual size: 20 GiB (21474836480 bytes)
disk size: 1.44 GiB
Delete is the tidy-up. It commits the overlay back into the base, removes the save file and the timestamped overlays, and returns the guest to a single flat image, all in about a second while the VM keeps running. There is no equivalent button for merging without discarding the snapshot metadata, which is what virsh blockcommit is for and what the backup section uses next. For the command line view of all this, the virsh snapshot workflow and the virsh cheat sheet cover the flags Cockpit hides.
Back up a KVM guest
Cockpit has no backup feature. There is no export, no download, no scheduled job. The closest thing on the page is Clone, in the guest’s action menu, and it only appears while the VM is shut off. It also needs the virtinst package, which libvirt-daemon-system does not pull in; without it the menu item is disabled and says so.

The dialog is one field, prefilled with the source name plus -clone. Cloning a 20 GiB guest whose image occupied 1.5 GB took five seconds and produced a 2.9 GB image with a freshly generated MAC address. That growth is not a bug and it is worth understanding, because the same thing happens during migration. Compare the two files:
sudo qemu-img check /var/lib/libvirt/images/web04.qcow2
sudo qemu-img check /var/lib/libvirt/images/web04-clone.qcow2
Run the second one before you boot the clone, or first-boot writes will muddy the comparison. Identical cluster counts, and the compression figure is the whole story. Cloud images ship with most of their clusters compressed, and the copy is written out uncompressed:
No errors were found on the image.
43987/327680 = 13.42% allocated, 74.33% fragmented, 72.52% compressed clusters
Image end offset: 1545404416
No errors were found on the image.
43987/327680 = 13.42% allocated, 0.00% fragmented, 0.00% compressed clusters
Image end offset: 2884304896
So size your target filesystem off the uncompressed footprint, not off what ls says about the source. Read-only media is not duplicated: the clone points at the original’s CD-ROM, which is why the volumes tab lists that ISO against two guests afterwards. A clone is a duplicate on the same host and the same disk, so it is a rollback point, not a backup.
Cold backup of a stopped guest
Two commands capture everything that matters: the domain definition and the disk. Give them somewhere to land first, owned by whoever will run them:
sudo mkdir -p /var/backups/kvm
sudo chown "$USER" /var/backups/kvm
The -c flag compresses the allocated clusters, turning 1.5 GB into 1.2 GB here. That modest saving is because this source is a cloud image whose clusters are already mostly compressed; on an image written from scratch the gain is far larger. Compression is CPU bound either way, so time it once on your own images before making it a habit:
virsh dumpxml --inactive web04 > /var/backups/kvm/web04.xml
sudo qemu-img convert -O qcow2 -c /var/lib/libvirt/images/web04.qcow2 /var/backups/kvm/web04.qcow2
That took one minute forty seconds and turned a 1.5 GB source file into 1.2 GB on disk. Check the result before you trust it:
sudo qemu-img check /var/backups/kvm/web04.qcow2
The compression ratio line at the end is the interesting one:
No errors were found on the image.
43987/327680 = 13.42% allocated, 94.80% fragmented, 93.21% compressed clusters
Image end offset: 1213464576
Restoring is qemu-img convert back to an uncompressed image, then virsh define against the saved XML.
Live backup with near-zero downtime
For a guest you cannot stop, put an overlay in front of the disk, copy the now read-only base at your leisure, then merge the overlay back. The guest used here had its disk moved onto the nfsstore pool in preparation for the shared-storage migration later in this guide, so its images live under /mnt/nfsstore rather than the default image directory. Substitute whatever virsh domblklist reports for your own guest.
Save the domain definition first, while the disk paths in it still point where you want them to. Do this after the snapshot and you will archive XML that references a temporary overlay. Use --inactive so you capture the persistent configuration instead of the running one, which carries device aliases and indexes you do not want to define later:
virsh dumpxml --inactive web05 > /var/backups/kvm/web05.xml
Now the disk-only snapshot, with no metadata, telling libvirt to skip the CD-ROM:
virsh snapshot-create-as --domain web05 backup-tmp --disk-only --atomic --no-metadata \
--diskspec vda,file=/mnt/nfsstore/web05.overlay.qcow2 --diskspec sda,snapshot=no
That returned in 0.29 seconds. All guest writes now land in the overlay and the base image is frozen, so copy it:
sudo qemu-img convert -O qcow2 -c /mnt/nfsstore/web05.qcow2 /var/backups/kvm/web05.qcow2
The copy ran for one minute forty-four seconds with the guest serving traffic throughout. Finally, fold the overlay back into the base and switch the guest onto it in one atomic step:
virsh blockcommit web05 vda --active --pivot --verbose
Progress runs to completion and the pivot is confirmed:
Block commit: [100.00 %]
Successfully pivoted
0.74 seconds, and virsh domblklist shows the guest back on its original path. The overlay file is left behind after the pivot, so delete it yourself. Total guest impact across the whole procedure is two sub-second operations, which is why this pattern sits underneath most of the dedicated KVM backup tools worth using.
One caveat that decides whether the result is usable. What you captured is crash consistent, equivalent to pulling the power on the guest at that instant. A database mid-transaction will replay its journal on restore, and may not enjoy the experience. Install qemu-guest-agent inside the guest and add --quiesce to the snapshot command, and libvirt asks the agent to flush and freeze the filesystems first, which turns a crash-consistent copy into a filesystem-consistent one.
Migrate a VM to another host
Migrate lives in the same action menu as Clone, and the two are mutually exclusive: Migrate only shows on a running guest, Clone only on a stopped one. There is no offline migration in the interface. A shut-off guest offers Clone, Rename, Edit description, Add TPM and Delete, and that is all.
Before the dialog will work, the source host’s libvirt daemon needs passwordless SSH to the destination as the user in the URI. libvirt runs the transfer, not your browser session, so this is root’s key on the source host:
sudo ssh-keygen -t ed25519 -N '' -f /root/.ssh/id_ed25519
sudo cat /root/.ssh/id_ed25519.pub
ssh-copy-id root@kvm02 will not do this for you on a stock Ubuntu destination, because sshd ships with PermitRootLogin prohibit-password and root has no password to authenticate with. Paste the key in through your normal sudo account on the destination instead:
sudo mkdir -p /root/.ssh
echo 'ssh-ed25519 AAAA...source-host-key' | sudo tee -a /root/.ssh/authorized_keys
sudo chmod 600 /root/.ssh/authorized_keys
Prove the whole path works before you touch the browser. Do not skip this step even if you are confident in the key, because it is also what accepts the destination’s host key into root’s known_hosts. Cockpit hands the migration to the source libvirt daemon, which runs as root and will refuse an unverified host with nothing more than a generic error in the dialog:
sudo virsh -c qemu+ssh://root@kvm02/system nodeinfo
If that prints the destination’s CPU layout, the migration dialog will connect. Two more things have to be true and neither produces a useful error when it is not. The destination firewall has to allow inbound TCP on libvirt’s migration range, ports 49152 to 49215 by default, because Cockpit does not tunnel the data channel through the SSH connection. And the destination CPU has to be able to run the guest’s CPU model, which is the usual reason a migration between non-identical hardware refuses. The dialog itself has three controls:

Destination URI takes a libvirt connection string, with qemu+ssh://192.0.2.16/system as the placeholder. Temporary migration is an unticked checkbox. Storage is a pair of radios: “Storage is at a shared location”, selected by default, or “Copy storage”.
Error: “no storage pool with matching target path”
Copy storage needs the destination host to already have a pool whose target path matches the directory the source disk sits in. A fresh libvirt install with no pools defined fails immediately:

Define the matching pool on the destination, in its own Cockpit or from a terminal, and retry:
sudo virsh pool-define-as default dir --target /var/lib/libvirt/images
sudo virsh pool-build default
sudo virsh pool-start default
sudo virsh pool-autostart default
Error: “Cannot access storage file … No such file or directory”
Copy storage copies writable disks. It does not copy read-only media, and libvirt expects any attached ISO to exist at the same path on the destination:
Migration failed
Cannot access storage file '/var/lib/libvirt/images/web05-seed.iso': No such file or directory
The obvious fix is Cockpit’s own Eject button on the disks table. Whether it works depends on what the guest is doing with the tray. Two attempts against a freshly booted guest failed the same way:
Media could not be ejected from web05
internal error: unable to execute QEMU command 'blockdev-remove-medium': Tray of device 'sata0-0-0' is not open
The same button on the same guest succeeded later in the session, after several reboots had left nothing holding the device open. When the first attempt fails, Cockpit keeps the dialog up and adds a red Force eject next to the greyed-out Eject, which retries the same call with libvirt’s force flag. Try that before you reach for anything heavier.
Failing that, copy the ISO across, which keeps the guest running and is one command:
sudo scp /var/lib/libvirt/images/web05-seed.iso root@kvm02:/var/lib/libvirt/images/
Worth knowing before you retry: the first failed attempt had already pre-created the destination image before hitting the ISO error. Failed copy-storage migrations leave that behind for you to clean up.
Permanent, temporary, and the split-brain trap
With the checkbox clear, migration is permanent: libvirt adds the VIR_MIGRATE_UNDEFINE_SOURCE flag and the source definition disappears. The disk image does not. After the Copy storage run the 1.5 GB source image was still sitting in the pool on the origin host with no domain referencing it, so that one goes on your cleanup list.
Read that carefully before you reach for rm. It only holds for Copy storage, where the destination got its own copy. After a shared-storage migration the image left on the origin is the same file the guest is now running from, and deleting it destroys a live VM. The vanished domain definition is not evidence that the disk is orphaned.
Tick Temporary migration and a warning appears in the dialog: “Do not run this VM on the origin and destination hosts at the same time.” Take it seriously. After a temporary migration the source host keeps a full persistent definition showing the guest as shut off, and nothing prevents you pressing Run. On shared storage that means two QEMU processes writing the same qcow2. On the destination the guest arrives transient:
sudo virsh dominfo web05 | grep -E 'State|Persistent|Autostart'
Persistent reads no, which means if that guest ever stops on the destination its definition evaporates:
State: running
Persistent: no
Autostart: disable
Temporary migration is for draining a host before maintenance, and only when you are going to migrate straight back. For anything else, leave the box alone.
Shared storage is the version you want
The NFS pool from earlier is what makes migration boring, in the good way. Define the same pool on both hosts with the same target path, put the guest’s disk on it, and Cockpit’s default radio does the rest. Nothing but RAM crosses the wire, and the difference is not subtle: the same guest took seventeen seconds to migrate with Copy storage and three to four seconds over shared storage, with no second copy of the disk on the far end at all. Halve the link speed and both numbers roughly double, so what grows is the absolute gap, which is the part that has to fit inside a maintenance window.
An iSCSI target works the same way if NFS is not your thing. The requirement is only that both hosts reach the same bytes at the same path.
Timings from this lab
Numbers help when you are deciding what to do inside a maintenance window. All of these are from two Ubuntu 26.04 hosts that are themselves VMs on one hypervisor, bridged to each other and measured at 216 MB/s over SSH, with a 20 GiB virtual disk holding 1.5 GB of compressed image data and either 2 or 3 GiB of guest RAM. That is about 1.7 Gbit/s, so on a 1 GbE segment expect the two migration rows to take roughly 1.7 times longer, and less on anything faster.
| Operation | Elapsed | Guest downtime |
|---|---|---|
| Create snapshot, external, 2 GiB guest | 2.0 s | ~1.6 s frozen (ICMP) |
| Create snapshot, internal, 3 GiB guest | 4.2 s | ~3.8 s frozen (ICMP) |
| Revert to snapshot, running guest | 3 s | Full restart from memory image |
| Delete snapshot and commit overlay | 1 s | None |
| Clone a stopped guest | 5 s | Already stopped |
| Cold backup, compressed convert | 1 m 40 s | Whole duration |
| Live backup, snapshot plus convert plus blockcommit | 1 m 45 s | About 1 s total |
| Live migration, Copy storage | 17 s | Not measured, guest stayed reachable |
| Live migration, shared NFS | 3 to 4 s | Not measured, guest stayed reachable |
The rows to internalise are the backup pair and the migration pair. Compressing an image is CPU bound and takes about the same wall clock either way, so there is no reason to accept a hundred seconds of downtime when snapshot and blockcommit cost you one. The snapshot rows are the reason: a full system snapshot freezes the guest for as long as it takes to write its memory, while a disk-only one costs two sub-second pauses.
On migration, the seventeen seconds moved the guest’s allocated data plus its RAM, so the gap between the two methods scales with how full your disks are rather than how big they are, and it stretches on a slower link. The destination file is worth a second look too. It reports 21,478,375,424 bytes to ls because libvirt pre-creates it with metadata preallocation, while du on the same file returns 2.7 GiB. Nothing is wasted, but any capacity check that trusts apparent size will lie to you, and that 2.7 GiB against a 1.5 GB source is the same decompression effect the clone showed.
If your guests are already on shared storage, the Cockpit machines page will carry most of a normal week without a terminal. Building pools on bare disks and merging snapshot chains are the two jobs it will still send you back to virsh for.