How to create a live snapshow of a running KVM virtual machine

KVM Snapshotting and Cloning 101


First the VM must be in qcow2 format. Do this to check:

virsh dumpxml | grep -i qemu
<driver name='qemu' type='qcow2'/>

Next do this:

virsh snapshot-create-as --domain --name "04nov2023s0" --description "test" --live
error: Operation not supported: live snapshot creation is supported only with external checkpoints

The confusing message will go away once you drop --live.

To see the snapshot(s):

virsh snapshot-list --domain
Name Creation Time State
04nov2023s0 2023-11-04 12:07:48 +0200 running


Suspend the machine:

virsh suspend
Domain suspended

Try prompt and fail:

virt-clone --prompt
WARNING --prompt mode is no longer supported.
ERROR Either --auto-clone or --file is required, use '--auto-clone or --file' and try again.

Do manual cloning using the command line:

virt-clone -o -n -f ./
WARNING Setting the graphics device port to autoport, in order to avoid conflicting.
Allocating '' | 10 GB 00:06:22

Clone '' created successfully.

It took around 6 minutes to clone 10 gigabytes.

Then copy it to another hypervisor took quite long:

> 9668MB 49.0MB/s 03:17


Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top