A --clone VM's clone is now seeded with a snapshot, not git push, and gets everything a working copy has. devvm clone fetch brings it all back, and devvm rm and clone off check it before deleting. - Refs: every branch, tag and notes ref, and a detached HEAD. - Uncommitted changes: staged, unstaged and untracked files; files skip-worktree by hand get the index's version, named. - Operations in progress (merge, rebase, cherry-pick, revert, bisect) and the stash; a stash's untracked part goes as its own branch. - The repo's settings and hooks, sent as settings only where they live in the repo (husky); ORIG_HEAD never goes. - Partial clones, with their promisor remote, and messages per network tier when it can't be reached. - Initialised submodules, nested ones too, each with a clone of its own; a submodule's own folder is refused as a top-level --clone. vm.json gains an optional `submodules` field. - Git LFS both ways: objects hash-checked, written under os.Root with no link followed, a question past 2 GiB; the filter is set only in the clone's repos; git-lfs 3.8.1 in base, pinned by SHA-256. - rm and clone off keep the VM when anything the VM has didn't come back, and name it. - Every shell script embedded in Go is shellchecked. - clone.md is a guide that leads with commands; TestUserPageProse covers it and coding-agents.md. After you upgrade: base and every image on it build again once, for git-lfs. Fixes #40, reported by @Josuesp1620. Thanks to @dhruv1220 for #42, which found the cause (receive-pack refusing a shallow push); its receive.shallowUpdate setting stays in the VM's repos. Co-authored-by: Dhruv Arora <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
6.0 KiB
devvm: a guide for the agents in this VM
You're running in a devvm VM. devvm gives each project folder on the user's machine its own Linux VM, and the user runs devvm on that machine, the host, never in here. This guide is the same in every VM, so it says how devvm VMs work and not how this one is set up. devvm-help prints it, and the full docs are at https://devvm.dev/docs/.
This VM
- The project folder is mounted read-write at the same path as on the host, so the user's editor sees your changes at once. It's the only folder of the host's that the VM can write to: the agent store's folders and the shared tools are mounted read-only.
- Your home folder is on the VM's own disk, not the host's. The coding agents' settings, skills and logins come from devvm's agent store, and the folders among them are mounted read-only.
- devvm update, devvm layer add and devvm layer rm make the VM again from a newer or another image. The project folder and your home folder survive, and everything else on the disk is lost, such as packages installed with apt, programs installed outside your home and Docker's images. Shell settings of your own go in
~/.bashrc.d, because the image owns~/.bashrc. - In the project folder, git can commit, branch, fetch and pull, but
.git's hooks and config are locked, sogit config,git remote add,push -uto a new branch and hook installers fail withOperation not permitted. Ask the user to change them on the host. A VM made with--clonehas its own clone of the repo instead, and the user fetches its work withdevvm clone fetch, its branches, a detached HEAD's commits, stash entries and Git LFS objects.
Network and secrets
Every request goes through a proxy that devvm runs on the host, and the VM's network tier decides what the proxy lets through:
| Tier | What the VM reaches |
|---|---|
open |
whatever the host reaches, its localhost and LAN included |
internet |
every public host, but no host or LAN address |
allowlist |
only the hosts on the VM's allowlist (the default) |
none |
only its agents' hosts, its secrets' hosts and its links |
The VM doesn't record its tier, and the user sees it with devvm network on the host. A VM can also learn the hosts it needs: it's on the internet tier while it learns, and once the user runs devvm network lock on the host, it's on the allowlist tier with the hosts the user kept, so a host that works while it learns may be blocked after. A request that the tier refuses fails with a 403 from the proxy, which names the host and the rule that would allow it, and on every tier but open a direct connection to an address fails at once.
- Run
devvm-whyto see what the proxy blocked lately. A note before each shell prompt says when something new was blocked. - The proxy settings are in the environment (
HTTP_PROXY,HTTPS_PROXYand their lowercase forms). On every tier but open, a tool that ignores them still reaches the proxy by the names it looks up, over HTTPS and HTTP and on the ports the rules name, unless the user turned transparent mode off: every name resolves to 198.18.0.1, and the proxy reads the real host from the connection and judges it the same way, so a blocked HTTPS host shows the proxy's 403. Another port of such a name is refused at once, and so is a protocol that names no host, such as a database's, so a tool like that needs the proxy's address in its own settings.devvm-whylists both what the proxy blocked and what the VM refused. - No secret is in the VM.
GH_TOKEN,CLAUDE_CODE_OAUTH_TOKENand the agents' logins hold placeholders, and the proxy puts the real value into each request for that secret's hosts. Use them as they are, and don't copy them anywhere else, because they work nowhere but through this VM's proxy. - git over ssh goes through the proxy too, with
devvm-ssh-proxyas its ProxyCommand, so the host must be one the tier allows. - Browsers ask for a proxy's password, so they use
devvm-local-proxy, which the desktop starts on the VM's loopback.
Tools and installs
- The toolchains, such as node (the list), and the coding agents are shared tools, mounted read-only from images that every VM shares. They can't update themselves, and global installs go into your home:
npm i -ginstalls into~/.npm-global, Python's packages go into a virtual environment or~/.local/bin, anddotnet tool install -ginstalls into~/.dotnet/tools. - mise runs the shared tools. A project that asks for another version, in
.tool-versions,mise.tomlor its own toolchain file, gets it from mise, which installs it in your home on first use. sudoneeds no password, andapt install(apk addon Alpine) goes through the proxy, whose allowlist for every VM has Ubuntu's, Debian's and Alpine's package hosts. What it installs is lost when the VM is made again.devvm-fetch URL SHA256 OUTdownloads a file and fails when its checksum doesn't match.
What to ask the user for
These commands run on the host, in the project folder, so ask the user to run them:
| You need | The user runs |
|---|---|
| a host the proxy blocks | devvm network allow RULE, such as devvm network allow example.com |
a dev server's port on the host's localhost |
devvm ports add LIST, such as devvm ports add 5173 |
| another toolchain or agent | devvm tools add TOOL, such as devvm tools add python |
| a layer, such as docker, desktop or nix | devvm layer add LAYER, which makes the VM again |
| an agent's changed settings, skills or plugins kept for every VM | devvm agent save |
| the GitHub token in this VM | devvm secret set github, then devvm secret use github |
| an agent logged in | devvm agent login AGENT, such as devvm agent login claude |
.git's hooks or config changed |
devvm git-protect off, with the VM stopped, then devvm git-protect on |
| an image, a PDF or a file from the host, such as a screenshot or pages copied from a PDF | devvm paste, which puts it in the paste folder, /tmp/devvm-paste unless the user set paste-dir, and gives the user its path to paste to you |