CLI Reference

Version: 1.0

The vmlab command-line interface: lab lifecycle, per-VM power, snapshots, guest execution and scripting, console and logs, template builds and OCI distribution, and the daemons.

§ 1Commands

- vmlab validate

- vmlab up

- vmlab down

- vmlab destroy

- vmlab status

- vmlab vm

- vmlab vm start

- vmlab vm stop

- vmlab vm restart

- vmlab snapshot

- vmlab snapshot create

- vmlab snapshot restore

- vmlab snapshot list

- vmlab snapshot delete

- vmlab exec

- vmlab script

- vmlab console

- vmlab logs

- vmlab template

- vmlab template build

- vmlab template list

- vmlab template rm

- vmlab template export

- vmlab template import

- vmlab template login

- vmlab template push

- vmlab template pull

- vmlab daemon

- vmlab daemon start

- vmlab daemon stop

- vmlab daemon status

§ 1.1vmlab validate

WCL schema + semantic validation of the lab, with no side effects. Run after editing vmlab.wcl and before up.

console
vmlab validate

§ 1.2vmlab up

Create linked clones, boot the VMs (a subset is optional), and run provision scripts in declaration order.

ArgumentRequiredDescriptionRemarks
vm…optionalOptional VMs to bring up; omit for the whole lab.
console
vmlab up
vmlab up dc01 client01

§ 1.3vmlab down

Graceful stop (guest agent → ACPI → kill). Linked clones are retained.

ArgumentRequiredDescriptionRemarks
vm…optionalOptional VMs to stop; omit for the whole lab.
SwitchValueDescriptionRemarks
--forceSkip the graceful ladder and kill immediately.
console
vmlab down

§ 1.4vmlab destroy

Stop the lab and DELETE its linked clones, lab-local state and dynamic network config. Destructive.

console
vmlab destroy

§ 1.5vmlab status

Show lab / VM / segment state, IPs and ready flags.

console
vmlab status

§ 1.6vmlab vm

Per-VM power control.

vmlab vm start

Start a single VM.

ArgumentRequiredDescriptionRemarks
vmrequiredVM name.
console
vmlab vm start dc01

vmlab vm stop

Stop a single VM gracefully.

ArgumentRequiredDescriptionRemarks
vmrequiredVM name.
SwitchValueDescriptionRemarks
--forceKill immediately instead of the graceful ladder.
console
vmlab vm stop dc01

vmlab vm restart

Restart a single VM.

ArgumentRequiredDescriptionRemarks
vmrequiredVM name.
console
vmlab vm restart dc01

§ 1.7vmlab snapshot

Online (running: disk+RAM+device state) or offline (powered off: disk only) snapshots, per current power state. Restoring an online snapshot resumes running.

vmlab snapshot create

Create a snapshot. Omitting --vm snapshots every VM in the lab (best-effort, not coordinated).

ArgumentRequiredDescriptionRemarks
namerequiredSnapshot name.
SwitchValueDescriptionRemarks
--vmVMTarget a single VM; omit for the whole lab.
console
vmlab snapshot create clean --vm dc01

vmlab snapshot restore

Restore a snapshot.

ArgumentRequiredDescriptionRemarks
namerequiredSnapshot name.
SwitchValueDescriptionRemarks
--vmVMTarget a single VM; omit for the whole lab.
console
vmlab snapshot restore clean --vm dc01

vmlab snapshot list

List a VM's snapshots (name, takenat, powerstate).

ArgumentRequiredDescriptionRemarks
vmrequiredVM name.
console
vmlab snapshot list dc01

vmlab snapshot delete

Delete a VM's snapshot.

ArgumentRequiredDescriptionRemarks
vmrequiredVM name.
namerequiredSnapshot name.
console
vmlab snapshot delete dc01 clean

§ 1.8vmlab exec

Run a command in a guest via the guest agent and print its stdout/stderr.

ArgumentRequiredDescriptionRemarks
vmrequiredVM name.
cmd…requiredCommand and arguments, after --.
console
vmlab exec dc01 -- ipconfig /all

§ 1.9vmlab script

Run an ad-hoc wscript script against the running lab (entry point fn main(lab: Lab)).

