How to create a memory snapshot in QEMU KVM?

ENV: Ubuntu budgie 25.04 + qemu kvm
The main purpose is to save the running Win11 virtual machine, and the memory snapshot of different software displayed at different positions on the screen. I used the following command but failed. If I modify virsh edit win11, the virtual machine cannot start.

ubuntu@web:~$ virsh snapshot-create-as   --domain win11   --name win11-full-running   --description "Full snapshot with memory state"   
error: Operation not supported: internal snapshots of a VM with pflash based firmware require QCOW2 nvram format

ubuntu@web:~$ 
ubuntu@web:~$ virsh snapshot-create-as \
  --domain win11 \
  --name win11-memory-save \
  --atomic
error: Operation not supported: internal snapshots of a VM with pflash based firmware require QCOW2 nvram format

ubuntu@web:~$ 

ubuntu@web:~$ sudo qemu-img convert -f raw -O qcow2 /var/lib/libvirt/qemu/nvram/win11_VARS.fd /var/lib/libvirt/qemu/nvram/win11_VARS.qcow2

ubuntu@web:~$ virsh edit win11
<nvram file='/var/lib/libvirt/qemu/nvram/win11_VARS.fd' format='qcow2'> 

Start the Windows11 virtual machine

 internal error: process exited while connecting to monitor: 2025-06-03T14:50:09.654344Z qemu-system-x86_64: -blockdev {"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage","backing":null}: Image is not in qcow2 format

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 71, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 107, in tmpcb
    callback(*args, **kwargs)
    ~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1384, in startup
    self._backend.create()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/libvirt.py", line 1379, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2025-06-03T14:50:09.654344Z qemu-system-x86_64: -blockdev {"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage","backing":null}: Image is not in qcow2 format

1 Like

Looks like this capability has been deliberately disabled from working

2 Likes

virtualbox7.1.8 can achieve memory snapshots, but unfortunately, it does not support the 6.14 kernel.

1 Like

The message refers to internal snapshots - did you read about external qemu snapshots - a little more work, but these should work.

Link copied-pasted here

1 Like