<div dir="ltr"><div>This is a non interactive procedure to freeze the guest vdi before taking the snapshot and unfreeze it right after.<br><br>The guest must run qemu-ga.<br>It's possible to run it also on windows guest, but I didn't tested it yet.<br>
The host must run qemu 0.16 or higher.<br><br>Host side:<br>run guest with options<br>-chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 \<br>-device virtio-serial \<br>-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0<br>
<br>Guest side<br>qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 &<br><br>Host side<br>echo '{"execute":"guest-fsfreeze-freeze"}' | socat unix-connect:/tmp/qga.sock -<br>
dog vdi snapshot yourvdi<br>echo '{"execute":"guest-fsfreeze-thaw"}' | socat unix-connect:/tmp/qga.sock -<br></div><div><br></div><div>You can check the status any time by<br>echo '{"execute":"guest-fsfreeze-status"}' | socat unix-connect:/tmp/qga.sock -<br>
<br></div><div>It's possible to use tcp connection instead of socat.<br></div><div>I didn't try yet.<br></div><div><br></div>References<br><a href="http://wiki.qemu.org/Features/Snapshots#Snapshot_command_flow">http://wiki.qemu.org/Features/Snapshots#Snapshot_command_flow</a><br>
<a href="http://wiki.qemu.org/Features/QAPI/GuestAgent">http://wiki.qemu.org/Features/QAPI/GuestAgent</a><br></div>