ArgumentRequiredDescriptionRemarks
script.wsrequiredPath to the wscript file.
console
vmlab script scripts/test.ws

§ 1.10vmlab console

Launch a VNC viewer for a VM (host config viewer command), or forward VNC over localhost TCP.

ArgumentRequiredDescriptionRemarks
vmrequiredVM name.
SwitchValueDescriptionRemarks
--tcpForward VNC over a localhost TCP port instead of launching the viewer (WSL2 / remote viewers).
console
vmlab console dc01
vmlab console dc01 --tcp

§ 1.11vmlab logs

Print JSON-line logs: lab events, or one VM's QEMU/serial output.

ArgumentRequiredDescriptionRemarks
[lab/][vm]optionalLab events (default) or a specific VM's logs.
SwitchValueDescriptionRemarks
-f, --followFollow the log as it grows.
-n, --linesNLines of history (default 100).
console
vmlab logs -f
vmlab logs dc01 -n 50

§ 1.12vmlab template

Build, manage, and distribute disk templates. Local refs are <arch>/<name>[@<version>]; remote refs are host/repo:tag.

vmlab template build

Build the template {} blocks in a file (default ./vmlab.wcl). Name one to build just it.

ArgumentRequiredDescriptionRemarks
nameoptionalA single template to build; omit to build all.
SwitchValueDescriptionRemarks
-f, --fileFILEWCL file containing the template {} blocks (default ./vmlab.wcl).
console
vmlab template build
vmlab template build -f templates.wcl linux-modern

vmlab template list

List templates in the store.

SwitchValueDescriptionRemarks
--jsonEmit the full metadata array (ref, sizes in bytes, RFC 3339 created).
console
vmlab template list --json

vmlab template rm

Remove a template from the store. The exact version is required.

ArgumentRequiredDescriptionRemarks
<arch>/<name>@<version>requiredExact store ref including version.
SwitchValueDescriptionRemarks
--forceRemove even if linked clones back it.
console
vmlab template rm x86_64/linux-modern@1.0

vmlab template export

Export a stored template to a portable archive.

ArgumentRequiredDescriptionRemarks
<arch>/<name>[@<ver>]requiredStore ref to export.
out.tar.zstrequiredOutput archive path.
console
vmlab template export x86_64/linux-modern@1.0 linux.tar.zst

vmlab template import

Import a template archive into the store.

ArgumentRequiredDescriptionRemarks
archive.tar.zstrequiredArchive to import.
SwitchValueDescriptionRemarks
--overwriteReplace an existing store entry.
console
vmlab template import linux.tar.zst

vmlab template login

Log in to an OCI registry (persists to ~/.docker/config.json; existing docker logins are reused).

ArgumentRequiredDescriptionRemarks
registryrequiredRegistry host, e.g. ghcr.io.
SwitchValueDescriptionRemarks
-u, --userUSERRegistry username.
-p, --passwordTOKENPassword or token.
console
vmlab template login ghcr.io -u myuser -p <token>

vmlab template push

Push a stored template to a registry as an OCI artifact (chunked, multi-arch capable).

ArgumentRequiredDescriptionRemarks
<arch>/<name>[@<ver>]requiredLocal store ref.
registry/repo:tagrequiredRemote registry ref.
console
vmlab template push x86_64/linux-modern@1.0 ghcr.io/owner/linux-modern:1.0

vmlab template pull

Pull a template from a registry into the store. --arch is required for multi-arch indexes.

ArgumentRequiredDescriptionRemarks
registry/repo:tagrequiredRemote registry ref.
SwitchValueDescriptionRemarks
--archARCHRequired when the remote is a multi-arch index.
console
vmlab template pull ghcr.io/owner/linux-modern:1.0 --arch x86_64

§ 1.13vmlab daemon

Manage the supervisor daemon. It is auto-started by any other verb, so this is rarely needed.

vmlab daemon start

Start the supervisor (auto-started by any other verb anyway).

console
vmlab daemon start

vmlab daemon stop

Stop the supervisor and all lab daemons.

console
vmlab daemon stop

vmlab daemon status

Show supervisor version and running labs (name/state/pid/root).

console
vmlab daemon status