Examples
Copy/paste fragments for your own base image and setup scripts. They are not DVM runtime code, and DVM does not maintain their versions or checksums: pin them yourself and update when you bump. Review and adapt before use.
In v3 there are two homes for these snippets:
- Base image (
~/.config/dvm/base/Containerfile): shared tooling baked once for every VM. These are DockerfileRUN/ARGlines that run at build time as root. Start the fileFROM dvm-baseand build withdvm base build. See the base image reference. - Per-VM (
~/.config/dvm/vms/<vm>/setup.sh): VM-specific, stateful steps (keys, dotfiles, tunnels). These run duringdvm syncas the Lima login user withsudo, withset -Eeuo pipefailprepended and theDVM_*variables exported (see the config reference). Run a command as the dev user withsudo -u "$DVM_USER" -H ....
dvm-base already installs zsh and the rootless-container dependencies, and
provides compressed swap (zram), the rootless-docker user service, and a binfmt
mask, so you do not need snippets for those. All examples assume the Fedora guest
with dnf5.
In the base image (Containerfile)
Section titled “In the base image (Containerfile)”| Topic | What it covers |
|---|---|
| Packages | Fedora and Copr packages |
| Verified binary download | Upstream binaries not in dnf |
| AI CLIs | Claude Code and Codex CLIs |
| Rootless Docker | Engine install on top of dvm-base |
| Rootless Podman | Rootless Podman |
Per-VM (setup.sh)
Section titled “Per-VM (setup.sh)”| Topic | What it covers |
|---|---|
| SSH keys | VM-local SSH keys, private repos |
| GPG signing key | VM-local GPG signing key |
| Dotfiles | chezmoi dotfiles |
| Cloudflare Tunnel | Cloudflare Tunnel |
| Tailscale | Tailscale |
| Default shell | Override the default shell |
| Rootful Docker | Rootful Docker (guest-root risk) |
| One user per project | One VM, one user per project |
Built and maintained by eshlox.