Snapshots

⚡ RequirementLima >= v0.16.0, QEMU or krunkit

A snapshot captures the complete state of an instance’s disk at a specific point in time. This allows you to quickly restore the virtual machine to a known, working state if a risky operation (such as an OS upgrade, configuration test, etc.) fails.

Creating a snapshot

To create a snapshot, ensure the instance is stopped and provide a unique tag name for it:

limactl stop default
limactl snapshot create default --tag before-upgrade

A QEMU instance without mounts can also be running. The snapshot then also captures the memory and device state of the instance.

Listing snapshots

To view the existing snapshots and their tags, use the list command:

limactl snapshot list default

The output will display a table with the snapshot ID, its tag, and the creation date.

Applying a snapshot

To restore the instance to a previously saved state, use the apply command with the tag:

limactl stop default
limactl snapshot apply default --tag before-upgrade

A running QEMU instance without mounts accepts only a snapshot that was created while it was running. A snapshot created on a stopped instance contains only the disk, and has to be applied while the instance is stopped. After applying a snapshot to a running instance, limactl snapshot apply resets the persistent SSH connection, so limactl shell keeps working, but SSH port forwards are not restored. Restart the instance to bring them back.

Deleting a snapshot

To remove a snapshot and free up disk space:

limactl snapshot delete default --tag before-upgrade