lager box config manages a declarative configuration for a Lager Box’s container. You describe what the box should have — USB device permissions (udev rules), apt packages, bind mounts, environment variables, pip/cargo/npm packages, sysctl values — and then apply puts it into effect. The configuration persists across container restarts and box updates.
Syntax
Global Options
| Option | Description |
|---|---|
--box TEXT | Lagerbox name or IP address |
--help | Show help message and exit |
How It Works
Editing the config and putting it into effect are two separate steps:- Change the config —
udev add,apt add,mount add,env set, etc. These only edit the stored config; nothing happens on the box yet. - Apply it —
lager box config applyvalidates the config and restarts (“bounces”) the container so the changes take effect. Host-side pieces (apt packages, udev rules, sysctl) are installed on the box host during apply; everything else is mounted into the fresh container.
Commands
Lifecycle| Command | Description |
|---|---|
show | Print the current config |
status | One-line summary of config state |
diff | Show pending changes vs. the last applied config |
validate | Validate the current config |
apply | Validate, then restart the container so the new config takes effect |
init | Create the config with defaults |
reset | Erase the config to empty |
restart | Restart the container without changing the config |
repair | Restore the config from the last applied snapshot and restart |
edit | Open the config in $EDITOR |
import / export | Replace the config from / write the config to a local JSON file |
copy | Copy one box’s config to another box |
audit | Show recent config changes recorded on the box |
| Group | Description |
|---|---|
udev | Host udev rules granting USB device access (by vid:pid) |
apt | Host-side apt packages |
mount | Host-to-container bind mounts |
volume | Named docker volumes attached to the container |
env | Container environment variables |
pip / cargo / npm | In-container language packages |
sysctl | Host sysctl values persisted across reboots |
Command Reference
udev
Grant a USB device read/write access from inside the container, by USB vendor/product id. Use this when a freshly-plugged device is owned by root and a tool inside the container can’t open it (for example dfu-util failing with “No DFU capable USB device available”).
| Option | Description |
|---|---|
--mode TEXT | Octal device-node permission mode (default 0666) |
--usbtmc | Also emit the usbtmc driver-unbind rule, required for SCPI/USB‑TMC instruments accessed via PyVISA/libusb |
0x prefix and uppercase are accepted and normalized (so 0x1AB1:0E11 becomes 1ab1:0e11). Re-adding the same vid:pid updates it in place.
apply, the rules are installed to /etc/udev/rules.d/99-lager-user.rules on the box host and udev is reloaded, so existing devices pick up the new permissions.
reset
Erase the config to a truly empty state. Unlike init (which re-seeds the default box-tools volume), reset clears everything — a clean slate.
| Option | Description |
|---|---|
--yes | Skip the confirmation prompt |
--apply | Also restart the container so you get a fresh, empty container in one step |
restart
Restart the container without changing the config — a fresh container with the same setup. Useful for test isolation between runs. Unlike apply, it restarts unconditionally (it does not skip when the config is unchanged).
apply
Validate the config and restart the container so changes take effect.
| Option | Description |
|---|---|
--yes | Skip the confirmation prompt |
--force | Restart even if the config is unchanged |
--dry-run | Show what would change, but make no changes |
--skip-restart | Validate and record the config without restarting |
--no-auto-prep | Skip host-path re-verification before restart |
--recursive-chown | For any configured mount whose host path is wrong-owned and populated, recursively chown it to uid 33 (www-data) |
--box accepts a comma-separated list to apply across multiple boxes.
apt
Host-side apt packages (installed on the box host during apply).
mount
Bind-mount a host path into the container.
mount add options:
| Option | Description |
|---|---|
--readonly | Mount as read-only |
--no-auto-prep | Skip the auto mkdir/chown of the host path (use when the directory is provisioned externally) |
--recursive-chown | If the host path already exists with the wrong owner and contains files, recursively chown it to uid 33 (www-data) |
env
Container environment variables.
pip / cargo / npm
In-container language packages, installed when the container starts.
pip add validates against PyPI by default; pass --no-validate-pypi to skip.
sysctl
Host sysctl values, persisted across reboots.
volume
Named docker volumes attached to the container (persist data across restarts).
Inspecting and editing
Backup, restore, and recovery
Notes
- Most editing commands only change the stored config — run
applyto put changes into effect. - udev rules, apt packages, and sysctl values are applied to the box host; mounts, env, and pip/cargo/npm apply inside the container.
- The config persists across container restarts and box updates. A user udev file (
99-lager-user.rules) is preserved acrosslager update. --boxaccepts a name (fromlager boxes) or an IP address.

