Windows GuestThe idea here is simple, there are few things you have to do:
- Delete all unnecessary files, empty recycle bin
- Defragment drive (you might need to do this several times, until you see it "compacted" well)
- Use sdelete to zero free disk space. Please note that this operation will cause that all drive free space will be filled by zero, so the virtual machine image will grow to the maximum size.
sdelete -c c:
- Convert image to the same format that is currently is (e.g. qcow2 => qcow2)... during this procedure it will release unused space.
qemu-img convert -O qcow2 w2k3.qcow2 \ w2k3-shrinked.qcow2