avr snapshot

Lists the snapshots held for the current environment, or captures a new one with a name. A snapshot preserves the packages and files inside Linux so that avr restore can bring them back.

  1. Help
  2. Examples
  3. What it does
    1. Which environments can be snapshotted
  4. Exit status
  5. Errors
    1. does not support snapshots
    2. too many arguments
  6. See also

Help

This is exactly what avr help snapshot or avr snapshot --help prints.

Usage:
  avr [selector flags] snapshot [name]

List snapshots for the selected environment, or capture one with a name. Snapshots are available only in environments whose backend supports them.

Selector flags such as --arch and --distro must come before the command; run `avr --help` to see them.

Examples

avr snapshot                          # list this environment's snapshots
avr snapshot before-upgrade           # capture one
avr --arch amd64 snapshot clean       # capture one of the amd64 environment

What it does

avr snapshot acts on the environment the selector flags and .avr.toml resolve to. The environment must already exist; this command never creates or starts one.

With no name, it lists the snapshots, one per line with the time each was captured, or says there are none yet.

With a name, it captures one and prints how to restore it:

Captured snapshot "before-upgrade" of Ubuntu 24.04 · arm64.

Restore it with: avr restore before-upgrade

Which environments can be snapshotted

A name already used for this environment is refused.

Exit status

Status When
0 Listed or captured
1 The environment cannot be snapshotted, does not exist, the name is taken or invalid, or the backend failed
2 More than one argument, or an unsupported environment

Errors

does not support snapshots

avr: <environment> does not support snapshots: it runs on Apple's virtualization framework, which cannot take them. `avr reset` returns it to a clean state, and an emulated environment (`avr --arch amd64`) can be snapshotted

macOS, native architecture. Exit status 1. On Windows the same line carries the reason that applies there instead: an environment registered as WSL 1, for example, gets the wsl --set-version command that converts it.

too many arguments

avr: `avr snapshot` takes at most one argument (the snapshot name), but got <N>: "<args>"

Exit status 2.

See also