Snapshots
A snapshot keeps a machine exactly as it is, so you can come back to it later: before an upgrade, or before trying something risky.
Taking one#
Choose Take Snapshot in the Virtual Machine menu (Cmd+Shift+S), or
open Snapshots… in the machine's menu to name it first.
swiftvm snapshot web-server "Before upgrade"
swiftvm snapshots web-server- A machine that is shut down is saved as it is on disk.
- A running machine pauses for a moment and comes back exactly where it was. Its memory is part of the snapshot.
Going back#
Revert… puts the machine back as it was when the snapshot was taken.
swiftvm revert web-server "Before upgrade"- Everything that happened in the machine since is lost. Take another snapshot first if you want to keep it.
- A snapshot of a running machine resumes at the moment it was taken, with the same programs running.
Renaming and deleting#
swiftvm rename-snapshot web-server "Before upgrade" "Before 2.0"
swiftvm delete-snapshot web-server "Before 2.0"Deleting a snapshot doesn't change the machine or its other snapshots.
Good to know#
- Snapshots are instant and share disk space with the machine, because APFS shares what hasn't changed. On another file system they are full copies.
- A snapshot of a running machine also keeps its memory, which can take several gigabytes.
- A snapshot covers the machine's own disk, not the disk images attached to it.
- A running machine can't be snapshotted while it has a writable disk image or a USB device attached, or while your Mac is locked. Eject or detach it, or shut the machine down first.
- After going back, the guest's clock is behind. The guest tools set it right away.