Commands · reference

vmlab destroy

3 min read · 2026-09-02 · vmlab 0.9

vmlab destroy stops the lab in the current directory and deletes everything it materialised: the clones, the container overlays and named volumes, the lab-local state under .vmlab/, and the dynamic network configuration. The lab file is untouched. The next vmlab up starts from fresh clones and runs first-boot provisioning again.

sh
vmlab destroy
OptionMeaning
-h, --helpPrint help.

What it does

The verb works in this order:

  1. With a lab daemon running, it asks the daemon to destroy the lab. The daemon stops every workspace syncer, force-stops every machine, waits up to 30 seconds for each to settle, then removes .vmlab/ and each machine's runtime directory.
  2. With no daemon running, it removes .vmlab/ itself if the directory exists.
  3. It asks the supervisor to release the lab, which reaps the lab daemon.

The last line printed is lab "<name>" destroyed.

Everything a machine had that was not in its template goes: snapshots live inside the clones, so they go with them, and a machine marked diverged by vmlab machine repair-agent comes back on its template's sealed agent, unless the next vmlab up refreshes it again; agent_update = false stops that. The workspace sync ledger in .vmlab/ goes too.

The workspace survives, the guest tree does not

A dev machine's source lives in the host workspace directory, which destroy never touches. The guest copy is deleted with the clone. Any guest edit the syncer has not carried to the host is lost, so run vmlab dev sync flush first if the syncer was halted.

Templates in the store are never written to by a lab and are not removed here; use vmlab template for that. To destroy a lab by name from any directory use vmlab lab destroy.

Examples

Tear a lab down and rebuild it from scratch:

sh
vmlab destroy
vmlab up

Exit status

Exit status is 0 when the lab's state was removed, whether or not a daemon was running. A lab directory that cannot be found, a machine that cannot be stopped, or a .vmlab/ directory that cannot be removed exits 1 (failed). A usage error exits 2.