VMM qemu stuck in a saved state

Through trial and error I’ve learned how to get a guest OS in the Virtual Machine Manager (QEMU) working after it gets stuck in a saved state. This probably works for any linux install but I was using Fedora 16.

My first attempt was to use a clone of the machine and then change the clone’s disk image to be that of the original. This did get it back up and running, however it took an age to clone the disk image so I thought I’d have a look into the config to find a better (quicker) way in case it happens again.

Through a few web articles and good old fashioned curiosity I discovered the virtual machines config and files are split across 2 folders. The /etc/libvirt holds all of the machine’s config for hardware and its GUID but not the state. It mentions edits should be made using virsh but when I tried, virsh reported back that it couldn’t find the domain.

Since I had the clone working from the original image, I navigated to the images folder (/var/lib/libvirt/images) to delete the cloned disk (.img file) that I wasn’t using (ssh’d in as root since my user can’t even see that directory). While doing this I thought I’d have a nosey about the libvirt directory and low and behold there it was. In /var/lib/libvirt/qemu/save was a file called win7.save. My guest was named win7 so I figured it was linked (university education kicking in there!). One delete command later and the saved state had vanished from the VMM and I could use the original guest again.

Still don’t know why the save kept failing to load but if it happens again maybe I’ll investigate that a bit further since I now know I can fix the problem easily.

UPDATE: one thing I should point out is that whatever was stored in that saved state will be lost (i.e. if you didn’t save your work on the client then it will be lost)