
To export a virt-manager snapshot (like the one shown in your screenshot) on Debian 13 (or any Debian-based system), you can use the virsh command-line tool, which is part of the libvirt suite. Here’s how you can do it:
From your screenshot, the snapshot is named before_baidu.
You can confirm this by listing all snapshots for the VM:
bashvirsh snapshot-list <vm_name> --all
Replace <vm_name> with the name of your virtual machine (e.g., Debian_trust_on_QEMU/KVM).
Use the following command to export the snapshot’s XML configuration to a file:
bashvirsh snapshot-dumpxml <vm_name> <snapshot_name> > snapshot_before_baidu.xml
For your case:
bashvirsh snapshot-dumpxml Debian_trust_on_QEMU/KVM before_baidu > snapshot_before_baidu.xml
This will save the snapshot’s metadata (e.g., disk state, VM configuration) to snapshot_before_baidu.xml.
If you want to export the actual disk image associated with the snapshot, you need to locate the disk file (usually a .qcow2 file) and copy it manually.
bashvirsh domblklist <vm_name>
/var/lib/libvirt/images/debian_trust.qcow2) to your desired location:
bashcp /var/lib/libvirt/images/debian_trust.qcow2 /path/to/backup/
To recreate the snapshot on another system:
bashvirsh snapshot-create <vm_name> --file snapshot_before_baidu.xml
bash# List snapshots virsh snapshot-list Debian_trust_on_QEMU/KVM --all # Export snapshot XML virsh snapshot-dumpxml Debian_trust_on_QEMU/KVM before_baidu > snapshot_before_baidu.xml # Copy disk image (optional) cp /var/lib/libvirt/images/debian_trust.qcow2 /path/to/backup/
Vibe can make mistakes. Check answers. Learn more