
With the -snapshot flag, any changes made to the virtual machine while it is running are written to temporary files and thrown away when the virtual machine is turned off. QEMU also supports temporary snapshots, where the user does not have to explicitly create a separate. Use the qemu-img info command to determine an image's backing file.īacking file: centos-cleaninstall.img (actual path: centos-cleaninstall.img) and then change your command line to use the qcow2 file rather than the old raw image. qemu-img convert -f raw -O qcow2 your-disk.img your-disk.qcow2. If you have a different format like a raw disk, you can convert it with qemu-img: 1. Make sure to delete any snapshots before running and modifying the original image. To use savevm snapshots you’ll need to be using a disk image format which supports them, like QCOW2. Making any changes to a base image ( centos-cleaninstall.img in our example) will corrupt its snapshots. lists all snapshots in the given image Command description: check -f fmt filename Perform a consistency check on the disk image filename. applies a snapshot (revert disk to saved state) -c. Instead delete the first snapshot image ( snapshot.img in our example), create another snapshot image of the base image as above, and start using the new. Parameters to snapshot subcommand: snapshot is the name of the snapshot to create, apply or delete -a. Making any changes to its backing file ( centos-cleaninstall.img) will corrupt this snapshot image.Ī snapshot image cannot be returned to its original state once modified. Qemu-img create -f qcow2 -b centos-cleaninstall.img snapshot.imgĪt this point, you would run QEMU against snapshot.img. The new image is now a read/write snapshot of the original image - any changes to snapshot.img will not be reflected in centos-cleaninstall.img. If you want to create a snapshot of an existing image called centos-cleaninstall.img, create a new QCow2 file using the -b flag to indicate a backing file. Snapshots in QEMU are images that refer to an original image using Redirect-on-Write to avoid changing the original image.
