Commands
dvm sync <vm> | <vm>/<proj> | --all create/start a VM (and its project containers)dvm sh <vm> | <vm>/<proj> interactive shell in the VM or a project containerdvm ssh <vm> -- cmd... | <vm>/<proj> -- cmd... run one command as DVM_USERdvm cp <src> <dst> copy a file; a side may be vm:path or vm/proj:pathdvm ls [--only-config] [<vm>] list VMs, or a VM's project containersdvm stop <vm> | <vm>/<proj> | --all [--only-config] stop a VM or project containerdvm logs <vm>/<proj> [-f] show a project container's logsdvm rm <vm> --yes [--config] | <vm>/<proj> --yes [--keep-data] [--config] delete a VM or projectdvm reset <vm> --yes | <vm>/<proj> --yes [--keep-data] rebuild a VM, or recreate a containerdvm new <vm> write starter VM config and setup scriptdvm add <vm>/<proj> define a project (container) inside a VMdvm base <subcommand> build/manage the base image VMs boot fromdvm versiondvm with no args runs dvm ls.
A <vm>/<project> argument targets a project container inside a pool VM. See
Trust tiers & project containers for the model;
this page is the per-command reference.
Loads config, creates or starts dvm-<vm>, ensures DVM_USER and
DVM_CODE_DIR exist, provisions subordinate uid/gid ranges, then runs the per-VM
setup script. With a base image it boots from it; otherwise it falls back to
template:fedora. See config.md.
DVM_DRY_RUN=1 dvm sync app # print Lima argv + setup order, no Lima contactdvm sync app # create/start the VM and run its setupdvm sync --all # sync every VM with a configWhen projects are defined under a VM, dvm sync <vm> also builds the dev-base
image (if configured) and brings up every project container.
dvm sync trusted # the VM + all its project containersdvm sync trusted/api # just the api containersh / ssh
Section titled “sh / ssh”dvm sh <vm> opens DVM_USER’s login shell, starting in the project directory.
dvm ssh <vm> -- cmd runs one command as DVM_USER. With a <vm>/<proj>
target both run inside that project’s container instead (starting it first if it
is stopped).
dvm sh appdvm ssh app -- sudo journalctl -fdvm sh trusted/api # shell inside the api containerdvm ssh trusted/api -- npm test # one command inside the containerExactly one side must be a vm:path or vm/proj:path. Relative VM paths resolve
under /home/<DVM_USER>/code/<vm> (or the container’s PROJ_WORKDIR) and copy
as DVM_USER; absolute paths are used as given. Directory copies are not
supported. Use ./tmp:notes.txt for a local path containing a colon.
dvm cp ./file app:/tmp/file # to an exact VM pathdvm cp ./file app:notes.txt # to code/app/notes.txtdvm cp app:notes.txt ./filedvm cp ./patch trusted/api:patch # into the api container's workspaceLifecycle
Section titled “Lifecycle”dvm ls and dvm stop --all operate on dvm-* Lima instances. Add
--only-config to limit them to instances that have a config. The base-image
builder (dvm-builder) is hidden from both; manage it with dvm base.
dvm ls <vm> lists that VM’s project containers with each container’s state and
image. dvm stop <vm>/<proj> stops one container; dvm logs <vm>/<proj> [-f]
shows (and with -f follows) its logs.
dvm ls # all VMsdvm ls trusted # trusted's project containersdvm stop trusted/apidvm logs trusted/api -fdvm rm <vm> --yes deletes the Lima instance; add --config to also remove
~/.config/dvm/vms/<vm>. dvm rm <vm>/<proj> --yes removes a project’s
container and its workspace volume (the VM and siblings are untouched); add
--keep-data to keep the volume, or --config to also delete the project’s
config directory.
dvm reset <vm>/<proj> --yes recreates a project’s container from a clean
image, re-running its setup; the VM and siblings are untouched. Add --keep-data
to keep the workspace volume (repo, node_modules) while still getting a fresh
runtime. dvm reset <vm> --yes is the heavy form: it removes the Lima instance
and re-syncs from the base image. See
reset.
dvm reset trusted/api --yes # clean container, re-clone, re-run setupdvm reset trusted/api --yes --keep-data # clean container, keep the workspacedvm reset trusted --yes # rebuild the whole VMnew / add
Section titled “new / add”dvm new <vm> scaffolds ~/.config/dvm/vms/<vm>/{config.sh,setup.sh} (and the
global config on first run). dvm add <vm>/<proj> scaffolds a project under an
existing VM: projects/<proj>/{project.sh,setup.sh}. See
project.sh.
Builds and manages the base image every VM boots from, and the dev-base image project containers run from. See the base image reference for the full workflow.
dvm base init # scaffold ~/.config/dvm/base/Containerfiledvm base dev-init # scaffold the dev-base Containerfile + packages.txtdvm base build [--clean] [--no-cache] # build the qcow2 in the builder VMdvm base status # show the cached image and builder statedvm base rm [--builder] [--image] # remove the builder VM and/or cached imageBuilt and maintained by eshlox.