Linux

Where Does systemd-nspawn Store Machines?

systemd-nspawn keeps machine images in /var/lib/machines, with per-container overrides in /etc/systemd/nspawn on Linux.

Last updated

nspawn treats /var/lib/machines as the machine store: each subdirectory or subvolume is a bootable container image. Per-container tweaks (networking, bind mounts, capabilities) live in /etc/systemd/nspawn as .nspawn files, separate from images.

That split mirrors the site convention. Back up the machines tree for data, version the nspawn drop-ins for config. Import tools (machinectl pull-tar, pull-raw) land new images in the same store automatically.

Where systemd-nspawn stores this, by platform

Linux
/var/lib/machines

One subvolume or directory per machine. /etc/systemd/nspawn holds .nspawn overrides. Manage contents with machinectl; never hand-edit a running image tree.

Frequently asked questions

How do I move an nspawn container to another host?

Copy the machine subvolume or directory to another host's /var/lib/machines with the manager stopped. btrfs send/receive keeps subvolume structure intact.

Where do per-container nspawn settings live?

Create a same-named .nspawn file in /etc/systemd/nspawn. Settings there override image defaults without modifying the machine tree itself.

Notice an outdated path? Let us know.