Files

15974 lines
3.7 MiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>devvm – Docs</title><link>https://next.devvm.dev/docs/</link><description>Recent content in Docs on devvm</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://next.devvm.dev/docs/index.xml" rel="self" type="application/rss+xml"/><item><title>Coding agents</title><link>https://next.devvm.dev/docs/using/coding-agents/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/coding-agents/</guid><description>
&lt;h2 data-hextra-search-id="running-an-agent"&gt;Running an agent&lt;span class="hx:absolute hx:-mt-20" id="running-an-agent"&gt;&lt;/span&gt;
&lt;a href="#running-an-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An agent runs where you start it, so you start it in the VM&amp;rsquo;s shell, not on this machine. On this machine, devvm opens the VM&amp;rsquo;s shell, and the VM&amp;rsquo;s prompt starts with &lt;code&gt;(devvm)&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;~/some-project $ devvm
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;(devvm) ~/some-project $ claude
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the VM the agent sees only your project folder, and your agents&amp;rsquo; settings from &lt;a href="#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;, which it gets read-only. Whatever it runs, such as a script a package installs, runs in the VM too. You don&amp;rsquo;t install any agent on this machine, because devvm installs each one in the VMs that have it. How devvm gives each agent its settings, logins and history is in &lt;a href="https://next.devvm.dev/docs/internals/agents/"&gt;how it works&lt;/a&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-guide-in-every-vm"&gt;The guide in every VM&lt;span class="hx:absolute hx:-mt-20" id="the-guide-in-every-vm"&gt;&lt;/span&gt;
&lt;a href="#the-guide-in-every-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Every VM has a guide to devvm for the agents in it, at &lt;code&gt;/usr/share/doc/devvm/README.md&lt;/code&gt;, and &lt;code&gt;devvm-help&lt;/code&gt; in the VM prints it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm-help &lt;span class="c1"&gt;# in the VM: print the guide to devvm&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It tells an agent what a devvm VM is, how its network tiers and secrets work, where its installs go, and which commands to ask you to run on this machine, such as &lt;code&gt;devvm network allow&lt;/code&gt; for a blocked host or &lt;code&gt;devvm agent login&lt;/code&gt; for a login. The guide is the same in every VM, so it says nothing about the VM&amp;rsquo;s own tier, ports or layers, and nothing in the VM can change it for long (&lt;a href="https://next.devvm.dev/docs/internals/agents/#the-guide-in-every-vm"&gt;the guide&lt;/a&gt;). Ask your agent to read it, or to run &lt;code&gt;devvm-help&lt;/code&gt;, when it doesn&amp;rsquo;t know where it&amp;rsquo;s running. devvm adds nothing about it to the agents&amp;rsquo; instruction files.&lt;/p&gt;
&lt;h2 data-hextra-search-id="supported-agents"&gt;Supported agents&lt;span class="hx:absolute hx:-mt-20" id="supported-agents"&gt;&lt;/span&gt;
&lt;a href="#supported-agents" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A new VM gets an agent when you choose it as you customize the VM, or when you name it with &lt;code&gt;--agents&lt;/code&gt;. A VM that exists gets one from &lt;code&gt;devvm tools&lt;/code&gt;, which shows the same list with the VM&amp;rsquo;s agents already chosen, or from &lt;code&gt;devvm tools add&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="c1"&gt;# a new VM: customize it, then choose its agents in the list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --agents claude,codex &lt;span class="c1"&gt;# a new VM with Claude Code and Codex, without the list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools &lt;span class="c1"&gt;# the VM that exists: choose its agents in the list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools add opencode &lt;span class="c1"&gt;# the VM that exists: add opencode without the list&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the VM, you run each agent by its name in the table, such as &lt;code&gt;claude&lt;/code&gt;.&lt;/p&gt;
&lt;!-- the agents' table, generated from internal/agents and the hosts in assets/shared-tools/&lt;name&gt;.policy by mise run cli-docs --&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;What devvm adds&lt;/th&gt;
&lt;th&gt;Allowlist, on the allowlist and none tiers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;claude&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;the newest release, with its auto-update off, since the shared copy is read-only, and its telemetry off&lt;/td&gt;
&lt;td&gt;Anthropic&amp;rsquo;s API, Claude&amp;rsquo;s login, Claude Code&amp;rsquo;s downloads and claude.ai&amp;rsquo;s connectors: &lt;code&gt;api.anthropic.com&lt;/code&gt;, &lt;code&gt;claude.ai&lt;/code&gt;, &lt;code&gt;downloads.claude.ai&lt;/code&gt;, &lt;code&gt;platform.claude.com&lt;/code&gt; and &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;codex&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Codex&lt;/td&gt;
&lt;td&gt;the newest release, with its analytics and metrics off unless your config sets them&lt;/td&gt;
&lt;td&gt;the OpenAI API and the ChatGPT login: &lt;code&gt;api.openai.com&lt;/code&gt;, &lt;code&gt;chatgpt.com&lt;/code&gt; and &lt;code&gt;auth.openai.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;opencode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;opencode&lt;/td&gt;
&lt;td&gt;the newest 2.x release, because opencode marks its 1.x releases as its latest on GitHub&lt;/td&gt;
&lt;td&gt;opencode&amp;rsquo;s own service and its model catalog: &lt;code&gt;opencode.ai&lt;/code&gt; and &lt;code&gt;models.opencode.ai&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pi&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://pi.dev" target="_blank" rel="noopener"&gt;pi&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;the newest release, with its check for a newer pi and its install report off, and &lt;code&gt;fd&lt;/code&gt;, which pi finds files with, in base&lt;/td&gt;
&lt;td&gt;pi&amp;rsquo;s model catalog: &lt;code&gt;pi.dev&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cursor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://cursor.com/cli" target="_blank" rel="noopener"&gt;Cursor CLI&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;the release devvm pins, run as &lt;code&gt;cursor-agent&lt;/code&gt; or &lt;code&gt;agent&lt;/code&gt;, with its self-update off through its static channel&lt;/td&gt;
&lt;td&gt;Cursor&amp;rsquo;s API, its agent&amp;rsquo;s hosts and its codebase indexing: &lt;code&gt;api2.cursor.sh&lt;/code&gt;, &lt;code&gt;api5.cursor.sh&lt;/code&gt;, &lt;code&gt;*.api5.cursor.sh&lt;/code&gt; and &lt;code&gt;repo42.cursor.sh&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;!-- end of the agents' table --&gt;
&lt;ul&gt;
&lt;li&gt;opencode and pi talk to the model provider you choose, so on the allowlist tier you allow that provider&amp;rsquo;s API host yourself, such as &lt;code&gt;devvm network allow api.anthropic.com&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#changing-rules"&gt;changing rules&lt;/a&gt;), unless devvm keeps the agent&amp;rsquo;s login or API key for that provider, because the VM&amp;rsquo;s proxy then allows its host.&lt;/li&gt;
&lt;li&gt;Claude Code&amp;rsquo;s telemetry hosts aren&amp;rsquo;t on its allowlist, because blocking them costs nothing. Every VM turns off each agent&amp;rsquo;s self-update and telemetry with the agent&amp;rsquo;s own variables, in every shell (&lt;a href="https://next.devvm.dev/docs/internals/agents/#each-agents-variables"&gt;each agent&amp;rsquo;s variables&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;pi&amp;rsquo;s releases are built for glibc alone, so a VM made &lt;code&gt;--from&lt;/code&gt; an Alpine-based container image can&amp;rsquo;t have pi, and devvm refuses it there (&lt;a href="https://next.devvm.dev/docs/using/from/#shared-tools-and-glibc"&gt;shared tools and glibc&lt;/a&gt;). Every other agent runs on Alpine too.&lt;/li&gt;
&lt;li&gt;Agents are &lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;shared tools&lt;/a&gt;, like the toolchains, so you can combine them with any layers and with each other, as in &lt;code&gt;devvm --tools node --agents claude,codex&lt;/code&gt;. devvm follows each agent&amp;rsquo;s newest release, because agents release several times a week, and &lt;code&gt;devvm update&lt;/code&gt; or &lt;code&gt;devvm tools update&lt;/code&gt; moves a VM to newer versions (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;adding and removing tools&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="setups-default-agents"&gt;Setup&amp;rsquo;s default agents&lt;span class="hx:absolute hx:-mt-20" id="setups-default-agents"&gt;&lt;/span&gt;
&lt;a href="#setups-default-agents" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm setup&lt;/code&gt; chooses the agents that the list checks for every new VM, and that a new VM gets without a terminal. devvm asks for them on its first run in a terminal and again in &lt;code&gt;devvm setup&lt;/code&gt;&amp;rsquo;s questions, and &lt;code&gt;devvm setup --agents claude,codex&lt;/code&gt; or &lt;code&gt;devvm setup --agents none&lt;/code&gt; sets them without asking. They&amp;rsquo;re a setting for new VMs only, so a VM that exists keeps its agents (&lt;a href="https://next.devvm.dev/docs/using/settings/#devvm-setup"&gt;devvm setup&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;span class="hx:absolute hx:-mt-20" id="devvms-agent-store"&gt;&lt;/span&gt;
&lt;a href="#devvms-agent-store" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm keeps the agents&amp;rsquo; settings and logins on this machine in a store of its own, and every VM with an agent gets that agent&amp;rsquo;s settings and logins from there. devvm never reads the agents&amp;rsquo; own files in your home folder for a VM, such as &lt;code&gt;~/.claude&lt;/code&gt;, &lt;code&gt;~/.claude.json&lt;/code&gt;, &lt;code&gt;~/.codex&lt;/code&gt;, &lt;code&gt;~/.config/opencode&lt;/code&gt;, &lt;code&gt;~/.local/share/opencode&lt;/code&gt; or &lt;code&gt;~/.pi/agent&lt;/code&gt;, so a VM gets the same settings and logins whether or not this machine has the agent. The one command that reads those files is &lt;a href="#importing-from-this-machine"&gt;&lt;code&gt;devvm agent import&lt;/code&gt;&lt;/a&gt;, which copies them into the store when you run it, and &lt;a href="#saving-a-vms-settings"&gt;&lt;code&gt;devvm agent save&lt;/code&gt;&lt;/a&gt; copies the settings you changed in a VM into the store.&lt;/p&gt;
&lt;p&gt;The store has two folders for each agent, and each one holds the agent&amp;rsquo;s files at the same paths below it as the agent keeps them in a home folder:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Settings&lt;/strong&gt; go in &lt;code&gt;~/.config/devvm/agents/&amp;lt;agent&amp;gt;/&lt;/code&gt;, such as &lt;code&gt;~/.config/devvm/agents/claude/.claude/settings.json&lt;/code&gt; and &lt;code&gt;~/.config/devvm/agents/claude/.claude/skills&lt;/code&gt;. You can edit these files and make or delete these folders yourself, and a VM gets the change on its next launch, as &lt;a href="#mounts"&gt;mounts&lt;/a&gt; and &lt;a href="#copies"&gt;copies&lt;/a&gt; describe. Keep every folder from &lt;code&gt;~/.config/devvm/agents&lt;/code&gt; down a real folder, because &lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; never write the store through a link. When a link is on the path to what they&amp;rsquo;d write, they fail and name it before they change anything.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logins&lt;/strong&gt; go in &lt;code&gt;~/.local/share/devvm/logins/&amp;lt;agent&amp;gt;/&lt;/code&gt;, such as &lt;code&gt;~/.local/share/devvm/logins/codex/.codex/auth.json&lt;/code&gt; and &lt;code&gt;~/.local/share/devvm/logins/claude/.claude.json&lt;/code&gt;, and so does a login that you make inside a VM, such as Codex&amp;rsquo;s (&lt;a href="#codex-and-opencode-logins"&gt;Codex and opencode logins&lt;/a&gt;) or Claude Code&amp;rsquo;s in &lt;code&gt;~/.local/share/devvm/logins/claude/.claude/.credentials.json&lt;/code&gt; (&lt;a href="#claude-code-login"&gt;Claude Code login&lt;/a&gt;). Only you can read them, because devvm makes each agent&amp;rsquo;s logins folder yours alone (mode 700) and each login file mode 600. On macOS, devvm keeps each agent&amp;rsquo;s logins folder out of Time Machine&amp;rsquo;s backups.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each VM gets its agents&amp;rsquo; settings and logins from the store, but never your history. Transcripts, sessions and databases aren&amp;rsquo;t in the store, and each VM&amp;rsquo;s own stay in that VM. Before you leave an agent running unattended, read &lt;a href="https://next.devvm.dev/docs/safety/#the-habits"&gt;staying safe&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#rogue-agents"&gt;rogue agents&lt;/a&gt;.&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 744px; --devvm-diagram-width: 704px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 704 744" width="704" height="744" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="db17e8376495869e1--title" aria-describedby="db17e8376495869e1--desc"&gt;&lt;title id="db17e8376495869e1--title"&gt;The agent store and a VM&lt;/title&gt;&lt;desc id="db17e8376495869e1--desc"&gt;devvm agent import copies the agents' files from your home folder into devvm's agent store, but never your history. The store's settings folders are mounted into each VM read-only, and its settings files and logins are copied in on every launch, without your secrets. devvm agent save brings changed copies back after a diff and a yes. Each VM's own history goes to a .tar.gz on this machine with devvm history export or devvm rm, and comes back with devvm history import, or with yes when a new VM offers it.&lt;/desc&gt;&lt;g class="pele-clusters"&gt;&lt;g class="pele-cluster" data-id="guest"&gt;&lt;rect x="8" y="410" width="585.45" height="142" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="48.73" y="433.4" text-anchor="middle"&gt;The VM&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-cluster" data-id="store"&gt;&lt;rect x="72.41" y="149" width="433.18" height="137" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="171.05" y="172.4" text-anchor="middle"&gt;devvm's agent store&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_home_store_0"&gt;&lt;path d="M289,68L289,142"/&gt;&lt;path class="pele-marker" d="M289,149L285.64,141L292.36,141Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_folders_links_0"&gt;&lt;path d="M186.14,246L186.14,292Q186.14,304 174.14,304L115.91,304Q103.91,304 103.91,316L103.91,460"/&gt;&lt;path class="pele-marker" d="M103.91,467L100.55,459L107.27,459Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_files_copies_0"&gt;&lt;path d="M405.23,246L405.23,292Q405.23,304 417.23,304L457.64,304Q469.64,304 469.64,316L469.64,380Q469.64,392 457.64,392L311.82,392Q299.82,392 299.82,404L299.82,460"/&gt;&lt;path class="pele-marker" d="M299.82,467L296.46,459L303.18,459Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_copies_store_0"&gt;&lt;path d="M276.82,467L276.82,310.09Q276.82,304 282.91,304Q289,304 289,297.91L289,293"/&gt;&lt;path class="pele-marker" d="M289,286L292.36,294L285.64,294Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_own_export_0"&gt;&lt;path d="M480.64,512L480.64,558Q480.64,570 468.64,570L393.09,570Q381.09,570 381.09,582L381.09,646Q381.09,658 393.09,658L447.57,658Q455.82,658 455.82,666.25L455.82,669"/&gt;&lt;path class="pele-marker" d="M455.82,676L452.46,668L459.18,668Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_export_own_0"&gt;&lt;path d="M521.45,676L521.45,668.13Q521.45,658 531.58,658L584.18,658Q596.18,658 596.18,646L596.18,582Q596.18,570 584.18,570L508.64,570Q496.64,570 496.64,558L496.64,519" stroke-dasharray="3 4"/&gt;&lt;path class="pele-marker" d="M496.64,512L500,520L493.28,520Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_home_store_0"&gt;&lt;rect x="200.36" y="92.5" width="177.27" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="289" y="104.7"&gt;devvm agent import,&lt;/tspan&gt;&lt;tspan x="289" y="120.7"&gt;never your history&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_folders_links_0"&gt;&lt;rect x="59.82" y="332" width="88.18" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="103.91" y="344.2"&gt;mounted&lt;/tspan&gt;&lt;tspan x="103.91" y="360.2"&gt;read-only&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_files_copies_0"&gt;&lt;rect x="398.82" y="324" width="141.64" height="48" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="469.64" y="336.2"&gt;copied on every&lt;/tspan&gt;&lt;tspan x="469.64" y="352.2"&gt;launch, without&lt;/tspan&gt;&lt;tspan x="469.64" y="368.2"&gt;your secrets&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_copies_store_0"&gt;&lt;rect x="174.82" y="332" width="204" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="276.82" y="344.2"&gt;devvm agent save,&lt;/tspan&gt;&lt;tspan x="276.82" y="360.2"&gt;after a diff and a yes&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_own_export_0"&gt;&lt;rect x="283.55" y="598" width="195.09" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="381.09" y="610.2"&gt;devvm history export,&lt;/tspan&gt;&lt;tspan x="381.09" y="626.2"&gt;devvm rm&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_export_own_0"&gt;&lt;rect x="498.64" y="590" width="195.09" height="48" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="596.18" y="602.2"&gt;devvm history import,&lt;/tspan&gt;&lt;tspan x="596.18" y="618.2"&gt;or yes when a new VM&lt;/tspan&gt;&lt;tspan x="596.18" y="634.2"&gt;offers it&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="home" transform="translate(289,38)"&gt;&lt;rect x="-102.64" y="-30" width="205.27" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;the agents' files&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;in your home folder&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="folders" transform="translate(186.14,216)"&gt;&lt;rect x="-93.73" y="-30" width="187.45" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;settings folders:&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;skills, plugins…&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="files" transform="translate(405.23,216)"&gt;&lt;rect x="-80.36" y="-30" width="160.73" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;settings files&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;and logins&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="links" transform="translate(103.91,489.5)"&gt;&lt;rect x="-75.91" y="-22.5" width="151.82" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;linked into ~&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="copies" transform="translate(291.82,489.5)"&gt;&lt;rect x="-67" y="-22.5" width="134" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;copies in ~&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="own" transform="translate(488.64,489.5)"&gt;&lt;rect x="-84.82" y="-22.5" width="169.64" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;its own history&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="export" transform="translate(488.64,706)"&gt;&lt;rect x="-84.82" y="-30" width="169.64" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;a .tar.gz&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;on this machine&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;Each row lists the agent&amp;rsquo;s paths in the VM&amp;rsquo;s home, and the store keeps each one at the same path below the agent&amp;rsquo;s settings or logins folder:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Mounted read-only, linked into &lt;code&gt;~&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Copied in on every launch&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;claude&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/{skills,agents,commands,output-styles}&lt;/code&gt;, and the store&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; at &lt;code&gt;~/.claude/plugins-seed&lt;/code&gt; (&lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/settings.json&lt;/code&gt;, &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;, and from the logins &lt;code&gt;~/.claude.json&lt;/code&gt; (&lt;a href="#copies"&gt;merged&lt;/a&gt;, only its settings, account state and MCP servers)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;codex&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.codex/{prompts,skills}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.codex/{config.toml,AGENTS.md}&lt;/code&gt;, and from the logins &lt;code&gt;~/.codex/auth.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;opencode&lt;/td&gt;
&lt;td&gt;the subfolders of &lt;code&gt;~/.config/opencode&lt;/code&gt; (not &lt;code&gt;node_modules&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;the files in &lt;code&gt;~/.config/opencode&lt;/code&gt; (not lock files, &lt;code&gt;.gitignore&lt;/code&gt;, &lt;code&gt;.DS_Store&lt;/code&gt; or &lt;a href="#opencodes-service"&gt;its service&amp;rsquo;s settings&lt;/a&gt;), and from the logins &lt;code&gt;~/.local/share/opencode/auth.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pi&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.pi/agent/{extensions,skills,prompts,themes}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.pi/agent/{settings.json,keybindings.json,models.json,mcp.json,AGENTS.md,SYSTEM.md,APPEND_SYSTEM.md}&lt;/code&gt;, and from the logins &lt;code&gt;~/.pi/agent/auth.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-hextra-search-id="importing-from-this-machine"&gt;Importing from this machine&lt;span class="hx:absolute hx:-mt-20" id="importing-from-this-machine"&gt;&lt;/span&gt;
&lt;a href="#importing-from-this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When you already use an agent on this machine, &lt;code&gt;devvm agent import&lt;/code&gt; copies its settings and logins from your home folder into the store, so your VMs get them. With no argument it imports every agent that your home folder has files of, and &lt;code&gt;devvm agent import claude codex&lt;/code&gt; imports only the agents you name:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent import &lt;span class="c1"&gt;# copy every agent&amp;#39;s settings and logins into the store&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent import codex &lt;span class="c1"&gt;# copy only Codex&amp;#39;s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent import --force &lt;span class="c1"&gt;# replace what the store has without asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent import --follow-links &lt;span class="c1"&gt;# copy what links out of the agents&amp;#39; folders lead to as well&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm says which agents it imported and where, and an agent you named that your home folder has nothing of gets a warning. What the import copies and asks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The import copies only the paths in the table above, so it never copies your history or &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#importing"&gt;what it copies&lt;/a&gt;). From &lt;code&gt;~/.claude.json&lt;/code&gt; it keeps only the settings, account state and MCP servers, so your API key and your per-project entries stay out of the store. From &lt;code&gt;~/.claude/plugins&lt;/code&gt; it copies only the marketplaces, their records and the plugins&amp;rsquo; cache, never what is this machine&amp;rsquo;s own, such as each plugin&amp;rsquo;s data.&lt;/li&gt;
&lt;li&gt;devvm reads each agent&amp;rsquo;s settings inside the agent&amp;rsquo;s own folder, such as &lt;code&gt;~/.claude&lt;/code&gt;. A link to a file inside the folder becomes a copy of that file when that file is one of the settings that the import copies, such as &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;. devvm leaves out a link to anything else inside the folder, such as your history, &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; or a plugin&amp;rsquo;s data, with a warning that names where it leads. It does the same with a link to a folder inside it and a link that leads nowhere, and it always leaves out a login file that&amp;rsquo;s a link, with a warning. A link that leads out of the folder, by a relative or an absolute path, is copied only when you allow it (&lt;a href="#links-out-of-an-agents-folder"&gt;links out of an agent&amp;rsquo;s folder&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;One import copies at most 20,000 files, folders and links, 128 MiB, and 16 MiB in one file, of each agent&amp;rsquo;s own folder, at most 128 folders deep. When the folder holds more, devvm imports nothing and names the folder, so take out what it doesn&amp;rsquo;t need, such as a plugin&amp;rsquo;s build files, and import again.&lt;/li&gt;
&lt;li&gt;An import that fails leaves the store&amp;rsquo;s settings and logins as they were, so run it again (&lt;a href="https://next.devvm.dev/docs/internals/agents/#importing"&gt;how&lt;/a&gt;). That holds whether it fails while it reads, such as at a file that changed meanwhile, or while it puts them in place, such as at a login it can&amp;rsquo;t save. In the rare case that putting the store back also fails, devvm names the stores it couldn&amp;rsquo;t put back and the folders that hold what it moved aside, so copy what you need from those before you import again, which deletes them.&lt;/li&gt;
&lt;li&gt;On a Mac, whose volume ignores case by default, a file whose name differs from the store&amp;rsquo;s only in case, such as &lt;code&gt;foo.md&lt;/code&gt; where the store has &lt;code&gt;Foo.md&lt;/code&gt;, replaces the store&amp;rsquo;s file, which keeps its name. Two names that differ only in case, which your home folder can have only on a volume that tells case apart, would be one file in the store, so devvm imports nothing and names both.&lt;/li&gt;
&lt;li&gt;Runs that write the store take turns. While another &lt;code&gt;devvm agent import&lt;/code&gt; or &lt;code&gt;devvm agent save&lt;/code&gt; writes it, or a start cleans it, devvm says it&amp;rsquo;s waiting and goes on once that one is done.&lt;/li&gt;
&lt;li&gt;When a VM&amp;rsquo;s project folder is inside an agent&amp;rsquo;s folder, such as a skill you work on in &lt;code&gt;~/.claude/skills&lt;/code&gt;, or holds one, such as &lt;code&gt;~/.pi&lt;/code&gt;, devvm warns that the VM can change the settings it imports for every VM, and each launch of such a VM also warns (&lt;a href="https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses"&gt;project folders devvm refuses&lt;/a&gt;). Keep such a project somewhere else unless you trust that VM. When the path to an agent&amp;rsquo;s folder passes through a link in a VM&amp;rsquo;s project folder that leads elsewhere, devvm leaves that agent&amp;rsquo;s folder out with a warning.&lt;/li&gt;
&lt;li&gt;A VM whose state devvm can&amp;rsquo;t read gets a warning that names the file, because devvm can&amp;rsquo;t tell where its project folder is, and &lt;code&gt;devvm doctor&lt;/code&gt; says what&amp;rsquo;s wrong with it. That VM&amp;rsquo;s project folder could hold a link, so until the state is fixed, devvm leaves out, with a warning that names the state, every link out of an agent&amp;rsquo;s folder, and every agent&amp;rsquo;s folder or login whose path leads through a link, such as an agent&amp;rsquo;s folder that&amp;rsquo;s a link to your dotfiles.&lt;/li&gt;
&lt;li&gt;When the store already has settings or a login of an agent you import, devvm asks in a terminal whether to replace them, with no as the default. Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, devvm refuses and names &lt;code&gt;--force&lt;/code&gt;, which replaces them without asking. An agent whose settings aren&amp;rsquo;t in your home folder keeps the store&amp;rsquo;s settings, and one without a login there keeps the store&amp;rsquo;s login.&lt;/li&gt;
&lt;li&gt;On macOS, Claude Code keeps its own login in the Keychain, and devvm neither reads it nor copies it. You log Claude Code in from a VM instead, with &lt;code&gt;devvm agent login claude&lt;/code&gt;, and every VM with Claude Code gets that login (&lt;a href="#claude-code-login"&gt;Claude Code login&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;When this machine&amp;rsquo;s opencode is version 2 or later, devvm saves the API key of each provider, and your OpenAI login when you made it with one of opencode&amp;rsquo;s Codex logins, the browser or the headless one. Any other login is left out with a warning that names it, such as opencode&amp;rsquo;s Sign in with ChatGPT, whose tokens a VM can&amp;rsquo;t use, or another provider&amp;rsquo;s OAuth login, and you log in from a VM instead, with &lt;code&gt;devvm agent login opencode&lt;/code&gt; (&lt;a href="#logging-in-with-devvm-agent-login"&gt;logging in with devvm agent login&lt;/a&gt;). When &lt;code&gt;opencode auth export&lt;/code&gt; fails, the import fails too, and the store keeps the login it had.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-hextra-search-id="links-out-of-an-agents-folder"&gt;Links out of an agent&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="links-out-of-an-agents-folder"&gt;&lt;/span&gt;
&lt;a href="#links-out-of-an-agents-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;When your settings live elsewhere, such as in a dotfiles repo with links into &lt;code&gt;~/.claude&lt;/code&gt;, devvm copies what those links lead to only when you allow it, because every VM with the agent gets what&amp;rsquo;s in the store. In a terminal, devvm names each link and where it leads, and asks whether to copy them, with no as the default. Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, it leaves them out with a warning that names &lt;code&gt;--follow-links&lt;/code&gt;. You allow them for one run with the flag, or for good with &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;follow-links&lt;/code&gt;, which lists the folders whose links devvm follows without asking:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent import --follow-links &lt;span class="c1"&gt;# copy what the links lead to, naming each, without asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# in ~/.config/devvm/config.toml: follow links into these folders without asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;follow-links&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;~/dotfiles&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;What devvm copies through a link, and what it refuses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Copies, never links.&lt;/strong&gt; A linked file becomes a file in the store, and a linked folder, such as a skill that &lt;code&gt;~/.claude/skills/x&lt;/code&gt; links to, becomes a folder of copies. Each import copies them again, and takes a copy out once its link is gone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only inside the folder you allowed.&lt;/strong&gt; devvm reads what a link leads to through a &lt;code&gt;follow-links&lt;/code&gt; folder, or with &lt;code&gt;--follow-links&lt;/code&gt; through the linked folder itself, or the linked file&amp;rsquo;s own folder. A link inside a linked folder becomes a copy of the file it leads to only when that file is inside the same folder, and any other is left out with a warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never your secrets or devvm&amp;rsquo;s own files.&lt;/strong&gt; devvm never follows a link to your home folder or a folder that holds it, to devvm&amp;rsquo;s own folders, to &lt;code&gt;~/.ssh&lt;/code&gt;, &lt;code&gt;~/.gnupg&lt;/code&gt;, &lt;code&gt;~/.aws&lt;/code&gt;, &lt;code&gt;~/Library/Keychains&lt;/code&gt;, &lt;code&gt;~/.config/devvm&lt;/code&gt;, &lt;code&gt;~/.netrc&lt;/code&gt;, &lt;code&gt;~/.config/gh&lt;/code&gt;, &lt;code&gt;~/.docker&lt;/code&gt; or &lt;code&gt;~/.kube&lt;/code&gt;, or to an agent&amp;rsquo;s logins or history, such as &lt;code&gt;~/.codex&lt;/code&gt;, nor into one of these or to a folder that holds one. It leaves such a link out with a warning, even with &lt;code&gt;--follow-links&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;follow-links&lt;/code&gt; folder must be safe as a whole.&lt;/strong&gt; A folder that is, holds or is inside one of those places fails the import, naming it, so name a folder inside it instead, such as &lt;code&gt;~/dotfiles/skills&lt;/code&gt; when &lt;code&gt;~/.claude&lt;/code&gt; is a link to &lt;code&gt;~/dotfiles/claude&lt;/code&gt;. Write each folder as an absolute path or one that starts with &lt;code&gt;~/&lt;/code&gt;, and devvm refuses anything else (&lt;code&gt;config.toml&lt;/code&gt; names the line).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s project folder gets a warning.&lt;/strong&gt; When a link leads into the folder of one of your VMs, &lt;code&gt;--clone&lt;/code&gt; VMs included, devvm names that VM and warns that it can change what every VM&amp;rsquo;s agent reads from the next import on. Follow such links only when you trust that VM. A link that passes through a link in a VM&amp;rsquo;s project folder to a place outside that folder is left out with a warning naming the VM, whatever allows it, because that VM chose where it leads. While a VM&amp;rsquo;s state can&amp;rsquo;t be read, devvm can&amp;rsquo;t tell where that VM&amp;rsquo;s project folder is, so it leaves out every link, with a warning that names the state.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;At most 20,000 files and folders, 128 MiB, and 16 MiB in one file,&lt;/strong&gt; for all the links of one import together. A link whose files would pass that is left out whole, with a warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Settings files and folders keep their kind.&lt;/strong&gt; A link that is one of an agent&amp;rsquo;s settings files, such as &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;, must lead to a file, and one that is a settings folder, such as &lt;code&gt;~/.claude/skills&lt;/code&gt;, must lead to a folder. Any other is left out with a warning.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without either, two layouts keep your settings in a dotfiles repo and import them as they are. You can link the agent&amp;rsquo;s whole folder, such as &lt;code&gt;~/.config/opencode&lt;/code&gt;, to a folder in the repo, and devvm then reads that folder as the agent&amp;rsquo;s folder, so its links to files inside it become copies. Or your dotfiles manager can write real files rather than links, as chezmoi does by default, so your home folder has files that devvm copies.&lt;/p&gt;
&lt;h3 data-hextra-search-id="saving-a-vms-settings"&gt;Saving a VM&amp;rsquo;s settings&lt;span class="hx:absolute hx:-mt-20" id="saving-a-vms-settings"&gt;&lt;/span&gt;
&lt;a href="#saving-a-vms-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When you change an agent&amp;rsquo;s settings in a VM, for example by installing a Claude Code plugin there with &lt;code&gt;claude plugin install&lt;/code&gt; or &lt;code&gt;/plugin&lt;/code&gt;, or by changing &lt;code&gt;~/.claude/settings.json&lt;/code&gt;, &lt;code&gt;devvm agent save&lt;/code&gt; copies them into the store, so every VM with that agent gets them. With no argument it saves every agent that the folder&amp;rsquo;s VM has, and &lt;code&gt;devvm agent save claude&lt;/code&gt; saves only the agents you name. devvm starts a stopped VM for it. It reads only the settings, never the logins or your history, treats everything the VM sends as untrusted, and puts your secrets back where the VM&amp;rsquo;s copies hold placeholders (&lt;a href="https://next.devvm.dev/docs/internals/agents/#saving-a-vms-settings"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent save &lt;span class="c1"&gt;# show what changed in the VM&amp;#39;s agents&amp;#39; settings, then save them&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent save codex &lt;span class="c1"&gt;# save only Codex&amp;#39;s&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It reads at most 128 MiB from the VM, in at most 20,000 files, folders and links, none of the files larger than 16 MiB, at most 128 folders deep and in paths of at most 4,096 bytes. The VM sends only what the store keeps, as the table above lists, so opencode&amp;rsquo;s lock files, such as the &lt;code&gt;bun.lock&lt;/code&gt; that its plugins&amp;rsquo; installs write, stay in the VM. When the VM sends more, or sends a path outside the agents&amp;rsquo; settings, devvm saves nothing. A save that fails partway leaves the store as it was.&lt;/p&gt;
&lt;p&gt;For example, to give every VM a plugin that you install in one:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;claude plugin install my-plugin@my-marketplace &lt;span class="c1"&gt;# in the VM: installs into the VM&amp;#39;s own ~/.claude/plugins&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent save claude &lt;span class="c1"&gt;# on this machine, in the project folder: copies it into the store&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Before it saves anything, devvm shows what would change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For each folder it lists the files it adds (A), changes (M) and removes (D), and then it shows a diff of each file it adds or changes against the store&amp;rsquo;s copy, with a line when a file&amp;rsquo;s mode changes.&lt;/li&gt;
&lt;li&gt;The diff shows the settings files and &lt;code&gt;~/.claude.json&lt;/code&gt; as a VM gets them, written out again with &lt;code&gt;devvm-redacted&lt;/code&gt; in place of the values that look like secrets, so it never prints your secrets, and it says so when only those values or the file&amp;rsquo;s layout changed.&lt;/li&gt;
&lt;li&gt;Every character that a terminal wouldn&amp;rsquo;t show, such as a control character, a zero-width character or a character that reverses the text, appears in the diff as its code, such as &lt;code&gt;\u{200b}&lt;/code&gt;, so a VM can&amp;rsquo;t hide a line from you.&lt;/li&gt;
&lt;li&gt;The diff names a binary file without showing it, and it shows a file of more than 1 MiB or 10,000 lines, and every line past the first 20,000 of the whole diff, only as a count.&lt;/li&gt;
&lt;li&gt;On a Mac, whose volume ignores case by default, a file whose name differs from the store&amp;rsquo;s only in case, such as &lt;code&gt;foo.md&lt;/code&gt; where the store has &lt;code&gt;Foo.md&lt;/code&gt;, is the store&amp;rsquo;s file, so the diff shows it as changed and the store keeps its name.&lt;/li&gt;
&lt;li&gt;Two names in the VM that differ only in case, such as &lt;code&gt;A.md&lt;/code&gt; and &lt;code&gt;a.md&lt;/code&gt;, would be one file in the store on a Mac, so once you say yes, devvm saves nothing and names both, and you rename one of them in the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then devvm says that every VM with these agents runs the hooks, the MCP servers&amp;rsquo; commands and the plugins you save, and it asks whether to save them, with no as the default. Read the diff before you answer, because a hook or a plugin that a &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#rogue-agents"&gt;rogue agent&lt;/a&gt; added in one VM runs in every VM once you save it. devvm agent save always asks, and no flag answers for you, so without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, it shows what would change and then refuses. What devvm doesn&amp;rsquo;t save:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A file where the VM changed what&amp;rsquo;s around a placeholder,&lt;/strong&gt; which devvm leaves out with a warning, so make that change in the store&amp;rsquo;s file yourself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anything, when the store changed after devvm showed what differs,&lt;/strong&gt; as when you ran &lt;code&gt;devvm agent import&lt;/code&gt; meanwhile, so run &lt;code&gt;devvm agent save&lt;/code&gt; again to see what differs now.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="mounts"&gt;Mounts&lt;span class="hx:absolute hx:-mt-20" id="mounts"&gt;&lt;/span&gt;
&lt;a href="#mounts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm mounts the store&amp;rsquo;s settings folders that exist when it creates the VM read-only, at the same path as in the store on this machine, and links them from the VM&amp;rsquo;s home. This machine enforces read-only, so even root in the VM can&amp;rsquo;t write to them (&lt;a href="https://next.devvm.dev/docs/internals/agents/#mounts"&gt;links and paths in them&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;devvm mounts each folder whole, whatever the VM&amp;rsquo;s network tier, so the VM reads every file in it, a &lt;code&gt;.env&lt;/code&gt; or a key file in a plugin&amp;rsquo;s folder included, and the git config of a private plugin marketplace whose URL holds a password. devvm takes no secrets out of these folders, because they hold plugins, skills and their scripts that the agent runs as they are. So keep secrets out of these folders, as you keep them out of the project folder (&lt;a href="https://next.devvm.dev/docs/internals/network/#what-stays-in-the-vms-copies"&gt;why devvm mounts them whole&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;When &lt;code&gt;devvm agent import&lt;/code&gt; or &lt;code&gt;devvm agent save&lt;/code&gt; copies a Claude Code marketplace that has a password or an access token in its clone&amp;rsquo;s git config, or in its source in &lt;code&gt;known_marketplaces.json&lt;/code&gt;, it copies it as it is and warns, naming the marketplace, the store&amp;rsquo;s file and the keys that hold it, never the credential (&lt;a href="https://next.devvm.dev/docs/internals/agents/#mounts"&gt;what it checks&lt;/a&gt;). Take the credential out of that file and of the marketplace on this machine, and keep it in a credential helper instead.&lt;/li&gt;
&lt;li&gt;devvm doesn&amp;rsquo;t mount a folder whose path has a comma, on any backend, and it warns you.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When you make or delete one of these folders in the store later, by hand or with &lt;code&gt;devvm agent import&lt;/code&gt;, devvm notices on the VM&amp;rsquo;s next launch and names the folder. A VM&amp;rsquo;s mounts change only when it starts, so a stopped VM gets the new mounts as the launch starts it. For a running VM, devvm asks in a terminal whether to restart it now, which stops anything running in it, in the one question that covers every change waiting for the VM&amp;rsquo;s next start, and because the mounts are among those changes, the default answer is yes (&lt;a href="https://next.devvm.dev/docs/using/vms/#restarting-and-stopping"&gt;restarting&lt;/a&gt;). If you answer no, or there&amp;rsquo;s no terminal, or you pass &lt;code&gt;--no-input&lt;/code&gt;, the mounts change when the VM next starts, for example with &lt;code&gt;devvm restart&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm restart &lt;span class="c1"&gt;# give a running VM the store&amp;#39;s new folders now&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-plugins"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-plugins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Claude Code writes into its plugins folder as it runs, for each plugin&amp;rsquo;s data, for the plugins you install and for its marketplaces&amp;rsquo; updates, so each VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; is its own folder, on the VM&amp;rsquo;s disk. The store&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; is mounted read-only and linked at &lt;code&gt;~/.claude/plugins-seed&lt;/code&gt;, and Claude Code reads it as its seed, a plugins folder it never writes. Every shell in the VM names both for Claude Code, with &lt;code&gt;CLAUDE_CODE_PLUGIN_CACHE_DIR&lt;/code&gt; and &lt;code&gt;CLAUDE_CODE_PLUGIN_SEED_DIR&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-plugins"&gt;how&lt;/a&gt;). What that means in a VM:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A plugin in the store loads when &lt;code&gt;enabledPlugins&lt;/code&gt; in &lt;code&gt;~/.claude/settings.json&lt;/code&gt; turns it on, as it does on this machine, and Claude Code keeps its data in the VM&amp;rsquo;s own &lt;code&gt;~/.claude/plugins/data&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A plugin you install in the VM goes into the VM&amp;rsquo;s own folder, and only that VM has it until you &lt;a href="#saving-a-vms-settings"&gt;save it&lt;/a&gt;. The save copies the plugins you installed and their marketplaces into the store, and it never takes a plugin out of the store, so remove one in the store&amp;rsquo;s folder yourself, or import your machine&amp;rsquo;s plugins again.&lt;/li&gt;
&lt;li&gt;Claude Code doesn&amp;rsquo;t update the store&amp;rsquo;s marketplaces in a VM, and &lt;code&gt;claude plugin marketplace update&lt;/code&gt; refuses them, so update a marketplace on this machine and run &lt;code&gt;devvm agent import claude&lt;/code&gt; again.&lt;/li&gt;
&lt;li&gt;Neither &lt;code&gt;devvm agent import&lt;/code&gt; nor &lt;code&gt;devvm agent save&lt;/code&gt; copies what is each machine&amp;rsquo;s own, such as each plugin&amp;rsquo;s data, and an export of the VM&amp;rsquo;s history leaves out the VM&amp;rsquo;s plugins folder.&lt;/li&gt;
&lt;li&gt;When the store holds such entries, as an import by devvm 0.1.0 left there, a VM&amp;rsquo;s start takes them out of the store and warns once, naming them, and leaves your own folder as it is. When devvm can&amp;rsquo;t take them out, or the store&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; is a link or below one, a VM with Claude Code doesn&amp;rsquo;t start until that folder is one of its own that holds only &lt;code&gt;known_marketplaces.json&lt;/code&gt;, &lt;code&gt;marketplaces&lt;/code&gt; and &lt;code&gt;cache&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-plugins"&gt;how&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;claude plugin list &lt;span class="c1"&gt;# in the VM: the store&amp;#39;s plugins and the VM&amp;#39;s own&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="copies"&gt;Copies&lt;span class="hx:absolute hx:-mt-20" id="copies"&gt;&lt;/span&gt;
&lt;a href="#copies" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm copies the store&amp;rsquo;s files into the VM&amp;rsquo;s home on every launch, over the VM&amp;rsquo;s own. On every &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt;, the copies of the logins and settings files have your secrets taken out, and the VM&amp;rsquo;s proxy puts them into requests instead (&lt;a href="https://next.devvm.dev/docs/internals/network/#agents-logins-and-settings"&gt;agents&amp;rsquo; logins and settings&lt;/a&gt;). devvm merges the store&amp;rsquo;s &lt;code&gt;.claude.json&lt;/code&gt; into the VM&amp;rsquo;s own, so servers added in the VM stay, and it merges Claude Code&amp;rsquo;s login into the VM&amp;rsquo;s &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, so &lt;a href="#mcp-servers-logins"&gt;MCP servers&amp;rsquo; logins&lt;/a&gt; made in the VM also stay. It writes &lt;code&gt;devvm-redacted&lt;/code&gt; in place of each secret in the settings files, names what it replaced in each file, and names each file it didn&amp;rsquo;t copy (&lt;a href="https://next.devvm.dev/docs/internals/agents/#copies"&gt;what it takes out&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="claude-code-login"&gt;Claude Code login&lt;span class="hx:absolute hx:-mt-20" id="claude-code-login"&gt;&lt;/span&gt;
&lt;a href="#claude-code-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You log Claude Code in once, from inside any VM that has it, and devvm keeps the login on this machine for every VM with Claude Code, so this machine never needs Claude Code:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login claude &lt;span class="c1"&gt;# log Claude Code in to your Claude subscription&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login claude --setup-token &lt;span class="c1"&gt;# get a long-lived Claude Code token with claude setup-token instead&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm starts the folder&amp;rsquo;s VM first if it&amp;rsquo;s stopped, as &lt;code&gt;devvm host&lt;/code&gt; does, and then runs Claude Code&amp;rsquo;s own login in the VM, on your terminal: &lt;code&gt;claude auth login --claudeai&lt;/code&gt;, or &lt;code&gt;claude setup-token&lt;/code&gt; with &lt;code&gt;--setup-token&lt;/code&gt;. Claude Code shows an address, which you open in a browser on any machine. When you approve the login there, the browser shows a code, which you paste back at Claude Code&amp;rsquo;s prompt, so devvm forwards no port. The VM uses the login at once, and every other VM with Claude Code gets it from its next launch (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-login"&gt;how&lt;/a&gt;). When the login ends without a new login in the store, such as when Ctrl-C ends Claude Code&amp;rsquo;s login in the VM, devvm says so and fails. Run &lt;code&gt;--setup-token&lt;/code&gt; in a terminal, because &lt;code&gt;claude setup-token&lt;/code&gt; draws on one and shows nothing without it, and devvm warns when there&amp;rsquo;s none (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;how the login gets a terminal&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm keeps one Claude Code login, either your subscription&amp;rsquo;s login or a Claude Code token, and the newest replaces the other, so every VM uses the account you logged in to last:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Your subscription&amp;rsquo;s login&lt;/strong&gt;, from &lt;code&gt;devvm agent login claude&lt;/code&gt; or a &lt;code&gt;claude /login&lt;/code&gt; that you run in a VM yourself, goes in devvm&amp;rsquo;s agent store, in &lt;code&gt;~/.local/share/devvm/logins/claude/.claude/.credentials.json&lt;/code&gt;, only yours to read. The VM&amp;rsquo;s &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; holds placeholders, with no refresh token and an expiry in 2099, so Claude Code in the VM never refreshes the login itself. The VM&amp;rsquo;s proxy puts the login into the VM&amp;rsquo;s requests to &lt;code&gt;api.anthropic.com&lt;/code&gt; and to &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt;, the host of your claude.ai connectors, and refreshes it on this machine when it&amp;rsquo;s due, through the company proxy when &lt;code&gt;config.toml&lt;/code&gt; names one. devvm keeps only a login that can use Claude&amp;rsquo;s models and can&amp;rsquo;t make API keys, so a login to an Anthropic Console account, which Claude Code uses to make an API key, fails in a VM, and no API key reaches it. Only a VM that has Claude Code can log it in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A Claude Code token&lt;/strong&gt;, from &lt;code&gt;devvm agent login claude --setup-token&lt;/code&gt; or a &lt;code&gt;claude setup-token&lt;/code&gt; that you run in a VM yourself, goes with the other &lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;secrets&lt;/a&gt;. You can also save one with &lt;code&gt;devvm secret set claude&lt;/code&gt; and paste the token that &lt;code&gt;claude setup-token&lt;/code&gt; printed on another machine (&lt;code&gt;sk-ant-oat01-…&lt;/code&gt;), not the code the browser shows. devvm neither saves nor sends a Claude Code token that isn&amp;rsquo;t a setup token. Every VM with Claude Code gets the token in its environment as &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt;, holding a placeholder of its own, and its proxy puts the token into its requests. When you set up a token in a VM, &lt;code&gt;claude setup-token&lt;/code&gt; prints that VM&amp;rsquo;s placeholder, not the token, because devvm already saved it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt; in devvm&amp;rsquo;s own environment on this machine wins over both, as it does in Claude Code, so VMs get that token, and &lt;code&gt;devvm agent login claude&lt;/code&gt; warns you when it&amp;rsquo;s set. With your subscription&amp;rsquo;s login, and only with it, a VM can use your claude.ai connectors, and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;your claude.ai connectors&lt;/a&gt; says how to stop that. Anthropic doesn&amp;rsquo;t document the requests that Claude Code&amp;rsquo;s login sends, so devvm follows the ones Claude Code sends today, and a new Claude Code release can change them. When a login in a VM stops working, run &lt;code&gt;devvm agent login claude&lt;/code&gt; again, or save a Claude Code token instead.&lt;/p&gt;
&lt;h4 data-hextra-search-id="mcp-servers-logins"&gt;MCP servers&amp;rsquo; logins&lt;span class="hx:absolute hx:-mt-20" id="mcp-servers-logins"&gt;&lt;/span&gt;
&lt;a href="#mcp-servers-logins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;You log Claude Code in to an MCP server that asks for a login inside the VM, the way you would on this machine:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/mcp # in Claude Code in the VM: pick the server and log in to it&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Claude Code keeps these logins in the VM&amp;rsquo;s &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, beside the Claude login, and they&amp;rsquo;re the VM&amp;rsquo;s own (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-login"&gt;how&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;They stay in the VM.&lt;/strong&gt; Each launch replaces only the Claude login in that file and keeps the rest, so a login you make lasts across launches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;They hold real tokens,&lt;/strong&gt; which code in the VM can read, and they never reach this machine, another VM, &lt;code&gt;devvm agent save&lt;/code&gt; or an export of the VM&amp;rsquo;s history.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;They don&amp;rsquo;t come along when devvm makes the VM again,&lt;/strong&gt; such as to add a layer, so you log in to those servers again there (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-vm-made-again-keeps"&gt;what a VM made again keeps&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="codex-and-opencode-logins"&gt;Codex and opencode logins&lt;span class="hx:absolute hx:-mt-20" id="codex-and-opencode-logins"&gt;&lt;/span&gt;
&lt;a href="#codex-and-opencode-logins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You log Codex and opencode in from inside a VM, with &lt;a href="#logging-in-with-devvm-agent-login"&gt;&lt;code&gt;devvm agent login&lt;/code&gt;&lt;/a&gt;, and devvm keeps the login on this machine for every VM with that agent:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login codex &lt;span class="c1"&gt;# log Codex in to ChatGPT in a browser on this machine&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login opencode &lt;span class="c1"&gt;# log opencode in with its Codex login, the same way&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On every network tier, the VM&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; holds placeholders, and its proxy holds the real API keys and logins, so when the agent in the VM stops getting answers, the proxy&amp;rsquo;s own log, &lt;code&gt;proxy.log&lt;/code&gt; in &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;, may say that refreshing a login failed or that you&amp;rsquo;re no longer logged in that way. To log in again, run &lt;a href="#logging-in-with-devvm-agent-login"&gt;&lt;code&gt;devvm agent login codex&lt;/code&gt; or &lt;code&gt;devvm agent login opencode&lt;/code&gt;&lt;/a&gt; in the VM&amp;rsquo;s folder, which also gives that VM the new login&amp;rsquo;s placeholders, and the other VMs get them on their next launch. Some logins stay on this machine, and devvm names each at every launch (&lt;a href="https://next.devvm.dev/docs/internals/agents/#codexs-and-opencodes-logins"&gt;how&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Codex&amp;rsquo;s other logins, such as a personal access token or an Amazon Bedrock key, so to use Codex in a VM, log in with ChatGPT or an OpenAI API key (&lt;a href="#logging-in-with-devvm-agent-login"&gt;logging in with devvm agent login&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;opencode&amp;rsquo;s other entries, such as another provider&amp;rsquo;s API key or an OAuth login, which the VM gets without its key or its tokens. To use an OAuth login&amp;rsquo;s provider in the VM, log in to it with an API key on this machine and import the login again.&lt;/li&gt;
&lt;li&gt;Claude Code&amp;rsquo;s account fields in &lt;code&gt;~/.claude.json&lt;/code&gt; other than the ones it writes there today.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To give the VM one provider&amp;rsquo;s API key as it is, such as a local model server&amp;rsquo;s that the VM&amp;rsquo;s proxy can&amp;rsquo;t put in, list the provider under &lt;code&gt;opencode&lt;/code&gt; in &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt; table (&lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;config.toml&lt;/a&gt;), as you would for &lt;a href="#pi-logins"&gt;pi&lt;/a&gt;. The provider is its entry&amp;rsquo;s name in opencode&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt;, such as &lt;code&gt;ollama&lt;/code&gt;. Every VM with opencode then gets that entry whole, its &lt;code&gt;metadata&lt;/code&gt; included, and opencode 2 in the VM imports it into its database too, and devvm says so at each launch. It applies only to entries with an API key, because a VM never gets a login&amp;rsquo;s tokens, and only to providers whose keys the proxy doesn&amp;rsquo;t put in, because a key the proxy puts in is always its placeholder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pass-keys&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;opencode&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ollama&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;So when opencode in a VM can&amp;rsquo;t reach a provider whose key works on this machine, such as a local model server&amp;rsquo;s, and devvm&amp;rsquo;s warning at launch names that provider, add it to &lt;code&gt;[pass-keys]&lt;/code&gt; and run devvm in the folder again.&lt;/p&gt;
&lt;h4 data-hextra-search-id="logging-in-with-devvm-agent-login"&gt;Logging in with devvm agent login&lt;span class="hx:absolute hx:-mt-20" id="logging-in-with-devvm-agent-login"&gt;&lt;/span&gt;
&lt;a href="#logging-in-with-devvm-agent-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;code&gt;devvm agent login&lt;/code&gt; logs Codex or opencode in from inside this folder&amp;rsquo;s VM, so this machine never needs either agent, and devvm&amp;rsquo;s agent store keeps the login for every VM with that agent. Claude Code&amp;rsquo;s login is &lt;code&gt;devvm agent login claude&lt;/code&gt; (&lt;a href="#claude-code-login"&gt;Claude Code login&lt;/a&gt;), and pi&amp;rsquo;s is an API key alone (&lt;a href="#pi-logins"&gt;pi logins&lt;/a&gt;):&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login codex &lt;span class="c1"&gt;# log Codex in to ChatGPT in a browser on this machine&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login opencode --device-code &lt;span class="c1"&gt;# log opencode in with a code, in a browser on any machine&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login codex --api-key &lt;span class="c1"&gt;# save Codex&amp;#39;s OpenAI API key, asking for it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login codex --api-key --stdin &amp;lt; key.txt &lt;span class="c1"&gt;# save it from a file or a pipe&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login opencode --api-key --provider anthropic &lt;span class="c1"&gt;# save opencode&amp;#39;s Anthropic API key&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm starts the folder&amp;rsquo;s VM first if it&amp;rsquo;s stopped, as &lt;code&gt;devvm host&lt;/code&gt; does, and the VM must have the agent, which &lt;code&gt;devvm tools add codex&lt;/code&gt; gives it. Then devvm logs the agent in one of three ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;In a browser on this machine&lt;/strong&gt;, by default: &lt;code&gt;codex login&lt;/code&gt; for Codex, and &lt;code&gt;opencode auth login openai --method chatgpt-browser&lt;/code&gt;, opencode&amp;rsquo;s Codex browser login, for opencode. The agent shows an address, which you open in a browser on this machine, and devvm forwards this machine&amp;rsquo;s &lt;code&gt;localhost:1455&lt;/code&gt; to the VM while the login runs (&lt;a href="https://next.devvm.dev/docs/internals/agents/#logging-in"&gt;how&lt;/a&gt;). When another program on this machine has port 1455, devvm refuses and names &lt;code&gt;--device-code&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;With &lt;code&gt;--device-code&lt;/code&gt;&lt;/strong&gt;, the agent shows a code instead, which you type into a browser on any machine, and devvm forwards nothing. Codex&amp;rsquo;s device code login is &lt;code&gt;codex login --device-auth&lt;/code&gt;, which your ChatGPT account&amp;rsquo;s security settings must allow, and opencode&amp;rsquo;s is &lt;code&gt;opencode auth login openai --method chatgpt-headless&lt;/code&gt;, its Codex device code login.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;With &lt;code&gt;--api-key&lt;/code&gt;&lt;/strong&gt;, devvm asks for the API key without showing it, or reads it from a line of input with &lt;code&gt;--stdin&lt;/code&gt;, and saves it in the store itself, so the key never goes into the VM. Codex&amp;rsquo;s key is an OpenAI key, and it replaces Codex&amp;rsquo;s ChatGPT login in the store, as &lt;code&gt;codex login --with-api-key&lt;/code&gt; does. opencode&amp;rsquo;s key is for the provider that &lt;code&gt;--provider&lt;/code&gt; names, by one of the IDs in &lt;a href="#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt;, and the store keeps opencode&amp;rsquo;s other providers beside it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;opencode&amp;rsquo;s Anthropic login is an API key, because opencode itself has no other way to log in to Anthropic. opencode&amp;rsquo;s Claude Agent provider uses Claude Code&amp;rsquo;s own login instead, so it works in a VM that has Claude Code too, with the login that &lt;code&gt;devvm agent login claude&lt;/code&gt; saves. When the agent logs in, the VM&amp;rsquo;s proxy saves the login in the store, and the agent in the VM gets placeholders, as &lt;a href="#logins-made-in-a-vm"&gt;the next section&lt;/a&gt; describes. devvm then says what the store saved and the account&amp;rsquo;s email, and the VM uses the login at once. When the login ends without a new login in the store, for example because you chose another way to log in, devvm says so and fails, and &lt;code&gt;devvm network log&lt;/code&gt; shows each login the proxy saved.&lt;/p&gt;
&lt;h4 data-hextra-search-id="logins-made-in-a-vm"&gt;Logins made in a VM&lt;span class="hx:absolute hx:-mt-20" id="logins-made-in-a-vm"&gt;&lt;/span&gt;
&lt;a href="#logins-made-in-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;A login that Codex or opencode makes in a VM, whether &lt;code&gt;devvm agent login&lt;/code&gt; runs it or you run it yourself, is saved in devvm&amp;rsquo;s store, and every VM with that agent gets it from its next launch. A login that shows a code to type into a browser works in a VM as it is, but opencode&amp;rsquo;s Sign in with ChatGPT doesn&amp;rsquo;t, so choose one of opencode&amp;rsquo;s Codex logins instead, as &lt;code&gt;devvm agent login opencode&lt;/code&gt; does (&lt;a href="https://next.devvm.dev/docs/internals/agents/#logins-made-in-a-vm"&gt;how a VM&amp;rsquo;s logins are saved&lt;/a&gt;). On the open tier, a program that goes around the VM&amp;rsquo;s proxy gets the login&amp;rsquo;s tokens itself, and devvm saves nothing (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="opencodes-service"&gt;opencode&amp;rsquo;s service&lt;span class="hx:absolute hx:-mt-20" id="opencodes-service"&gt;&lt;/span&gt;
&lt;a href="#opencodes-service" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;opencode&amp;rsquo;s background service, which opencode starts when it needs one, asks for a password when you sign in to it, and each VM&amp;rsquo;s opencode makes its own the first time its service starts. To sign in to a VM&amp;rsquo;s service, such as from opencode&amp;rsquo;s app, read that VM&amp;rsquo;s password in the VM:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;opencode service get password &lt;span class="c1"&gt;# in the VM: its service&amp;#39;s password, made now if it has none&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;opencode service &lt;span class="nb"&gt;set&lt;/span&gt; password PASSWORD &lt;span class="c1"&gt;# in the VM: choose another, which stops its service&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;devvm never copies this machine&amp;rsquo;s opencode service settings into its agent store or a VM. They&amp;rsquo;re &lt;code&gt;service.json&lt;/code&gt; in &lt;code&gt;~/.config/opencode&lt;/code&gt;, or &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; for another channel&amp;rsquo;s opencode, and they hold this machine&amp;rsquo;s service password and, with remote access on, the secret route that the service is served on. So &lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; leave them out, and each VM&amp;rsquo;s service settings stay in that VM.&lt;/li&gt;
&lt;li&gt;When devvm&amp;rsquo;s agent store holds them, a VM&amp;rsquo;s start takes them out and warns once, and each VM&amp;rsquo;s setup takes out any copy of them that devvm made, so the VM&amp;rsquo;s opencode makes its own password (&lt;a href="https://next.devvm.dev/docs/internals/agents/#opencodes-service"&gt;how&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A service that&amp;rsquo;s running keeps the password it started with, so after that warning, restart each running VM that has opencode:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm restart &lt;span class="c1"&gt;# in the VM&amp;#39;s folder: its opencode service starts again with a password of its own&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="pi-logins"&gt;pi logins&lt;span class="hx:absolute hx:-mt-20" id="pi-logins"&gt;&lt;/span&gt;
&lt;a href="#pi-logins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;pi in a VM uses API keys that devvm keeps on this machine, for the providers whose keys the VM&amp;rsquo;s proxy puts in, which &lt;a href="#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt; lists. You save one with &lt;code&gt;devvm agent login pi --api-key --provider PROVIDER&lt;/code&gt;, because pi&amp;rsquo;s login always takes both flags, or you import the API keys in your own &lt;code&gt;~/.pi/agent/auth.json&lt;/code&gt; with &lt;code&gt;devvm agent import pi&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login pi --api-key --provider anthropic &lt;span class="c1"&gt;# save pi&amp;#39;s Anthropic API key, asking for it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent import pi &lt;span class="c1"&gt;# copy pi&amp;#39;s settings and auth.json from this machine&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The login needs a VM with pi in this folder, which it gives its copy of the login at once, and every other VM with pi gets it at its next launch.&lt;/li&gt;
&lt;li&gt;The VM gets a placeholder in place of each key, and devvm keeps pi&amp;rsquo;s other entries on this machine, such as a local model server&amp;rsquo;s API key, a key that&amp;rsquo;s a command for pi to run and a key that pi fills in from a variable, even for a provider whose key the proxy puts in, and warns you about each (&lt;a href="https://next.devvm.dev/docs/internals/agents/#pis-logins"&gt;how&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To give the VM one provider&amp;rsquo;s API key as it is, such as a local model server&amp;rsquo;s that the VM&amp;rsquo;s proxy can&amp;rsquo;t put in, list the provider under &lt;code&gt;pi&lt;/code&gt; in &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt; table (&lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;config.toml&lt;/a&gt;). Every VM with pi then gets that entry whole, its &lt;code&gt;env&lt;/code&gt; included, and devvm says so at each launch. It applies only to entries with an API key, because a VM never gets a login&amp;rsquo;s tokens, and only to providers whose keys the proxy doesn&amp;rsquo;t put in, because a key the proxy puts in is always its placeholder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pass-keys&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;pi&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ollama&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;pi&amp;rsquo;s own logins with an account, which &lt;code&gt;/login&lt;/code&gt; and &lt;code&gt;pi auth login&lt;/code&gt; make for a subscription, such as Claude&amp;rsquo;s, ChatGPT&amp;rsquo;s or GitHub Copilot&amp;rsquo;s, aren&amp;rsquo;t among the logins devvm keeps, so save the provider&amp;rsquo;s API key instead. Don&amp;rsquo;t log pi in with an account inside a VM either, because the VM&amp;rsquo;s proxy would save it as another agent&amp;rsquo;s login or refuse it (&lt;a href="https://next.devvm.dev/docs/internals/agents/#pis-logins"&gt;pi&amp;rsquo;s logins&lt;/a&gt;).&lt;/p&gt;
&lt;h4 data-hextra-search-id="pis-settings"&gt;pi&amp;rsquo;s settings&lt;span class="hx:absolute hx:-mt-20" id="pis-settings"&gt;&lt;/span&gt;
&lt;a href="#pis-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Two of pi&amp;rsquo;s settings act differently in a VM:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The VM&amp;rsquo;s copy of pi&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt; leaves out three keys, because each would undo what devvm sets in the VM, and devvm names the ones it left out. &lt;code&gt;httpProxy&lt;/code&gt; would send pi around the VM&amp;rsquo;s proxy, &lt;code&gt;sessionDir&lt;/code&gt; would keep pi&amp;rsquo;s sessions outside &lt;code&gt;~/.pi/agent/sessions&lt;/code&gt;, where history exports look for them, and &lt;code&gt;selfUpdateCommand&lt;/code&gt; would run a command of the file&amp;rsquo;s on &lt;code&gt;pi update&lt;/code&gt;. When &lt;code&gt;devvm agent save pi&lt;/code&gt; saves the VM&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt;, its diff shows those keys as taken out, so save it only when you mean to drop them from the store&amp;rsquo;s copy too.&lt;/li&gt;
&lt;li&gt;When the store&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt; sets &lt;code&gt;defaultProjectTrust&lt;/code&gt; to &lt;code&gt;always&lt;/code&gt;, devvm warns you at each launch. That setting makes pi load a project folder&amp;rsquo;s own &lt;code&gt;.pi&lt;/code&gt; extensions, settings and MCP servers without asking, and they run in the VM with pi, so set it to &lt;code&gt;ask&lt;/code&gt; in devvm&amp;rsquo;s agent store unless you trust every project you open.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="cursor-cli-login"&gt;Cursor CLI login&lt;span class="hx:absolute hx:-mt-20" id="cursor-cli-login"&gt;&lt;/span&gt;
&lt;a href="#cursor-cli-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Cursor&amp;rsquo;s CLI runs in the VM as &lt;code&gt;cursor-agent&lt;/code&gt;, or &lt;code&gt;agent&lt;/code&gt;, its other name. You log it in once, from inside any VM that has it, and devvm keeps the login on this machine for every VM with the CLI:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login cursor&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm starts the folder&amp;rsquo;s VM first if it&amp;rsquo;s stopped, as &lt;code&gt;devvm host&lt;/code&gt; does, and then runs &lt;code&gt;cursor-agent login&lt;/code&gt; in the VM, on your terminal, with &lt;code&gt;NO_OPEN_BROWSER=1&lt;/code&gt;, so the CLI prints an address rather than opening a browser in the VM. You open that address in a browser on any machine and approve the login, and the CLI waits for it, so devvm forwards no port. The VM&amp;rsquo;s proxy saves the login as Cursor&amp;rsquo;s API hands it to the CLI, in &lt;code&gt;~/.local/share/devvm/logins/cursor/.config/cursor/auth.json&lt;/code&gt;, only yours to read, and the CLI in the VM gets placeholders. A &lt;code&gt;cursor-agent login&lt;/code&gt; that you run in a VM yourself is saved in the same way, and every VM with the CLI gets the login from its next launch.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cursor&amp;rsquo;s CLI never refreshes a login, so devvm doesn&amp;rsquo;t either. When the login expires, the proxy puts nothing in, and its own log says to log in again with &lt;code&gt;devvm agent login cursor&lt;/code&gt;. devvm doesn&amp;rsquo;t keep a Cursor API key, so &lt;code&gt;devvm agent login cursor&lt;/code&gt; takes neither &lt;code&gt;--api-key&lt;/code&gt; nor &lt;code&gt;--device-code&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm agent import cursor&lt;/code&gt; copies the CLI&amp;rsquo;s settings from &lt;code&gt;~/.cursor&lt;/code&gt; on this machine, which are &lt;code&gt;cli-config.json&lt;/code&gt;, &lt;code&gt;mcp.json&lt;/code&gt; and the &lt;code&gt;rules&lt;/code&gt; and &lt;code&gt;commands&lt;/code&gt; folders. On Linux it copies the CLI&amp;rsquo;s login from &lt;code&gt;~/.config/cursor/auth.json&lt;/code&gt; too. On macOS the CLI keeps its login in the Keychain, which devvm doesn&amp;rsquo;t read, so log in from a VM instead.&lt;/li&gt;
&lt;li&gt;The CLI would update itself in the VM, but every VM sets its channel to &lt;code&gt;static&lt;/code&gt; in &lt;code&gt;~/.cursor/cli-config.json&lt;/code&gt; at each launch, which the CLI never updates on, so it stays the release that devvm pins. Cursor&amp;rsquo;s CLI has no setting that turns off its reports to Cursor, so its allowlist leaves out the host it sends its metrics to, &lt;code&gt;api3.cursor.sh&lt;/code&gt;, which Cursor documents for its editor&amp;rsquo;s Tab requests, and the reports it sends to Cursor&amp;rsquo;s API go with the rest. That host is &lt;a href="https://next.devvm.dev/docs/safety/network/#quiet-hosts"&gt;quiet&lt;/a&gt;, so its blocks never show in the VM. If Cursor Tab doesn&amp;rsquo;t work in a &lt;a href="https://next.devvm.dev/docs/using/ssh/#cursors-agent"&gt;&lt;code&gt;devvm cursor&lt;/code&gt;&lt;/a&gt; window on the allowlist tier, &lt;code&gt;devvm network allow api3.cursor.sh&lt;/code&gt; lets it through.&lt;/li&gt;
&lt;li&gt;In a VM, Cursor&amp;rsquo;s CLI can&amp;rsquo;t install, update or remove plugins and marketplaces, change automations or cloud agents&amp;rsquo; environments, start, fork, pin or merge the work of a cloud agent, or change your team, because each of those changes your Cursor account in a way that outlasts the VM and acts outside it. Do them from Cursor on your machine. Cursor&amp;rsquo;s agent store isn&amp;rsquo;t available in a VM either, so use it from Cursor on your machine. The CLI in a VM keeps its own chats without the store. Checking Amazon Bedrock keys doesn&amp;rsquo;t work in a VM either, as devvm doesn&amp;rsquo;t keep them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cursor-agent worker&lt;/code&gt;, which makes the machine a worker that runs your cloud agents&amp;rsquo; work, doesn&amp;rsquo;t work in a VM, because the proxy never puts the login into its requests, and its host, &lt;code&gt;api2direct.cursor.sh&lt;/code&gt;, isn&amp;rsquo;t among the Cursor hosts the allowlist tier lets through (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;how&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;The VM&amp;rsquo;s proxy puts the real login only into the requests that the CLI&amp;rsquo;s own methods make, and cuts a reply off where a token starts, but a token in a shape devvm doesn&amp;rsquo;t know could still reach the VM, so if you suspect that one did, log in again with &lt;code&gt;devvm agent login cursor&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#cursors-cli"&gt;how&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;span class="hx:absolute hx:-mt-20" id="api-keys-the-proxy-puts-in"&gt;&lt;/span&gt;
&lt;a href="#api-keys-the-proxy-puts-in" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The VM&amp;rsquo;s proxy puts in opencode&amp;rsquo;s and pi&amp;rsquo;s API keys for the providers in this table. The ID is the provider&amp;rsquo;s entry in the agent&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; and the value that &lt;code&gt;devvm agent login --provider&lt;/code&gt; takes. The VM&amp;rsquo;s copy of the login holds a placeholder in place of each of these keys, and on every network tier the proxy swaps it for the key in the headers that the table names, in requests to the provider&amp;rsquo;s hosts alone, so any other host gets only the placeholder. Where the table names a path, the proxy swaps it only in requests for paths that start with it, so the rest of that host gets the placeholder too. The proxy also allows those hosts on port 443, as it allows the hosts of every secret it puts in, so you don&amp;rsquo;t allow them yourself:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Hosts&lt;/th&gt;
&lt;th&gt;Paths&lt;/th&gt;
&lt;th&gt;Headers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;anthropic&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Anthropic&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.anthropic.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x-api-key&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;deepseek&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;DeepSeek&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.deepseek.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;google&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Google Gemini&lt;/td&gt;
&lt;td&gt;&lt;code&gt;generativelanguage.googleapis.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x-goog-api-key&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;groq&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Groq&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.groq.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mistral&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mistral&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.mistral.ai&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;openai&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;OpenAI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.openai.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;openrouter&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;OpenRouter&lt;/td&gt;
&lt;td&gt;&lt;code&gt;openrouter.ai&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;, &lt;code&gt;x-api-key&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;xai&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;xAI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.x.ai&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The Google Gemini key is the Gemini API&amp;rsquo;s, for Google AI Studio. Vertex AI logs in with a Google Cloud account or a service account instead, so devvm withholds its logins, as it does any other provider&amp;rsquo;s. These providers&amp;rsquo; keys never need &lt;code&gt;[pass-keys]&lt;/code&gt;, and when it lists one of them all the same, the VM still gets the key&amp;rsquo;s placeholder, not the key, and devvm notes at each launch that you can take the provider out. With some of these keys, code in the VM can make a credential of its own that works without the proxy, or reach hosts that the allowlist doesn&amp;rsquo;t have through the provider&amp;rsquo;s own tools (&lt;a href="https://next.devvm.dev/docs/internals/agents/#api-keys"&gt;how the proxy puts them in&lt;/a&gt;).&lt;/p&gt;
&lt;div class="devvm-callout devvm-callout-warning"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 1h1v1H5ZM4 2h1v1H4ZM6 2h1v1H6ZM4 3h1v1H4ZM6 3h1v1H6ZM3 4h1v1H3ZM7 4h1v1H7ZM3 5h1v1H3ZM5 5h1v1H5ZM7 5h1v1H7ZM2 6h1v1H2ZM5 6h1v1H5ZM8 6h1v1H8ZM2 7h1v1H2ZM5 7h1v1H5ZM8 7h1v1H8ZM1 8h1v1H1ZM9 8h1v1H9ZM1 9h1v1H1ZM5 9h1v1H5ZM9 9h1v1H9ZM0 10h1v1H0ZM10 10h1v1H10ZM0 11h11v1H0Z"/&gt;&lt;/svg&gt; Warning&lt;/p&gt;&lt;p&gt;A VM that was given one of these keys as it was, before the launch that first gave it the placeholder, may still hold copies of it, and those copies still work wherever they are. So when you don&amp;rsquo;t trust that VM, make a new key at the provider, save it with &lt;code&gt;devvm agent login AGENT --api-key --provider PROVIDER&lt;/code&gt; and revoke the old one.&lt;/p&gt;&lt;/div&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login opencode --api-key --provider openai &lt;span class="c1"&gt;# save the new key, then revoke the old one at the provider&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="pasting-images"&gt;Pasting images&lt;span class="hx:absolute hx:-mt-20" id="pasting-images"&gt;&lt;/span&gt;
&lt;a href="#pasting-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An agent in the VM can&amp;rsquo;t see this machine&amp;rsquo;s clipboard, so an image you copied, such as a screenshot, gets to it through devvm paste, which sends the image into the VM and copies its path there for you to paste:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy an image on this machine, such as a screenshot, copy pages in a PDF viewer such as Preview, or copy a file in Finder or your file manager.&lt;/li&gt;
&lt;li&gt;In a terminal on this machine, run &lt;code&gt;devvm paste&lt;/code&gt; in the project folder. devvm says where the image is in the VM, such as &lt;code&gt;/tmp/devvm-paste/paste-20261109-153012-7f3a9c01.png&lt;/code&gt;, and puts that path on your clipboard. If putting it there fails, devvm warns you and still says where the image is, so you can paste that path yourself.&lt;/li&gt;
&lt;li&gt;Paste the path into the agent with your terminal&amp;rsquo;s paste shortcut, which is Cmd+V on macOS and usually Ctrl+Shift+V on Linux. Ctrl+V on its own asks the agent to read the VM&amp;rsquo;s clipboard, and the VM has none. Claude Code, Codex and opencode attach an image whose path you paste, and pi reads it with its &lt;code&gt;read&lt;/code&gt; tool.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The VM must be running, because devvm paste is for an agent that runs in it, and devvm refuses a stopped one.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm paste &lt;span class="c1"&gt;# send what you copied, asking first about a copied file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm paste --send-file &lt;span class="c1"&gt;# send a file in the project folder without asking, as a script must&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm paste --json &lt;span class="c1"&gt;# the same, and print what it sent&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm paste rm &lt;span class="c1"&gt;# delete the files devvm paste left in the VM, after asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="what-devvm-paste-sends"&gt;What devvm paste sends&lt;span class="hx:absolute hx:-mt-20" id="what-devvm-paste-sends"&gt;&lt;/span&gt;
&lt;a href="#what-devvm-paste-sends" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm reads only an image, a PDF or a copied file&amp;rsquo;s reference from the clipboard, never text, so a password you copied never reaches it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;An image&lt;/strong&gt;: PNG, JPEG, GIF or WebP, and on macOS also a TIFF, which many Mac apps copy, sent as a PNG.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A PDF&lt;/strong&gt;, such as pages you copied in Preview, sent as it is, as a &lt;code&gt;.pdf&lt;/code&gt; file, because most models read PDFs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One copied file&lt;/strong&gt;, after devvm asks you about it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nothing over 64 MiB&lt;/strong&gt;, whether it&amp;rsquo;s an image, a PDF or a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm checks that an image&amp;rsquo;s or a PDF&amp;rsquo;s bytes are the type the clipboard claims (&lt;a href="https://next.devvm.dev/docs/contributing/design/#pasting-images"&gt;how&lt;/a&gt;). Text is never sent, so paste text, such as an error message, into the agent&amp;rsquo;s terminal yourself. The app you copied from hands over what you copied when devvm asks for it, and devvm waits for it at most 30 seconds, then stops waiting, sends nothing and says so, so copy it again, or wait until the app responds, then run devvm paste again. On macOS, devvm reads the clipboard of the session you&amp;rsquo;re logged in to, so run devvm paste in a terminal on that Mac, not over ssh.&lt;/p&gt;
&lt;p&gt;What devvm gets depends on the app you copied from:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A browser&amp;rsquo;s Copy Image&lt;/strong&gt; hands over a PNG, never the original JPEG, GIF or WebP, and Safari hands over a TIFF, which devvm makes a PNG, so an animated GIF arrives as one still frame. To send the original, save it and copy the saved file instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A PDF viewer&lt;/strong&gt; puts a picture of what you copied beside the PDF, and devvm sends the PDF, never the picture. When you copy a page&amp;rsquo;s thumbnail in Preview, Preview also puts a temporary file of its own on the clipboard, and devvm sends the PDF without asking about that file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Finder&lt;/strong&gt;, on macOS, puts the copied file&amp;rsquo;s icon on the clipboard as an image beside the file, and devvm sends the file, not the icon. If the file is gone by the time you run devvm paste, devvm says so and sends nothing, rather than the icon. Text is never taken for a file, even when it&amp;rsquo;s a path, so copy the file itself in Finder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Photos&lt;/strong&gt; puts a file of the Photos library beside a photo you copy, so devvm asks about that file, as it does about any copied file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="copied-files"&gt;Copied files&lt;span class="hx:absolute hx:-mt-20" id="copied-files"&gt;&lt;/span&gt;
&lt;a href="#copied-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Before devvm sends a copied file, it shows the file&amp;rsquo;s path on this machine and asks, [y/N], because the clipboard can name any file of yours, such as a key in &lt;code&gt;~/.ssh&lt;/code&gt; that you didn&amp;rsquo;t mean to copy. Answer no and nothing is sent. An image or a PDF is sent without a question, because it&amp;rsquo;s only what you copied. devvm sends a copied file under a name of its own that keeps only the file&amp;rsquo;s extension, when it&amp;rsquo;s letters and digits alone and at most 16 of them, so &lt;code&gt;my shot (1).png&lt;/code&gt; becomes &lt;code&gt;paste-20261109-153012-7f3a9c01.png&lt;/code&gt;, and &lt;code&gt;Makefile&lt;/code&gt; becomes &lt;code&gt;paste-20261109-153012-7f3a9c01&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/design/#pasting-images"&gt;why&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;It sends one file at a time, and it refuses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;several files;&lt;/li&gt;
&lt;li&gt;a folder;&lt;/li&gt;
&lt;li&gt;a file with a symbolic link anywhere in its path, your own included, because a link the VM planted in the project folder could point at a file of yours. The only links devvm follows are the system&amp;rsquo;s own, which root owns, such as macOS&amp;rsquo;s &lt;code&gt;/tmp&lt;/code&gt;, so copy the file from the folder it&amp;rsquo;s really in.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;devvm paste --send-file&lt;/code&gt; answers the question for a file in the project folder, which it sends without asking, as a script must, because the VM can read that folder already. It doesn&amp;rsquo;t answer for the rest:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A file anywhere else&lt;/strong&gt; is still asked about, so only you can send it, at a terminal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file whose path goes through a symbolic link&lt;/strong&gt; is asked about too, even through one of the system&amp;rsquo;s that devvm follows, because the file may not be where its path says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A clone VM&amp;rsquo;s files&lt;/strong&gt;, because a clone VM, made with &lt;code&gt;--clone&lt;/code&gt;, doesn&amp;rsquo;t mount the folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Where devvm can&amp;rsquo;t ask, such as without a terminal, it sends nothing, and it names &lt;code&gt;--send-file&lt;/code&gt; for a file in the folder, the file and the folder for one outside it, and the file for one reached through a link. So don&amp;rsquo;t bind &lt;code&gt;devvm paste --send-file&lt;/code&gt; to a hotkey to send files from outside the project, because a hotkey has no terminal to ask in, and devvm refuses those files.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-paste-json"&gt;devvm paste &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-paste-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-paste-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm paste --json&lt;/code&gt; does the same and prints what it sent as one object, with &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt; first. It has whether anything was &lt;code&gt;sent&lt;/code&gt;, which is &lt;code&gt;false&lt;/code&gt; when you answered no about a file, the VM, and the file&amp;rsquo;s &lt;code&gt;path&lt;/code&gt; in it (&lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; when nothing was sent). Then its &lt;code&gt;kind&lt;/code&gt; (&lt;code&gt;image&lt;/code&gt;, &lt;code&gt;pdf&lt;/code&gt; or &lt;code&gt;file&lt;/code&gt;), an image&amp;rsquo;s or a PDF&amp;rsquo;s &lt;code&gt;type&lt;/code&gt; (&lt;code&gt;image/png&lt;/code&gt;, &lt;code&gt;image/jpeg&lt;/code&gt;, &lt;code&gt;image/gif&lt;/code&gt;, &lt;code&gt;image/webp&lt;/code&gt; or &lt;code&gt;application/pdf&lt;/code&gt;, and &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; for a file), and a copied file&amp;rsquo;s &lt;code&gt;source&lt;/code&gt;, its path on this machine (&lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; otherwise). Last come its size in &lt;code&gt;bytes&lt;/code&gt;, and whether the path was &lt;code&gt;copied&lt;/code&gt; to the clipboard:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;sent&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;vm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm-website-3f9a1c2b4d5e6f&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;path&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/tmp/devvm-paste/paste-20261109-153012-7f3a9c01.png&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;kind&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;image&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;type&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;image/png&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;source&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;bytes&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;48213&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;copied&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="the-paste-folder-and-your-agents-settings"&gt;The paste folder and your agent&amp;rsquo;s settings&lt;span class="hx:absolute hx:-mt-20" id="the-paste-folder-and-your-agents-settings"&gt;&lt;/span&gt;
&lt;a href="#the-paste-folder-and-your-agents-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The files go into the VM&amp;rsquo;s paste folder, &lt;code&gt;/tmp/devvm-paste&lt;/code&gt; unless &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;paste-dir&lt;/code&gt; names another (&lt;a href="https://next.devvm.dev/docs/using/settings/#the-paste-folder"&gt;the paste folder&lt;/a&gt;), and they keep their mode, 600, so only the VM&amp;rsquo;s user reads them. The folder is a fixed path so that you can allow it once in an agent&amp;rsquo;s settings. Claude Code refuses to read a path outside the project folder when its &lt;code&gt;permissions.blockReadsOutsideWorkingDirectories&lt;/code&gt; setting is on, until you add the folder in Claude Code:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/add-dir /tmp/devvm-paste&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Or list it in &lt;code&gt;permissions.additionalDirectories&lt;/code&gt; in your settings, which &lt;a href="#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt; keeps for every VM, in &lt;code&gt;~/.config/devvm/agents/claude/.claude/settings.json&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;permissions&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;additionalDirectories&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/tmp/devvm-paste&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Anything in the VM can read what you send, as it can read any file in the project folder, so paste nothing you wouldn&amp;rsquo;t put in the folder.&lt;/p&gt;
&lt;h3 data-hextra-search-id="deleting-pasted-files"&gt;Deleting pasted files&lt;span class="hx:absolute hx:-mt-20" id="deleting-pasted-files"&gt;&lt;/span&gt;
&lt;a href="#deleting-pasted-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm paste rm &lt;span class="c1"&gt;# delete the files devvm paste left in the folder, after asking in a terminal&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm paste rm --force &lt;span class="c1"&gt;# delete them without asking, as a script must&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm never deletes a pasted file on its own, because Codex reads the image when you submit your message and pi when the model calls &lt;code&gt;read&lt;/code&gt;, which may be some time after the paste. devvm paste rm deletes only the files devvm paste named, and nothing else in the folder, so a &lt;code&gt;paste-dir&lt;/code&gt; of your own, such as &lt;code&gt;/home/USER/pastes&lt;/code&gt; where &lt;code&gt;USER&lt;/code&gt; is your user in the VM, can hold other files. The VM&amp;rsquo;s &lt;code&gt;/tmp&lt;/code&gt; is emptied when the VM boots, so with the default folder the files are gone after a restart anyway. With a &lt;code&gt;paste-dir&lt;/code&gt; of your own, they stay, and a command that starts a stopped VM and opens its shell offers to delete them, [y/N], once the VM is set up. Those commands are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm&lt;/code&gt; and &lt;code&gt;devvm restart&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm tools&lt;/code&gt;, &lt;code&gt;devvm tools add&lt;/code&gt;, &lt;code&gt;devvm tools rm&lt;/code&gt; and &lt;code&gt;devvm tools update&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm layer rm&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm update&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm clone on&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without a terminal, devvm keeps the files and says nothing, and if deleting them fails, it warns you and opens the shell anyway. Commands that start a VM without opening its shell, such as &lt;code&gt;devvm code&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt;, don&amp;rsquo;t ask, so run &lt;code&gt;devvm paste rm&lt;/code&gt; when you want the files gone.&lt;/p&gt;
&lt;h3 data-hextra-search-id="on-linux"&gt;On Linux&lt;span class="hx:absolute hx:-mt-20" id="on-linux"&gt;&lt;/span&gt;
&lt;a href="#on-linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm reads and writes the clipboard with &lt;code&gt;wl-paste&lt;/code&gt; and &lt;code&gt;wl-copy&lt;/code&gt; in a Wayland session, which &lt;code&gt;WAYLAND_DISPLAY&lt;/code&gt; names, and with &lt;code&gt;xclip&lt;/code&gt; in an X11 session, which &lt;code&gt;DISPLAY&lt;/code&gt; names. It tells you which one is missing, and installs nothing itself, so install &lt;code&gt;wl-clipboard&lt;/code&gt; or &lt;code&gt;xclip&lt;/code&gt; with your distribution&amp;rsquo;s package manager:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt install wl-clipboard &lt;span class="c1"&gt;# or xclip for X11; dnf, pacman and zypper have both&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm looks for them only in the system&amp;rsquo;s folders, never elsewhere on your &lt;code&gt;PATH&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/design/#pasting-images"&gt;which folders, and why&lt;/a&gt;). Run devvm paste from a terminal in your desktop session, because without either variable there&amp;rsquo;s no clipboard to read. If &lt;code&gt;WAYLAND_DISPLAY&lt;/code&gt; or &lt;code&gt;DISPLAY&lt;/code&gt; names a session that&amp;rsquo;s over, as in a tmux window left from an earlier login, devvm tells you that &lt;code&gt;wl-paste&lt;/code&gt; or &lt;code&gt;xclip&lt;/code&gt; failed and what it said, rather than that the clipboard is empty. Copying the path leaves &lt;code&gt;wl-copy&lt;/code&gt; or &lt;code&gt;xclip&lt;/code&gt; running until you copy something else, because a Linux clipboard&amp;rsquo;s contents live in the program that copied them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="history"&gt;History&lt;span class="hx:absolute hx:-mt-20" id="history"&gt;&lt;/span&gt;
&lt;a href="#history" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each VM&amp;rsquo;s transcripts and sessions stay in that VM. &lt;code&gt;devvm history export [FILE]&lt;/code&gt; saves them, and &lt;code&gt;devvm rm&lt;/code&gt; saves them before it deletes a VM that has an agent. The export is a &lt;code&gt;.tar.gz&lt;/code&gt; of the agents&amp;rsquo; history in the VM, &lt;!-- the agents' history, generated from internal/agents by mise run cli-docs --&gt;&lt;code&gt;~/.claude&lt;/code&gt;, &lt;code&gt;~/.claude.json&lt;/code&gt;, &lt;code&gt;~/.codex&lt;/code&gt;, &lt;code&gt;~/.local/share/opencode&lt;/code&gt;, &lt;code&gt;~/.local/state/opencode&lt;/code&gt;, &lt;code&gt;~/.pi/agent/sessions&lt;/code&gt; and &lt;code&gt;~/.cursor/chats&lt;/code&gt;&lt;!-- end of the agents' history --&gt;, written to FILE or to &lt;code&gt;~/.local/share/devvm/exports/&amp;lt;vm&amp;gt;-&amp;lt;date&amp;gt;-&amp;lt;time&amp;gt;.tar.gz&lt;/code&gt;. An export in that folder gets a &lt;code&gt;&amp;lt;vm&amp;gt;-&amp;lt;date&amp;gt;-&amp;lt;time&amp;gt;.folder&lt;/code&gt; file beside it, which names the VM&amp;rsquo;s project folder and the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt; when devvm wrote the export. The agents&amp;rsquo; logins are never in an export, and neither is the key that every machine paired with the VM&amp;rsquo;s opencode trusts. An export holds at most 2 GiB (&lt;a href="https://next.devvm.dev/docs/internals/agents/#history-exports"&gt;what an export holds&lt;/a&gt;). The commands:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="nb"&gt;history&lt;/span&gt; &lt;span class="c1"&gt;# list the exports devvm saved&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="nb"&gt;history&lt;/span&gt; &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="c1"&gt;# save this folder&amp;#39;s VM&amp;#39;s agents&amp;#39; history&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="nb"&gt;history&lt;/span&gt; &lt;span class="nb"&gt;export&lt;/span&gt; ~/backup.tgz &lt;span class="c1"&gt;# or save it to a file of your own&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="nb"&gt;history&lt;/span&gt; import &lt;span class="c1"&gt;# put this folder&amp;#39;s newest export into its VM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm history&lt;/code&gt; lists the exports in &lt;code&gt;~/.local/share/devvm/exports&lt;/code&gt;, oldest first, in a table with a header. It shows each export&amp;rsquo;s file, the VM it&amp;rsquo;s of, that VM&amp;rsquo;s folder, the date and time devvm wrote it, and its size, with &lt;code&gt;-&lt;/code&gt; for a folder devvm has no record of. Exports you wrote to a FILE of your own aren&amp;rsquo;t listed, and &lt;code&gt;devvm history&lt;/code&gt; changes nothing and starts no VM.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-history-json"&gt;devvm history &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-history-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-history-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm history --json&lt;/code&gt; prints the same list as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. Each of the &lt;code&gt;exports&lt;/code&gt; has its &lt;code&gt;file&lt;/code&gt;, its &lt;code&gt;vm&lt;/code&gt;, the VM&amp;rsquo;s &lt;code&gt;folder&lt;/code&gt;, which is &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; when devvm has no record of it, the &lt;code&gt;date&lt;/code&gt; devvm wrote it in RFC 3339 with this machine&amp;rsquo;s time zone, and its &lt;code&gt;size&lt;/code&gt; in bytes.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;exports&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;file&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/.local/share/devvm/exports/devvm-website-71a99b1076d92c-20261001-120000.tar.gz&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;vm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm-website-71a99b1076d92c&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;folder&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/code/website&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;date&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-10-01T12:00:00+02:00&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1048576&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="deleting-exports"&gt;Deleting exports&lt;span class="hx:absolute hx:-mt-20" id="deleting-exports"&gt;&lt;/span&gt;
&lt;a href="#deleting-exports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;After &lt;code&gt;devvm rm&lt;/code&gt;, an export is the only copy of that VM&amp;rsquo;s history, so devvm keeps the exports until you ask it to delete them. &lt;code&gt;devvm gc --history&lt;/code&gt; also deletes the exports in that folder, and &lt;code&gt;devvm gc --history --older-than 30d&lt;/code&gt; deletes only those written 30 days ago or more. An export&amp;rsquo;s age counts from the date and time in its name, which is this machine&amp;rsquo;s local time when devvm wrote it, so across a change to or from daylight saving time an export reaches an age such as &lt;code&gt;30d&lt;/code&gt; an hour earlier or later, for &lt;code&gt;--older-than&lt;/code&gt; and for the &lt;code&gt;history.age&lt;/code&gt; &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention setting&lt;/a&gt; alike. gc lists each one by its VM and date first, and in a terminal it asks. Exports you wrote to a FILE of your own stay where they are. To delete only the older ones:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --history --older-than 30d &lt;span class="c1"&gt;# also delete the exports written 30 days ago or more, after asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="importing-history"&gt;Importing history&lt;span class="hx:absolute hx:-mt-20" id="importing-history"&gt;&lt;/span&gt;
&lt;a href="#importing-history" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="nb"&gt;history&lt;/span&gt; import &lt;span class="c1"&gt;# put this folder&amp;#39;s newest export into its VM&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="nb"&gt;history&lt;/span&gt; import ~/backup.tar.gz &lt;span class="c1"&gt;# or an export of your own&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm history import [FILE]&lt;/code&gt; puts an export back into this folder&amp;rsquo;s VM, so the agents&amp;rsquo; transcripts and sessions carry over when you delete a VM and make it again. Without FILE, it imports the newest export in &lt;code&gt;~/.local/share/devvm/exports&lt;/code&gt; that devvm saved for this folder, going by the &lt;code&gt;.folder&lt;/code&gt; file beside each one, and it never picks an export made for another folder. With FILE, it imports that &lt;code&gt;.tar.gz&lt;/code&gt;, such as one you saved with &lt;code&gt;devvm history export FILE&lt;/code&gt;. devvm starts a stopped VM for the import, as it does for an export, and the import works on every VM, whatever its base (&lt;a href="https://next.devvm.dev/docs/internals/agents/#importing-history"&gt;how&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When devvm makes a new VM that has an agent, and it saved an export for the same folder before, it offers that export. In a terminal it asks whether to import it into the new VM, with no as the default. Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, it doesn&amp;rsquo;t ask, and it says which export it found and that &lt;code&gt;devvm history import&lt;/code&gt; in the folder puts it into the VM. devvm imports the export once the VM has started and before its setup, and if the import fails, devvm warns and makes the VM anyway, so you can run &lt;code&gt;devvm history import&lt;/code&gt; later.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An export holds what a VM wrote, so devvm treats it as untrusted, and when it comes from a VM on a less strict tier than the VM you import it into, devvm warns you before it imports. It treats an export with no tier recorded, or a FILE elsewhere, as if it came from an open VM. When an export holds a path outside the agents&amp;rsquo; history folders, devvm imports nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The import leaves out what devvm puts in the VM itself. That&amp;rsquo;s the agents&amp;rsquo; logins, &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, with the old VM&amp;rsquo;s own MCP servers&amp;rsquo; logins in it, &lt;code&gt;~/.codex/auth.json&lt;/code&gt;, and opencode&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt;, &lt;code&gt;account.json&lt;/code&gt;, &lt;code&gt;mcp-auth.json&lt;/code&gt; and &lt;code&gt;bin&lt;/code&gt;. It&amp;rsquo;s also &lt;code&gt;~/.claude.json&lt;/code&gt;, whose copy in the old VM held that VM&amp;rsquo;s own placeholders, and every agent&amp;rsquo;s &lt;a href="#devvms-agent-store"&gt;mounted folders and copied files&lt;/a&gt;, which the new VM&amp;rsquo;s setup links and copies from devvm&amp;rsquo;s agent store.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The import also leaves out the old VM&amp;rsquo;s opencode identity, as an export does: opencode&amp;rsquo;s &lt;code&gt;~/.local/state/opencode/machine&lt;/code&gt;, with the key that every machine paired with the old VM&amp;rsquo;s opencode trusts, and its &lt;code&gt;service.json&lt;/code&gt;, or &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; for another channel&amp;rsquo;s opencode, and &lt;code&gt;pty&lt;/code&gt;, which hold the password of the old VM&amp;rsquo;s opencode service and the access tokens of its terminals&amp;rsquo; daemons. The new VM&amp;rsquo;s opencode makes its own. The import also leaves out the project plugins you approved in opencode&amp;rsquo;s native client, &lt;code&gt;plugin-approvals.json&lt;/code&gt; and &lt;code&gt;plugin-staged&lt;/code&gt;, so opencode asks again before it runs one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;opencode&amp;rsquo;s sessions come without what opencode would act on without asking. Neither an export nor an import keeps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;automations, whose shell commands run on their schedule without asking again&lt;/li&gt;
&lt;li&gt;the requests you said always to allow&lt;/li&gt;
&lt;li&gt;subagents&amp;rsquo; jobs and queued messages&lt;/li&gt;
&lt;li&gt;a project&amp;rsquo;s commands&lt;/li&gt;
&lt;li&gt;opencode&amp;rsquo;s git repositories and worktrees&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No session resumes its turn on its own, and each session keeps only its deny and ask rules (&lt;a href="https://next.devvm.dev/docs/internals/agents/#history-exports"&gt;what an export holds&lt;/a&gt;). In the new VM, make again any automation you want, and opencode asks again before the requests you had always allowed. &lt;code&gt;devvm rm&lt;/code&gt; deletes opencode&amp;rsquo;s worktrees with the VM, so it asks before their uncommitted changes go (&lt;a href="#opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A file or folder the VM already has stays as it is, so importing into a VM that has history of its own adds the export&amp;rsquo;s files without replacing any of its own.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;span class="hx:absolute hx:-mt-20" id="opencodes-worktrees"&gt;&lt;/span&gt;
&lt;a href="#opencodes-worktrees" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm &lt;span class="c1"&gt;# show opencode&amp;#39;s worktrees&amp;#39; uncommitted changes, then ask&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm --no-worktree-check &lt;span class="c1"&gt;# delete the VM without checking them, losing those changes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm update --clean-home &lt;span class="c1"&gt;# a remake that starts from the image&amp;#39;s home folder checks them too&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;opencode makes its worktrees in &lt;code&gt;~/.local/share/opencode/worktree&lt;/code&gt; in the VM, and an export leaves that folder out, so their uncommitted changes go with the VM. Before &lt;code&gt;devvm rm&lt;/code&gt; deletes the VM, and before a command that makes it again with &lt;code&gt;--clean-home&lt;/code&gt; gives it the image&amp;rsquo;s home folder, devvm checks each of those worktrees, starting a stopped VM for the check as a launch does. It asks before what it finds is lost, only in a terminal, so &lt;code&gt;--force&lt;/code&gt; never answers. Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, devvm refuses and keeps the VM, and when only the worktrees have work, the refusal names &lt;code&gt;--no-worktree-check&lt;/code&gt;, which warns and goes ahead without the check.&lt;/p&gt;
&lt;p&gt;devvm asks about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Uncommitted changes:&lt;/strong&gt; it lists the first 20 in all, under each worktree&amp;rsquo;s path.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A detached HEAD&amp;rsquo;s commits&lt;/strong&gt; that no branch, tag or remote-tracking branch in the VM has. To keep them, run &lt;code&gt;git switch -c NAME&lt;/code&gt; in that worktree first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A worktree that git can&amp;rsquo;t read,&lt;/strong&gt; such as one whose entry your project&amp;rsquo;s repository pruned, because it may hold changes devvm can&amp;rsquo;t see.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;More than 100 worktrees,&lt;/strong&gt; of which devvm checks the first 100.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To keep the work, commit it in the worktree, which puts it in your project&amp;rsquo;s repository for a VM that mounts the folder, or in the clone, whose branches &lt;code&gt;devvm rm&lt;/code&gt; offers to fetch, for a &lt;code&gt;--clone&lt;/code&gt; VM (&lt;a href="https://next.devvm.dev/docs/using/clone/#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;). For a &lt;code&gt;--clone&lt;/code&gt; VM, the clone&amp;rsquo;s check and the worktrees&amp;rsquo; share one question, and when the clone has work too, the refusal tells you to run the command in a terminal, as the clone&amp;rsquo;s own does. When reading the worktrees fails, or the VM doesn&amp;rsquo;t start for the check, devvm keeps the VM and names &lt;code&gt;--no-worktree-check&lt;/code&gt;. A command that keeps the VM&amp;rsquo;s home folder, such as &lt;code&gt;devvm update&lt;/code&gt; without &lt;code&gt;--clean-home&lt;/code&gt;, keeps the worktrees too, so it doesn&amp;rsquo;t check them (&lt;a href="https://next.devvm.dev/docs/internals/agents/#opencodes-worktrees"&gt;how devvm checks&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-vms-setup"&gt;The VM&amp;rsquo;s setup&lt;span class="hx:absolute hx:-mt-20" id="the-vms-setup"&gt;&lt;/span&gt;
&lt;a href="#the-vms-setup" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Besides the agents&amp;rsquo; config, every launch sets the VM up from this machine&amp;rsquo;s settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;its hostname, which is the folder&amp;rsquo;s part of the VM&amp;rsquo;s name;&lt;/li&gt;
&lt;li&gt;the timezone (&lt;code&gt;TZ&lt;/code&gt;, else this machine&amp;rsquo;s) and, when it&amp;rsquo;s UTF-8, the locale (&lt;code&gt;LC_ALL&lt;/code&gt;, else &lt;code&gt;LANG&lt;/code&gt;);&lt;/li&gt;
&lt;li&gt;git&amp;rsquo;s &lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt;, as git has them in the project folder;&lt;/li&gt;
&lt;li&gt;telemetry off where an environment variable can&amp;rsquo;t turn it off, which is Go&amp;rsquo;s, and Codex&amp;rsquo;s analytics and metrics;&lt;/li&gt;
&lt;li&gt;every agent&amp;rsquo;s environment variables, which turn off its self-update and its telemetry (&lt;a href="#supported-agents"&gt;supported agents&lt;/a&gt;);&lt;/li&gt;
&lt;li&gt;every toolchain&amp;rsquo;s environment variables, such as the ones that turn off .NET&amp;rsquo;s telemetry and send &lt;code&gt;npm i -g&lt;/code&gt; into your home, and the folders where the toolchains&amp;rsquo; global installs go, on the &lt;code&gt;PATH&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;toolchains&lt;/a&gt;);&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(devvm)&lt;/code&gt; at the start of the prompt.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On every network tier, the launch also installs the VM&amp;rsquo;s own CA and the next one, points apt, sudo, ssh, the &lt;a href="https://next.devvm.dev/docs/using/images/#docker"&gt;docker layer&lt;/a&gt;&amp;rsquo;s Docker and the &lt;a href="https://next.devvm.dev/docs/using/images/#nix"&gt;nix layer&lt;/a&gt;&amp;rsquo;s Nix at the proxy, and adds &lt;code&gt;devvm-why&lt;/code&gt;, which shows what the proxy blocked lately. It also tells the agents, in &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; and &lt;code&gt;~/.codex/AGENTS.md&lt;/code&gt;, why a request may fail (&lt;a href="https://next.devvm.dev/docs/safety/network/#inside-the-vm"&gt;inside the VM&lt;/a&gt;). The VM&amp;rsquo;s secrets go in &lt;code&gt;~/.config/devvm/env&lt;/code&gt; in the VM, which login shells read, and that file holds their placeholders.&lt;/p&gt;</description></item><item><title>Docker Sandboxes</title><link>https://next.devvm.dev/docs/compared/docker-sandboxes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/compared/docker-sandboxes/</guid><description>
&lt;p&gt;Docker Sandboxes, the &lt;code&gt;sbx&lt;/code&gt; command, is the tool closest to devvm: each sandbox is a VM with its own kernel on your machine, the project folder is mounted read-write, outbound traffic goes through a proxy on your machine, and API keys and agents&amp;rsquo; logins stay outside the VM. This page sets the two side by side. Last checked on 2026-11-08 against Docker&amp;rsquo;s docs, which each row links to, and against Docker&amp;rsquo;s isolation and network rules pages again on 2026-11-12.&lt;/p&gt;
&lt;h2 data-hextra-search-id="whats-the-same"&gt;What&amp;rsquo;s the same&lt;span class="hx:absolute hx:-mt-20" id="whats-the-same"&gt;&lt;/span&gt;
&lt;a href="#whats-the-same" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A VM with its own kernel.&lt;/strong&gt; Docker&amp;rsquo;s sandboxes are microVMs with their own Linux kernel and Docker Engine, and the agent runs as a user with sudo (&lt;a href="https://docs.docker.com/ai/sandboxes/security/isolation/" target="_blank" rel="noopener"&gt;isolation&lt;/a&gt;). devvm&amp;rsquo;s VMs are full Lima VMs, whose user also has sudo.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The folder mounted, or a clone.&lt;/strong&gt; Both mount the project folder read-write by default, and both have a mode in which the VM works on a clone of its own instead (&lt;a href="https://docs.docker.com/ai/sandboxes/security/isolation/" target="_blank" rel="noopener"&gt;isolation&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;working on a clone&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Placeholders for API keys.&lt;/strong&gt; In both, the VM holds a placeholder, and a proxy on your machine puts the real value into requests (&lt;a href="https://docs.docker.com/ai/sandboxes/configuration/credentials/" target="_blank" rel="noopener"&gt;credentials&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/safety/network/#secrets"&gt;secrets&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agents&amp;rsquo; logins on your machine.&lt;/strong&gt; Both keep the logins of the agents they support outside the VM and give the VM placeholders, and in both, one login for each agent serves every VM. Docker Sandboxes does this for Claude Code, Codex, Cursor and Droid (&lt;a href="https://docs.docker.com/ai/sandboxes/configuration/credentials/" target="_blank" rel="noopener"&gt;credentials&lt;/a&gt;), and devvm for Claude Code, Codex, opencode and Cursor&amp;rsquo;s CLI, and for pi&amp;rsquo;s API keys (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#logins-made-in-a-vm"&gt;coding agents&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rules by method and path.&lt;/strong&gt; Both let a rule for a host name its HTTP methods and its path, so a VM can read from an API without changing anything there (&lt;a href="https://docs.docker.com/ai/governance/local/network-rules/" target="_blank" rel="noopener"&gt;network rules&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/safety/network/#rules-by-method-and-path"&gt;rules by method and path&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="what-differs"&gt;What differs&lt;span class="hx:absolute hx:-mt-20" id="what-differs"&gt;&lt;/span&gt;
&lt;a href="#what-differs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;devvm&lt;/th&gt;
&lt;th&gt;Docker Sandboxes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Source and account&lt;/td&gt;
&lt;td&gt;open source (MIT), no account&lt;/td&gt;
&lt;td&gt;closed source, a Docker sign-in (&lt;a href="https://docs.docker.com/ai/sandboxes/install/" target="_blank" rel="noopener"&gt;install&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Usage data&lt;/td&gt;
&lt;td&gt;none; a release check at most once a day, which you can turn off&lt;/td&gt;
&lt;td&gt;usage data, with your Docker username when you&amp;rsquo;re signed in, unless you turn it off (&lt;a href="https://docs.docker.com/ai/sandboxes/faq/" target="_blank" rel="noopener"&gt;FAQ&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hosts&lt;/td&gt;
&lt;td&gt;macOS 13 or newer and Linux&lt;/td&gt;
&lt;td&gt;macOS 14 or newer on Apple silicon, Windows 11 and Ubuntu 24.04 or newer, plus Docker&amp;rsquo;s cloud (&lt;a href="https://docs.docker.com/ai/sandboxes/install/" target="_blank" rel="noopener"&gt;install&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network default&lt;/td&gt;
&lt;td&gt;the allowlist tier&lt;/td&gt;
&lt;td&gt;a preset you choose at first run (&lt;a href="https://docs.docker.com/ai/governance/local/network-rules/" target="_blank" rel="noopener"&gt;network rules&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rules&lt;/td&gt;
&lt;td&gt;host and port, and HTTP method and path&lt;/td&gt;
&lt;td&gt;host and port, and HTTP method, path and URL query (&lt;a href="https://docs.docker.com/ai/governance/local/network-rules/" target="_blank" rel="noopener"&gt;network rules&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learning the hosts a VM needs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--network learn&lt;/code&gt;, then &lt;code&gt;devvm network lock&lt;/code&gt; keeps the hosts you choose (&lt;a href="https://next.devvm.dev/docs/safety/network/#learning-the-hosts-a-vm-needs"&gt;learning&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;none on its network rules page, which has a log of blocked connections (&lt;a href="https://docs.docker.com/ai/governance/local/network-rules/" target="_blank" rel="noopener"&gt;network rules&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.git&lt;/code&gt; in the folder&lt;/td&gt;
&lt;td&gt;hooks and config locked on macOS, and read-only in the VM on Linux where the kernel allows it, or watched where it doesn&amp;rsquo;t, for the folder&amp;rsquo;s own repo and each repo nested up to four folders down (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;.git protection&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;writable by the agent in direct mode, which the docs warn about, along with CI and editor config (&lt;a href="https://docs.docker.com/ai/sandboxes/security/isolation/" target="_blank" rel="noopener"&gt;isolation&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The clone&lt;/td&gt;
&lt;td&gt;your local branches, tags, uncommitted changes, stash, the repo&amp;rsquo;s settings and hooks, submodules and Git LFS files, with the work fetched back by &lt;code&gt;devvm clone fetch&lt;/code&gt; as &lt;code&gt;devvm/&amp;lt;branch&amp;gt;&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/clone/#whats-copied"&gt;what&amp;rsquo;s copied&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;a private clone with its own index, refs and working tree, fetched back through a &lt;code&gt;sandbox-&amp;lt;sandbox-name&amp;gt;&lt;/code&gt; remote, and the docs don&amp;rsquo;t say what it copies (&lt;a href="https://docs.docker.com/ai/sandboxes/security/isolation/" target="_blank" rel="noopener"&gt;isolation&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&amp;rsquo;s login&lt;/td&gt;
&lt;td&gt;you log in with &lt;code&gt;devvm agent login claude&lt;/code&gt;, or in the VM; devvm keeps the login and refreshes it on your machine, and the VM gets placeholders&lt;/td&gt;
&lt;td&gt;you log in with &lt;code&gt;/login&lt;/code&gt; inside the sandbox, and a proxy on the host takes the tokens from the login&amp;rsquo;s token exchange, keeps them in your host&amp;rsquo;s keychain and gives the sandbox placeholders; that one login serves every sandbox (&lt;a href="https://docs.docker.com/ai/sandboxes/agents/claude-code/" target="_blank" rel="noopener"&gt;Claude Code&lt;/a&gt;, &lt;a href="https://docs.docker.com/ai/sandboxes/configuration/credentials/" target="_blank" rel="noopener"&gt;credentials&lt;/a&gt;, &lt;a href="https://github.com/docker/sbx-releases/issues/74" target="_blank" rel="noopener"&gt;one login&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSH agent&lt;/td&gt;
&lt;td&gt;off by default&lt;/td&gt;
&lt;td&gt;forwarded by default (&lt;a href="https://docs.docker.com/ai/sandboxes/security/isolation/" target="_blank" rel="noopener"&gt;isolation&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP servers&lt;/td&gt;
&lt;td&gt;run in the VM&lt;/td&gt;
&lt;td&gt;local stdio servers run on your machine (&lt;a href="https://docs.docker.com/ai/sandboxes/security/" target="_blank" rel="noopener"&gt;security&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ports&lt;/td&gt;
&lt;td&gt;every port from 1024 up forwarded to &lt;code&gt;localhost&lt;/code&gt; unless you limit them&lt;/td&gt;
&lt;td&gt;none until you publish one (&lt;a href="https://docs.docker.com/ai/sandboxes/usage/" target="_blank" rel="noopener"&gt;usage&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Toolchains&lt;/td&gt;
&lt;td&gt;shared read-only between VMs, detected from the project&amp;rsquo;s files&lt;/td&gt;
&lt;td&gt;in each sandbox&amp;rsquo;s own image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agents&lt;/td&gt;
&lt;td&gt;Claude Code, Codex, opencode, pi and Cursor&amp;rsquo;s CLI&lt;/td&gt;
&lt;td&gt;Claude Code, Codex, Copilot, Cursor, Devin, Docker Agent, Droid, Gemini, Kiro and OpenCode (&lt;a href="https://docs.docker.com/ai/sandboxes/agents/" target="_blank" rel="noopener"&gt;agents&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Images from the clipboard&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm paste&lt;/code&gt; sends an image, a PDF or a copied file into the VM, and never text (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#pasting-images"&gt;pasting images&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;the sandbox can read images from the host&amp;rsquo;s clipboard if you turn that on, and can write text there but not read it (&lt;a href="https://docs.docker.com/ai/sandboxes/security/isolation/" target="_blank" rel="noopener"&gt;isolation&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snapshots&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;a sandbox saved as a template (&lt;a href="https://docs.docker.com/reference/cli/sbx/template/save/" target="_blank" rel="noopener"&gt;template save&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secrets from other stores&lt;/td&gt;
&lt;td&gt;saved with &lt;code&gt;devvm secret set&lt;/code&gt;, each with the hosts, methods and paths it goes to (&lt;a href="https://next.devvm.dev/docs/safety/network/#your-own-secrets"&gt;your own secrets&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;1Password, AWS Secrets Manager or a command (&lt;a href="https://docs.docker.com/ai/sandboxes/configuration/credentials/" target="_blank" rel="noopener"&gt;credentials&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secrets on Linux&lt;/td&gt;
&lt;td&gt;in files only you can read&lt;/td&gt;
&lt;td&gt;in a file only you can read when no Secret Service runs (&lt;a href="https://docs.docker.com/ai/sandboxes/configuration/credentials/" target="_blank" rel="noopener"&gt;credentials&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="choosing-between-them"&gt;Choosing between them&lt;span class="hx:absolute hx:-mt-20" id="choosing-between-them"&gt;&lt;/span&gt;
&lt;a href="#choosing-between-them" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Choose Docker Sandboxes&lt;/strong&gt; if you need Windows, rules by URL query, one of the agents devvm doesn&amp;rsquo;t support, a sandbox saved as a template, or a sandbox you can move to Docker&amp;rsquo;s cloud.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Choose devvm&lt;/strong&gt; if you want open source without an account, toolchains shared between projects, &lt;code&gt;.git&lt;/code&gt; protected from the VM in the folder you work in and in the repos nested in it, or a VM that learns the hosts it needs before you lock its allowlist.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Installing</title><link>https://next.devvm.dev/docs/getting-started/install/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/getting-started/install/</guid><description>
&lt;p&gt;This page gets devvm installed and checked on your machine. &lt;a href="https://next.devvm.dev/docs/using/upgrading/"&gt;Upgrading and uninstalling&lt;/a&gt; covers what comes later.&lt;/p&gt;
&lt;h2 data-hextra-search-id="installing-devvm"&gt;Installing devvm&lt;span class="hx:absolute hx:-mt-20" id="installing-devvm"&gt;&lt;/span&gt;
&lt;a href="#installing-devvm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Run the command for your system:&lt;/p&gt;
&lt;div class="devvm-install"&gt;
&lt;div class="hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain"&gt;
&lt;div class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800" role="tablist"&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-install-0-1" role="tab" type="button" aria-controls="tabs-panel-tabs-install-0-1" aria-selected="true" tabindex="0" data-state="selected"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 4h1V3h1V2h1V1H6v1H5Zm-3 7h1v-1H2Zm1 1h2v-1H3Zm-2-2h1V5H1Zm4 1h1v-1H5Zm1 1h2v-1H6Zm2-1h1v-1H8ZM2 5h2V4H2Zm7 5h1V9H9ZM4 6h3V5H4Zm4 3h1V6H8ZM7 5h2V4H7Zm2 1h1V5H9Zm0 0"/&gt;&lt;/svg&gt;macOS&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-install-0-2" role="tab" type="button" aria-controls="tabs-panel-tabs-install-0-2" aria-selected="false" tabindex="-1"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M3 1h5v1H3ZM2 2h1v1H2ZM8 2h1v1H8ZM2 3h1v1H2ZM4 3h1v1H4ZM6 3h1v1H6ZM8 3h1v1H8ZM2 4h1v1H2ZM8 4h1v1H8ZM1 5h1v1H1ZM4 5h3v1H4ZM9 5h1v1H9ZM0 6h1v1H0ZM3 6h1v1H3ZM7 6h1v1H7ZM10 6h1v1H10ZM0 7h1v1H0ZM2 7h1v1H2ZM8 7h1v1H8ZM10 7h1v1H10ZM0 8h1v1H0ZM2 8h1v1H2ZM8 8h1v1H8ZM10 8h1v1H10ZM1 9h2v1H1ZM8 9h2v1H8ZM2 10h7v1H2ZM1 11h3v1H1ZM7 11h3v1H7Z"/&gt;&lt;/svg&gt;Linux&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-install-0-1" role="tabpanel" aria-labelledby="tabs-tab-tabs-install-0-1" aria-hidden="false" tabindex="0" data-state="selected"&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Install devvm, and Lima with it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew trust --formula devvmhq/tap/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install devvmhq/tap/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The install script in the Linux tab also works on macOS.&lt;/p&gt;&lt;/div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-install-0-2" role="tabpanel" aria-labelledby="tabs-tab-tabs-install-0-2" aria-hidden="true"&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Install devvm and what it needs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://github.com/devvmhq/devvm/releases/latest/download/install.sh &lt;span class="p"&gt;|&lt;/span&gt; bash&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The script asks before it installs Lima, QEMU or access to &lt;code&gt;/dev/kvm&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;script&gt;
(() =&gt; {
const group = document.currentScript.parentElement;
const platform = [navigator.userAgentData?.platform, navigator.platform, navigator.userAgent].join(" ");
if (!/linux/i.test(platform) || /android/i.test(platform)) return;
const select = (elements, attribute, on, off) =&gt;
elements.forEach((element, i) =&gt; {
const selected = i === 1;
element.dataset.state = selected ? "selected" : "";
element.setAttribute(attribute, selected ? on : off);
if (selected) element.tabIndex = 0;
else if (attribute === "aria-selected") element.tabIndex = -1;
else element.removeAttribute("tabindex");
});
select(group.querySelectorAll("[role=tab]"), "aria-selected", "true", "false");
select(group.querySelectorAll("[role=tabpanel]"), "aria-hidden", "false", "true");
})();
&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;Install devvm one way, with Homebrew or with the install script, but not both (&lt;a href="https://next.devvm.dev/docs/using/upgrading/#one-devvm"&gt;one devvm&lt;/a&gt;). The install script needs &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;tar&lt;/code&gt;, and &lt;code&gt;sha256sum&lt;/code&gt; or &lt;code&gt;shasum&lt;/code&gt;, it never needs sudo for devvm itself, and it checks the download&amp;rsquo;s checksum and signature before it installs anything (&lt;a href="https://next.devvm.dev/docs/internals/install/"&gt;Installing and updating&lt;/a&gt;). To check the script itself against devvm&amp;rsquo;s release key before you run it, follow &lt;a href="https://next.devvm.dev/docs/internals/install/#checking-the-install-script"&gt;checking the install script&lt;/a&gt;. It takes options after &lt;code&gt;bash -s --&lt;/code&gt;, as in &lt;code&gt;curl -fsSL … | bash -s -- --yes&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--yes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;answer yes to every question&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--version 0.1.0&lt;/code&gt;, or &lt;code&gt;DEVVM_VERSION=0.1.0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;install that release&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--no-deps&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;install devvm only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;install even when Homebrew installed devvm, which leaves you with two copies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_PREFIX=/some/dir&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;install under that folder instead of &lt;code&gt;~/.local&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="requirements"&gt;Requirements&lt;span class="hx:absolute hx:-mt-20" id="requirements"&gt;&lt;/span&gt;
&lt;a href="#requirements" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm runs its VMs on &lt;a href="https://next.devvm.dev/docs/backends/lima/#requirements"&gt;Lima&lt;/a&gt;, its default &lt;a href="https://next.devvm.dev/docs/backends/"&gt;backend&lt;/a&gt;. It&amp;rsquo;s tested on Apple silicon Macs and on Linux on both arm64 and x86_64, but not yet on Intel Macs (&lt;a href="https://next.devvm.dev/docs/using/limits/#intel-macs"&gt;Known limits&lt;/a&gt;). The last column says whether the install script offers to install a requirement for you.&lt;/p&gt;
&lt;div class="devvm-install"&gt;
&lt;div class="hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain"&gt;
&lt;div class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800" role="tablist"&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-1-1" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-1-1" aria-selected="true" tabindex="0" data-state="selected"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 4h1V3h1V2h1V1H6v1H5Zm-3 7h1v-1H2Zm1 1h2v-1H3Zm-2-2h1V5H1Zm4 1h1v-1H5Zm1 1h2v-1H6Zm2-1h1v-1H8ZM2 5h2V4H2Zm7 5h1V9H9ZM4 6h3V5H4Zm4 3h1V6H8ZM7 5h2V4H7Zm2 1h1V5H9Zm0 0"/&gt;&lt;/svg&gt;macOS&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-1-2" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-1-2" aria-selected="false" tabindex="-1"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M3 1h5v1H3ZM2 2h1v1H2ZM8 2h1v1H8ZM2 3h1v1H2ZM4 3h1v1H4ZM6 3h1v1H6ZM8 3h1v1H8ZM2 4h1v1H2ZM8 4h1v1H8ZM1 5h1v1H1ZM4 5h3v1H4ZM9 5h1v1H9ZM0 6h1v1H0ZM3 6h1v1H3ZM7 6h1v1H7ZM10 6h1v1H10ZM0 7h1v1H0ZM2 7h1v1H2ZM8 7h1v1H8ZM10 7h1v1H10ZM0 8h1v1H0ZM2 8h1v1H2ZM8 8h1v1H8ZM10 8h1v1H10ZM1 9h2v1H1ZM8 9h2v1H8ZM2 10h7v1H2ZM1 11h3v1H1ZM7 11h3v1H7Z"/&gt;&lt;/svg&gt;Linux&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-1-1" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-1-1" aria-hidden="false" tabindex="0" data-state="selected"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You need&lt;/th&gt;
&lt;th&gt;To check&lt;/th&gt;
&lt;th&gt;To get it&lt;/th&gt;
&lt;th&gt;The install script&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;macOS at &lt;a href="../backends/lima.md#requirements"&gt;Lima&amp;rsquo;s minimum&lt;/a&gt;, on arm64 or x86_64&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sw_vers&lt;/code&gt; and &lt;code&gt;uname -m&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8 GiB of memory and 4 CPUs, recommended&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sysctl hw.memsize hw.ncpu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lima at &lt;a href="../backends/lima.md#requirements"&gt;its minimum&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;brew install lima&lt;/code&gt;, or &lt;a href="https://lima-vm.io/docs/installation/" target="_blank" rel="noopener"&gt;Lima&amp;rsquo;s install guide&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-yes"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 9h1V8h1V7h1V6h1V5h1V4h1V3H9v1H8v1H7v1H6v1H5V6H4V5H2v1h1v1h1v1h1Zm-3 2h1v-1H2Zm-1-1h1V9H1ZM0 9h1V4H0Zm3 3h5v-1H3ZM1 4h1V3H1Zm7 7h1v-1H8ZM2 3h1V2H2Zm7 7h1V9H9Zm1-1h1V6h-1ZM3 2h5V1H3Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; offers it: Homebrew&amp;rsquo;s when you have Homebrew, otherwise Lima&amp;rsquo;s latest release into &lt;code&gt;~/.local&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenSSH 8.7 or newer, for ssh and editors by name (&lt;a href="../using/ssh.md#ssh-access-by-name"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ssh -V&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;macOS 13&amp;rsquo;s has it&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker Desktop, only for &lt;code&gt;--from&lt;/code&gt; with an &lt;a href="../using/from.md#images-only-docker-has"&gt;image only Docker has&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;docker version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Docker Desktop&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-1-2" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-1-2" aria-hidden="true"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You need&lt;/th&gt;
&lt;th&gt;To check&lt;/th&gt;
&lt;th&gt;To get it&lt;/th&gt;
&lt;th&gt;The install script&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Linux on arm64 or x86_64&lt;/td&gt;
&lt;td&gt;&lt;code&gt;uname -m&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8 GiB of memory and 4 CPUs, recommended&lt;/td&gt;
&lt;td&gt;&lt;code&gt;free -g&lt;/code&gt; and &lt;code&gt;nproc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lima at &lt;a href="../backends/lima.md#requirements"&gt;its minimum&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;brew install lima&lt;/code&gt;, or &lt;a href="https://lima-vm.io/docs/installation/" target="_blank" rel="noopener"&gt;Lima&amp;rsquo;s install guide&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-yes"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 9h1V8h1V7h1V6h1V5h1V4h1V3H9v1H8v1H7v1H6v1H5V6H4V5H2v1h1v1h1v1h1Zm-3 2h1v-1H2Zm-1-1h1V9H1ZM0 9h1V4H0Zm3 3h5v-1H3ZM1 4h1V3H1Zm7 7h1v-1H8ZM2 3h1V2H2Zm7 7h1V9H9Zm1-1h1V6h-1ZM3 2h5V1H3Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; offers it: Homebrew&amp;rsquo;s when you have Homebrew, otherwise Lima&amp;rsquo;s latest release into &lt;code&gt;~/.local&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;QEMU&lt;/td&gt;
&lt;td&gt;&lt;code&gt;qemu-img --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your package manager: apt, dnf, pacman or zypper&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-yes"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 9h1V8h1V7h1V6h1V5h1V4h1V3H9v1H8v1H7v1H6v1H5V6H4V5H2v1h1v1h1v1h1Zm-3 2h1v-1H2Zm-1-1h1V9H1ZM0 9h1V4H0Zm3 3h5v-1H3ZM1 4h1V3H1Zm7 7h1v-1H8ZM2 3h1V2H2Zm7 7h1V9H9Zm1-1h1V6h-1ZM3 2h5V1H3Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; offers it, with sudo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access to &lt;code&gt;/dev/kvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ls -l /dev/kvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo usermod -aG kvm $USER&lt;/code&gt;, then log out and back in&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-yes"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 9h1V8h1V7h1V6h1V5h1V4h1V3H9v1H8v1H7v1H6v1H5V6H4V5H2v1h1v1h1v1h1Zm-3 2h1v-1H2Zm-1-1h1V9H1ZM0 9h1V4H0Zm3 3h5v-1H3ZM1 4h1V3H1Zm7 7h1v-1H8ZM2 3h1V2H2Zm7 7h1V9H9Zm1-1h1V6h-1ZM3 2h5V1H3Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; offers it, with sudo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenSSH 8.7 or newer, for ssh and editors by name (&lt;a href="../using/ssh.md#ssh-access-by-name"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ssh -V&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ubuntu 22.04&amp;rsquo;s has it&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker&amp;rsquo;s engine, only for &lt;code&gt;--from&lt;/code&gt; with an &lt;a href="../using/from.md#images-only-docker-has"&gt;image only Docker has&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;docker version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Docker&amp;rsquo;s engine&lt;/td&gt;
&lt;td&gt;&lt;span class="devvm-no"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M1 2H0v9h1Zm0 0h9V1H1Zm0 10h9v-1H1Zm2-3h1V8H3Zm1-1h1V7H4Zm1-1h1V6H5ZM3 5h1V4H3Zm1 1h1V5H4Zm2 2h1V7H6Zm1 1h1V8H7ZM6 6h1V5H6Zm1-1h1V4H7Zm3 6h1V2h-1Zm0 0"/&gt;&lt;/svg&gt;&lt;/span&gt; doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;script&gt;
(() =&gt; {
const group = document.currentScript.parentElement;
const platform = [navigator.userAgentData?.platform, navigator.platform, navigator.userAgent].join(" ");
if (!/linux/i.test(platform) || /android/i.test(platform)) return;
const select = (elements, attribute, on, off) =&gt;
elements.forEach((element, i) =&gt; {
const selected = i === 1;
element.dataset.state = selected ? "selected" : "";
element.setAttribute(attribute, selected ? on : off);
if (selected) element.tabIndex = 0;
else if (attribute === "aria-selected") element.tabIndex = -1;
else element.removeAttribute("tabindex");
});
select(group.querySelectorAll("[role=tab]"), "aria-selected", "true", "false");
select(group.querySelectorAll("[role=tabpanel]"), "aria-hidden", "false", "true");
})();
&lt;/script&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A smaller machine works too.&lt;/strong&gt; devvm gives base fewer CPUs and less memory there (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;size and ports&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your first VM needs 8 GiB of free disk space&lt;/strong&gt;, for the base image, the VM&amp;rsquo;s own image and the shared tools (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#free-space"&gt;free space&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Everything else goes inside the VMs,&lt;/strong&gt; including the toolchains, the coding agents and Docker for your projects (&lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;docker layer&lt;/a&gt;), so you don&amp;rsquo;t install any of the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#supported-agents"&gt;supported coding agents&lt;/a&gt; on this machine (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux hosts&lt;/strong&gt; have a few limits, such as &lt;code&gt;.git&lt;/code&gt; protection that needs a kernel which lets devvm use a user namespace, which Ubuntu 23.10 and newer don&amp;rsquo;t by default (&lt;a href="https://next.devvm.dev/docs/using/limits/#linux-hosts"&gt;Known limits&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="checking-what-devvm-needs"&gt;Checking what devvm needs&lt;span class="hx:absolute hx:-mt-20" id="checking-what-devvm-needs"&gt;&lt;/span&gt;
&lt;a href="#checking-what-devvm-needs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Run &lt;code&gt;devvm doctor&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm doctor&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It lists everything that devvm&amp;rsquo;s backend, Lima, needs and doesn&amp;rsquo;t have, each with what to do, then its warnings, such as a machine with less than the recommended memory, and it fails only when something is missing. devvm never installs anything on this machine itself, and every command that needs the backend checks it first and stops at the first thing that&amp;rsquo;s missing. &lt;a href="https://next.devvm.dev/docs/internals/install/#what-devvm-doctor-checks"&gt;What devvm doctor checks&lt;/a&gt; lists each check and warning.&lt;/p&gt;
&lt;p&gt;When &lt;code&gt;devvm doctor&lt;/code&gt; finds nothing missing, you&amp;rsquo;re ready for &lt;a href="https://next.devvm.dev/docs/getting-started/first-vm/"&gt;your first VM&lt;/a&gt;. Before you make it, read &lt;a href="https://next.devvm.dev/docs/safety/#the-habits"&gt;staying safe&lt;/a&gt;, which lists the habits that close most of what devvm leaves open.&lt;/p&gt;</description></item><item><title>Lima</title><link>https://next.devvm.dev/docs/backends/lima/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/backends/lima/</guid><description>
&lt;p&gt;&lt;a href="https://lima-vm.io" target="_blank" rel="noopener"&gt;Lima&lt;/a&gt; is devvm&amp;rsquo;s backend, so every new VM runs on it (&lt;a href="https://next.devvm.dev/docs/backends/#a-vms-backend"&gt;a VM&amp;rsquo;s backend&lt;/a&gt;). Each project gets a full VM with a kernel of its own, which runs on Apple&amp;rsquo;s Virtualization framework (&lt;code&gt;vz&lt;/code&gt;) on macOS and on QEMU on Linux. &lt;a href="https://next.devvm.dev/docs/internals/lima/"&gt;How it works › Lima&lt;/a&gt; explains how devvm sets up, confines and clones Lima&amp;rsquo;s VMs.&lt;/p&gt;
&lt;h2 data-hextra-search-id="requirements"&gt;Requirements&lt;span class="hx:absolute hx:-mt-20" id="requirements"&gt;&lt;/span&gt;
&lt;a href="#requirements" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="devvm-install"&gt;
&lt;div class="hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain"&gt;
&lt;div class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800" role="tablist"&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-0-1" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-0-1" aria-selected="true" tabindex="0" data-state="selected"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 4h1V3h1V2h1V1H6v1H5Zm-3 7h1v-1H2Zm1 1h2v-1H3Zm-2-2h1V5H1Zm4 1h1v-1H5Zm1 1h2v-1H6Zm2-1h1v-1H8ZM2 5h2V4H2Zm7 5h1V9H9ZM4 6h3V5H4Zm4 3h1V6H8ZM7 5h2V4H7Zm2 1h1V5H9Zm0 0"/&gt;&lt;/svg&gt;macOS&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-0-2" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-0-2" aria-selected="false" tabindex="-1"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M3 1h5v1H3ZM2 2h1v1H2ZM8 2h1v1H8ZM2 3h1v1H2ZM4 3h1v1H4ZM6 3h1v1H6ZM8 3h1v1H8ZM2 4h1v1H2ZM8 4h1v1H8ZM1 5h1v1H1ZM4 5h3v1H4ZM9 5h1v1H9ZM0 6h1v1H0ZM3 6h1v1H3ZM7 6h1v1H7ZM10 6h1v1H10ZM0 7h1v1H0ZM2 7h1v1H2ZM8 7h1v1H8ZM10 7h1v1H10ZM0 8h1v1H0ZM2 8h1v1H2ZM8 8h1v1H8ZM10 8h1v1H10ZM1 9h2v1H1ZM8 9h2v1H8ZM2 10h7v1H2ZM1 11h3v1H1ZM7 11h3v1H7Z"/&gt;&lt;/svg&gt;Linux&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-0-1" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-0-1" aria-hidden="false" tabindex="0" data-state="selected"&gt;&lt;ul&gt;
&lt;li&gt;macOS 13 or newer, on arm64 or x86_64.&lt;/li&gt;
&lt;li&gt;Lima 2.2 or newer, with &lt;code&gt;limactl&lt;/code&gt; on your &lt;code&gt;PATH&lt;/code&gt;. Install it with Homebrew, &lt;code&gt;brew install lima&lt;/code&gt;, or see &lt;a href="https://lima-vm.io/docs/installation/" target="_blank" rel="noopener"&gt;Lima&amp;rsquo;s install guide&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-0-2" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-0-2" aria-hidden="true"&gt;&lt;ul&gt;
&lt;li&gt;Linux on arm64 or x86_64.&lt;/li&gt;
&lt;li&gt;Lima 2.2 or newer, with &lt;code&gt;limactl&lt;/code&gt; on your &lt;code&gt;PATH&lt;/code&gt;. Install it with Homebrew, &lt;code&gt;brew install lima&lt;/code&gt;, or see &lt;a href="https://lima-vm.io/docs/installation/" target="_blank" rel="noopener"&gt;Lima&amp;rsquo;s install guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;QEMU from your package manager: &lt;code&gt;qemu-system-aarch64&lt;/code&gt; (or &lt;code&gt;qemu-system-x86_64&lt;/code&gt;) and &lt;code&gt;qemu-img&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Read and write access to &lt;code&gt;/dev/kvm&lt;/code&gt;. That means virtualization is turned on in the firmware (or nested virtualization, in a VM), and your user is in the &lt;code&gt;kvm&lt;/code&gt; group.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;script&gt;
(() =&gt; {
const group = document.currentScript.parentElement;
const platform = [navigator.userAgentData?.platform, navigator.platform, navigator.userAgent].join(" ");
if (!/linux/i.test(platform) || /android/i.test(platform)) return;
const select = (elements, attribute, on, off) =&gt;
elements.forEach((element, i) =&gt; {
const selected = i === 1;
element.dataset.state = selected ? "selected" : "";
element.setAttribute(attribute, selected ? on : off);
if (selected) element.tabIndex = 0;
else if (attribute === "aria-selected") element.tabIndex = -1;
else element.removeAttribute("tabindex");
});
select(group.querySelectorAll("[role=tab]"), "aria-selected", "true", "false");
select(group.querySelectorAll("[role=tabpanel]"), "aria-hidden", "false", "true");
})();
&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;Every command that needs Lima checks these first and stops at the first one that&amp;rsquo;s missing. &lt;code&gt;devvm doctor&lt;/code&gt; lists them all, each with the command that installs it where there&amp;rsquo;s one to run. That&amp;rsquo;s Homebrew&amp;rsquo;s command for Lima when you have Homebrew, your package manager&amp;rsquo;s for QEMU (apt, dnf, pacman or zypper), and &lt;code&gt;sudo usermod -aG kvm $USER&lt;/code&gt; for &lt;code&gt;/dev/kvm&lt;/code&gt;, after which you log in again. devvm never runs them itself (&lt;a href="https://next.devvm.dev/docs/getting-started/install/#checking-what-devvm-needs"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvms-lima-home"&gt;devvm&amp;rsquo;s Lima home&lt;span class="hx:absolute hx:-mt-20" id="devvms-lima-home"&gt;&lt;/span&gt;
&lt;a href="#devvms-lima-home" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm keeps its VMs and images in a Lima home of its own, &lt;code&gt;~/.local/share/devvm/lima&lt;/code&gt; (under &lt;code&gt;$XDG_DATA_HOME&lt;/code&gt; when that&amp;rsquo;s set), whatever &lt;code&gt;LIMA_HOME&lt;/code&gt; says. Your own Lima VMs stay where they are, and Lima settings you made for them don&amp;rsquo;t reach devvm&amp;rsquo;s VMs. Because of this, a plain &lt;code&gt;limactl list&lt;/code&gt; doesn&amp;rsquo;t show devvm&amp;rsquo;s VMs, so run &lt;code&gt;devvm limactl list&lt;/code&gt; instead (&lt;a href="#running-limactl"&gt;below&lt;/a&gt;). To keep devvm&amp;rsquo;s VMs somewhere else, such as a sandbox or a shorter path, set &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; to that folder.&lt;/p&gt;
&lt;p&gt;Lima adds &lt;code&gt;_config/default.yaml&lt;/code&gt; and &lt;code&gt;_config/override.yaml&lt;/code&gt; from its home to every VM it starts, so devvm refuses to start a VM while devvm&amp;rsquo;s Lima home holds either file, and you move them out of it to go on. devvm also refuses a VM that has a network devvm didn&amp;rsquo;t give it, because a second network would get around the VM&amp;rsquo;s proxy, so remove the &lt;code&gt;networks:&lt;/code&gt; entries from the file that devvm names (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;why&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="running-limactl"&gt;Running limactl&lt;span class="hx:absolute hx:-mt-20" id="running-limactl"&gt;&lt;/span&gt;
&lt;a href="#running-limactl" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm limactl ARGS...&lt;/code&gt; runs &lt;code&gt;limactl&lt;/code&gt; with ARGS on devvm&amp;rsquo;s Lima home, in devvm&amp;rsquo;s place. Its input, output, terminal and exit code are &lt;code&gt;limactl&lt;/code&gt;&amp;rsquo;s, and devvm passes every option on to it, &lt;code&gt;--help&lt;/code&gt; included. &lt;code&gt;devvm help limactl&lt;/code&gt; shows devvm&amp;rsquo;s own help for the command.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm limactl list
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm limactl shell --start devvm-img-&amp;lt;key&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;It runs from devvm&amp;rsquo;s data folder, as devvm&amp;rsquo;s own &lt;code&gt;limactl&lt;/code&gt; commands do, so give files by their absolute path.&lt;/li&gt;
&lt;li&gt;It runs without your SSH agent, so a VM never gets your agent through it, whatever its &lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;SSH agent&lt;/a&gt; choice says (&lt;a href="https://next.devvm.dev/docs/internals/security/"&gt;why&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A VM you start this way, with &lt;code&gt;devvm limactl start&lt;/code&gt; or &lt;code&gt;shell --start&lt;/code&gt;, runs unconfined, whatever its tier, and &lt;code&gt;devvm ls&lt;/code&gt; shows it as &lt;code&gt;unenforced&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;). Start project VMs with devvm.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="file-watchers"&gt;File watchers&lt;span class="hx:absolute hx:-mt-20" id="file-watchers"&gt;&lt;/span&gt;
&lt;a href="#file-watchers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A dev server or a watcher that runs in the VM, such as Vite, webpack, &lt;code&gt;tsc --watch&lt;/code&gt; or nodemon, learns about changed files from the VM&amp;rsquo;s kernel. The kernel sees every change made in the VM, so a file that a coding agent or a command in the VM&amp;rsquo;s shell writes reaches the watcher at once. Lima&amp;rsquo;s mounts don&amp;rsquo;t pass on the changes you make on this machine, though, so a watcher in the VM misses a file you save in your editor here, and the dev server doesn&amp;rsquo;t reload. On Linux the project folder is a 9p mount, and there a watcher also misses the VM&amp;rsquo;s own changes in the folder&amp;rsquo;s subfolders, and sees only those to files at the top of the folder.&lt;/p&gt;
&lt;p&gt;To have a watcher see your edits, set it to poll the project folder, which costs some CPU in a large project:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;chokidar, and tools built on it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CHOKIDAR_USEPOLLING=1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vite&lt;/td&gt;
&lt;td&gt;&lt;code&gt;server.watch.usePolling: true&lt;/code&gt; in &lt;code&gt;vite.config&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;webpack&lt;/td&gt;
&lt;td&gt;&lt;code&gt;watchOptions.poll&lt;/code&gt; in &lt;code&gt;webpack.config.js&lt;/code&gt;, or &lt;code&gt;WATCHPACK_POLLING=true&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;nodemon&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nodemon --legacy-watch&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tsc --watch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;quot;watchOptions&amp;quot;: { &amp;quot;watchFile&amp;quot;: &amp;quot;fixedPollingInterval&amp;quot; }&lt;/code&gt; in &lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cargo watch&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cargo watch --poll&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Set the variables in the VM&amp;rsquo;s shell or in your project&amp;rsquo;s scripts, before the tool starts. Leave Lima&amp;rsquo;s own file event setting, &lt;code&gt;mountInotify&lt;/code&gt;, off, because with it on, commands in the VM that write to the project folder, such as &lt;code&gt;git init&lt;/code&gt;, fail at random (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-project-folders-cache"&gt;The project folder&amp;rsquo;s cache&lt;span class="hx:absolute hx:-mt-20" id="the-project-folders-cache"&gt;&lt;/span&gt;
&lt;a href="#the-project-folders-cache" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On Linux, QEMU shares the project folder with the VM over 9p, and the VM&amp;rsquo;s kernel can cache the folder&amp;rsquo;s files as it reads and writes them. devvm gives every new VM the cache mode &lt;code&gt;none&lt;/code&gt;, so the VM reads and writes straight through to the folder on this machine, and what you edit on either side is what the other side sees.&lt;/p&gt;
&lt;p&gt;Lima&amp;rsquo;s own default for a writable folder is &lt;code&gt;mmap&lt;/code&gt;, which caches the files&amp;rsquo; contents in the VM, and Linux&amp;rsquo;s 9p client loses data with it in two ways. When a program reads a file&amp;rsquo;s size while another write is making the file longer, the VM can take the older size from this machine and drop the new data, even after &lt;code&gt;fsync&lt;/code&gt; succeeded, so the file ends up empty or cut to 4096 bytes, and Claude Code&amp;rsquo;s edits are one way to set it off. And when a program locks a file it has written, its next read of that file returns zeros. That stops SQLite at its second write with &lt;code&gt;file is not a database&lt;/code&gt;, whatever its journal mode, and Gradle&amp;rsquo;s second build with &lt;code&gt;Unexpected lock protocol found in lock file&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A VM made before devvm chose &lt;code&gt;none&lt;/code&gt; keeps &lt;code&gt;mmap&lt;/code&gt;, and devvm doesn&amp;rsquo;t change its mount on its own, so each launch of such a VM warns until you switch it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm mount-cache &lt;span class="c1"&gt;# how this folder&amp;#39;s VM caches its project folder&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm mount-cache none &lt;span class="c1"&gt;# switch it to none from the VM&amp;#39;s next start&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm mount-cache none&lt;/code&gt; switches the mode from the VM&amp;rsquo;s next start, so in a terminal devvm offers to restart a running VM now. &lt;code&gt;none&lt;/code&gt; is the only mode devvm sets, so any other value is refused.&lt;/p&gt;
&lt;p&gt;A &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt; VM&lt;/a&gt; mounts no project folder, so it has no cache mode until &lt;code&gt;devvm clone off&lt;/code&gt; mounts the folder, which then gets &lt;code&gt;none&lt;/code&gt;. On macOS, VMs share the project folder with virtiofs, which has no cache mode to choose, so there &lt;code&gt;devvm mount-cache&lt;/code&gt; refuses. On Linux it refuses the same for a VM whose project folder isn&amp;rsquo;t a 9p mount, such as one whose Lima config you gave another mount type.&lt;/p&gt;
&lt;h3 data-hextra-search-id="when-the-cache-mode-changes"&gt;When the cache mode changes&lt;span class="hx:absolute hx:-mt-20" id="when-the-cache-mode-changes"&gt;&lt;/span&gt;
&lt;a href="#when-the-cache-mode-changes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The VM gets &lt;code&gt;none&lt;/code&gt; at its next start, and that start mounts the project folder again once the VM runs, before devvm sets the VM up or opens its shell. The VM&amp;rsquo;s first mount of the folder at boot still has the old mode, because the guest reads its new mount options only after it has mounted the folder. devvm then checks the folder:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When the folder is mounted with &lt;code&gt;none&lt;/code&gt;, the VM goes on as usual.&lt;/li&gt;
&lt;li&gt;When the folder is still mounted with the old mode, isn&amp;rsquo;t mounted at all, or the VM doesn&amp;rsquo;t answer the check, devvm restarts the VM once, before it sets it up or opens its shell. The folder can be left with the old mode when the VM couldn&amp;rsquo;t unmount it, because something it started at boot, such as a container, was using it, or when the VM&amp;rsquo;s start was degraded. It can be left unmounted when the VM unmounted it but couldn&amp;rsquo;t mount it again, as happens on an Alpine VM. The restart&amp;rsquo;s boot mounts the folder with &lt;code&gt;none&lt;/code&gt;, and devvm checks it again.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After the restart, devvm checks the folder once more and doesn&amp;rsquo;t restart the VM again:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When the folder is mounted with &lt;code&gt;none&lt;/code&gt;, the VM goes on as usual.&lt;/li&gt;
&lt;li&gt;When the folder is still mounted with the old mode, devvm warns and goes on, though the folder can lose writes under that mode.&lt;/li&gt;
&lt;li&gt;When the folder isn&amp;rsquo;t mounted at all, or the VM doesn&amp;rsquo;t answer the check, devvm stops the VM before it sets it up or opens its shell, because files written there would go to the VM&amp;rsquo;s own disk and vanish once the folder is mounted over them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In both cases a restart of your own repeats what failed, so look first at why the VM&amp;rsquo;s boot didn&amp;rsquo;t mount the folder with &lt;code&gt;none&lt;/code&gt;. Its console log, which &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-vm-wont-boot"&gt;A VM won&amp;rsquo;t boot&lt;/a&gt; shows where to find, has what the boot said, and the run log has what the VM&amp;rsquo;s &lt;code&gt;umount&lt;/code&gt; and &lt;code&gt;mount&lt;/code&gt; said and why devvm restarted the VM (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;logs&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;When devvm can&amp;rsquo;t stop the VM for the restart, a folder still mounted with the old mode is warned of and the VM goes on as it runs. Otherwise the launch fails, saying the VM didn&amp;rsquo;t stop, because it may still be running. Pressing Ctrl+C while devvm mounts or checks the folder, or stops the VM for the restart, stops the VM, without a restart. A launch into a running VM checks too that its project folder is mounted, and refuses to open a shell in one whose folder isn&amp;rsquo;t, naming &lt;code&gt;devvm restart&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-mount-cache-json"&gt;devvm mount-cache &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-mount-cache-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-mount-cache-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm mount-cache --json&lt;/code&gt; prints the VM&amp;rsquo;s mode, whether it was chosen, as the VM was made or with &lt;code&gt;devvm mount-cache none&lt;/code&gt;, rather than kept from Lima, and the mode its next start gives it, when that differs:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;mode&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;mmap&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;chosen&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;pending&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;none&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="programs-that-map-files-for-writing"&gt;Programs that map files for writing&lt;span class="hx:absolute hx:-mt-20" id="programs-that-map-files-for-writing"&gt;&lt;/span&gt;
&lt;a href="#programs-that-map-files-for-writing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;With &lt;code&gt;none&lt;/code&gt;, a program in the VM can&amp;rsquo;t map a file in the project folder for shared writing, or map one it opened for writing at all, and it fails at once with &lt;code&gt;Invalid argument&lt;/code&gt;, so nothing is lost. LMDB, numpy&amp;rsquo;s &lt;code&gt;memmap&lt;/code&gt; in &lt;code&gt;r+&lt;/code&gt; or &lt;code&gt;w+&lt;/code&gt; mode, Java&amp;rsquo;s read-write &lt;code&gt;MappedByteBuffer&lt;/code&gt; and the mold linker do this, while git, npm, Vite, webpack, esbuild, jest, Go, cargo with Rust&amp;rsquo;s own linker, GNU ld, lld, Gradle, DuckDB, ccache and Terraform work as they do on any disk. LMDB is what Parcel&amp;rsquo;s &lt;code&gt;.parcel-cache&lt;/code&gt; and Gatsby&amp;rsquo;s cache use.&lt;/p&gt;
&lt;p&gt;For a program that maps its files, keep them on the VM&amp;rsquo;s own disk, such as in its home folder: for mold, a &lt;code&gt;CARGO_TARGET_DIR&lt;/code&gt; there, or lld instead. Or use a &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt; VM&lt;/a&gt;, whose repo is on the VM&amp;rsquo;s own disk. The VM&amp;rsquo;s own disk is also far faster than the shared folder, so a &lt;code&gt;--clone&lt;/code&gt; VM suits large repos and heavy builds: on a Fedora 43 host, &lt;code&gt;npm ci&lt;/code&gt; of 369 packages took 4.8 s in the shared folder and 2.8 s on the VM&amp;rsquo;s disk, a debug &lt;code&gt;cargo build&lt;/code&gt; of ripgrep 8.5 s and 4.8 s, and a cold &lt;code&gt;git status&lt;/code&gt; of an 18,000-file tree 23 s and 1 s.&lt;/p&gt;
&lt;h3 data-hextra-search-id="sqlite-and-the-cache"&gt;SQLite and the cache&lt;span class="hx:absolute hx:-mt-20" id="sqlite-and-the-cache"&gt;&lt;/span&gt;
&lt;a href="#sqlite-and-the-cache" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;SQLite&amp;rsquo;s default journal works in the project folder. WAL mode doesn&amp;rsquo;t, because SQLite maps its shared index and fails with &lt;code&gt;disk I/O error&lt;/code&gt;, unless the connection sets &lt;code&gt;PRAGMA locking_mode=EXCLUSIVE&lt;/code&gt; before &lt;code&gt;PRAGMA journal_mode=WAL&lt;/code&gt;. That keeps the index in memory, and lets only that connection use the database. A project whose database is in WAL mode works in a &lt;code&gt;--clone&lt;/code&gt; VM, or with the database outside the project folder, such as in the VM&amp;rsquo;s home folder or &lt;code&gt;/tmp&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="cleaning-up"&gt;Cleaning up&lt;span class="hx:absolute hx:-mt-20" id="cleaning-up"&gt;&lt;/span&gt;
&lt;a href="#cleaning-up" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm gc&lt;/code&gt; deletes devvm&amp;rsquo;s stale and unfinished Lima images and the shared tools that no VM has and that aren&amp;rsquo;t current, and it leaves your VMs as they are. &lt;code&gt;devvm images rm&lt;/code&gt; deletes an image that&amp;rsquo;s current, except on Linux hosts one whose disk VMs use (&lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;cleaning up&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --caches &lt;span class="c1"&gt;# free the cloud images nothing of devvm&amp;#39;s needs, after asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm keeps Ubuntu&amp;rsquo;s cloud images in its own folder and gives Lima that file, so its builds add nothing to Lima&amp;rsquo;s own download cache, which your own Lima VMs share. That cache can still hold the cloud images that earlier releases of devvm had Lima download. &lt;code&gt;devvm gc --caches&lt;/code&gt; deletes devvm&amp;rsquo;s own copies that no image of devvm&amp;rsquo;s needs, and the entries in Lima&amp;rsquo;s cache that an image record of devvm&amp;rsquo;s names once devvm has its own copy, unless one of Lima&amp;rsquo;s own templates uses that image. devvm never runs &lt;code&gt;limactl prune&lt;/code&gt;, which empties the whole cache (&lt;a href="https://next.devvm.dev/docs/using/space/#lima"&gt;what devvm keeps&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="limits"&gt;Limits&lt;span class="hx:absolute hx:-mt-20" id="limits"&gt;&lt;/span&gt;
&lt;a href="#limits" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Folder names in VM names are cut short.&lt;/strong&gt; Lima keeps each VM&amp;rsquo;s ssh socket in the VM&amp;rsquo;s folder in its home, and a socket path has fewer than 104 characters. A long Lima home leaves less room for the name, so set &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; to a shorter folder if devvm says the home is too long, or that a VM&amp;rsquo;s name leaves no room for the folder&amp;rsquo;s name (&lt;a href="https://next.devvm.dev/docs/internals/backends/#vm-names"&gt;VM names&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paths can&amp;rsquo;t contain commas.&lt;/strong&gt; Lima and QEMU split mount options on commas, so devvm refuses to mount a project folder whose path has one, and it leaves out an agent&amp;rsquo;s folder whose path has one, with a warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disks can grow but not shrink.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mounts on Linux are 9p.&lt;/strong&gt; A 9p share mounts once per guest, file watchers in the VM miss changes in its subfolders (&lt;a href="#file-watchers"&gt;file watchers&lt;/a&gt;), and SQLite&amp;rsquo;s WAL mode doesn&amp;rsquo;t work in the project folder, which a &lt;code&gt;--clone&lt;/code&gt; VM avoids (&lt;a href="#sqlite-and-the-cache"&gt;SQLite and the cache&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM that Lima reports as failed to start&lt;/strong&gt; still starts, with a warning, when it&amp;rsquo;s running but degraded because one of Lima&amp;rsquo;s boot scripts failed. A VM that doesn&amp;rsquo;t answer over ssh within a minute is stopped instead, and its console log is in its Lima folder (&lt;code&gt;serial*.log&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Network tiers</title><link>https://next.devvm.dev/docs/safety/network/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/safety/network/</guid><description>
&lt;p&gt;Every VM goes through a proxy that devvm runs for it on this machine, and the VM&amp;rsquo;s network tier decides what the proxy lets it reach. New VMs get the allowlist tier by default, so they reach only the hosts on their allowlist, which are devvm&amp;rsquo;s built-in hosts, your secrets&amp;rsquo; hosts and the hosts you add. No VM holds the secrets that devvm saved, whatever its tier, because its proxy puts them into its requests, but code in the VM can still use each secret the VM may use, on that secret&amp;rsquo;s hosts. A secret is a credential devvm keeps on this machine for VMs to use: your GitHub token, Claude Code&amp;rsquo;s token, an agent&amp;rsquo;s login or an API key. An open VM, the one tier that isn&amp;rsquo;t confined to its proxy, reaches anything this machine can, including this machine&amp;rsquo;s own services on &lt;code&gt;localhost&lt;/code&gt; and your LAN.&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 398px; --devvm-diagram-width: 514px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-sequence" viewBox="0 0 514 398" width="514" height="398" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="sequence" aria-labelledby="d10b0fcda5ce268dc--title" aria-describedby="d10b0fcda5ce268dc--desc"&gt;&lt;title id="d10b0fcda5ce268dc--title"&gt;A VM's requests through its proxy&lt;/title&gt;&lt;desc id="d10b0fcda5ce268dc--desc"&gt;The VM sends GET /user with a placeholder to its proxy on this machine, which finds api.github.com on the allowlist and sends the request on with your GitHub token, then passes the response back. A CONNECT to example.com:443 gets a 403, because that host isn't on the allowlist.&lt;/desc&gt;&lt;g transform="translate(50.73,8)"&gt;&lt;g class="pele-lifelines" fill="none" stroke="var(--_b)"&gt;&lt;path class="pele-lifeline" data-id="P" d="M0,56V382"/&gt;&lt;path class="pele-lifeline" data-id="X" d="M170.55,56V382"/&gt;&lt;path class="pele-lifeline" data-id="H" d="M376.73,56V382"/&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge pele-message" data-id="i0"&gt;&lt;path d="M0,110H163.55"/&gt;&lt;path class="pele-marker" d="M170.55,110L162.55,113.36L162.55,106.64Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i2"&gt;&lt;path d="M170.55,198H369.73"/&gt;&lt;path class="pele-marker" d="M376.73,198L368.73,201.36L368.73,194.64Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i3"&gt;&lt;path d="M376.73,232H177.55" stroke-dasharray="4 4"/&gt;&lt;path class="pele-marker" d="M170.55,232L178.55,228.64L178.55,235.36Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i4"&gt;&lt;path d="M170.55,266H7" stroke-dasharray="4 4"/&gt;&lt;path class="pele-marker" d="M0,266L8,262.64L8,269.36Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i5"&gt;&lt;path d="M0,314H163.55"/&gt;&lt;path class="pele-marker" d="M170.55,314L162.55,317.36L162.55,310.64Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i6"&gt;&lt;path d="M170.55,362H7" stroke-dasharray="4 4"/&gt;&lt;path class="pele-marker" d="M0,362L8,358.64L8,365.36Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="i0"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="85.27" y="86.2"&gt;GET /user, with&lt;/tspan&gt;&lt;tspan x="85.27" y="102.2"&gt;a placeholder&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i2"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="273.64" y="174.2"&gt;GET /user, with&lt;/tspan&gt;&lt;tspan x="273.64" y="190.2"&gt;your GitHub token&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i3"&gt;&lt;text x="273.64" y="223.2" text-anchor="middle"&gt;the response&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i4"&gt;&lt;text x="85.27" y="257.2" text-anchor="middle"&gt;the response&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i5"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="85.27" y="290.2"&gt;CONNECT&lt;/tspan&gt;&lt;tspan x="85.27" y="306.2"&gt;example.com:443&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i6"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="85.27" y="338.2"&gt;403: not on&lt;/tspan&gt;&lt;tspan x="85.27" y="354.2"&gt;the allowlist&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-notes" font-size="14" fill="var(--_a)" stroke="var(--_b)"&gt;&lt;g class="pele-note" data-id="i1"&gt;&lt;rect x="89.27" y="120" width="162.55" height="30" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" stroke="none" fill="var(--_fg)" x="170.55" y="139.2" text-anchor="middle"&gt;on the allowlist&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-actor pele-actor-participant" data-id="P"&gt;&lt;rect x="-42.73" y="15" width="85.45" height="41" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="40.4" text-anchor="middle"&gt;The VM&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-actor pele-actor-participant" data-id="X"&gt;&lt;rect x="87.73" y="0" width="165.64" height="56" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="170.55" y="23.9"&gt;Its proxy,&lt;/tspan&gt;&lt;tspan x="170.55" y="41.9"&gt;on this machine&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-actor pele-actor-participant" data-id="H"&gt;&lt;rect x="298.36" y="15" width="156.73" height="41" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="376.73" y="40.4" text-anchor="middle"&gt;api.github.com&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;This page covers what you do with a VM&amp;rsquo;s tier and what you see. &lt;a href="https://next.devvm.dev/docs/internals/network/"&gt;How it works › Network tiers&lt;/a&gt; explains how devvm confines a VM to its proxy and how the proxy handles each connection.&lt;/p&gt;
&lt;h2 data-hextra-search-id="network-tiers"&gt;Network tiers&lt;span class="hx:absolute hx:-mt-20" id="network-tiers"&gt;&lt;/span&gt;
&lt;a href="#network-tiers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM is on one of four tiers, from the lowest to the highest:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tier&lt;/th&gt;
&lt;th&gt;What the VM reaches&lt;/th&gt;
&lt;th&gt;Confined to its proxy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;open&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whatever this machine reaches, its &lt;code&gt;localhost&lt;/code&gt; and the LAN included; the proxy applies no rules&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every public host, on any port, apart from your denies; never this machine&amp;rsquo;s addresses or its networks'&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;allowlist&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;only the hosts its &lt;a href="#allowlists"&gt;allowlists&lt;/a&gt; allow, apart from your denies&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;none&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;only its agents&amp;rsquo; hosts, the hosts of its secrets and logins, and its &lt;a href="#links-between-vms"&gt;links&lt;/a&gt;, apart from your denies&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --network internet &lt;span class="c1"&gt;# make this folder&amp;#39;s new VM on the internet tier&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network none &lt;span class="c1"&gt;# give this folder&amp;#39;s VM the none tier&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network &lt;span class="c1"&gt;# show its tier and its allowlist&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;--network TIER&lt;/code&gt; chooses a new VM&amp;rsquo;s tier, and &lt;code&gt;devvm network&lt;/code&gt; with a tier changes an existing VM&amp;rsquo;s (&lt;a href="#choosing-a-tier"&gt;choosing a tier&lt;/a&gt;). A higher tier is stricter, and a VM on any tier but open is confined: it reaches nothing but its proxy, and a direct connection from it fails. A VM can also start on the internet tier while it &lt;a href="#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt;, and then go to the allowlist tier with the ones you choose.&lt;/p&gt;
&lt;p&gt;An open VM runs on its backend&amp;rsquo;s own network, so it reaches this machine and your LAN directly, as a VM without a proxy would. It still gets only a placeholder for each secret it may use, so a request that goes around its proxy carries no secret, and every launch checks that its proxy is set in the VM and answers it (&lt;a href="https://next.devvm.dev/docs/internals/network/#starting-a-vm-on-its-tier"&gt;an open VM&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rules by tier:&lt;/strong&gt; on the internet and none tiers, devvm reads only the denies of your policy files, because the internet tier allows every public host itself and the none tier allows only what the VM&amp;rsquo;s agents, secrets and links need. &lt;code&gt;devvm network&lt;/code&gt; marks each such file &lt;code&gt;(denies only)&lt;/code&gt;, and when you add an allow to a VM on either tier, devvm says that the allow changes nothing until the VM is on the allowlist tier. On the open tier no rule applies at all.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When a change applies:&lt;/strong&gt; a change from one confined tier to another applies at once, because the VM&amp;rsquo;s proxy starts again with the new tier&amp;rsquo;s rules and the VM keeps running. A change into or out of the open tier applies from the VM&amp;rsquo;s next start, as &lt;a href="#choosing-a-tier"&gt;choosing a tier&lt;/a&gt; describes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What you see:&lt;/strong&gt; &lt;code&gt;devvm ls&lt;/code&gt; and &lt;code&gt;devvm network&lt;/code&gt; show a VM&amp;rsquo;s tier, or &lt;code&gt;unenforced&lt;/code&gt; when a confined tier isn&amp;rsquo;t in force (&lt;a href="#when-it-isnt-enforced"&gt;when it isn&amp;rsquo;t enforced&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="choosing-a-tier"&gt;Choosing a tier&lt;span class="hx:absolute hx:-mt-20" id="choosing-a-tier"&gt;&lt;/span&gt;
&lt;a href="#choosing-a-tier" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A new VM gets the allowlist tier unless you choose another, and the summary devvm shows before it makes the VM names its tier. When you customize the VM in a terminal, devvm lists the four tiers, each with what it reaches, with &lt;code&gt;learn&lt;/code&gt; after &lt;code&gt;internet&lt;/code&gt;, and the tier the summary showed is chosen (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;):&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Network tier for devvm-some-project-71a99b1076d92c (up/down to choose, enter to confirm):
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ( ) open reaches anything this machine can
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ( ) internet reaches any public host
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ( ) learn reaches any public host while it learns which it needs, until devvm network lock
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; (*) allowlist reaches only the hosts you allow (recommended)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ( ) none reaches only its agents&amp;#39; and secrets&amp;#39; hosts and its links&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Up and down move the choice, and enter gives the VM the chosen tier, so pressing enter at once keeps the tier the summary showed. &lt;code&gt;learn&lt;/code&gt; gives the VM the internet tier while it &lt;a href="#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt;. &lt;code&gt;--network TIER&lt;/code&gt; answers the question up front, such as &lt;code&gt;devvm --network internet&lt;/code&gt; or &lt;code&gt;devvm --network learn&lt;/code&gt;, and when there&amp;rsquo;s no terminal to ask in, or you give &lt;code&gt;--no-input&lt;/code&gt;, the VM gets the tier the summary showed. A VM keeps its tier. On an existing VM devvm ignores &lt;code&gt;--network&lt;/code&gt; and warns you, naming the &lt;code&gt;devvm network&lt;/code&gt; command that changes the tier.&lt;/p&gt;
&lt;p&gt;To give every new VM another tier, save it with &lt;code&gt;devvm network -g&lt;/code&gt;, or choose it in &lt;a href="https://next.devvm.dev/docs/using/settings/#devvm-setup"&gt;devvm setup&lt;/a&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network -g none &lt;span class="c1"&gt;# every new VM gets the none tier&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network -g &lt;span class="c1"&gt;# show what new VMs get, and where it came from&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Neither takes &lt;code&gt;learn&lt;/code&gt;, because each VM learns the hosts it needs on its own, so &lt;code&gt;devvm network -g&lt;/code&gt; refuses it and names &lt;code&gt;devvm --network learn&lt;/code&gt; and &lt;code&gt;devvm network learn&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Each new VM&amp;rsquo;s summary then shows that tier, and customizing the VM still asks, with Enter keeping the saved tier.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm network -g&lt;/code&gt; shows what new VMs get, &lt;code&gt;allowlist&lt;/code&gt; until you save another tier, followed by where it came from after a &lt;code&gt;#&lt;/code&gt;, and &lt;code&gt;devvm network -g --json&lt;/code&gt; prints it as &lt;code&gt;policy&lt;/code&gt;, with &lt;code&gt;source&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;devvm reads the saved tier only when it creates a VM, so the VMs you already have keep their own tier, and &lt;code&gt;--network&lt;/code&gt; still chooses for one new VM.&lt;/li&gt;
&lt;li&gt;You can also set it with &lt;code&gt;network&lt;/code&gt; in &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt;, which wins over the saved tier, and then &lt;code&gt;devvm network -g&lt;/code&gt; refuses to change it and names the file (&lt;a href="https://next.devvm.dev/docs/using/settings/#where-a-default-comes-from"&gt;where a default comes from&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Lima confines every VM to its proxy, so every VM can be on any tier, the docker layer&amp;rsquo;s included. devvm never starts a VM on a confined tier with an open network, so if a VM&amp;rsquo;s backend couldn&amp;rsquo;t confine it, the VM could only be open: devvm would refuse to make it on any other tier unless you give &lt;code&gt;--network open&lt;/code&gt;, and it would refuse to give it any other tier with &lt;code&gt;devvm network&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/backends/#when-a-backend-lacks-something"&gt;when a backend lacks something&lt;/a&gt;).&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;print this folder&amp;rsquo;s VM&amp;rsquo;s tier as &lt;code&gt;devvm ls&lt;/code&gt; shows it, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;internet (learning)&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt; or &lt;code&gt;unenforced&lt;/code&gt;, and then its &lt;a href="#changing-rules"&gt;allowlist&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network open|internet|allowlist|none&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;change it: between confined tiers at once, and into or out of open from the VM&amp;rsquo;s next start, which &lt;code&gt;devvm restart&lt;/code&gt; gives you, and for a running VM, ask in a terminal whether to restart it now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network learn&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;give it the internet tier while it &lt;a href="#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt;, from now on&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;choose which of those hosts it keeps, and give it the allowlist tier (&lt;a href="#locking-it"&gt;locking it&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network -g [open|internet|allowlist|none]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show or change what new VMs get&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;When a change into or out of open finds the VM running, devvm asks in a terminal whether to restart it now, which stops anything running in it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you answer yes, devvm restarts the VM as &lt;code&gt;devvm restart&lt;/code&gt; does, so the change applies at once.&lt;/li&gt;
&lt;li&gt;If you answer no, or there&amp;rsquo;s no terminal, or you pass &lt;code&gt;--no-input&lt;/code&gt;, the change waits until the VM starts again.&lt;/li&gt;
&lt;li&gt;If you give a running open VM a confined tier, the VM isn&amp;rsquo;t confined yet, so &lt;code&gt;devvm ls&lt;/code&gt; shows it as &lt;code&gt;unenforced&lt;/code&gt;, and its next launch offers to restart it confined, as it does for a VM started outside devvm.&lt;/li&gt;
&lt;li&gt;If you make a VM open while it runs confined, its launches keep it confined to its proxy, which now applies an open VM&amp;rsquo;s rules, until it next starts, and they warn you that the VM leaves its proxy&amp;rsquo;s confinement when it next starts. In a terminal, each of those launches first asks whether to restart the VM now, with no as the default unless an agent&amp;rsquo;s new folders wait too (&lt;a href="https://next.devvm.dev/docs/using/vms/#restarting-and-stopping"&gt;restarting&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="when-it-isnt-enforced"&gt;When it isn&amp;rsquo;t enforced&lt;span class="hx:absolute hx:-mt-20" id="when-it-isnt-enforced"&gt;&lt;/span&gt;
&lt;a href="#when-it-isnt-enforced" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On every launch devvm checks on this machine that the VM still runs on the process devvm started confined, and that a direct connection from the VM to the internet fails. A VM that fails either check shows as &lt;code&gt;unenforced&lt;/code&gt;, and devvm offers to restart it confined or stops it, as &lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt; describes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="learning-the-hosts-a-vm-needs"&gt;Learning the hosts a VM needs&lt;span class="hx:absolute hx:-mt-20" id="learning-the-hosts-a-vm-needs"&gt;&lt;/span&gt;
&lt;a href="#learning-the-hosts-a-vm-needs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Finding every host a project needs one block at a time takes a while, so a VM can learn them instead:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make the VM learn. For a new VM, choose &lt;code&gt;learn&lt;/code&gt; in its tier list when you customize it, or give &lt;code&gt;--network learn&lt;/code&gt;, such as &lt;code&gt;devvm --network learn&lt;/code&gt;. For an existing VM, run &lt;code&gt;devvm network learn&lt;/code&gt;, which gives it the internet tier at once, as &lt;code&gt;devvm network internet&lt;/code&gt; does, and starts its learning from now.&lt;/li&gt;
&lt;li&gt;Run the project&amp;rsquo;s installs, builds and tests. The VM has the internet tier&amp;rsquo;s access meanwhile, and its proxy logs each host it reaches, as it does on every tier.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;devvm network lock&lt;/code&gt;, which lets you choose which of those hosts the VM keeps, and puts it on the allowlist tier with them (&lt;a href="#locking-it"&gt;locking it&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Learning is for one VM at a time, so no default makes new VMs learn: &lt;code&gt;devvm network -g&lt;/code&gt;, &lt;code&gt;devvm setup&lt;/code&gt; and &lt;code&gt;config.toml&lt;/code&gt; don&amp;rsquo;t take &lt;code&gt;learn&lt;/code&gt; (&lt;a href="#choosing-a-tier"&gt;choosing a tier&lt;/a&gt;).&lt;/p&gt;
&lt;div class="devvm-callout devvm-callout-warning"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 1h1v1H5ZM4 2h1v1H4ZM6 2h1v1H6ZM4 3h1v1H4ZM6 3h1v1H6ZM3 4h1v1H3ZM7 4h1v1H7ZM3 5h1v1H3ZM5 5h1v1H5ZM7 5h1v1H7ZM2 6h1v1H2ZM5 6h1v1H5ZM8 6h1v1H8ZM2 7h1v1H2ZM5 7h1v1H5ZM8 7h1v1H8ZM1 8h1v1H1ZM9 8h1v1H9ZM1 9h1v1H1ZM5 9h1v1H5ZM9 9h1v1H9ZM0 10h1v1H0ZM10 10h1v1H10ZM0 11h11v1H0Z"/&gt;&lt;/svg&gt; Warning&lt;/p&gt;&lt;p&gt;Learning isn&amp;rsquo;t a tier of its own. While it lasts, the VM is on the internet tier, so it reaches every public host and only your denies apply, and links and groups treat it as an internet VM. That&amp;rsquo;s internet access for as long as the VM learns, and that includes the dependency installs you run to teach it, when packages&amp;rsquo; install scripts run in the VM. So a compromised dependency that you install meanwhile can reach a host of its attacker&amp;rsquo;s choosing, and that host then shows up among the learned hosts. That&amp;rsquo;s why &lt;code&gt;devvm network lock&lt;/code&gt; asks, starts with few hosts ticked, and leaves you to read the list before you confirm it. Your secrets stay on this machine as they do on every tier, and the VM still gets only placeholders.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;Each launch of a learning VM says that it&amp;rsquo;s learning, since when, and how many hosts it has reached beyond its allowlist, and it names &lt;code&gt;devvm network lock&lt;/code&gt;. Once the VM&amp;rsquo;s log holds more than 2 MiB, the launch leaves out the count, so it never reads the whole log each time. &lt;code&gt;devvm ls&lt;/code&gt; and &lt;code&gt;devvm network&lt;/code&gt; show its tier as &lt;code&gt;internet (learning)&lt;/code&gt;, and their &lt;code&gt;--json&lt;/code&gt; adds &lt;code&gt;learning_since&lt;/code&gt;, the time it started learning.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm network internet&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt; or &lt;code&gt;open&lt;/code&gt; end the learning and give the VM that tier. &lt;code&gt;devvm network allowlist&lt;/code&gt; refuses while the VM learns, because &lt;code&gt;devvm network lock&lt;/code&gt; is how a learning VM goes to the allowlist tier, and &lt;code&gt;devvm network lock --none&lt;/code&gt; does it without adding a host. A VM in a &lt;a href="#links-between-vms"&gt;group&lt;/a&gt; can&amp;rsquo;t start learning or be locked, because a group&amp;rsquo;s VMs are all on one tier, so run &lt;code&gt;devvm group leave&lt;/code&gt; first, and for the same reason a learning VM can&amp;rsquo;t join a group until you lock it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="locking-it"&gt;Locking it&lt;span class="hx:absolute hx:-mt-20" id="locking-it"&gt;&lt;/span&gt;
&lt;a href="#locking-it" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm network lock&lt;/code&gt; reads the hosts the VM reached since it started learning from its network log, and it leaves out these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;what the VM&amp;rsquo;s allowlist tier would allow already, judged by the proxy&amp;rsquo;s own rules: devvm&amp;rsquo;s built-in rules, its shared tools&amp;rsquo; and layers&amp;rsquo;, your own rules for every VM and for this VM, and its secrets&amp;rsquo; and logins&amp;rsquo; hosts&lt;/li&gt;
&lt;li&gt;what your rules deny, which no allow would reach&lt;/li&gt;
&lt;li&gt;blocked requests&lt;/li&gt;
&lt;li&gt;internal and LAN addresses, which the internet tier never reaches&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In a terminal it lists the rest, one row for each host and port, with how many connections each had and the first word of the &lt;code&gt;User-Agent&lt;/code&gt; that the requests sent most, in three groups:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The hosts that the VM&amp;rsquo;s tools reached through its proxy come first.&lt;/li&gt;
&lt;li&gt;The hosts that only tools without proxy settings reached, which &lt;a href="#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt; sent to the proxy, come next, under a heading of their own, because background tools&amp;rsquo; telemetry and update checks reach the proxy that way, and you may not want to keep them.&lt;/li&gt;
&lt;li&gt;The risky hosts come last, under a heading of their own, so neither a long name nor a &lt;code&gt;User-Agent&lt;/code&gt; can push off the row what makes them risky.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That &lt;code&gt;User-Agent&lt;/code&gt; is the VM&amp;rsquo;s own claim, which any program in it can set to anything, so it&amp;rsquo;s a hint, not proof of which tool made the connection, and devvm shows it only when it&amp;rsquo;s at most 32 letters, digits and &lt;code&gt;._/+-&lt;/code&gt;. Which way a connection came is the VM&amp;rsquo;s own doing, as its &lt;code&gt;User-Agent&lt;/code&gt; is, so the second group&amp;rsquo;s heading is a hint about the tool, not proof of what it is. A host name that doesn&amp;rsquo;t fit is cut from the left, so its domain shows, and a list longer than the terminal scrolls, with a line above and below that says how many more rows there are. In a terminal too short to show a few rows, devvm refuses rather than draw the list wrong:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Since 2026-11-08 09:03 the VM could reach any public host, so this list can hold a host that a compromised dependency reached. Only a host on port 443 of a package registry or vendor devvm knows starts ticked, so read the others before you tick them.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Choose the hosts devvm-some-project-71a99b1076d92c keeps. Use up and down to move, space to toggle, a to toggle them all and enter to confirm.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; [x] files.pythonhosted.org:443 2 connections, User-Agent: uv/0.9.2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [x] static.crates.io:443 1 connection, User-Agent: cargo/1.91.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] example.com:8443 1 connection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] uploads.github.com:443 1 connection, User-Agent: git/2.51.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Reached only by tools without proxy settings, which the VM&amp;#39;s names sent to its proxy:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] api.open-meteo.com:443 3 connections
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Risky, each an easy way to send data out:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] 203.0.113.5:443 1 connection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] docs.google.com:443 1 connection, User-Agent: python-requests/2.32
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] pastebin.com:443 1 connection, User-Agent: curl/8.5.0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A host starts ticked only when it&amp;rsquo;s on port 443 and belongs to a package registry or vendor on a short list that devvm keeps, each name checked so that nobody but its vendor can make a host or post a page under it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;npm&amp;rsquo;s &lt;code&gt;registry.npmjs.org&lt;/code&gt;, PyPI&amp;rsquo;s &lt;code&gt;files.pythonhosted.org&lt;/code&gt; and &lt;code&gt;crates.io&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Go&amp;rsquo;s &lt;code&gt;proxy.golang.org&lt;/code&gt; and &lt;code&gt;sum.golang.org&lt;/code&gt;, and NuGet&amp;rsquo;s &lt;code&gt;api.nuget.org&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;the toolchains&amp;rsquo; own release hosts, such as &lt;code&gt;nodejs.org&lt;/code&gt; and &lt;code&gt;static.rust-lang.org&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Docker Hub&amp;rsquo;s and GitHub&amp;rsquo;s container registries&lt;/li&gt;
&lt;li&gt;the agents&amp;rsquo; APIs, &lt;code&gt;api.anthropic.com&lt;/code&gt; and &lt;code&gt;api.openai.com&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A registry&amp;rsquo;s packages are its users&amp;rsquo;, but they only get there through the registry&amp;rsquo;s own upload, with a token. Nothing else makes a host start ticked: not a domain where anyone can get a subdomain or a page, such as &lt;code&gt;github.io&lt;/code&gt;, &lt;code&gt;googleapis.com&lt;/code&gt;, &lt;code&gt;amazonaws.com&lt;/code&gt; or &lt;code&gt;pypi.org&lt;/code&gt;, which takes uploads, not a host beside one your rules or your secrets name, and not one beside a host an earlier lock added. So &lt;code&gt;files.pythonhosted.org:443&lt;/code&gt; starts ticked, while &lt;code&gt;files.pythonhosted.org:8080&lt;/code&gt;, &lt;code&gt;docs.google.com&lt;/code&gt; and &lt;code&gt;evil.github.io&lt;/code&gt; don&amp;rsquo;t. Every other host starts unticked, and so does every host when the list has more than 30, so read the list, or &lt;code&gt;devvm network lock --json&lt;/code&gt;, before you tick them.&lt;/p&gt;
&lt;p&gt;A host that&amp;rsquo;s an easy way to send data out is risky, and it always starts unticked. devvm&amp;rsquo;s own rules leave all of them out too, so tick one only when the project needs it. These are risky:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an address rather than a host name&lt;/li&gt;
&lt;li&gt;a name with a punycode (&lt;code&gt;xn--&lt;/code&gt;) label, which can look like another name&lt;/li&gt;
&lt;li&gt;a paste or file drop site such as pastebin.com, paste.ubuntu.com or gist.github.com, or a log that takes entries from anyone, such as rekor.sigstore.dev&lt;/li&gt;
&lt;li&gt;file storage or file sharing such as transfer.sh, Dropbox, Google Docs, SharePoint or an S3 bucket&lt;/li&gt;
&lt;li&gt;a mail server such as Gmail&amp;rsquo;s&lt;/li&gt;
&lt;li&gt;a tunnel such as ngrok or trycloudflare.com&lt;/li&gt;
&lt;li&gt;a service that records what it&amp;rsquo;s sent, such as webhook.site or an OAST domain&lt;/li&gt;
&lt;li&gt;free hosting such as vercel.app, workers.dev or cloudfront.net&lt;/li&gt;
&lt;li&gt;a chat service&amp;rsquo;s endpoint for bots, such as Discord&amp;rsquo;s, Slack&amp;rsquo;s hooks or Telegram&amp;rsquo;s API&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the list, these keys choose the hosts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Space ticks or unticks the row under the cursor.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a&lt;/code&gt; ticks every row, the risky ones and those on other ports too, and again unticks them all.&lt;/li&gt;
&lt;li&gt;Enter adds the ticked hosts to the VM&amp;rsquo;s own policy file. Each is an exact host and port, such as &lt;code&gt;registry.example.com:443&lt;/code&gt; or &lt;code&gt;example.com:8443&lt;/code&gt;, with the port written even for 443, so it doesn&amp;rsquo;t allow port 80 too, and never a &lt;code&gt;*.&lt;/code&gt; wildcard. Then devvm gives the VM the allowlist tier at once, as it does between confined tiers, so a running VM keeps running, and its learning ends.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When the VM&amp;rsquo;s tier changed while the list was open, such as with &lt;code&gt;devvm network internet&lt;/code&gt; in another terminal, &lt;code&gt;devvm network lock&lt;/code&gt; changes nothing and says so. When the terminal doesn&amp;rsquo;t let devvm read single keys, or goes away while the list is open, or you press Ctrl+C, &lt;code&gt;devvm network lock&lt;/code&gt; changes nothing, rather than lock with the hosts as they were ticked then. Later, &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; change those rules as they change any other (&lt;a href="#changing-rules"&gt;changing rules&lt;/a&gt;).&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;list the hosts the VM learned, so you choose which it keeps, then give it the allowlist tier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--all&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;keep every host it learned, the unticked ones too, without asking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--none&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;keep none of them, without asking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;list the hosts it learned, and change nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, &lt;code&gt;devvm network lock&lt;/code&gt; refuses and names &lt;code&gt;--all&lt;/code&gt; and &lt;code&gt;--none&lt;/code&gt;. When the VM reached no host beyond its allowlist, it locks at once without asking. A VM that isn&amp;rsquo;t learning has nothing to lock, so &lt;code&gt;devvm network lock&lt;/code&gt; refuses and names &lt;code&gt;devvm network learn&lt;/code&gt;. While the VM links to a target on a lower tier than allowlist, &lt;code&gt;devvm network lock&lt;/code&gt; refuses as &lt;code&gt;devvm network allowlist&lt;/code&gt; would (&lt;a href="#links-between-vms"&gt;links between VMs&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The proxy keeps each VM&amp;rsquo;s log to its last 10 to 20 MiB (&lt;a href="#logs"&gt;logs&lt;/a&gt;), so a VM that learns for a long time with a lot of traffic can lose the first hosts it reached. When the log no longer goes back to the time the VM started learning, &lt;code&gt;devvm network lock&lt;/code&gt; warns you, and its &lt;code&gt;--json&lt;/code&gt; sets &lt;code&gt;partial&lt;/code&gt;. A host that&amp;rsquo;s missing then is blocked once the VM is locked, and &lt;code&gt;devvm network log --blocked&lt;/code&gt; names the &lt;code&gt;devvm network allow&lt;/code&gt; command that allows it.&lt;/p&gt;
&lt;h4 data-hextra-search-id="devvm-network-lock-json"&gt;devvm network lock &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-network-lock-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-network-lock-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;code&gt;devvm network lock --json&lt;/code&gt; prints what the VM learned as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes, and changes nothing, so devvm refuses it with &lt;code&gt;--all&lt;/code&gt; or &lt;code&gt;--none&lt;/code&gt;. The hosts come in the list&amp;rsquo;s order: the tickable ones first, then the others, then those that only tools without proxy settings reached, then the risky ones.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;learning_since&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;when the VM started learning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;partial&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt; when the log no longer goes back that far&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hosts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each host the VM learned, with the fields below&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rule&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the rule that &lt;code&gt;devvm network lock&lt;/code&gt; adds for it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;host&lt;/code&gt;, &lt;code&gt;port&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its host and port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;count&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the number of its connections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;last&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the last time the VM reached it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;User-Agent&lt;/code&gt;&amp;rsquo;s first word that reached it most, when devvm shows one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tickable&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt; for a host on port 443 of a registry or vendor on devvm&amp;rsquo;s list, which starts ticked unless it&amp;rsquo;s risky&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;risk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for a risky host, &lt;code&gt;address&lt;/code&gt;, &lt;code&gt;lookalike&lt;/code&gt;, &lt;code&gt;paste&lt;/code&gt;, &lt;code&gt;storage&lt;/code&gt;, &lt;code&gt;mail&lt;/code&gt;, &lt;code&gt;tunnel&lt;/code&gt;, &lt;code&gt;webhook&lt;/code&gt;, &lt;code&gt;hosting&lt;/code&gt; or &lt;code&gt;chat&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;via&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dns&lt;/code&gt; for a host that only tools without proxy settings reached&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;learning_since&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-11-07T10:00:00Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;hosts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rule&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;files.pythonhosted.org:443&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;host&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;files.pythonhosted.org&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;last&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-11-07T10:19:00Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;agent&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;uv/0.9.2&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tickable&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rule&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;registry.example.com:443&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;host&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;registry.example.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;last&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-11-07T10:20:00Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;agent&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;npm/11.6.2&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rule&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;pastebin.com:443&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;host&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;pastebin.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;last&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-11-07T10:21:00Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;agent&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;curl/8.5.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;risk&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;paste&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="allowlists"&gt;Allowlists&lt;span class="hx:absolute hx:-mt-20" id="allowlists"&gt;&lt;/span&gt;
&lt;a href="#allowlists" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The VM&amp;rsquo;s proxy reads devvm&amp;rsquo;s built-in policies first and then your policy files, in order, as one list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;devvm&amp;rsquo;s own rules for every VM, which allow OS packages, mise&amp;rsquo;s version lists, the Sigstore and GitHub trust roots that mise checks a download&amp;rsquo;s attestations against, Node&amp;rsquo;s downloads for a project&amp;rsquo;s own node, and GitHub;&lt;/li&gt;
&lt;li&gt;devvm&amp;rsquo;s rules for each shared tool in the VM&amp;rsquo;s image (&lt;code&gt;node&lt;/code&gt;, &lt;code&gt;claude&lt;/code&gt; and the others), which allow its registries, downloads and APIs;&lt;/li&gt;
&lt;li&gt;devvm&amp;rsquo;s rules for each &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;built-in layer&lt;/a&gt; in the VM&amp;rsquo;s image, so the &lt;code&gt;docker&lt;/code&gt; layer allows Docker&amp;rsquo;s packages and the container registries Docker Hub and ghcr.io, and the &lt;code&gt;nix&lt;/code&gt; layer allows Nix&amp;rsquo;s binary cache, channels and flake registry;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.config/devvm/layers/&amp;lt;name&amp;gt;.policy&lt;/code&gt;, for each of your own layers in the VM&amp;rsquo;s image;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.config/devvm/policy&lt;/code&gt;, your own rules for every VM, which &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; change with &lt;code&gt;-g&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/policy&lt;/code&gt;, the rules for that VM only, in the VM&amp;rsquo;s own folder, which is named by the hash that the VM&amp;rsquo;s name ends with, which &lt;a href="#changing-rules"&gt;&lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt;&lt;/a&gt; change;&lt;/li&gt;
&lt;li&gt;the hosts of the VM&amp;rsquo;s secrets and logins, and the host its agents log in at, such as Codex&amp;rsquo;s and opencode&amp;rsquo;s &lt;code&gt;auth.openai.com&lt;/code&gt; and Claude Code&amp;rsquo;s &lt;code&gt;platform.claude.com&lt;/code&gt; and &lt;code&gt;console.anthropic.com&lt;/code&gt;, on port 443, which devvm adds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first three are built in: they come with devvm, inside its binary, so you can&amp;rsquo;t edit them, and an upgrade of devvm is what changes them. To change what a VM reaches, add your own rules, and to keep a VM from a host that devvm&amp;rsquo;s rules allow, add a deny, which beats any allow. devvm leaves storage and paste sites out of its defaults on purpose, because they&amp;rsquo;re easy ways to send data out. Rules never come from the project folder, because the VM can write it. The proxy reads each of your files again when it changes, so an edit applies at once, from the next connection. &lt;a href="https://next.devvm.dev/docs/internals/network/#policy-files"&gt;How it works&lt;/a&gt; lists where each policy comes from.&lt;/p&gt;
&lt;h3 data-hextra-search-id="rules"&gt;Rules&lt;span class="hx:absolute hx:-mt-20" id="rules"&gt;&lt;/span&gt;
&lt;a href="#rules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A policy file holds one rule per line. &lt;code&gt;#&lt;/code&gt; starts a comment, and matching a host ignores case.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;th&gt;Matches&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;that host only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;*.example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any subdomain, at any depth, not &lt;code&gt;example.com&lt;/code&gt; itself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;**&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any host, and any address, though an internal address still needs its own rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.0.0.5&lt;/code&gt;, &lt;code&gt;10.0.0.0/8&lt;/code&gt;, &lt;code&gt;fd00::/8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;addresses, IPv4 or IPv6 (also what lets a connection past the internal-address refusal)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RULE:22&lt;/code&gt;, &lt;code&gt;[fd00::1]:22&lt;/code&gt;, &lt;code&gt;10.0.0.0/8:8080&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;only that port; without a port, 443 and 80&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RULE:*&lt;/code&gt;, &lt;code&gt;**:*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;!RULE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;deny: a deny beats any allow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RULE METHODS PATH&lt;/code&gt;, such as &lt;code&gt;api.github.com GET,HEAD /repos/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;only those requests to a host name, by their methods, their path or both (&lt;a href="#rules-by-method-and-path"&gt;rules by method and path&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A rule is written this way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A rule is plain ASCII, and a host&amp;rsquo;s part has no spaces in it, while a rule by method and path has its methods and its path after the host, each after a space.&lt;/li&gt;
&lt;li&gt;A port is a number from 1 to 65535, or &lt;code&gt;*&lt;/code&gt; for any port.&lt;/li&gt;
&lt;li&gt;A host&amp;rsquo;s one trailing dot is dropped, so &lt;code&gt;example.com.&lt;/code&gt; matches &lt;code&gt;example.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Brackets hold only an IPv6 address, and an address can&amp;rsquo;t follow &lt;code&gt;*.&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A line that holds anything else, such as &lt;code&gt;example.com:x&lt;/code&gt;, &lt;code&gt;a*.example.com&lt;/code&gt; or &lt;code&gt;! example.com&lt;/code&gt; with a space after the &lt;code&gt;!&lt;/code&gt;, isn&amp;rsquo;t a rule. A line that isn&amp;rsquo;t a rule and doesn&amp;rsquo;t start with &lt;code&gt;!&lt;/code&gt; is skipped, and the file&amp;rsquo;s other lines still apply. The proxy names each such line in its own log.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="devvm-callout devvm-callout-warning"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 1h1v1H5ZM4 2h1v1H4ZM6 2h1v1H6ZM4 3h1v1H4ZM6 3h1v1H6ZM3 4h1v1H3ZM7 4h1v1H7ZM3 5h1v1H3ZM5 5h1v1H5ZM7 5h1v1H7ZM2 6h1v1H2ZM5 6h1v1H5ZM8 6h1v1H8ZM2 7h1v1H2ZM5 7h1v1H5ZM8 7h1v1H8ZM1 8h1v1H1ZM9 8h1v1H9ZM1 9h1v1H1ZM5 9h1v1H5ZM9 9h1v1H9ZM0 10h1v1H0ZM10 10h1v1H10ZM0 11h11v1H0Z"/&gt;&lt;/svg&gt; Warning&lt;/p&gt;&lt;p&gt;When a line that isn&amp;rsquo;t a rule starts with &lt;code&gt;!&lt;/code&gt;, it reads as a deny, but the proxy can&amp;rsquo;t tell what it would deny. So while the line is there, the proxy of every VM that reads the file denies every new connection apart from the VM&amp;rsquo;s &lt;a href="#links-between-vms"&gt;links&lt;/a&gt;, whatever the other rules allow. Connections that are already open stay open. Each refusal names the file and the line, and it suggests no &lt;code&gt;devvm network allow&lt;/code&gt; command, because no rule would help.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;devvm warns about each line that isn&amp;rsquo;t a rule, with the file and the line&amp;rsquo;s number, and the warning for a broken deny says that the proxies deny everything until it&amp;rsquo;s fixed. It warns when you open a confined VM whose proxy reads the file, when &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; or &lt;code&gt;rm&lt;/code&gt; changes the file, and in &lt;code&gt;devvm doctor&lt;/code&gt;. &lt;code&gt;devvm network&lt;/code&gt; also marks the line. Fix the line or remove it, and the change applies from the next connection.&lt;/p&gt;
&lt;p&gt;The proxy never dials a denied address, even for an allowed name that resolves to it or to its NAT64 or 6to4 form. A missing file has no rules. A file that changed but can&amp;rsquo;t be read keeps its last rules, so a deny never lapses.&lt;/p&gt;
&lt;h3 data-hextra-search-id="quiet-hosts"&gt;Quiet hosts&lt;span class="hx:absolute hx:-mt-20" id="quiet-hosts"&gt;&lt;/span&gt;
&lt;a href="#quiet-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some tools send telemetry to a host of their own, and devvm&amp;rsquo;s built-in policies leave such hosts out. Cursor&amp;rsquo;s CLI has no setting that turns its metrics off, so it keeps sending them to &lt;code&gt;api3.cursor.sh&lt;/code&gt; and getting blocked, many times a session. devvm&amp;rsquo;s built-in policies mark a few such hosts quiet, with a &lt;code&gt;quiet HOST&lt;/code&gt; line, for one exact host name. A quiet host is blocked as any host that no rule allows, and &lt;code&gt;devvm network log&lt;/code&gt; still shows each block, ending &lt;code&gt;, quiet&lt;/code&gt;. The VM gets no note before its prompt for it, though, and &lt;code&gt;devvm-why&lt;/code&gt; doesn&amp;rsquo;t list it, the &lt;code&gt;403&lt;/code&gt; that the tool gets suggests no command, &lt;code&gt;devvm network log --blocked&lt;/code&gt; shows &lt;code&gt;- (quiet)&lt;/code&gt; instead of one, and &lt;code&gt;devvm network lock&lt;/code&gt; never offers it.&lt;/p&gt;
&lt;p&gt;A block is quiet only when no rule of yours covers the host and nothing else refused it, such as its address. To allow a quiet host anyway, add it as any other host, such as &lt;code&gt;devvm network allow api3.cursor.sh&lt;/code&gt;, and your rule wins. Only devvm&amp;rsquo;s own policies can mark a host quiet. In one of your files, a &lt;code&gt;quiet&lt;/code&gt; line isn&amp;rsquo;t a rule, so the proxy skips it, and devvm warns about it as it warns about any other line that isn&amp;rsquo;t a rule, saying that only devvm&amp;rsquo;s policies can mark a host quiet. These are the quiet hosts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;api3.cursor.sh&lt;/code&gt;, the host Cursor documents for its editor&amp;rsquo;s Tab requests, which Cursor&amp;rsquo;s CLI uses for its metrics (in a &lt;code&gt;devvm cursor&lt;/code&gt; window, Tab&amp;rsquo;s requests come from the Cursor app on this machine, not the VM);&lt;/li&gt;
&lt;li&gt;&lt;code&gt;telemetry.go.dev&lt;/code&gt;, Go&amp;rsquo;s telemetry uploads, which every VM turns off.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="changing-rules"&gt;Changing rules&lt;span class="hx:absolute hx:-mt-20" id="changing-rules"&gt;&lt;/span&gt;
&lt;a href="#changing-rules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm network&lt;/code&gt; shows this folder&amp;rsquo;s VM&amp;rsquo;s allowlist after its tier. It prints each of the VM&amp;rsquo;s policies that holds more than comments, and then its rules without their comments. A built-in policy has its name after &lt;code&gt;# devvm:&lt;/code&gt;, because it has no file you could edit, and one of your files has its path after &lt;code&gt;#&lt;/code&gt;, followed by &lt;code&gt;(denies only)&lt;/code&gt; on the internet and none tiers, where it shows only the file&amp;rsquo;s denies. An open VM has no policies, so &lt;code&gt;devvm network&lt;/code&gt; prints its tier alone. A built-in policy&amp;rsquo;s quiet line is marked &lt;code&gt;# blocked, without a notice in the VM&lt;/code&gt;, and a line that isn&amp;rsquo;t a rule is marked &lt;code&gt;# not a rule, skipped&lt;/code&gt;, with its line number:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;allowlist
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# devvm: layers/base.policy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ports.ubuntu.com
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; github.com
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# /Users/you/.local/share/devvm/vms/71a99b1076d92c/policy
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; example.com
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; example.com:x # not a rule, skipped (line 2)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network allow RULE...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;add the rules to the VM&amp;rsquo;s own file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network deny RULE...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;add them as denies, adding &lt;code&gt;!&lt;/code&gt; when it&amp;rsquo;s missing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network rm RULE...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;remove the lines with these rules, a deny with its &lt;code&gt;!&lt;/code&gt;, and warn about one that isn&amp;rsquo;t there&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-g&lt;/code&gt;, &lt;code&gt;--global&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; or &lt;code&gt;rm&lt;/code&gt;, change &lt;code&gt;~/.config/devvm/policy&lt;/code&gt;, for every VM, instead, which needs no VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--method METHODS&lt;/code&gt;, &lt;code&gt;--path PATH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; or &lt;code&gt;rm&lt;/code&gt;, narrow each rule to those requests (&lt;a href="#rules-by-method-and-path"&gt;rules by method and path&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A rule is what &lt;a href="#rules"&gt;Rules&lt;/a&gt; lists, without spaces or a comment, and &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt; add its methods and its path. devvm refuses anything else before it adds any rule, and it also refuses &lt;code&gt;allow !RULE&lt;/code&gt;. A rule that&amp;rsquo;s already in the file, in any case, isn&amp;rsquo;t added again, and a rule by method and path is the same rule however its methods are written, while its path&amp;rsquo;s case is its own. Each change applies at once, from the next connection. For an open VM, devvm notes that no rule applies to it, and for an allow on the internet or none tier, that only denies apply there. When &lt;code&gt;devvm network log --blocked&lt;/code&gt; or a blocked request in the VM suggests a &lt;code&gt;devvm network allow&lt;/code&gt; command, its rule is one that &lt;code&gt;devvm network allow&lt;/code&gt; takes.&lt;/p&gt;
&lt;p&gt;If a VM was deleted outside devvm, devvm deletes what it kept for that VM when it makes a new VM for the same project folder, so the new VM never gets the old one&amp;rsquo;s rules.&lt;/p&gt;
&lt;h3 data-hextra-search-id="rules-by-method-and-path"&gt;Rules by method and path&lt;span class="hx:absolute hx:-mt-20" id="rules-by-method-and-path"&gt;&lt;/span&gt;
&lt;a href="#rules-by-method-and-path" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A rule for a host name can also name the requests it covers, by their methods, their path or both. So a VM can read from an API without changing anything there, or reach a host without pushing to it. &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; take &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt; for this, and the file gets the rule as one line, such as &lt;code&gt;api.github.com GET,HEAD /repos/&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network allow api.example.com --method GET,HEAD&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;let the VM only read from &lt;code&gt;api.example.com&lt;/code&gt;, a host that no other rule allows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network allow api.example.com --path /v1/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;let it reach only the paths below &lt;code&gt;/v1/&lt;/code&gt; there&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network deny api.github.com --method POST,PUT,PATCH,DELETE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;keep it from changing anything through GitHub&amp;rsquo;s API, which devvm&amp;rsquo;s rules allow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network deny github.com --path '/*/*/git-receive-pack'&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;keep it from pushing to GitHub over HTTPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network deny -g pastebin.com --method POST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;keep every VM from posting there&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Allows add up and a deny beats any allow, as for every rule:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An allow by method and path lets through only the requests it names, and the host&amp;rsquo;s other requests stay blocked unless another rule allows the whole host.&lt;/li&gt;
&lt;li&gt;So to narrow a host that a rule already allows whole, such as &lt;code&gt;api.github.com&lt;/code&gt;, which devvm&amp;rsquo;s own rules allow, add a deny of what the VM mustn&amp;rsquo;t do. An allow by method and path for such a host narrows nothing, and devvm warns you so when you add one, naming the VMs where another rule allows the host whole, with &lt;code&gt;-g&lt;/code&gt; each VM&amp;rsquo;s own rules counted, and the deny to add instead. Where a whole allow names port 443 alone, such as &lt;code&gt;api.example.com:443&lt;/code&gt;, an allow by method and path still narrows the host&amp;rsquo;s plain HTTP on port 80, and the warning says that.&lt;/li&gt;
&lt;li&gt;A deny by method and path refuses only the requests it names, and the host&amp;rsquo;s other requests go on.&lt;/li&gt;
&lt;li&gt;You can narrow any host this way, devvm&amp;rsquo;s built-in ones, a secret&amp;rsquo;s and an agent&amp;rsquo;s included, for one VM or with &lt;code&gt;-g&lt;/code&gt; for every VM.&lt;/li&gt;
&lt;li&gt;On the internet and none tiers your denies apply, by method and path too, while your allows apply only on the allowlist tier, as for every rule.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The methods are some of &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;HEAD&lt;/code&gt;, &lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;PATCH&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;, &lt;code&gt;OPTIONS&lt;/code&gt;, &lt;code&gt;TRACE&lt;/code&gt; and &lt;code&gt;QUERY&lt;/code&gt;, in any case, joined by commas, and devvm writes them in capitals in that order:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;GET&lt;/code&gt; doesn&amp;rsquo;t include &lt;code&gt;HEAD&lt;/code&gt;, so name both for reading.&lt;/li&gt;
&lt;li&gt;A deny refuses only the methods it names, so to keep a host read-only, name &lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;PATCH&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A GraphQL API, such as GitHub&amp;rsquo;s at &lt;code&gt;api.github.com/graphql&lt;/code&gt;, takes its reads as &lt;code&gt;POST&lt;/code&gt; too, so such a deny refuses them as well, and the GitHub CLI, which reads through it, fails there.&lt;/li&gt;
&lt;li&gt;Some servers take a request&amp;rsquo;s method from a header or a parameter instead of the request itself, so the proxy judges a request by every method it names, and while a rule by method covers a host, it refuses a request whose method it can&amp;rsquo;t read alike for every server (&lt;a href="https://next.devvm.dev/docs/internals/network/#requests-by-method-and-path"&gt;requests by method and path&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A path is a pattern:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Matches&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/repos/*/*/issues&lt;/code&gt;, &lt;code&gt;/*/*.git/info/refs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any part of one segment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;**&lt;/code&gt;, as a whole segment&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/repos/**&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;one segment or more&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a path that ends with &lt;code&gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/repos/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;everything below it, as &lt;code&gt;/**&lt;/code&gt; there would, so &lt;code&gt;/repos/a&lt;/code&gt; and &lt;code&gt;/repos/a/b&lt;/code&gt; but not &lt;code&gt;/repos&lt;/code&gt; itself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a path without a &lt;code&gt;/&lt;/code&gt; at its end&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;also the request&amp;rsquo;s path with one, so &lt;code&gt;/user/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;any path&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/search&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whatever the query, so &lt;code&gt;/search?q=x&lt;/code&gt;, because the query never counts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A path starts with &lt;code&gt;/&lt;/code&gt;, and it has no &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;..&lt;/code&gt; part, no doubled slash, and no space, &lt;code&gt;%&lt;/code&gt;, &lt;code&gt;\&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;?&lt;/code&gt; or &lt;code&gt;#&lt;/code&gt;. Servers don&amp;rsquo;t all read a request&amp;rsquo;s path alike, so an allow matches only a path in a plain form that every server reads the same way, and a deny matches broadly. So a deny of &lt;code&gt;/gists/&lt;/code&gt; refuses &lt;code&gt;/gists&lt;/code&gt;, &lt;code&gt;/GISTS/1&lt;/code&gt;, &lt;code&gt;/gists/&lt;/code&gt;, &lt;code&gt;/gists.json&lt;/code&gt;, &lt;code&gt;/%67ists/1&lt;/code&gt;, &lt;code&gt;/x/../gists/1&lt;/code&gt; and &lt;code&gt;/gists;x/1&lt;/code&gt; alike, and a deny of &lt;code&gt;/admin&lt;/code&gt; refuses &lt;code&gt;/admin.json&lt;/code&gt; and &lt;code&gt;/admin.&lt;/code&gt; but not &lt;code&gt;/administrator&lt;/code&gt;. While a rule with a path covers a host, a request there whose path has an encoded character, such as a file name with a space, is refused unless a rule without a path allows it (&lt;a href="https://next.devvm.dev/docs/internals/network/#requests-by-method-and-path"&gt;requests by method and path&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;To see each request, the proxy decrypts the host&amp;rsquo;s HTTPS on port 443 with &lt;a href="#secrets"&gt;the VM&amp;rsquo;s own CA&lt;/a&gt;, as it does for a secret&amp;rsquo;s hosts. That has these effects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The proxy checks every request on the connection, each one on a kept-alive connection and on HTTP/2 alike, with the rules as they are then, so a change to them applies to a decrypted tunnel from its next request. A tunnel that was open to the host before a rule narrowed it isn&amp;rsquo;t decrypted, so it carries on unchecked until it closes.&lt;/li&gt;
&lt;li&gt;A tunnel to such a host on any other port is refused, because the proxy can&amp;rsquo;t see the requests in it, while plain HTTP on any port gets the same check for each request.&lt;/li&gt;
&lt;li&gt;A tool in the VM that doesn&amp;rsquo;t trust the VM&amp;rsquo;s CA fails there, and &lt;code&gt;devvm network log&lt;/code&gt; gives the reason &lt;code&gt;TLS with the VM failed&lt;/code&gt;, which is why devvm reminds you when you add such a rule that the host is now decrypted. A host that a whole allow covers, with no deny by method and path, stays a tunnel.&lt;/li&gt;
&lt;li&gt;A rule by method and path needs a host name or &lt;code&gt;*.name&lt;/code&gt;, so devvm refuses &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt; with an address or a CIDR, which have no name to decrypt by, and with &lt;code&gt;**&lt;/code&gt;, which would decrypt every host.&lt;/li&gt;
&lt;li&gt;A WebSocket is checked by the request that opens it, and what it carries after that isn&amp;rsquo;t. A switch to any other protocol, such as &lt;code&gt;Upgrade: h2c&lt;/code&gt;, and a &lt;code&gt;CONNECT&lt;/code&gt; inside a decrypted tunnel are refused, because the proxy couldn&amp;rsquo;t check the requests that would follow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A request that the rules block gets &lt;code&gt;403&lt;/code&gt; from the proxy, with the reason, and never reaches the host. &lt;code&gt;devvm network log&lt;/code&gt; shows it with its method and its path, and &lt;code&gt;devvm-why&lt;/code&gt; lists it. For a request that no allow covers, the proxy suggests the &lt;code&gt;devvm network allow&lt;/code&gt; command for the whole host, and for one that a deny refuses it suggests nothing, because no allow lifts a deny. A request that a rule by method and path let through shows that rule in &lt;code&gt;devvm network log&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ devvm network allow api.example.com --method GET --path /v1/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;==&amp;gt; devvm added api.example.com GET /v1/ to devvm-some-project-71a99b1076d92c&amp;#39;s rules.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The proxy now decrypts api.example.com&amp;#39;s HTTPS on port 443 to check each request, so a tool that doesn&amp;#39;t trust the VM&amp;#39;s CA fails there, and a new tunnel to it on another port is refused. Tunnels to it that are open already carry on unchecked until they close.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://devvm.dev/docs/safety/network/#rules-by-method-and-path&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the VM, a &lt;code&gt;GET&lt;/code&gt; below &lt;code&gt;/v1/&lt;/code&gt; reaches the host, while a &lt;code&gt;POST&lt;/code&gt; there gets the proxy&amp;rsquo;s answer:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ curl -X POST https://api.example.com/v1/charges
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm: api.example.com:443 is blocked (no rule allows this method and path). Allow it on the host with: devvm network allow api.example.com&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And on this machine, &lt;code&gt;devvm network log&lt;/code&gt; shows both:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-11-08T10:00:01Z allowed api.example.com:443 rule api.example.com GET /v1/, decrypted
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-11-08T10:00:01Z allowed api.example.com:443 GET /v1/charges, rule api.example.com GET /v1/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-11-08T10:00:02Z BLOCKED api.example.com:443 POST /v1/charges: no rule allows this method and path&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Learning stays by host: &lt;code&gt;devvm network lock&lt;/code&gt; adds whole hosts, and you can narrow them afterwards with these flags (&lt;a href="#learning-the-hosts-a-vm-needs"&gt;learning the hosts a VM needs&lt;/a&gt;). A line with a method that devvm doesn&amp;rsquo;t know, such as &lt;code&gt;!api.github.com PSOT&lt;/code&gt;, isn&amp;rsquo;t a rule, so as a deny it makes the proxy deny everything until you fix it (&lt;a href="#rules"&gt;rules&lt;/a&gt;). The shared Nix cache&amp;rsquo;s own downloads from &lt;code&gt;cache.nixos.org&lt;/code&gt; meet these rules too, as &lt;code&gt;GET&lt;/code&gt;s of the paths the VM asked the cache for (&lt;a href="#nix"&gt;Nix&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s proxy is the devvm binary that started it, which is the one from before an upgrade until the VM&amp;rsquo;s next launch. A proxy from before rules by method and path reads such a rule as a line that isn&amp;rsquo;t a rule: it skips an allow by method and path, and a deny by method and path makes it deny the VM everything, until it starts again. Likewise, once one of a VM&amp;rsquo;s secrets goes in by method or by a path pattern, such a proxy puts none of the VM&amp;rsquo;s secrets in. So when you add or remove such a rule, or change such a secret, while a VM&amp;rsquo;s proxy runs from another devvm binary, or from one devvm can&amp;rsquo;t tell, devvm warns you and names the VM, and running &lt;code&gt;devvm&lt;/code&gt; in the VM&amp;rsquo;s folder starts its proxy again.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-network-json"&gt;devvm network &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-network-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-network-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm network --json&lt;/code&gt; prints the VM&amp;rsquo;s tier and its allowlist as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. With &lt;code&gt;--json&lt;/code&gt; the command only shows, so devvm refuses a tier with it.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt; or &lt;code&gt;unenforced&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;learning_since&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for a learning VM, the time it started &lt;a href="#learning-the-hosts-a-vm-needs"&gt;learning&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;allowlist&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each policy that holds more than comments, in the order the proxy reads them, with the fields below&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;builtin&lt;/code&gt;, &lt;code&gt;file&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a built-in policy&amp;rsquo;s name, or the path of one of your files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the policy&amp;rsquo;s rules: all of a file&amp;rsquo;s rules, or on the internet and none tiers, for a file whose denies alone apply, its denies, as &lt;code&gt;devvm network&lt;/code&gt; lists them under &lt;code&gt;(denies only)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;denies_only&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt; for a file whose denies alone apply&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;not_rules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each line that isn&amp;rsquo;t a rule, with its &lt;code&gt;line&lt;/code&gt; number and its &lt;code&gt;text&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;quiet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a built-in policy&amp;rsquo;s &lt;a href="#quiet-hosts"&gt;quiet hosts&lt;/a&gt;, there only when it has some&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;transparent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s &lt;a href="#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt;, with &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;from&lt;/code&gt;, as &lt;code&gt;devvm network transparent --json&lt;/code&gt; has it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;With &lt;code&gt;-g&lt;/code&gt;, the object has only &lt;code&gt;policy&lt;/code&gt;, which is the tier new VMs get, and &lt;code&gt;source&lt;/code&gt;, which says where it came from: &lt;code&gt;config.toml&lt;/code&gt;, &lt;code&gt;settings.json&lt;/code&gt; for what &lt;code&gt;devvm network -g&lt;/code&gt; or &lt;code&gt;devvm setup&lt;/code&gt; saved, or &lt;code&gt;built-in&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/settings/#where-a-default-comes-from"&gt;where a default comes from&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;policy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;allowlist&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;source&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;config.toml&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;policy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;allowlist&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;allowlist&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;builtin&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;layers/base.policy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;ports.ubuntu.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;github.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;not_rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;file&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/.local/share/devvm/vms/71a99b1076d92c/policy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;example.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;not_rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;line&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;text&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;example.com:x&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;transparent&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;on&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;from&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;default&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On the none tier, a VM with Claude Code gets Claude Code&amp;rsquo;s built-in policy whole, and its own file shows only its denies:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;policy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;none&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;allowlist&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;builtin&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;shared-tools/claude.policy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;api.anthropic.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;claude.ai&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;not_rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;file&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/.local/share/devvm/vms/71a99b1076d92c/policy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;denies_only&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;!tracker.example.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;not_rules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="inside-the-vm"&gt;Inside the VM&lt;span class="hx:absolute hx:-mt-20" id="inside-the-vm"&gt;&lt;/span&gt;
&lt;a href="#inside-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every login in the VM has the proxy settings in its environment (&lt;code&gt;HTTP_PROXY&lt;/code&gt;, &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and their lowercase forms, &lt;code&gt;NO_PROXY&lt;/code&gt; for the VM itself, and &lt;code&gt;NODE_USE_ENV_PROXY&lt;/code&gt;), and the &lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;CA variables&lt;/a&gt; that every VM has point the tools that don&amp;rsquo;t read the system&amp;rsquo;s store at the VM&amp;rsquo;s own CAs. devvm also points apt, sudo, ssh and Docker at the proxy (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-setup"&gt;how&lt;/a&gt;), on every tier.&lt;/p&gt;
&lt;p&gt;On a confined tier, a direct connection to an address fails at once, even as root, and no DNS query leaves the VM. Names resolve in the proxy as the tool wrote them, without this machine&amp;rsquo;s DNS search domain added, so to reach a host on your network, use its full name, such as &lt;code&gt;jenkins.corp.example.com&lt;/code&gt; and not &lt;code&gt;jenkins&lt;/code&gt;. Inside the VM, every name resolves to one stand-in address, which leads to the proxy too, so a tool that skips the proxy settings still reaches the hosts the rules allow over HTTPS and HTTP (&lt;a href="#tools-that-ignore-the-proxy"&gt;tools that ignore the proxy&lt;/a&gt;). Such a tool&amp;rsquo;s connection to another port of a name is refused at once, and nothing reaches the log for it (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-tool-that-skips-the-proxy-fails"&gt;what to do&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A blocked request gets &lt;code&gt;403&lt;/code&gt;, and the response names the host, the reason and the rule that would allow it, but for a &lt;a href="#quiet-hosts"&gt;quiet host&lt;/a&gt;. The proxy also answers at &lt;code&gt;http://devvm.proxy/&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/blocked&lt;/code&gt; lists the last 50 blocks.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/blocked/new?after=N&lt;/code&gt; gives the number of blocks so far, then those after the Nth, with each rule once, so a shell prompt can show what a command hit.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/ca.pem&lt;/code&gt; is the VM&amp;rsquo;s own CA certificate and the next one&amp;rsquo;s, never their keys.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/nix/&lt;/code&gt; is the shared Nix cache, in a VM with the &lt;code&gt;nix&lt;/code&gt; layer (&lt;a href="#nix"&gt;below&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/transparent/ports&lt;/code&gt; lists the ports that &lt;a href="#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt; sends to the proxy, one a line.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A request for &lt;code&gt;http://devvm.proxy/&lt;/code&gt; that comes through transparent mode, without the proxy settings, reaches &lt;code&gt;/blocked&lt;/code&gt; alone and gets &lt;code&gt;403&lt;/code&gt; for the rest, because that way asks the tool for no password, so a container without the proxy settings can&amp;rsquo;t fetch the VM&amp;rsquo;s CA or the Nix cache.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm-why &lt;span class="c1"&gt;# in the VM: what the proxy blocked lately&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the VM, &lt;code&gt;devvm-why&lt;/code&gt; prints what the proxy blocked lately, and a note before each prompt tells you when something new was blocked. These help too:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When the proxy blocked nothing lately, &lt;code&gt;devvm-why&lt;/code&gt; says so, and it adds that a connection refused, or a DNS error, for a host the tier allows means the tool skipped the proxy on a port or in a way devvm can&amp;rsquo;t send to it, so you turn on the tool&amp;rsquo;s own proxy setting or give it the address in &lt;code&gt;$HTTPS_PROXY&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-tool-that-skips-the-proxy-fails"&gt;a tool that skips the proxy fails&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;With transparent mode on, &lt;code&gt;devvm-why&lt;/code&gt; then says which ports it sends to the proxy, lists the connections to other ports that the VM refused lately, by port and time, and lists the names that tools looked up lately.&lt;/li&gt;
&lt;li&gt;devvm also tells Claude Code and Codex, in &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; and &lt;code&gt;~/.codex/AGENTS.md&lt;/code&gt;, why a request may fail and to run &lt;code&gt;devvm-why&lt;/code&gt;, that a tool that ignores the proxy settings still reaches the proxy over HTTPS, HTTP and the ports the rules name, and that a connection refused on another port while &lt;code&gt;devvm-why&lt;/code&gt; shows nothing blocked means the tool skipped the proxy.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="nix"&gt;Nix&lt;span class="hx:absolute hx:-mt-20" id="nix"&gt;&lt;/span&gt;
&lt;a href="#nix" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In a VM with the &lt;a href="https://next.devvm.dev/docs/using/images/#nix"&gt;&lt;code&gt;nix&lt;/code&gt; layer&lt;/a&gt;, Nix&amp;rsquo;s daemon makes most of Nix&amp;rsquo;s downloads, and devvm also points it at the proxy, so its downloads go through the same allowlists. The layer&amp;rsquo;s allowlist has &lt;code&gt;cache.nixos.org&lt;/code&gt; for Nix&amp;rsquo;s binary cache, and &lt;code&gt;channels.nixos.org&lt;/code&gt; and &lt;code&gt;releases.nixos.org&lt;/code&gt; for its channels and flake registry, and GitHub, where most flakes&amp;rsquo; inputs come from, is in devvm&amp;rsquo;s rules for every VM.&lt;/p&gt;
&lt;p&gt;Nix asks the proxy&amp;rsquo;s shared cache, &lt;code&gt;http://devvm.proxy/nix&lt;/code&gt;, before cache.nixos.org, so every VM with the layer shares the packages that any of them downloaded (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#nix-projects"&gt;shared downloads&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;the shared Nix cache&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The proxy fetches what the cache doesn&amp;rsquo;t have from cache.nixos.org alone, and only while the VM&amp;rsquo;s tier and rules let it reach &lt;code&gt;cache.nixos.org&lt;/code&gt;. It keeps a package only when cache.nixos.org&amp;rsquo;s signature on it checks, and the VM&amp;rsquo;s Nix checks that signature again.&lt;/li&gt;
&lt;li&gt;A VM can only make the proxy fetch from cache.nixos.org: the proxy refuses anything a VM sends to store, and every request that isn&amp;rsquo;t for one of Nix&amp;rsquo;s cache files.&lt;/li&gt;
&lt;li&gt;Each request shows in &lt;code&gt;devvm network log&lt;/code&gt; as &lt;code&gt;cache&lt;/code&gt;, with whether it was a &lt;code&gt;hit&lt;/code&gt;, &lt;code&gt;fetched&lt;/code&gt;, or why it wasn&amp;rsquo;t found. What one VM can learn of another through the cache is under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;Attack vectors&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;An open VM has its proxy too, so it shares the cache as well, and its proxy fetches from cache.nixos.org for it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When a package isn&amp;rsquo;t in the binary cache, Nix builds it from source, and the build downloads its sources from their own hosts, such as &lt;code&gt;ftpmirror.gnu.org&lt;/code&gt;. The proxy blocks those hosts until you allow them, so the build fails, and the error, &lt;code&gt;devvm-why&lt;/code&gt; and &lt;code&gt;devvm network log --blocked&lt;/code&gt; name the host and the &lt;code&gt;devvm network allow&lt;/code&gt; command that allows it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="behind-a-company-proxy"&gt;Behind a company proxy&lt;span class="hx:absolute hx:-mt-20" id="behind-a-company-proxy"&gt;&lt;/span&gt;
&lt;a href="#behind-a-company-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When this machine reaches the internet only through a company proxy, the VM&amp;rsquo;s proxy sends the requests it allows through that proxy. devvm reads &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt;, or their lowercase forms, from the shell you run it in. When that shell sets neither &lt;code&gt;HTTPS_PROXY&lt;/code&gt; nor &lt;code&gt;HTTP_PROXY&lt;/code&gt;, devvm reads the &lt;code&gt;[proxy]&lt;/code&gt; table of &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; instead, so the proxy works from every shell, including an editor&amp;rsquo;s terminal that didn&amp;rsquo;t load your profile. The shell&amp;rsquo;s settings win whole: devvm never mixes them with &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s, so a &lt;code&gt;NO_PROXY&lt;/code&gt; alone in the shell still leaves &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s proxy in effect, with its own &lt;code&gt;no-proxy&lt;/code&gt;.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;https&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://[email protected]:8080&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;http&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://[email protected]:8080&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;no-proxy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;localhost,.example.com&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm passes the settings to the VM&amp;rsquo;s proxy when the proxy starts, and when you run devvm again with different settings, devvm starts the VM&amp;rsquo;s proxy again with the new ones. So after you change them, run devvm again in the folder or &lt;code&gt;devvm restart&lt;/code&gt;. When a VM&amp;rsquo;s proxy went through a company proxy the last time it started and devvm finds none this time, devvm warns you and names &lt;code&gt;config.toml&lt;/code&gt;, because a VM&amp;rsquo;s proxy that a shell without the settings starts sends the VM&amp;rsquo;s requests directly.&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s proxy uses the company proxy this way (&lt;a href="https://next.devvm.dev/docs/internals/network/#through-a-company-proxy"&gt;through a company proxy&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It still decides each request by the host name the VM asked for, against the same allowlists, and only then passes it on. It sends tunnels, which carry HTTPS and the requests it puts your secrets into, through &lt;code&gt;HTTPS_PROXY&lt;/code&gt;&amp;rsquo;s proxy, and plain HTTP requests through &lt;code&gt;HTTP_PROXY&lt;/code&gt;&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;It reaches the hosts that &lt;code&gt;NO_PROXY&lt;/code&gt; names directly, and also &lt;code&gt;localhost&lt;/code&gt; and loopback addresses. In &lt;code&gt;NO_PROXY&lt;/code&gt;, &lt;code&gt;example.com&lt;/code&gt; matches that host and its subdomains, &lt;code&gt;.example.com&lt;/code&gt; matches only its subdomains, an address or a CIDR matches addresses, any entry can end in a port, and &lt;code&gt;*&lt;/code&gt; matches every host. An IPv6 address with a zone, such as &lt;code&gt;fe80::1%eth0&lt;/code&gt;, matches nothing, as it does in Go&amp;rsquo;s HTTP clients.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm network log&lt;/code&gt; adds &lt;code&gt;through host:port&lt;/code&gt; to each request that went through the company proxy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The company proxy&amp;rsquo;s address and password follow these rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The company proxy needs an &lt;code&gt;http://&lt;/code&gt; address, such as &lt;code&gt;http://user:[email protected]:8080&lt;/code&gt; in &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, and a proxy without a port is on port 80. devvm doesn&amp;rsquo;t start a VM&amp;rsquo;s proxy while &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; or a &lt;code&gt;[proxy]&lt;/code&gt; key names an &lt;code&gt;https://&lt;/code&gt; or &lt;code&gt;socks5://&lt;/code&gt; proxy, and it tells you which setting to change.&lt;/li&gt;
&lt;li&gt;The company proxy&amp;rsquo;s password stays on this machine. The VM never gets it, and devvm writes it into no log, no image and no process&amp;rsquo;s arguments.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;config.toml&lt;/code&gt; never holds the password, because it&amp;rsquo;s a file you might copy to other machines or keep with your dotfiles, and devvm refuses a &lt;code&gt;[proxy]&lt;/code&gt; URL that has one. Put only the user in the URL, as &lt;code&gt;http://[email protected]:8080&lt;/code&gt;, and save the password with &lt;code&gt;devvm secret set proxy&lt;/code&gt;, which keeps it as it keeps the other &lt;a href="#saving-and-binding-secrets"&gt;secrets&lt;/a&gt;. devvm&amp;rsquo;s proxies look it up themselves when they start, so no file of devvm&amp;rsquo;s holds it in the clear.&lt;/li&gt;
&lt;li&gt;devvm doesn&amp;rsquo;t make a new VM, start a VM&amp;rsquo;s proxy, or build an image or the shared tools while &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s proxy names a user and no password is saved, and it checks before anything starts or stops. So &lt;code&gt;devvm&lt;/code&gt; or &lt;code&gt;devvm restart&lt;/code&gt; in the folder of a running VM leaves the VM and its proxy running as they were, as long as that proxy still enforces the VM&amp;rsquo;s network tier, and otherwise devvm stops the VM (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A VM&amp;rsquo;s proxy reads the password only when it starts, so after you change it, run &lt;code&gt;devvm restart&lt;/code&gt; in each VM&amp;rsquo;s folder. No VM ever gets the &lt;code&gt;proxy&lt;/code&gt; secret, and &lt;code&gt;devvm secret use proxy&lt;/code&gt; refuses.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm secret &lt;span class="nb"&gt;set&lt;/span&gt; proxy &lt;span class="c1"&gt;# save the company proxy&amp;#39;s password, which devvm asks for&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm restart &lt;span class="c1"&gt;# in each VM&amp;#39;s folder, once the password changed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="devvm-callout devvm-callout-note"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M4 9h3V8H6V5H4v1h1v2H4Zm-3 1h1V9H1Zm1 1h1v-1H2ZM0 9h1V4H0Zm3 3h5v-1H3Zm5-1h1v-1H8ZM1 4h1V3H1Zm8 6h1V9H9ZM2 3h1V2H2Zm3 1h1V3H5Zm5 5h1V4h-1ZM3 2h5V1H3Zm6 2h1V3H9ZM8 3h1V2H8Zm0 0"/&gt;&lt;/svg&gt; Note&lt;/p&gt;&lt;p&gt;The company proxy sees the name and port of every host the VM reaches, and if it inspects TLS, the &lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;CA you add for it&lt;/a&gt; also lets it read the traffic. The company proxy also looks up each name itself, so the VM&amp;rsquo;s proxy can&amp;rsquo;t check every address a name leads to. It still refuses an address that&amp;rsquo;s this machine&amp;rsquo;s own or internal, unless a rule names it, and it refuses a name when this machine&amp;rsquo;s lookup gives an internal or denied address for it. A name that this machine can&amp;rsquo;t look up goes to the company proxy unchecked only when an allowlist names it, as &lt;code&gt;example.com&lt;/code&gt; or &lt;code&gt;*.example.com&lt;/code&gt;. When only &lt;code&gt;**&lt;/code&gt; allows a name that this machine can&amp;rsquo;t look up, the VM&amp;rsquo;s proxy refuses it, so &lt;code&gt;**&lt;/code&gt; never lets a VM send the company proxy a name of its own making. What a VM can still reach through the company proxy, such as hosts on your company&amp;rsquo;s network, is under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;Attack vectors&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;&lt;h3 data-hextra-search-id="open-vms-and-builds"&gt;Open VMs and builds&lt;span class="hx:absolute hx:-mt-20" id="open-vms-and-builds"&gt;&lt;/span&gt;
&lt;a href="#open-vms-and-builds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;These go through the company proxy too:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Open VMs.&lt;/strong&gt; An open VM goes through its proxy as every VM does, and its proxy sends its requests through the company proxy, from the shell&amp;rsquo;s settings or &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s, so the company proxy&amp;rsquo;s password stays on this machine for it too. The VM never gets the shell&amp;rsquo;s proxy settings, and Lima gets none to pass on to it. What an open VM reaches directly, past its proxy, such as the hosts its &lt;code&gt;NO_PROXY&lt;/code&gt; names, doesn&amp;rsquo;t go through the company proxy. Lima prints each proxy setting it gives a VM, password and all, as it starts the VM. devvm keeps the password out of its &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;run log&lt;/a&gt;, and once the VM has started, it replaces the password with as many &lt;code&gt;*&lt;/code&gt; in the log Lima keeps for the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds.&lt;/strong&gt; Builds never get your company proxy&amp;rsquo;s settings, and images never keep them. A build goes through the shell&amp;rsquo;s company proxy, or else &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s, as a VM&amp;rsquo;s proxy does. When devvm builds an image, builds the shared tools or converts a &lt;code&gt;--from&lt;/code&gt; container image on Lima behind a company proxy, the build goes through a proxy of devvm&amp;rsquo;s on this machine, made for that build alone, which goes through your company proxy. The build&amp;rsquo;s commands get only that proxy&amp;rsquo;s address, with a password devvm makes for the build, while they run, and devvm stops the proxy when the build ends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What a build runs.&lt;/strong&gt; So the code a build runs, which includes a container image&amp;rsquo;s own, never sees your company proxy&amp;rsquo;s address or password. That proxy also runs on this machine, so a company proxy on &lt;code&gt;localhost&lt;/code&gt;, such as one a VPN client runs, works for builds too. A build&amp;rsquo;s proxy allows any host, as &lt;code&gt;**&lt;/code&gt; does. It sends a name that this machine can&amp;rsquo;t look up on to the company proxy, so builds work where only the company proxy looks up outside names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm&amp;rsquo;s own downloads on this machine.&lt;/strong&gt; They are devvm&amp;rsquo;s copy of mise and the versions it looks up for the shared tools, the list of Ubuntu&amp;rsquo;s cloud images, and a container registry&amp;rsquo;s answers for &lt;code&gt;--from&lt;/code&gt;. With the shell&amp;rsquo;s settings, each of them uses the shell&amp;rsquo;s. With &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s, devvm&amp;rsquo;s own requests send the password only to the company proxy. When a VM&amp;rsquo;s proxy refreshes a Codex or opencode login on this machine, the refresh goes through the same company proxy as the VM&amp;rsquo;s requests, with the password kept on this machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The mise devvm runs on this machine.&lt;/strong&gt; It gets the proxy&amp;rsquo;s URL with the password in it, in its environment, because mise takes a proxy&amp;rsquo;s password nowhere else. devvm percent-encodes the password in that URL and mise decodes it before it sends it, so a password with characters such as &lt;code&gt;@&lt;/code&gt;, &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;#&lt;/code&gt;, &lt;code&gt;%&lt;/code&gt; or a space works too. devvm never puts that URL in mise&amp;rsquo;s arguments or in a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="tools-that-ignore-the-proxy"&gt;Tools that ignore the proxy&lt;span class="hx:absolute hx:-mt-20" id="tools-that-ignore-the-proxy"&gt;&lt;/span&gt;
&lt;a href="#tools-that-ignore-the-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On every tier but open, devvm sends a tool that ignores the proxy settings to the VM&amp;rsquo;s proxy anyway, by the names it looks up. This is transparent mode, and it&amp;rsquo;s on unless you turn it off. In the VM, every name resolves to one stand-in address, &lt;code&gt;198.18.0.1&lt;/code&gt;, and a connection to that address on port 443, port 80 or a port that one of your allow rules names goes to the VM&amp;rsquo;s proxy.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network transparent &lt;span class="c1"&gt;# show whether this folder&amp;#39;s VM has transparent mode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network transparent off &lt;span class="c1"&gt;# turn it off for the VM, from its next launch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The proxy reads the host from the connection itself, from the TLS server name (SNI) on HTTPS and from each request&amp;rsquo;s &lt;code&gt;Host&lt;/code&gt; on plain HTTP, and it judges that host as it judges a request through the proxy settings, against the same allowlist, with the same secrets and the same log. A blocked HTTPS host gets the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt;, over a certificate for that host from the VM&amp;rsquo;s own CA, so the tool shows the same message, with the &lt;code&gt;devvm network allow&lt;/code&gt; command, that a request through the proxy settings would show. &lt;code&gt;devvm network log&lt;/code&gt; and &lt;code&gt;devvm-why&lt;/code&gt; mark each of these connections &lt;code&gt;without proxy settings&lt;/code&gt;, and so does the note before the prompt. A tool such as workerd, which &lt;code&gt;wrangler dev&lt;/code&gt; runs for Cloudflare&amp;rsquo;s adapters, makes its own lookups and connections, and transparent mode is what lets it reach your allowed hosts from a confined VM.&lt;/p&gt;
&lt;p&gt;Transparent mode covers HTTPS and HTTP to a host by name on ports 443 and 80, and on up to 32 more ports that your allow rules name for hosts by name, such as &lt;code&gt;api.example.com:8443&lt;/code&gt;, the lowest first. It never covers port 22 or 53, even when a rule names one, because SSH names no host in its first bytes and port 53 is the VM&amp;rsquo;s own names&amp;rsquo;. It leaves these to the tool&amp;rsquo;s own proxy settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Other ports.&lt;/strong&gt; A connection to another port of a name is refused at once, and so is UDP to any port, QUIC included, so a client that tries HTTP/3 falls back to TCP. A client that uses HTTP/3 alone doesn&amp;rsquo;t connect.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protocols that name no host in their first bytes,&lt;/strong&gt; such as Postgres, MySQL, Redis, SSH and raw TCP, and those whose server speaks first, such as SMTP. The proxy refuses such a connection and logs why, even on a port a rule names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Addresses.&lt;/strong&gt; A URL with an address in it, such as &lt;code&gt;https://1.2.3.4/&lt;/code&gt;, is a direct connection, which fails, and so does a tool that looks a name up itself and then gives the proxy the stand-in address, which the proxy refuses with a reason that says so.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IPv6.&lt;/strong&gt; Names have no IPv6 address in the VM, so a client that uses IPv6 alone finds no address.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Names without a dot, and your network&amp;rsquo;s names.&lt;/strong&gt; A name without a dot, such as &lt;code&gt;db&lt;/code&gt;, resolves only when &lt;code&gt;/etc/hosts&lt;/code&gt; has it, as the name of a &lt;a href="https://next.devvm.dev/docs/using/links/"&gt;link between VMs&lt;/a&gt; does. The VM&amp;rsquo;s resolver adds the search domain of this machine&amp;rsquo;s network to such a name, and transparent mode can&amp;rsquo;t tell &lt;code&gt;db.corp.example.com&lt;/code&gt; made that way from one a tool names whole, so every name under that search domain gets no answer either, such as &lt;code&gt;printer.lan&lt;/code&gt; or &lt;code&gt;git.corp.example.com&lt;/code&gt; when your network&amp;rsquo;s search domain is &lt;code&gt;corp.example.com&lt;/code&gt;. A tool that reaches such a host needs its proxy settings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A DNS server of yours on the VM&amp;rsquo;s &lt;code&gt;127.0.0.1:53&lt;/code&gt;.&lt;/strong&gt; Transparent mode sends the VM&amp;rsquo;s lookups there to its own names, so such a server, and a &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;forward&lt;/a&gt; of port 53 to it, gets none. Put the server on another address or port, or turn transparent mode off for the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clients that don&amp;rsquo;t trust the VM&amp;rsquo;s CA,&lt;/strong&gt; such as most Docker containers, and those that pin a certificate. For a blocked HTTPS host they show a certificate error instead of the &lt;code&gt;403&lt;/code&gt;, and the block is logged all the same.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With the &lt;a href="https://next.devvm.dev/docs/using/images/#docker"&gt;docker layer&lt;/a&gt;, Docker&amp;rsquo;s containers get the same treatment as the VM&amp;rsquo;s own programs, on Docker&amp;rsquo;s default bridge and on the networks that &lt;code&gt;docker network create&lt;/code&gt; and Compose make. A container without the proxy settings, whether its environment emptied them or a program made it through Docker&amp;rsquo;s API without them, reaches what the VM&amp;rsquo;s rules allow, as every program in the VM does. To give a container no network, run it with &lt;code&gt;--network none&lt;/code&gt;, and a container on an &lt;code&gt;--internal&lt;/code&gt; network reaches nothing either.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm network transparent&lt;/code&gt; shows a VM&amp;rsquo;s transparent mode, &lt;code&gt;on&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt;, and where that comes from: the VM&amp;rsquo;s own setting, &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;transparent-proxy&lt;/code&gt;, or devvm&amp;rsquo;s default, which is on. &lt;code&gt;devvm network transparent off&lt;/code&gt; and &lt;code&gt;devvm network transparent on&lt;/code&gt; give the folder&amp;rsquo;s VM its own setting, and &lt;code&gt;transparent-proxy = false&lt;/code&gt; in &lt;a href="https://next.devvm.dev/docs/using/settings/#transparent-mode"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; turns it off for every VM that has none of its own. A change applies at the VM&amp;rsquo;s next launch, without a restart.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; devvm network transparent
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;on # devvm: default
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; devvm network transparent off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;==&amp;gt; devvm turns transparent mode off for devvm-web-0c3c7077e29f06 at its next launch, and it applies while the VM is on a confined tier.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With transparent mode off, names don&amp;rsquo;t resolve in a confined VM at all, so a tool that skips the proxy fails with a DNS error. Tools such as curl and workerd under &lt;code&gt;wrangler dev&lt;/code&gt; get that error at once, on macOS and on a Linux host alike. On the open tier there&amp;rsquo;s no transparent mode, and the VM resolves names with Lima&amp;rsquo;s DNS. A VM made from an image built before devvm had transparent mode lacks the programs it runs, so each launch says so, and &lt;code&gt;devvm update&lt;/code&gt; makes the VM again from a newer image.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm network transparent --json&lt;/code&gt; prints the same as JSON, with &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;from&lt;/code&gt;, which is &lt;code&gt;vm&lt;/code&gt;, &lt;code&gt;config&lt;/code&gt; or &lt;code&gt;default&lt;/code&gt;, and &lt;code&gt;devvm network --json&lt;/code&gt; has it too, as &lt;code&gt;transparent&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;on&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;from&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;default&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On the open tier, a tool that ignores the proxy settings in the VM&amp;rsquo;s environment connects directly, past its proxy. Its connections still work, because an open VM reaches everything this machine can, but they don&amp;rsquo;t show in &lt;code&gt;devvm network log&lt;/code&gt;, they don&amp;rsquo;t go through your company proxy, and a request of theirs that needs one of your secrets carries only its placeholder, so the secret&amp;rsquo;s host refuses it. On every other tier, a tool that transparent mode doesn&amp;rsquo;t cover needs the proxy&amp;rsquo;s address in its own settings. These common tools don&amp;rsquo;t read &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, or read them only when told to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Node&amp;rsquo;s &lt;code&gt;fetch&lt;/code&gt;&lt;/strong&gt; reads them only with &lt;code&gt;NODE_USE_ENV_PROXY=1&lt;/code&gt;, from Node 24.0.0 and 22.21.0, or with &lt;code&gt;--use-env-proxy&lt;/code&gt;, from Node 24.5.0 and 22.21.0. devvm sets &lt;code&gt;NODE_USE_ENV_PROXY&lt;/code&gt; in every VM, so an older Node&amp;rsquo;s &lt;code&gt;fetch&lt;/code&gt; is the one that connects directly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Python&amp;rsquo;s aiohttp&lt;/strong&gt; reads them only when a program makes its session with &lt;code&gt;trust_env=True&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Go programs&lt;/strong&gt; read them through Go&amp;rsquo;s default HTTP transport, but a program that makes its own transport without a proxy function connects directly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Java&lt;/strong&gt; reads none of them. It takes its proxy from the &lt;code&gt;https.proxyHost&lt;/code&gt; and &lt;code&gt;https.proxyPort&lt;/code&gt; system properties, such as &lt;code&gt;-Dhttps.proxyHost=…&lt;/code&gt;, and &lt;code&gt;http.proxyHost&lt;/code&gt; and &lt;code&gt;http.proxyPort&lt;/code&gt; for plain HTTP.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Docker daemon&lt;/strong&gt; reads them only from its own environment as it starts, or from its &lt;code&gt;daemon.json&lt;/code&gt;, never from your shell. devvm points the daemon at the proxy itself, as &lt;a href="#inside-the-vm"&gt;Inside the VM&lt;/a&gt; says.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="secrets"&gt;Secrets&lt;span class="hx:absolute hx:-mt-20" id="secrets"&gt;&lt;/span&gt;
&lt;a href="#secrets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Secrets stay on this machine, whatever the VM&amp;rsquo;s tier. A VM gets a placeholder of its own for each one, and its proxy puts the real value into requests for that secret&amp;rsquo;s hosts. An open VM can send a request around its proxy, but then the request carries only the placeholder, which the secret&amp;rsquo;s host refuses (&lt;a href="#tools-that-ignore-the-proxy"&gt;tools that ignore the proxy&lt;/a&gt;). The proxy puts each secret into one header:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Secret&lt;/th&gt;
&lt;th&gt;Hosts&lt;/th&gt;
&lt;th&gt;Header&lt;/th&gt;
&lt;th&gt;Used by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;claude&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.anthropic.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every VM whose image has &lt;code&gt;claude&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;github&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;api.github.com&lt;/code&gt;, &lt;code&gt;github.com&lt;/code&gt;, &lt;code&gt;codeload.github.com&lt;/code&gt;, &lt;code&gt;raw.githubusercontent.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VMs it&amp;rsquo;s bound to&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#your-own-secrets"&gt;your own&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;the hosts you give it, for the paths and methods you give it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Authorization&lt;/code&gt;, or the header you give it&lt;/td&gt;
&lt;td&gt;VMs it&amp;rsquo;s bound to&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Agents&amp;rsquo; logins work the same way. When a VM&amp;rsquo;s image has a coding agent and devvm&amp;rsquo;s agent store has a login or an API key for it, the VM gets placeholders for the login, and so do Claude Code&amp;rsquo;s MCP servers&amp;rsquo; secrets (&lt;a href="https://next.devvm.dev/docs/internals/network/#agents-logins-and-settings"&gt;agents&amp;rsquo; logins and settings&lt;/a&gt;). A Claude Code, Codex or opencode login that you make inside a VM goes to the store, and the VM gets placeholders for it too (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;Claude Code login&lt;/a&gt;). A login to an MCP server that you make with &lt;code&gt;/mcp&lt;/code&gt; in a VM stays in that VM instead, with real tokens that code in the VM can read (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mcp-servers-logins"&gt;MCP servers&amp;rsquo; logins&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The logins a VM saves have two limits (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Only its own agents.&lt;/strong&gt; A VM saves a login only for an agent that its image has, and its proxy refuses a login for any other agent, so a VM without Codex can never replace the store&amp;rsquo;s Codex login.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One login for each agent.&lt;/strong&gt; Because the store keeps one login for each agent, any VM with the agent can replace it, so a VM you don&amp;rsquo;t trust can log your other VMs in to an account of its choosing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="saving-and-binding-secrets"&gt;Saving and binding secrets&lt;span class="hx:absolute hx:-mt-20" id="saving-and-binding-secrets"&gt;&lt;/span&gt;
&lt;a href="#saving-and-binding-secrets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret set claude&lt;/code&gt; or &lt;code&gt;github&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;asks for the Claude Code token or the GitHub token without showing it, and saves it (&lt;code&gt;--stdin&lt;/code&gt; reads a line instead)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret set proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;asks for the &lt;a href="#behind-a-company-proxy"&gt;company proxy&lt;/a&gt;&amp;rsquo;s password, for the user that &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; names, and saves it (&lt;code&gt;--stdin&lt;/code&gt; reads a line instead)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret set NAME --host HOST --env VARIABLE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;asks for a &lt;a href="#your-own-secrets"&gt;secret of your own&lt;/a&gt;, such as an API key, and saves it with the hosts it goes to and the variable that VMs find its placeholder in (&lt;code&gt;--stdin&lt;/code&gt; reads a line instead)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret rm NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;deletes a saved secret, after asking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;lists the secrets, each with its variable, header and hosts, a secret of your own&amp;rsquo;s path and methods, whether it&amp;rsquo;s saved, and the VMs using it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret use NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;lets this folder&amp;rsquo;s VM use the secret, and reach its hosts on port 443&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret unuse NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stops this folder&amp;rsquo;s VM using it, though a VM whose image has &lt;code&gt;claude&lt;/code&gt; always uses &lt;code&gt;claude&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;devvm saves a secret in the macOS Keychain, or elsewhere in &lt;code&gt;~/.local/share/devvm/secrets/&amp;lt;name&amp;gt;&lt;/code&gt;, a file only you can read (&lt;a href="https://next.devvm.dev/docs/internals/network/#where-secrets-are-saved"&gt;details&lt;/a&gt;). No devvm command prints a saved secret, because each VM&amp;rsquo;s proxy reads the values it needs itself. devvm checks each value as you save it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It drops whitespace in a secret&amp;rsquo;s value, except inside the &lt;code&gt;proxy&lt;/code&gt; password, which loses only the whitespace around it.&lt;/li&gt;
&lt;li&gt;It refuses a value with a quote, a backslash or a control character, a value that holds a VM&amp;rsquo;s placeholder, such as one copied from a VM&amp;rsquo;s &lt;code&gt;GH_TOKEN&lt;/code&gt;, and a &lt;code&gt;claude&lt;/code&gt; value that isn&amp;rsquo;t a setup token (&lt;code&gt;sk-ant-oat01-…&lt;/code&gt;, from &lt;code&gt;claude setup-token&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt; in devvm&amp;rsquo;s environment wins over a saved one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each change applies in its own time:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Saving, deleting, binding and unbinding apply at once to the proxies that are running.&lt;/li&gt;
&lt;li&gt;From its next launch, the VM gets the placeholder in &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt;, &lt;code&gt;GH_TOKEN&lt;/code&gt; or your own secret&amp;rsquo;s variable, and with &lt;code&gt;github&lt;/code&gt; a git credential helper for &lt;code&gt;https://github.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A secret&amp;rsquo;s hosts join the allowlist of each VM that uses it, on port 443 alone, whatever the VM&amp;rsquo;s tier, so a VM on the none tier reaches them too.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To put a secret in, the proxy shows the VM a certificate from the VM&amp;rsquo;s own CA, which no other VM trusts. Each CA lasts 30 days, and a VM that you don&amp;rsquo;t open again keeps working for at least 30 days after its last launch with &lt;code&gt;devvm&lt;/code&gt; in its folder. When its CA has ended, its proxy refuses its HTTPS connections to secrets&amp;rsquo; hosts, and &lt;code&gt;devvm network log --blocked&lt;/code&gt; gives the reason &lt;code&gt;devvm's CA has ended&lt;/code&gt;, so run &lt;code&gt;devvm&lt;/code&gt; in the VM&amp;rsquo;s folder to install new CAs (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;the VM&amp;rsquo;s CA&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm secret unuse&lt;/code&gt; and &lt;code&gt;devvm secret rm&lt;/code&gt; take a secret away from a VM at once, because the VM only ever had its placeholder. Neither command revokes what a VM made with the secret (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#secrets-and-keys-the-vm-may-use"&gt;minting credentials with a secret&lt;/a&gt;), so rotate it if that matters. Use a fine-grained GitHub token, scoped to the repos your VMs need.&lt;/p&gt;
&lt;h4 data-hextra-search-id="devvm-secret-json"&gt;devvm secret &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-secret-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-secret-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;code&gt;devvm secret --json&lt;/code&gt; prints the list as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. Each of the &lt;code&gt;secrets&lt;/code&gt; has its name, &lt;code&gt;saved&lt;/code&gt;, which is &lt;code&gt;true&lt;/code&gt; when it&amp;rsquo;s saved or, for &lt;code&gt;claude&lt;/code&gt;, in devvm&amp;rsquo;s environment, and &lt;code&gt;used_by&lt;/code&gt;, the names of the VMs using it. Then &lt;code&gt;custom&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; for a &lt;a href="#your-own-secrets"&gt;secret of your own&lt;/a&gt;, and &lt;code&gt;hosts&lt;/code&gt; lists the hosts the proxy puts it in for, none for &lt;code&gt;proxy&lt;/code&gt;. A secret that VMs get has its &lt;code&gt;header&lt;/code&gt; and &lt;code&gt;env&lt;/code&gt;, the variable that holds its placeholder, and &lt;code&gt;prefix&lt;/code&gt; when its placeholder starts with one. A secret of yours also has its &lt;code&gt;scheme&lt;/code&gt;, its &lt;code&gt;path&lt;/code&gt;, its &lt;code&gt;methods&lt;/code&gt; and &lt;code&gt;basic_user&lt;/code&gt; when it has them. The JSON never holds a secret&amp;rsquo;s value.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;secrets&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;claude&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;saved&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;used_by&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;devvm-some-project-71a99b1076d92c&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;custom&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;hosts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;api.anthropic.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;header&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Authorization&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;env&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;CLAUDE_CODE_OAUTH_TOKEN&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;prefix&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;sk-ant-oat01-&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;github&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;saved&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;used_by&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;custom&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;hosts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;api.github.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;github.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;codeload.github.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;raw.githubusercontent.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;header&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Authorization&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;env&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;GH_TOKEN&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;proxy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;saved&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;used_by&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;custom&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;hosts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;stripe&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;saved&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;used_by&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;devvm-some-project-71a99b1076d92c&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;custom&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;hosts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;api.stripe.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;header&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Authorization&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;env&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;STRIPE_API_KEY&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;prefix&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;sk_&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="your-own-secrets"&gt;Your own secrets&lt;span class="hx:absolute hx:-mt-20" id="your-own-secrets"&gt;&lt;/span&gt;
&lt;a href="#your-own-secrets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Any other credential that a tool in a VM sends in a header, such as an API key for Stripe, OpenRouter or your company&amp;rsquo;s own service, can be a secret of your own. You give it a name, the hosts it goes to and the variable that VMs find its placeholder in, and devvm asks for the value without showing it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ devvm secret set stripe --host api.stripe.com --env STRIPE_API_KEY --prefix sk_
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Paste the value of stripe, which VMs that use it send to api.stripe.com.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The VMs that use it can reach those hosts on port 443.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Token:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;==&amp;gt; devvm saved the stripe secret in the Keychain.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ devvm secret use stripe
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;==&amp;gt; devvm-web-71a99b1076d92c uses the stripe secret from its next launch, and its allowlist has api.stripe.com on port 443.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;From its next launch, the VM has &lt;code&gt;STRIPE_API_KEY&lt;/code&gt; set to its own placeholder, such as &lt;code&gt;sk_devvm-proxy-managed-secret-stripe-…&lt;/code&gt;, and a tool there sends it as &lt;code&gt;Authorization: Bearer $STRIPE_API_KEY&lt;/code&gt;. The proxy puts the real value in place of the placeholder only in requests to &lt;code&gt;api.stripe.com&lt;/code&gt; on port 443, over TLS, and a request to any other host goes out with the placeholder alone. A program that loads a &lt;code&gt;.env&lt;/code&gt; file gets the placeholder too, as long as the file doesn&amp;rsquo;t set &lt;code&gt;STRIPE_API_KEY&lt;/code&gt; itself, because most dotenv libraries leave a variable that&amp;rsquo;s already set as it is. Keep the real key out of the project&amp;rsquo;s &lt;code&gt;.env&lt;/code&gt;, which the VM can read.&lt;/p&gt;
&lt;p&gt;A secret of yours goes only to the VMs you use it in with &lt;code&gt;devvm secret use&lt;/code&gt;, and each one&amp;rsquo;s hosts then join that VM&amp;rsquo;s allowlist on port 443. &lt;code&gt;devvm secret set&lt;/code&gt; takes these flags:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flag&lt;/th&gt;
&lt;th&gt;What it gives the secret&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--host HOST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a host it goes to, such as &lt;code&gt;api.stripe.com&lt;/code&gt;: repeat the flag, or join hosts with commas, for up to 16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--env VARIABLE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the variable that VMs find its placeholder in, such as &lt;code&gt;STRIPE_API_KEY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--header HEADER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the header it goes in, such as &lt;code&gt;X-Api-Key&lt;/code&gt;, when it isn&amp;rsquo;t &lt;code&gt;Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--prefix PREFIX&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what its placeholder starts with, such as &lt;code&gt;sk_&lt;/code&gt;, for a client that checks how its key starts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--path PATH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the path of the requests it goes in for, written as a &lt;a href="#rules-by-method-and-path"&gt;rule&amp;rsquo;s path&lt;/a&gt; is, such as &lt;code&gt;/api/&lt;/code&gt; for everything below &lt;code&gt;/api/&lt;/code&gt;, so a request to the host&amp;rsquo;s other paths carries the placeholder alone, or &lt;code&gt;none&lt;/code&gt; for every path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--method METHODS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the methods of the requests it goes in for, such as &lt;code&gt;GET,HEAD&lt;/code&gt;, so a request with another method carries the placeholder alone, or &lt;code&gt;none&lt;/code&gt; for every method&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--scheme SCHEME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a scheme of its own before it in &lt;code&gt;Authorization&lt;/code&gt;, besides &lt;code&gt;Bearer&lt;/code&gt; and &lt;code&gt;Token&lt;/code&gt;, such as &lt;code&gt;ApiKey&lt;/code&gt;, or &lt;code&gt;none&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--basic-user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;lets it go in as the username of &lt;code&gt;Basic&lt;/code&gt; credentials, as Stripe and some other services take a key (&lt;code&gt;--basic-user=false&lt;/code&gt; takes that away)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The proxy puts the value in only when exactly one of the header&amp;rsquo;s values holds the placeholder, in one of these shapes, so that the value lands where the server reads a credential:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the placeholder alone, such as &lt;code&gt;X-Api-Key: PLACEHOLDER&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;for &lt;code&gt;Authorization&lt;/code&gt;, &lt;code&gt;Bearer&lt;/code&gt;, &lt;code&gt;Token&lt;/code&gt; or the secret&amp;rsquo;s own &lt;code&gt;--scheme&lt;/code&gt;, in any case, then one space and the placeholder;&lt;/li&gt;
&lt;li&gt;for &lt;code&gt;Authorization&lt;/code&gt;, &lt;code&gt;Basic&lt;/code&gt; credentials whose password is the placeholder, after a username of printable ASCII up to 64 characters, such as git&amp;rsquo;s &lt;code&gt;x-access-token:PLACEHOLDER&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;with &lt;code&gt;--basic-user&lt;/code&gt;, &lt;code&gt;Basic&lt;/code&gt; credentials whose username is the placeholder, before a password of printable ASCII up to 64 characters, such as &lt;code&gt;PLACEHOLDER:&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The placeholder in any other shape stays as it is, and the proxy&amp;rsquo;s own log says why without the value. That includes bytes of the VM&amp;rsquo;s own around it, the placeholder twice, a &lt;code&gt;Digest&lt;/code&gt; field, and the username of &lt;code&gt;Basic&lt;/code&gt; credentials without &lt;code&gt;--basic-user&lt;/code&gt;, because a server can show the VM those parts of a request it refuses, such as a username it doesn&amp;rsquo;t know. The same shapes apply to the &lt;code&gt;github&lt;/code&gt; and &lt;code&gt;claude&lt;/code&gt; secrets, which the GitHub CLI, git and Claude Code send as &lt;code&gt;Bearer&lt;/code&gt;, &lt;code&gt;token&lt;/code&gt; and git&amp;rsquo;s &lt;code&gt;Basic&lt;/code&gt; password.&lt;/p&gt;
&lt;p&gt;Without &lt;code&gt;--path&lt;/code&gt; and &lt;code&gt;--method&lt;/code&gt;, the value goes in for every path and every method. With them, the proxy judges each request as it judges an allow by method and path: by its method as written and each method it names in a method-override header or a &lt;code&gt;_method&lt;/code&gt; parameter, and by its path only in a plain form (&lt;a href="#rules-by-method-and-path"&gt;rules by method and path&lt;/a&gt;). So a key that may only read goes in for &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;HEAD&lt;/code&gt; alone:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ devvm secret set reports --host api.example.com --env REPORTS_API_KEY --method GET,HEAD
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Paste the value of reports, which VMs that use it send to api.example.com.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The VMs that use it can reach those hosts on port 443.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Token:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;==&amp;gt; devvm saved the reports secret in the Keychain.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A &lt;code&gt;POST&lt;/code&gt; from the VM to &lt;code&gt;api.example.com&lt;/code&gt; then carries the placeholder, which the host refuses, while a &lt;code&gt;GET&lt;/code&gt; gets the key. The proxy judges every request on a connection, so a kept-alive connection or an HTTP/2 one gets the key only in the requests that have those methods. The &lt;code&gt;github&lt;/code&gt; and &lt;code&gt;claude&lt;/code&gt; secrets go in for every method. To keep a VM from writing with your GitHub token, give it a deny instead, such as &lt;code&gt;devvm network deny api.github.com --method POST,PUT,PATCH,DELETE&lt;/code&gt;, which refuses those requests before they leave the proxy.&lt;/p&gt;
&lt;p&gt;devvm refuses a secret that breaks these rules:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Rules&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;lowercase letters, digits and dashes, and not &lt;code&gt;claude&lt;/code&gt;, &lt;code&gt;github&lt;/code&gt; or &lt;code&gt;proxy&lt;/code&gt;, nor starting with a coding agent&amp;rsquo;s name, such as &lt;code&gt;codex-key&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;host&lt;/td&gt;
&lt;td&gt;a host name, such as &lt;code&gt;api.example.com&lt;/code&gt;. devvm refuses a wildcard, such as &lt;code&gt;*.example.com&lt;/code&gt;, because some domains let anyone own a name under them. It also refuses an address, any port but 443, a name with a character that isn&amp;rsquo;t plain ASCII, as the proxy refuses such a host, and a name that&amp;rsquo;s only ever internal, such as &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;printer.local&lt;/code&gt; or a Tailscale or &lt;code&gt;nip.io&lt;/code&gt; name. The proxy refuses an internal address whatever name resolves to it anyway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;header&lt;/td&gt;
&lt;td&gt;not &lt;code&gt;Host&lt;/code&gt;, &lt;code&gt;Cookie&lt;/code&gt;, &lt;code&gt;Content-Length&lt;/code&gt;, &lt;code&gt;Content-Type&lt;/code&gt;, &lt;code&gt;Transfer-Encoding&lt;/code&gt;, &lt;code&gt;Expect&lt;/code&gt;, &lt;code&gt;Forwarded&lt;/code&gt;, &lt;code&gt;Via&lt;/code&gt;, an &lt;code&gt;X-Forwarded-&lt;/code&gt; or &lt;code&gt;Proxy-&lt;/code&gt; header, or one that ends at the next hop, such as &lt;code&gt;Connection&lt;/code&gt;, because the proxy drops or sets those itself. Nor one that servers commonly log or send back, such as &lt;code&gt;Origin&lt;/code&gt;, &lt;code&gt;Referer&lt;/code&gt;, &lt;code&gt;User-Agent&lt;/code&gt;, &lt;code&gt;X-Request-Id&lt;/code&gt; or &lt;code&gt;Traceparent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;variable&lt;/td&gt;
&lt;td&gt;not one that devvm or the VM&amp;rsquo;s shell sets, such as &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;GH_TOKEN&lt;/code&gt;, &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;NPM_CONFIG_PREFIX&lt;/code&gt; or any &lt;code&gt;DEVVM_&lt;/code&gt; variable, nor one that changes what a program runs or trusts, such as a &lt;code&gt;GIT_&lt;/code&gt; or &lt;code&gt;PYTHON&lt;/code&gt; variable, &lt;code&gt;NODE_OPTIONS&lt;/code&gt;, &lt;code&gt;EDITOR&lt;/code&gt; or &lt;code&gt;SSL_CERT_DIR&lt;/code&gt;, nor another secret&amp;rsquo;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;prefix&lt;/td&gt;
&lt;td&gt;not holding &lt;code&gt;devvm-proxy-managed&lt;/code&gt;, which every placeholder holds after its prefix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;value&lt;/td&gt;
&lt;td&gt;printable ASCII alone and at most 3,800 characters, and devvm refuses a longer one before it touches the one saved&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;To save a new value or change a secret, give &lt;code&gt;devvm secret set&lt;/code&gt; only what changes:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm secret &lt;span class="nb"&gt;set&lt;/span&gt; stripe &lt;span class="c1"&gt;# save a new value, such as after you rotate the key&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm secret &lt;span class="nb"&gt;set&lt;/span&gt; stripe --host api.stripe.com,files.stripe.com &lt;span class="c1"&gt;# give it a second host&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm secret rm stripe &lt;span class="c1"&gt;# delete it, after asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Run without the other flags, &lt;code&gt;devvm secret set NAME&lt;/code&gt; keeps the secret&amp;rsquo;s hosts, header, variable, prefix, path, methods and scheme. To change one of those, give only its flag with the new value, and the rest stay as they are.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--host&lt;/code&gt; gives the whole list of hosts each time. A host the secret loses goes from every VM at once. A host it gains reaches only the VMs you then run &lt;code&gt;devvm secret use NAME&lt;/code&gt; in again, so a host you add never gets the value from a VM you didn&amp;rsquo;t give it to, and devvm names the VMs that keep the hosts they had.&lt;/li&gt;
&lt;li&gt;To take a prefix away, delete the secret and save it again.&lt;/li&gt;
&lt;li&gt;Running VMs keep the variable they launched with, so after you change &lt;code&gt;--env&lt;/code&gt; or &lt;code&gt;--prefix&lt;/code&gt;, a VM that uses the secret gets the new placeholder at its next launch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;devvm secret rm NAME&lt;/code&gt; deletes the secret with its definition after asking, and the question names the VMs that use it, which stop using it before it goes. It also deletes a value that a failed save left without its definition. Each VM records the secret it was bound to by an ID that the secret gets as it&amp;rsquo;s first saved, so a secret saved again later by the same name goes to none of those VMs until you use it there again. A VM still bound to an earlier secret of the name gets nothing of the new one, its launch says so, and &lt;code&gt;devvm secret unuse NAME&lt;/code&gt; takes the name away whether a secret has it or not.&lt;/p&gt;
&lt;p&gt;devvm keeps your secrets&amp;rsquo; hosts, headers, variables, prefixes, paths, methods and schemes in &lt;code&gt;~/.local/share/devvm/custom-secrets.json&lt;/code&gt;, without their values, and checks each entry again whenever it reads the file. When it can&amp;rsquo;t read the file, or an entry breaks the rules above, such as after an edit by hand, devvm secret and the launch of each VM that uses one of your secrets fail and name the file. Fix the entry, or delete the file and save your secrets again with devvm secret set (&lt;a href="https://next.devvm.dev/docs/internals/network/#where-secrets-are-saved"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;div class="devvm-callout devvm-callout-warning"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 1h1v1H5ZM4 2h1v1H4ZM6 2h1v1H6ZM4 3h1v1H4ZM6 3h1v1H6ZM3 4h1v1H3ZM7 4h1v1H7ZM3 5h1v1H3ZM5 5h1v1H5ZM7 5h1v1H7ZM2 6h1v1H2ZM5 6h1v1H5ZM8 6h1v1H8ZM2 7h1v1H2ZM5 7h1v1H5ZM8 7h1v1H8ZM1 8h1v1H1ZM9 8h1v1H9ZM1 9h1v1H1ZM5 9h1v1H5ZM9 9h1v1H9ZM0 10h1v1H0ZM10 10h1v1H10ZM0 11h11v1H0Z"/&gt;&lt;/svg&gt; Warning&lt;/p&gt;&lt;p&gt;The proxy passes the replies from a secret&amp;rsquo;s hosts to the VM as they are, so a host that sends the request&amp;rsquo;s headers back, such as an echo or debug endpoint, shows the VM the real value. Give a secret only hosts that you trust with it, and a key scoped to what the VMs need. A secret&amp;rsquo;s hosts are also open to the VMs that use it for requests without the placeholder, on every tier, the none tier included. So on a host where anyone can make an account, such as a storage or payments service, code in the VM can send data to an account of its own there.&lt;/p&gt;&lt;/div&gt;&lt;h2 data-hextra-search-id="logs"&gt;Logs&lt;span class="hx:absolute hx:-mt-20" id="logs"&gt;&lt;/span&gt;
&lt;a href="#logs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm network log&lt;/code&gt; shows the proxy&amp;rsquo;s decisions for this folder&amp;rsquo;s VM, oldest first, one line each. A line has the time, &lt;code&gt;allowed&lt;/code&gt;, &lt;code&gt;BLOCKED&lt;/code&gt; or &lt;code&gt;cache&lt;/code&gt;, and the host and port. An allowed line then has the rule that allowed it (&lt;code&gt;, decrypted&lt;/code&gt; for an intercepted tunnel), or the request (&lt;code&gt;GET /user&lt;/code&gt;), with the &lt;a href="#rules-by-method-and-path"&gt;rule by method and path&lt;/a&gt; that let it through when one did, and the secrets put in (&lt;code&gt;, token: github&lt;/code&gt;). A blocked line has why it was blocked, after the request when the proxy saw one, and a &lt;code&gt;cache&lt;/code&gt; line, a request to the &lt;a href="#nix"&gt;shared Nix cache&lt;/a&gt;, has the request and what came of it. A line ends &lt;code&gt;, without proxy settings&lt;/code&gt; when &lt;a href="#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt; sent the connection to the proxy:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-10-09T10:00:00Z BLOCKED example.com:443 not on the allowlist
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-10-09T10:00:05Z allowed github.com:443 rule github.com
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-10-09T10:00:06Z allowed api.github.com:443 GET /user, token: github
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-10-09T10:00:07Z BLOCKED api.github.com:443 POST /gists: denied by !api.github.com POST,PUT,PATCH,DELETE
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-10-09T10:00:08Z cache cache.nixos.org:443 GET /nix/yv1zf3y6all4j99aad30cb8i55dw9zmp.narinfo: hit
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-10-09T10:00:09Z allowed api.open-meteo.com:443 rule **, without proxy settings&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-n N&lt;/code&gt;, &lt;code&gt;--lines N&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the last N (default 50)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--follow&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;then each new one as it happens, until Ctrl+C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--blocked&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the blocks instead, one row per host and port, by when last blocked: &lt;code&gt;LAST&lt;/code&gt;, &lt;code&gt;COUNT&lt;/code&gt;, &lt;code&gt;HOST&lt;/code&gt; and &lt;code&gt;ALLOW WITH&lt;/code&gt;, the &lt;code&gt;devvm network allow&lt;/code&gt; command that allows it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;ALLOW WITH&lt;/code&gt; is &lt;code&gt;-&lt;/code&gt; for a request that the proxy refuses whatever the allowlist says, such as a GitHub call that makes a credential, and for a host that isn&amp;rsquo;t a host name or an address, and &lt;code&gt;- (quiet)&lt;/code&gt; for a &lt;a href="#quiet-hosts"&gt;quiet host&lt;/a&gt;. An open VM&amp;rsquo;s log holds what went through its proxy and its links&amp;rsquo; connections, but not what the VM reached directly, and &lt;code&gt;devvm network log&lt;/code&gt; says so. The proxy keeps each VM&amp;rsquo;s log to its last 10 to 20 MiB by starting a new file once the current one reaches 10 MiB and keeping one older file, which &lt;code&gt;devvm network log&lt;/code&gt; reads too. &lt;code&gt;devvm rm&lt;/code&gt; deletes the VM&amp;rsquo;s logs, and &lt;a href="https://next.devvm.dev/docs/internals/network/#log-files"&gt;How it works&lt;/a&gt; describes the files.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-network-log-json"&gt;devvm network log &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-network-log-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-network-log-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm network log --json&lt;/code&gt; prints the last N events as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes, and devvm refuses it with &lt;code&gt;--follow&lt;/code&gt;. Each of the &lt;code&gt;events&lt;/code&gt; has what the proxy logged, without the VM&amp;rsquo;s name, and a log with nothing in it gives &lt;code&gt;&amp;quot;events&amp;quot;: []&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;time&lt;/code&gt;, &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;port&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;when, and the host and port, which for a link&amp;rsquo;s connection is the link&amp;rsquo;s name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;event&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tunnel&lt;/code&gt; for an allowed connection, &lt;code&gt;intercept&lt;/code&gt; for an allowed tunnel that the proxy decrypted, &lt;code&gt;forward&lt;/code&gt; for an allowed request, &lt;code&gt;blocked&lt;/code&gt;, or &lt;code&gt;nix-cache&lt;/code&gt; for a request to the shared Nix cache. A link&amp;rsquo;s connection is &lt;code&gt;link&lt;/code&gt; when devvm carried it, and &lt;code&gt;link_refused&lt;/code&gt;, &lt;code&gt;link_target_stopped&lt;/code&gt; or &lt;code&gt;link_limit&lt;/code&gt; when devvm refused it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;method&lt;/code&gt;, &lt;code&gt;path&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the request&amp;rsquo;s, when the event has them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rule&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the rule that allowed it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;reason&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the reason it was blocked, or what came of a cache request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the request&amp;rsquo;s &lt;code&gt;User-Agent&lt;/code&gt; header&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;secrets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the secrets put in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;refused&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for a request refused whatever the allowlist says, such as an allowed name that doesn&amp;rsquo;t resolve&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;quiet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for a block of a &lt;a href="#quiet-hosts"&gt;quiet host&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;upstream&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the company proxy it went through&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;target&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM that a link&amp;rsquo;s connection went to&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;via&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dns&lt;/code&gt; for a connection that &lt;a href="#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt; sent to the proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Each field but &lt;code&gt;time&lt;/code&gt;, &lt;code&gt;event&lt;/code&gt;, &lt;code&gt;host&lt;/code&gt; and &lt;code&gt;port&lt;/code&gt; is there only when the event has it.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;events&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;time&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-10-09T10:00:00Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;event&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;blocked&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;host&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;example.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;method&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;CONNECT&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;reason&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;not on the allowlist&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;time&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-10-09T10:00:06Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;event&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;forward&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;host&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;api.github.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;method&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;GET&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;path&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/user&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;secrets&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;github&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With &lt;code&gt;--blocked&lt;/code&gt;, each of the &lt;code&gt;blocked&lt;/code&gt; has the &lt;code&gt;last&lt;/code&gt; time it was blocked, the &lt;code&gt;count&lt;/code&gt;, the &lt;code&gt;host&lt;/code&gt; and the &lt;code&gt;port&lt;/code&gt;, and &lt;code&gt;allow&lt;/code&gt;, the rule that &lt;code&gt;devvm network allow&lt;/code&gt; takes to allow it. A block that &lt;code&gt;ALLOW WITH&lt;/code&gt; shows as &lt;code&gt;-&lt;/code&gt; has no &lt;code&gt;allow&lt;/code&gt;, and a quiet host&amp;rsquo;s has &lt;code&gt;&amp;quot;quiet&amp;quot;: true&lt;/code&gt; instead.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;blocked&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;last&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-10-09T10:01:00Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;host&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;example.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;allow&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;example.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="links-between-vms"&gt;Links between VMs&lt;span class="hx:absolute hx:-mt-20" id="links-between-vms"&gt;&lt;/span&gt;
&lt;a href="#links-between-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A &lt;a href="https://next.devvm.dev/docs/using/links/"&gt;link between VMs&lt;/a&gt; lets a program in one VM, the client, reach a port that another VM, the target, publishes. devvm carries a link&amp;rsquo;s connections over ssh through this machine, so they use neither VM&amp;rsquo;s network, and a confined VM reaches only what its tier allows and the links you added to it. A client&amp;rsquo;s proxy is a second way into its links: it carries a request for one of the client&amp;rsquo;s own links, by the link&amp;rsquo;s name and port, to the same link on this machine, and passes it on as it is, without looking into it or putting a secret into it. It reaches no other socket on this machine and no other VM&amp;rsquo;s links. The allowlist&amp;rsquo;s rules don&amp;rsquo;t apply to links, so &lt;code&gt;devvm network deny&lt;/code&gt; doesn&amp;rsquo;t stop one, and &lt;code&gt;devvm link rm&lt;/code&gt; does.&lt;/p&gt;
&lt;p&gt;A link joins the two VMs&amp;rsquo; trust. Code in the client can often run code in the target through the target&amp;rsquo;s service, such as Postgres&amp;rsquo;s &lt;code&gt;COPY … TO PROGRAM&lt;/code&gt;, and it then has whatever the target has: its network, the secrets it may use and its project folder. So devvm keeps two rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A client links only to a target on its own tier or a stricter one.&lt;/strong&gt; An allowlist client links to allowlist and none targets, but not to internet or open ones, because a link to a target on a lower tier would let the client reach more through the target, around its own proxy. An open client may link to any target, and it then has the target&amp;rsquo;s secrets and project folder within reach as well as its own network.
&lt;ul&gt;
&lt;li&gt;devvm checks this when you add a link, at each launch of the client and on every connection, and for a client on a confined tier, on every connection the target&amp;rsquo;s tier must be in force as it runs, so devvm refuses the connection while the target shows as &lt;code&gt;unenforced&lt;/code&gt;, and it warns you of such a target when you add the link, when you publish a port in its folder that the client links to, and when the client starts.&lt;/li&gt;
&lt;li&gt;While such a link exists, devvm refuses to give the target a tier lower than the client&amp;rsquo;s, such as &lt;code&gt;devvm network open&lt;/code&gt;, and it refuses to give the client a tier higher than a target&amp;rsquo;s, such as &lt;code&gt;devvm network allowlist&lt;/code&gt; for a client that links to an open target.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The target publishes.&lt;/strong&gt; A link reaches only a port that the target&amp;rsquo;s folder publishes with &lt;code&gt;devvm link publish&lt;/code&gt;, and only on the target&amp;rsquo;s own loopback. Publishing offers the port to any of your VMs, and each link is still added in the client&amp;rsquo;s folder, so a VM reaches another&amp;rsquo;s service only when you&amp;rsquo;ve run a command in both folders.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first rule keeps a client&amp;rsquo;s tier whole, but it doesn&amp;rsquo;t keep the target&amp;rsquo;s data in the target. A client on a confined tier can read whatever the target&amp;rsquo;s service gives it and send that out through the hosts its own tier reaches. Link two VMs only when you&amp;rsquo;d trust each with what the other has.&lt;/p&gt;
&lt;p&gt;A &lt;a href="https://next.devvm.dev/docs/using/links/#groups"&gt;group&lt;/a&gt; links each of its VMs to the ports that the others publish, once you&amp;rsquo;ve run &lt;code&gt;devvm group join&lt;/code&gt; in each VM&amp;rsquo;s folder. Its VMs are all on one tier, so every link it makes keeps the first rule, and devvm refuses to change a VM&amp;rsquo;s tier with &lt;code&gt;devvm network&lt;/code&gt; while it&amp;rsquo;s in a group. A group joins the trust of all its VMs, so put VMs in one only when you&amp;rsquo;d trust each with what the others have.&lt;/p&gt;
&lt;h2 data-hextra-search-id="not-covered"&gt;Not covered&lt;span class="hx:absolute hx:-mt-20" id="not-covered"&gt;&lt;/span&gt;
&lt;a href="#not-covered" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The tiers leave some things open, such as what an allowed host accepts beyond what &lt;a href="#rules-by-method-and-path"&gt;rules by method and path&lt;/a&gt; narrow, whatever your secrets allow, such as pushes and API calls, and what a company CA that you add can read. &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/"&gt;Attack vectors&lt;/a&gt; lists them under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;Narrowed, not closed&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;Left to you&lt;/a&gt;. What transparent mode leaves to a tool&amp;rsquo;s own proxy settings, such as other ports, databases&amp;rsquo; protocols, addresses and HTTP/3 alone, is under &lt;a href="#tools-that-ignore-the-proxy"&gt;tools that ignore the proxy&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Overview</title><link>https://next.devvm.dev/docs/internals/overview/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/overview/</guid><description>
&lt;p&gt;This page explains what devvm does, step by step, when it makes, opens, changes, stops and deletes a VM, and how it keeps each VM&amp;rsquo;s state. &lt;a href="https://next.devvm.dev/docs/getting-started/commands/"&gt;Everyday commands&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/using/vms/"&gt;Managing VMs&lt;/a&gt; cover the same commands from your side, and &lt;a href="https://next.devvm.dev/docs/using/settings/"&gt;Settings and files&lt;/a&gt; lists your settings.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-new-vm"&gt;A new VM&lt;span class="hx:absolute hx:-mt-20" id="a-new-vm"&gt;&lt;/span&gt;
&lt;a href="#a-new-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you run &lt;code&gt;devvm&lt;/code&gt; in a folder that has no VM, devvm makes one in these steps:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 1173px; --devvm-diagram-width: 472px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 472 1173" width="472" height="1173" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d37cef242ba8b3b82--title" aria-describedby="d37cef242ba8b3b82--desc"&gt;&lt;title id="d37cef242ba8b3b82--title"&gt;How devvm makes a VM&lt;/title&gt;&lt;desc id="d37cef242ba8b3b82--desc"&gt;Until the first shell opens, devvm checks everything first, checks the shared tools for newer versions if due, builds the image if it isn't built, writes the VM's state, makes the VM from its image, locks .git unless --clone, starts its proxy and then the VM, runs the self-check, and sets the VM up, then the clone and devcontainer.json's commands. Then it opens the shell. If it's interrupted before then, devvm deletes the VM and what it made for it, and unlocks .git.&lt;/desc&gt;&lt;g class="pele-clusters"&gt;&lt;g class="pele-cluster" data-id="before"&gt;&lt;rect x="37.41" y="8" width="361.09" height="998" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="171.68" y="31.4" text-anchor="middle"&gt;until the first shell opens&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_check_tools_0"&gt;&lt;path d="M217.95,141L217.95,179"/&gt;&lt;path class="pele-marker" d="M217.95,186L214.59,178L221.31,178Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_tools_build_0"&gt;&lt;path d="M217.95,246L217.95,284"/&gt;&lt;path class="pele-marker" d="M217.95,291L214.59,283L221.31,283Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_build_state_0"&gt;&lt;path d="M217.95,351L217.95,389"/&gt;&lt;path class="pele-marker" d="M217.95,396L214.59,388L221.31,388Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_state_make_0"&gt;&lt;path d="M217.95,456L217.95,494"/&gt;&lt;path class="pele-marker" d="M217.95,501L214.59,493L221.31,493Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_make_lock_0"&gt;&lt;path d="M217.95,561L217.95,599"/&gt;&lt;path class="pele-marker" d="M217.95,606L214.59,598L221.31,598Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_lock_start_0"&gt;&lt;path d="M217.95,666L217.95,704"/&gt;&lt;path class="pele-marker" d="M217.95,711L214.59,703L221.31,703Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_start_self_0"&gt;&lt;path d="M217.95,771L217.95,809"/&gt;&lt;path class="pele-marker" d="M217.95,816L214.59,808L221.31,808Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_self_setup_0"&gt;&lt;path d="M217.95,861L217.95,899"/&gt;&lt;path class="pele-marker" d="M217.95,906L214.59,898L221.31,898Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_setup_shell_0"&gt;&lt;path d="M217.95,966L217.95,1012Q217.95,1024 205.95,1024L104.82,1024Q92.82,1024 92.82,1036L92.82,1079.5"/&gt;&lt;path class="pele-marker" d="M92.82,1086.5L89.46,1078.5L96.18,1078.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_before_undo_0"&gt;&lt;path d="M233.95,1006L233.95,1012Q233.95,1024 245.95,1024L331.09,1024Q343.09,1024 343.09,1036L343.09,1079.5" stroke-dasharray="3 4"/&gt;&lt;path class="pele-marker" d="M343.09,1086.5L339.73,1078.5L346.45,1078.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_before_undo_0"&gt;&lt;rect x="290.09" y="1044" width="106" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="343.09" y="1057.2" text-anchor="middle"&gt;interrupted&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="check" transform="translate(217.95,93)"&gt;&lt;rect x="-138.27" y="-48" width="276.55" height="96" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-22.1"&gt;checks everything first:&lt;/tspan&gt;&lt;tspan x="0" y="-4.1"&gt;image, size, ports,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;network tier, SSH agent,&lt;/tspan&gt;&lt;tspan x="0" y="31.9"&gt;features, devcontainer.json&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="tools" transform="translate(217.95,216)"&gt;&lt;rect x="-133.82" y="-30" width="267.64" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;checks the shared tools&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;for newer versions, if due&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="build" transform="translate(217.95,321)"&gt;&lt;rect x="-93.73" y="-30" width="187.45" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;builds the image,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;if it isn't built&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="state" transform="translate(217.95,426)"&gt;&lt;rect x="-120.45" y="-30" width="240.91" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;writes the VM's state,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;with its network choice&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="make" transform="translate(217.95,531)"&gt;&lt;rect x="-80.36" y="-30" width="160.73" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;makes the VM&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;from its image&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="lock" transform="translate(217.95,636)"&gt;&lt;rect x="-80.36" y="-30" width="160.73" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;locks .git,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;unless --clone&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="start" transform="translate(217.95,741)"&gt;&lt;rect x="-93.73" y="-30" width="187.45" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;starts its proxy,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;then the VM&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="self" transform="translate(217.95,838.5)"&gt;&lt;rect x="-80.36" y="-22.5" width="160.73" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the self-check&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="setup" transform="translate(217.95,936)"&gt;&lt;rect x="-160.55" y="-30" width="321.09" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;sets the VM up, then the clone&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;and devcontainer.json's commands&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="shell" transform="translate(92.82,1109)"&gt;&lt;rect x="-84.82" y="-22.5" width="169.64" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;opens the shell&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="undo" transform="translate(343.09,1125.5)"&gt;&lt;rect x="-120.45" y="-39" width="240.91" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;deletes the VM and what&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;devvm made for it,&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;and unlocks .git&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;ol&gt;
&lt;li&gt;devvm checks everything the new VM needs before it builds anything, because a build can take minutes. That covers the folder, its toolchains, agents and layers, which it shows in a list in a terminal when you give none of &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;), the size, the ports, the network tier (&lt;a href="https://next.devvm.dev/docs/safety/network/#choosing-a-tier"&gt;choosing a tier&lt;/a&gt;), the SSH agent, the backend&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt; and what the folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; says. Last, when the VM gets an agent and devvm saved an export of agents&amp;rsquo; history for this folder before, devvm offers the newest one, asking in a terminal with no as the default (&lt;code&gt;history_import_ask&lt;/code&gt;) and naming &lt;code&gt;devvm history import&lt;/code&gt; without one (&lt;code&gt;history_import_later&lt;/code&gt;). Before any of it, devvm takes the folder&amp;rsquo;s &lt;a href="#locks"&gt;creation lock&lt;/a&gt;, which it holds until it has recorded that it made the VM in step 5.&lt;/li&gt;
&lt;li&gt;When the VM gets shared tools and the &lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;daily check&lt;/a&gt; is due, devvm checks for newer versions of them.&lt;/li&gt;
&lt;li&gt;devvm builds the image if it isn&amp;rsquo;t built yet (&lt;a href="https://next.devvm.dev/docs/internals/images/#building"&gt;building&lt;/a&gt;), then the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;shared tools&lt;/a&gt; that the share lacks.&lt;/li&gt;
&lt;li&gt;devvm writes the VM&amp;rsquo;s state, with the network choice in it, before it makes the VM. If a later step fails, the VM never starts without its network choice. devvm also clears what an earlier VM of this folder that was deleted some other way left behind: it stops that VM&amp;rsquo;s proxy and link session and deletes the VM&amp;rsquo;s folder in its data folder, with its own rules, its run files and its logs.&lt;/li&gt;
&lt;li&gt;devvm makes the VM from its image. The VM mounts only the project folder, read-write, and the shared tools and its agents&amp;rsquo; settings folders from &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;, read-only. With &lt;code&gt;--clone&lt;/code&gt;, devvm doesn&amp;rsquo;t mount the folder, and the VM gets its own clone of the repo instead (&lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;working on a clone&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Unless the VM is a &lt;code&gt;--clone&lt;/code&gt; VM, devvm locks the folder&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; hooks and config (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt;). It warns when the repo&amp;rsquo;s origin is an SSH remote and the VM has no SSH agent (&lt;code&gt;ssh_remote_hint&lt;/code&gt;), and on Linux hosts it names the set-id files in the folder, including those an earlier VM of this folder made. When the VM forwards your SSH agent, devvm checks that the agent has keys.&lt;/li&gt;
&lt;li&gt;devvm starts the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;proxy&lt;/a&gt;, then the VM, confined to the proxy on every tier but open.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;self-check&lt;/a&gt; runs, before the setup and the shell. Then, when you said yes to the export devvm offered, devvm warns when the tier that its &lt;code&gt;.folder&lt;/code&gt; file records is less strict than the VM&amp;rsquo;s, or when it records none (&lt;code&gt;history_import_less_strict&lt;/code&gt;, &lt;code&gt;history_import_tier_unknown&lt;/code&gt;), and streams it into the VM, whose own &lt;code&gt;tar&lt;/code&gt; checks its paths and unpacks it as the VM&amp;rsquo;s user (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-history"&gt;importing history&lt;/a&gt;), and a failed import only warns.&lt;/li&gt;
&lt;li&gt;devvm sets the VM up (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#the-vms-setup"&gt;the VM&amp;rsquo;s setup&lt;/a&gt;) and makes it reachable &lt;a href="https://next.devvm.dev/docs/using/ssh/"&gt;by name over SSH&lt;/a&gt;. It makes a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s clone, or a workspace clone&amp;rsquo;s repos, all in one command in the VM, then copies each repo&amp;rsquo;s branches into it (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-copy-into-a-clone-vm"&gt;the copy into a clone VM&lt;/a&gt;) and copies the folder&amp;rsquo;s own files, and then runs the commands of the folder&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/devcontainer/#commands"&gt;&lt;code&gt;devcontainer.json&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;devvm opens a shell in the VM in its own place, so devvm ends when the shell does. Without a terminal, the shell reads its commands from devvm&amp;rsquo;s input.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Until the first shell opens, nothing of yours is in the VM yet. If you interrupt devvm before then, it deletes the VM, stops its proxy, deletes its pinned host keys and its folder, with its state, its own rules and its run files, takes the locks off &lt;code&gt;.git&lt;/code&gt;, and for a &lt;code&gt;--clone&lt;/code&gt; VM removes the repo&amp;rsquo;s remote for it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-to-a-vm"&gt;Adding to a VM&lt;span class="hx:absolute hx:-mt-20" id="adding-to-a-vm"&gt;&lt;/span&gt;
&lt;a href="#adding-to-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When &lt;code&gt;devvm tools add&lt;/code&gt;, or &lt;code&gt;devvm tools&lt;/code&gt; in a terminal, adds shared tools to an existing VM (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;adding to a VM&lt;/a&gt;), the tools it builds join the VM&amp;rsquo;s state and are mounted as devvm then launches the VM, and nothing is installed on the VM&amp;rsquo;s disk. A new agent&amp;rsquo;s config folders are mounted as the launch matches the VM&amp;rsquo;s agent folder mounts, which restarts a running VM after asking. &lt;code&gt;devvm tools&lt;/code&gt; shows an existing VM&amp;rsquo;s layers but can&amp;rsquo;t change them, and &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; change nothing on an existing VM, because a layer goes onto the VM&amp;rsquo;s disk, which only &lt;a href="#making-a-vm-again"&gt;making the VM again&lt;/a&gt; changes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="making-a-vm-again"&gt;Making a VM again&lt;span class="hx:absolute hx:-mt-20" id="making-a-vm-again"&gt;&lt;/span&gt;
&lt;a href="#making-a-vm-again" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm layer add LAYER...&lt;/code&gt; makes the folder&amp;rsquo;s VM again from a new image, its own layers with the new ones on top, and keeps devvm&amp;rsquo;s settings for it and its home folder (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;). &lt;code&gt;devvm layer rm LAYER...&lt;/code&gt; makes it again from an image of its other layers, in their order (&lt;a href="https://next.devvm.dev/docs/using/images/#taking-layers-out-of-a-vm"&gt;taking layers out of a VM&lt;/a&gt;). &lt;code&gt;devvm update&lt;/code&gt; first moves the VM to the newest shared tools, the step &lt;code&gt;devvm tools update&lt;/code&gt; takes, which needs no remake because the tools are mounted. Then it makes the VM again from the image it has, when that image or one below it has a new key, so the VM gets the image&amp;rsquo;s new build (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;), and when the folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; isn&amp;rsquo;t the one the VM was made from, as &lt;a href="#reading-the-devcontainerjson-again"&gt;reading the devcontainer.json again&lt;/a&gt; describes. An outdated VM without &lt;code&gt;--force&lt;/code&gt; or a terminal is refused before the tools step, so a refusal changes nothing. The remake is one path in the VM&amp;rsquo;s lifecycle, which takes the image to make the VM from, so each command only works out that image and its own refusals: &lt;code&gt;devvm layer add&lt;/code&gt; names the layers the VM has already, &lt;code&gt;devvm layer rm&lt;/code&gt; names those it lacks (&lt;code&gt;lacks_layers&lt;/code&gt;) and refuses a name that&amp;rsquo;s no layer&amp;rsquo;s, though it takes out one of the user&amp;rsquo;s whose script is gone, and &lt;code&gt;devvm update&lt;/code&gt; says the VM is current (&lt;code&gt;vm_current&lt;/code&gt;) when it had the newest tools and nothing in its chain changed, or names what changed (&lt;code&gt;vm_changed&lt;/code&gt;) before it asks.&lt;/p&gt;
&lt;p&gt;Before anything changes, devvm refuses a name that isn&amp;rsquo;t a layer, a VM made for another folder, one whose creation didn&amp;rsquo;t finish and, except for &lt;code&gt;devvm clone&lt;/code&gt;, a &lt;code&gt;--clone&lt;/code&gt; VM, and it checks that the VM&amp;rsquo;s backend has every feature the VM needs with the new image (&lt;a href="https://next.devvm.dev/docs/internals/backends/#missing-and-unreviewed-features"&gt;missing and unreviewed features&lt;/a&gt;) and that the disk has room for a VM. Then it asks (&lt;code&gt;remake_confirm&lt;/code&gt;, or &lt;code&gt;remake_confirm_clean_home&lt;/code&gt; with &lt;code&gt;--clean-home&lt;/code&gt;), and a parent folder&amp;rsquo;s VM only in a terminal (&lt;code&gt;remake_parent_vm_ask&lt;/code&gt;). Then it checks what the remake would lose, as &lt;code&gt;devvm rm&lt;/code&gt; does: the clone for &lt;code&gt;devvm clone off&lt;/code&gt;, unless &lt;code&gt;--no-clone-check&lt;/code&gt;, and with &lt;code&gt;--clean-home&lt;/code&gt; opencode&amp;rsquo;s worktrees, unless &lt;code&gt;--no-worktree-check&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;/a&gt;). It asks once more when either finds work (&lt;code&gt;remake_anyway&lt;/code&gt;). The remake then goes in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;devvm builds the new image, as for a new VM.&lt;/li&gt;
&lt;li&gt;It exports the agents&amp;rsquo; history as &lt;code&gt;devvm rm&lt;/code&gt; does, unless &lt;code&gt;--no-export&lt;/code&gt;, and saves the VM&amp;rsquo;s home folder, unless &lt;code&gt;--clean-home&lt;/code&gt;. The VM runs &lt;code&gt;tar --one-file-system --ignore-failed-read&lt;/code&gt; in its home as its user, and devvm reads that stream on this machine and writes only what it keeps to &lt;code&gt;home.tar.gz&lt;/code&gt; in the VM&amp;rsquo;s folder (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-home-folders-copy"&gt;the home folder&amp;rsquo;s copy&lt;/a&gt;). A failure in either keeps the VM as it was (&lt;code&gt;export_failed_kept&lt;/code&gt;, &lt;code&gt;remake_home_failed&lt;/code&gt;), but an export over 2 GiB only warns (&lt;code&gt;history_too_large&lt;/code&gt;), and the remake goes on without one.&lt;/li&gt;
&lt;li&gt;devvm records the remake in the VM&amp;rsquo;s state (&lt;code&gt;remake&lt;/code&gt;), stops the VM, its proxy and its link session, and has the backend rename the VM&amp;rsquo;s machine to its aside name, &lt;code&gt;devvm-&amp;lt;hash&amp;gt;-old&lt;/code&gt;, which is no project VM&amp;rsquo;s name, so nothing else takes it for one. On Lima that&amp;rsquo;s &lt;code&gt;limactl rename&lt;/code&gt;, which keeps the old disk whole.&lt;/li&gt;
&lt;li&gt;devvm makes the new machine by the VM&amp;rsquo;s name from the new image, with what the state records: its project folder, its agents&amp;rsquo; folders, the tools share, its SSH agent, its size, its ports and its ssh port. It records that the new machine was made, and it keeps in the remake&amp;rsquo;s section what the VM had of its base&amp;rsquo;s &lt;code&gt;from&lt;/code&gt;, its shared tools, its ports and its &lt;code&gt;devcontainer&lt;/code&gt; section (&lt;code&gt;remake.was&lt;/code&gt;), so an undo can give them back. It clears which of its &lt;code&gt;devcontainer.json&lt;/code&gt;&amp;rsquo;s commands ran, so those that run once run again. Then it starts the VM as every start does (&lt;a href="#an-existing-vm"&gt;an existing VM&lt;/a&gt;, steps 4 to 8), which pins its new host keys.&lt;/li&gt;
&lt;li&gt;devvm puts the saved home folder in, with &lt;code&gt;tar --skip-old-files&lt;/code&gt; as the VM&amp;rsquo;s user, so what the new image has stays the image&amp;rsquo;s. The new machine is the VM from then on, so devvm records the new &lt;code&gt;image&lt;/code&gt; and &lt;code&gt;chain&lt;/code&gt;, and that the new machine is done.&lt;/li&gt;
&lt;li&gt;devvm deletes the old machine and ends the remake, which removes the section, then deletes &lt;code&gt;home.tar.gz&lt;/code&gt; and opens the VM as an existing VM, setting it up first. The proxy reads the VM&amp;rsquo;s layers from its image, so the new layers&amp;rsquo; allowlists apply from then, and those of layers taken out no longer do, as what the proxy started with has changed (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;). The VM&amp;rsquo;s &lt;code&gt;id&lt;/code&gt;, its alias and every other field stay as they were (&lt;a href="https://next.devvm.dev/docs/contributing/design/#a-vm-made-again"&gt;a VM made again&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Until the new machine has the home folder in step 5, a failure or an interrupt runs the remake&amp;rsquo;s cleanup (&lt;code&gt;remake_undone&lt;/code&gt;). It deletes the new machine, renames the old one back, whose next start makes it what the state asks for, as every start does, records that the machine by the VM&amp;rsquo;s name is the old one, gives the VM back the &lt;code&gt;from&lt;/code&gt;, shared tools, ports and &lt;code&gt;devcontainer&lt;/code&gt; section that step 4 kept, and ends the remake. When it can&amp;rsquo;t, it warns (&lt;code&gt;remake_undo_failed&lt;/code&gt;) and leaves the remake recorded. The section goes before &lt;code&gt;home.tar.gz&lt;/code&gt; does, so the saved home folder is there for as long as the remake is recorded. After step 5, nothing deletes the new machine, and a failure to delete the old one leaves the remake recorded as done.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm clone on&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; make the VM again from the image it has, in the other clone mode, which the remake records (&lt;code&gt;remake.clone&lt;/code&gt;), so a remake that didn&amp;rsquo;t finish is finished in that mode (&lt;a href="https://next.devvm.dev/docs/using/clone/#switching-a-vm-that-exists"&gt;switching a VM that exists&lt;/a&gt;). Before anything changes, &lt;code&gt;devvm clone on&lt;/code&gt; checks the folder as &lt;code&gt;--clone&lt;/code&gt; does, and after the question &lt;code&gt;devvm clone off&lt;/code&gt; checks the clone as &lt;code&gt;devvm rm&lt;/code&gt; does, unless &lt;code&gt;--no-clone-check&lt;/code&gt;. In step 4 the new machine mounts the project folder, or mounts none of it and keeps the clone at the folder&amp;rsquo;s path, and devvm records its mode when it records that the new machine was made. For the folder mounted, the mode comes with the &lt;code&gt;.git&lt;/code&gt; protection a new VM gets. Before the new machine starts, devvm removes the repo&amp;rsquo;s remote for the clone, keeping the work fetched from it as &lt;a href="#saved-branches"&gt;saved branches&lt;/a&gt;, and then locks &lt;code&gt;.git&lt;/code&gt;, because git can&amp;rsquo;t change a locked &lt;code&gt;.git/config&lt;/code&gt;. After &lt;code&gt;devvm clone on&lt;/code&gt;, devvm takes the &lt;code&gt;.git&lt;/code&gt; locks off in step 6, once the old machine is deleted and it has checked &lt;code&gt;.git&lt;/code&gt; as a launch that finds the VM stopped does. Undoing the remake sets the old mode back, takes off the locks the new machine got, and adds the remote back.&lt;/p&gt;
&lt;p&gt;A devvm holds the VM&amp;rsquo;s remake lock, &lt;code&gt;run/remake.lock&lt;/code&gt; in the VM&amp;rsquo;s folder, from when it finds the VM until the remake ends, and reads the VM&amp;rsquo;s state again once it has the lock. A second devvm that would make the VM again or finish its remake meanwhile refuses (&lt;code&gt;remake_running&lt;/code&gt;), so it never takes a remake that&amp;rsquo;s still running for one that stopped.&lt;/p&gt;
&lt;p&gt;A remake that&amp;rsquo;s recorded while no devvm holds the lock didn&amp;rsquo;t finish, because devvm was killed or its cleanup failed. The next &lt;code&gt;devvm&lt;/code&gt;, &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt;, &lt;code&gt;devvm update&lt;/code&gt;, &lt;code&gt;devvm clone on&lt;/code&gt; or &lt;code&gt;devvm clone off&lt;/code&gt; in the folder finishes it without asking (&lt;code&gt;remake_resuming&lt;/code&gt;). When the new machine is done, devvm deletes the old one and ends the remake. When the old machine is still aside, or the new one was never made, so the machine by the VM&amp;rsquo;s name is the old one, devvm puts the old machine back and makes the VM again from step 1. Otherwise the old machine is gone, and the new one, made or not, never ran a shell, so devvm checks the remake again as before step 1, deletes the new machine and makes it again from step 4 with the saved home folder, or without one, warning, when the file is gone (&lt;code&gt;remake_home_lost&lt;/code&gt;). Meanwhile every other command that acts on the VM refuses (&lt;code&gt;remake_pending&lt;/code&gt;), &lt;code&gt;devvm gc --orphans&lt;/code&gt; never takes the VM for an orphan, though the backend may have no machine by its name, and &lt;code&gt;devvm rm&lt;/code&gt; deletes the VM and its old machine too.&lt;/p&gt;
&lt;h3 data-hextra-search-id="reading-the-devcontainerjson-again"&gt;Reading the devcontainer.json again&lt;span class="hx:absolute hx:-mt-20" id="reading-the-devcontainerjson-again"&gt;&lt;/span&gt;
&lt;a href="#reading-the-devcontainerjson-again" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM&amp;rsquo;s &lt;code&gt;devcontainer&lt;/code&gt; section records more than the file&amp;rsquo;s SHA-256 and what it maps to of the VM&amp;rsquo;s own. It records which of the VM&amp;rsquo;s parts came from the file and which from you, so that &lt;code&gt;devvm update&lt;/code&gt; can replace only the file&amp;rsquo;s. &lt;code&gt;parts&lt;/code&gt; lists the toolchains and layers the file&amp;rsquo;s features mapped to when devvm last read it, and &lt;code&gt;gave&lt;/code&gt; lists those of them the VM got from the file alone. A part isn&amp;rsquo;t the file&amp;rsquo;s when &lt;code&gt;--tools&lt;/code&gt; or &lt;code&gt;--layers&lt;/code&gt; chose that part&amp;rsquo;s list, when &lt;code&gt;devvm setup&lt;/code&gt;&amp;rsquo;s layers have it, when the folder&amp;rsquo;s other files call for it, or when you unchecked it in the list. &lt;code&gt;ports&lt;/code&gt; lists the file&amp;rsquo;s &lt;code&gt;forwardPorts&lt;/code&gt;, and &lt;code&gt;ports_gave&lt;/code&gt; lists those of them that devvm added to the VM&amp;rsquo;s ports, as &lt;code&gt;devvm ports add&lt;/code&gt; adds them, because your ports didn&amp;rsquo;t forward them already and you didn&amp;rsquo;t give &lt;code&gt;--ports&lt;/code&gt;. &lt;code&gt;image&lt;/code&gt; is the container image the file names, recorded only when the VM&amp;rsquo;s base starts from it, and &lt;code&gt;from_flag&lt;/code&gt; records that you gave &lt;code&gt;--from&lt;/code&gt;, which wins over the file&amp;rsquo;s image for as long as the VM exists.&lt;/p&gt;
&lt;p&gt;When the folder&amp;rsquo;s file isn&amp;rsquo;t the one the VM was made from, because it changed, it&amp;rsquo;s gone or it appeared, &lt;code&gt;devvm update&lt;/code&gt; reads it again as a new VM&amp;rsquo;s file is read and refuses what a new VM refuses (&lt;code&gt;devcontainer_reread&lt;/code&gt;, or &lt;code&gt;devcontainer_gone&lt;/code&gt; for a file that&amp;rsquo;s gone). Then it works out what the VM is made again with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its parts.&lt;/strong&gt; devvm drops the parts in &lt;code&gt;gave&lt;/code&gt; that the file no longer calls for, and adds the ones the file now calls for that weren&amp;rsquo;t in &lt;code&gt;parts&lt;/code&gt; and that the VM lacks. A part you took out stays out, and your own parts stay. Layers go into the new image&amp;rsquo;s name, after the layers the VM keeps, and toolchains go into its shared tools.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its base.&lt;/strong&gt; With &lt;code&gt;from_flag&lt;/code&gt;, the base stays as it is, and devvm says the file&amp;rsquo;s image is ignored. When the file names another image, devvm pins it to the digest its registry gives anyone, as for a new VM. When the file no longer names one, the base starts from &lt;code&gt;$DEVVM_FROM&lt;/code&gt;, or else from Ubuntu&amp;rsquo;s cloud image.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its ports.&lt;/strong&gt; In the same way, devvm takes out the ports in &lt;code&gt;ports_gave&lt;/code&gt; that the file no longer lists, with the rule &lt;code&gt;devvm ports rm&lt;/code&gt; follows, and adds the ones it lists anew that the VM&amp;rsquo;s ports don&amp;rsquo;t already forward, with the rule &lt;code&gt;devvm ports add&lt;/code&gt; follows. A port you took out with &lt;code&gt;devvm ports rm&lt;/code&gt; stays out, your own ports stay, and with every port forwarded nothing changes. A port of the file&amp;rsquo;s that&amp;rsquo;s part of one of your ranges counts as yours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its variables and commands.&lt;/strong&gt; The file&amp;rsquo;s new ones replace the old ones, and the commands that run once run on the new disk.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The remake records all of this in its section (&lt;code&gt;remake.reread&lt;/code&gt;): the new base&amp;rsquo;s &lt;code&gt;from&lt;/code&gt;, the shared tools, the ports and the new &lt;code&gt;devcontainer&lt;/code&gt; section. After step 1 builds the new image from the new base, devvm builds the shared tools for that base, as for a new VM, and records their files there too, holding the lock that new VMs hold so that &lt;code&gt;devvm gc&lt;/code&gt; keeps the tool images. In step 4 the VM gets all four, so the port forwarder starts with the new ports when the VM starts, and an undo gives back what it had. A remake that didn&amp;rsquo;t finish keeps them, so it&amp;rsquo;s finished with what the file said when &lt;code&gt;devvm update&lt;/code&gt; read it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="an-existing-vm"&gt;An existing VM&lt;span class="hx:absolute hx:-mt-20" id="an-existing-vm"&gt;&lt;/span&gt;
&lt;a href="#an-existing-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you run &lt;code&gt;devvm&lt;/code&gt; in a folder whose VM exists, devvm opens the VM as it is and starts it if it&amp;rsquo;s stopped. Each time, it does these steps in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;devvm warns when an image the VM was made from has changed since, or when there are newer shared tools than the VM&amp;rsquo;s, and both warnings name &lt;code&gt;devvm update&lt;/code&gt;, which moves the VM to the newer tools and, after asking, makes it again from the changed image (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;). It also checks for newer tools once a day.&lt;/li&gt;
&lt;li&gt;devvm ignores the options for new VMs, with a warning for each. The VM keeps its shared tools, which &lt;code&gt;devvm tools&lt;/code&gt; changes, and its layers, which &lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm layer rm&lt;/code&gt; change. It keeps its network tier, which &lt;code&gt;devvm network&lt;/code&gt; changes, and its &lt;code&gt;.git&lt;/code&gt; protection, which &lt;code&gt;devvm git-protect&lt;/code&gt; changes. It keeps its size, which &lt;code&gt;devvm size&lt;/code&gt; changes, its ports, which &lt;code&gt;devvm ports&lt;/code&gt; changes, and its SSH agent forwarding, which &lt;code&gt;devvm ssh-agent&lt;/code&gt; changes. It also keeps its backend, and ignores &lt;code&gt;--from&lt;/code&gt; and &lt;code&gt;--no-devcontainer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;devvm warns when the folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; isn&amp;rsquo;t the one the VM was made from, and the warning names &lt;code&gt;devvm update&lt;/code&gt;, which makes the VM again as the file says now (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/#when-its-read"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm asks the backend for the VM&amp;rsquo;s status and config, once for the whole start. It compares the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;agent folder mounts&lt;/a&gt; with the folders in devvm&amp;rsquo;s agent store and names the folders that changed. A running VM gets the new mounts when it next starts. When a running VM has changes waiting for its next start, such as these mounts, a new size, a change to its agent forwarding or the open tier given to it while it ran confined, devvm names them in at most two lines, one for each change (&lt;code&gt;next_start_size&lt;/code&gt;, &lt;code&gt;next_start_agent&lt;/code&gt;, &lt;code&gt;next_start_mounts&lt;/code&gt;, &lt;code&gt;next_start_net_off&lt;/code&gt;), or past two the first change and how many more (&lt;code&gt;next_start_more&lt;/code&gt;). Then it asks once, in a terminal, whether to restart it now (&lt;code&gt;restart_now&lt;/code&gt;), yes by default (&lt;code&gt;[Y/n]&lt;/code&gt;) when the mounts are among the changes and no by default (&lt;code&gt;[y/N]&lt;/code&gt;) otherwise. A yes stops the VM here, so the steps below start it with the changes, and a no leaves it running.&lt;/li&gt;
&lt;li&gt;devvm checks &lt;code&gt;.git&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-each-launch"&gt;on each launch&lt;/a&gt;) and, on Linux hosts when it finds the VM stopped, names the set-id files in the folder. It skips both for a &lt;code&gt;--clone&lt;/code&gt; VM, which mounts neither.&lt;/li&gt;
&lt;li&gt;devvm checks that the backend can still give the VM what its state asks for: its tier&amp;rsquo;s confinement, its ports and its &lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;SSH agent forwarding&lt;/a&gt;, and turning that forwarding on or off when the VM has it the other way. A backend that can&amp;rsquo;t is refused before anything starts. When the VM forwards your agent, devvm checks that the agent has keys.&lt;/li&gt;
&lt;li&gt;devvm starts the VM if it&amp;rsquo;s stopped. The backend&amp;rsquo;s start gives the VM what its state asks for: its size, the agent folders in devvm&amp;rsquo;s agent store, its agent forwarding and its ports. It changes only what differs from the VM&amp;rsquo;s config, together with what the VM&amp;rsquo;s confinement needs, and it changes nothing on a running VM (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;on Lima&lt;/a&gt;). When the VM uses devvm&amp;rsquo;s own agent, devvm loads the keys that the agent lacks, whether the VM starts or runs already. A running VM keeps its proxy, unless what the proxy was started with has changed (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;), and a VM made open after it started confined stays confined to its proxy, which applies the open tier&amp;rsquo;s rules, until it next starts. For a VM that runs on, devvm then says in one place what the VM gets only when it next starts, where that differs from what its state asks for: its size, its agent forwarding, its agent folder mounts and the open tier&amp;rsquo;s direct network. It warns of each with the line that names it in step 4, then once that &lt;code&gt;devvm restart&lt;/code&gt; applies them (&lt;code&gt;next_start&lt;/code&gt;), which is also what &lt;code&gt;devvm size&lt;/code&gt;, &lt;code&gt;devvm network&lt;/code&gt; and &lt;code&gt;devvm ssh-agent&lt;/code&gt; say for a running VM you don&amp;rsquo;t restart.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;self-check&lt;/a&gt; runs, and devvm stops a VM whose confined tier isn&amp;rsquo;t enforced.&lt;/li&gt;
&lt;li&gt;devvm sets the VM up and opens the shell, as for a new VM. A &lt;code&gt;--clone&lt;/code&gt; VM whose clone wasn&amp;rsquo;t made yet gets it first. On the first launch after the VM started, the &lt;code&gt;postStartCommand&lt;/code&gt; of the &lt;code&gt;devcontainer.json&lt;/code&gt; that the VM was made from runs before the shell opens (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/#commands"&gt;commands&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Steps 4 to 8 are the one way devvm starts a VM, whatever the command, and only a launch matches the agent folder mounts in step 4. So &lt;code&gt;devvm host&lt;/code&gt; and &lt;code&gt;devvm code&lt;/code&gt;, an export, &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s check of a &lt;code&gt;--clone&lt;/code&gt; VM and a remake&amp;rsquo;s new machine check &lt;code&gt;.git&lt;/code&gt;, check what the backend can give, start the VM with the size, agent folders, agent forwarding and ports its state asks for, and run the self-check in the same way. A new VM goes through steps 5 to 8 once it&amp;rsquo;s made, and in step 5 devvm locks its &lt;code&gt;.git&lt;/code&gt; and checks its folder as step 6 of &lt;a href="#a-new-vm"&gt;a new VM&lt;/a&gt; says.&lt;/p&gt;
&lt;p&gt;devvm never starts a VM whose creation didn&amp;rsquo;t finish, because the VM would start without its tier (&lt;code&gt;vm_unfinished&lt;/code&gt;). That happens when devvm was stopped after it made the VM but before it recorded the VM&amp;rsquo;s tier. In a terminal and without &lt;code&gt;--no-input&lt;/code&gt;, devvm asks whether to delete such a VM and make it again (&lt;code&gt;remake_unfinished&lt;/code&gt;, &lt;code&gt;[y/N]&lt;/code&gt;), and yes deletes it as &lt;code&gt;devvm rm&lt;/code&gt; does, then makes the VM as for a folder without one. Otherwise, and for a parent folder&amp;rsquo;s VM, devvm refuses, and &lt;code&gt;devvm rm&lt;/code&gt; deletes such a VM.&lt;/p&gt;
&lt;p&gt;devvm also never starts a VM on a project folder that was replaced after the finder found the VM. A parent folder&amp;rsquo;s VM mounts a nested project folder too, so code in it can move the folder aside and put a link or another folder at its path. On Linux, Lima passes the path to QEMU as it is, and its 9p share follows a link when it opens the folder at the VM&amp;rsquo;s start. On macOS, the Lima backend mounts the folder by the device and inode in the state&amp;rsquo;s &lt;code&gt;folder&lt;/code&gt; instead (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;what devvm sets on a VM&lt;/a&gt;), so Virtualization.framework&amp;rsquo;s virtiofs share opens the folder devvm made the VM for, wherever it is then, and never what replaced it. devvm checks the folder three times in a start of a stopped VM: before step 5&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; checks, which would otherwise act on what the link points to, just before the backend&amp;rsquo;s start, and once the backend&amp;rsquo;s start returns. Each check resolves the path&amp;rsquo;s links, which must give the same path, and compares the folder&amp;rsquo;s identity, its device, inode and birth time, with the state&amp;rsquo;s &lt;code&gt;folder&lt;/code&gt;. macOS numbers its disks&amp;rsquo; devices in the order they appear at boot, so after a restart the same folder can be on a device with another number. So when only the folder&amp;rsquo;s device differs and the folder is still the VM&amp;rsquo;s, the start records the folder&amp;rsquo;s identity as it is now in the state&amp;rsquo;s &lt;code&gt;folder&lt;/code&gt;, under the VM&amp;rsquo;s &lt;code&gt;lock&lt;/code&gt;, before the first check. The folder is still the VM&amp;rsquo;s when its identity has its birth time and its file system never gives a new folder a deleted one&amp;rsquo;s inode number (as for &lt;a href="#a-moved-folder"&gt;a moved folder&lt;/a&gt;). devvm reads that identity from the folder opened at its path with no link followed, so a link swapped in for a moment can&amp;rsquo;t pass a copy&amp;rsquo;s identity off as the folder&amp;rsquo;s. The finder takes such a folder as the VM&amp;rsquo;s in the same way. The backend then mounts the folder by the device it&amp;rsquo;s on now, never by the old number, which may be another disk&amp;rsquo;s after the boot, and each of the three checks compares the identity with the recorded one exactly. A failed check before the start refuses it (&lt;code&gt;project_folder_changed&lt;/code&gt;), and one after it stops the VM and its proxy and refuses (&lt;code&gt;project_folder_changed_stopped&lt;/code&gt;). The backend&amp;rsquo;s start returns once the VM has booted, so a VM stopped by the last check ran with what it mounted for as long as its boot took, on its own tier&amp;rsquo;s network. A running VM&amp;rsquo;s share never follows a link put in the folder&amp;rsquo;s place later: QEMU&amp;rsquo;s 9p share holds the folder it opened at the start, and Virtualization.framework&amp;rsquo;s virtiofs share answers &amp;ldquo;Operation not permitted&amp;rdquo; for it, which the project section of the end-to-end tests checks on both. So a launch into a running VM checks nothing more than the finder did. On Linux, code that replaces the folder only for the moment QEMU opens it, and puts it back before the last check, stays unseen, and the VM keeps what the link pointed to until its next start. On macOS, the same swap leaves the VM with the project folder where it was moved to at the start, and once the folder is back, virtiofs answers &amp;ldquo;Operation not permitted&amp;rdquo; for it until the VM&amp;rsquo;s next start, which the project section of the end-to-end tests checks.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm&lt;/code&gt; warns about the setup that allows this before it makes or opens a VM that mounts its folder (&lt;code&gt;project_in_vm_folder&lt;/code&gt;). The finder walks the folders the VM&amp;rsquo;s folder is inside, as it does for &lt;a href="#a-subfolders-vm"&gt;a subfolder&amp;rsquo;s VM&lt;/a&gt;, and names the nearest one with a state of its own that was made for that folder and isn&amp;rsquo;t a &lt;code&gt;--clone&lt;/code&gt; VM. It reads only the states and asks no backend, so a stopped parent folder&amp;rsquo;s VM counts too, because it writes to the folder whenever it runs. The warning comes once per run of &lt;code&gt;devvm&lt;/code&gt;, and no other command gives it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="stopping-a-vm"&gt;Stopping a VM&lt;span class="hx:absolute hx:-mt-20" id="stopping-a-vm"&gt;&lt;/span&gt;
&lt;a href="#stopping-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm stop&lt;/code&gt; stops this folder&amp;rsquo;s VM, then its &lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;proxy&lt;/a&gt;, its &lt;a href="https://next.devvm.dev/docs/internals/ports/#its-process-and-files"&gt;port forwarder&lt;/a&gt; and its link session. Once the VM is stopped, devvm applies the &lt;code&gt;.git&lt;/code&gt; protection chosen with &lt;code&gt;devvm git-protect&lt;/code&gt; while the VM ran, checks &lt;code&gt;.git&lt;/code&gt; as a launch that finds the VM stopped does, and sets the locks that were waiting for the VM to stop (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-each-launch"&gt;on each launch&lt;/a&gt;). On Linux hosts it also names the set-id files in the folder. It skips both for a &lt;code&gt;--clone&lt;/code&gt; VM. Then devvm removes the VM&amp;rsquo;s entry from the &lt;a href="https://next.devvm.dev/docs/using/ssh/"&gt;ssh config&lt;/a&gt;. A VM that&amp;rsquo;s already stopped gets the same checks.&lt;/p&gt;
&lt;h2 data-hextra-search-id="deleting-a-vm"&gt;Deleting a VM&lt;span class="hx:absolute hx:-mt-20" id="deleting-a-vm"&gt;&lt;/span&gt;
&lt;a href="#deleting-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm rm&lt;/code&gt; deletes this folder&amp;rsquo;s VM and what devvm keeps for it: its state, its own allowlist and secret files, its network log, its &lt;code&gt;.git&lt;/code&gt; locks, its pinned host keys and its ssh config entry. Other VMs, images and the project folder stay.&lt;/p&gt;
&lt;p&gt;After the backend deletes the VM, devvm tears down the rest in one order, which &lt;code&gt;devvm gc --orphans&lt;/code&gt; follows too. It stops the VM&amp;rsquo;s proxy, port forwarder and link session first. Then it deletes what devvm keeps for the VM outside its folder: a clone&amp;rsquo;s remote and the &lt;code&gt;.git&lt;/code&gt; locks, other VMs&amp;rsquo; links to it and the links its group made, its pinned host keys, for &lt;code&gt;devvm gc --orphans&lt;/code&gt; the backend&amp;rsquo;s own leftovers, and the old machine of a &lt;a href="#making-a-vm-again"&gt;remake&lt;/a&gt; that didn&amp;rsquo;t finish. Then it deletes the VM&amp;rsquo;s folder, with every file devvm keeps for it there, and last its ssh config entry.&lt;/p&gt;
&lt;p&gt;For a &lt;code&gt;--clone&lt;/code&gt; VM, devvm first checks the clone for commits that this repo hasn&amp;rsquo;t fetched and for uncommitted changes, in the clone and in the worktrees inside it (&lt;a href="https://next.devvm.dev/docs/using/clone/#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;). It reads every repo of the clone in one command in the VM, a script sent with it that prints each repo&amp;rsquo;s branches, its status and each linked worktree below the project folder with that worktree&amp;rsquo;s status, as length-prefixed records. devvm reads at most 8 MiB of the answer and stops the command once it sends more, and it waits at most 2 minutes for the answer, so a VM that answers without end, or never, can&amp;rsquo;t keep &lt;code&gt;devvm rm&lt;/code&gt; waiting. It takes only whole records of the repos it asked for, each worktree&amp;rsquo;s path clean, relative and below the folder, and any other answer fails the check, which keeps the VM. The repo&amp;rsquo;s remote for the VM goes with the VM, and devvm keeps the work fetched from it as local branches, which &lt;a href="#saved-branches"&gt;saved branches&lt;/a&gt; names. When the VM&amp;rsquo;s image has an agent, devvm then exports the agents&amp;rsquo; history from the VM, starting it if it&amp;rsquo;s stopped (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;history&lt;/a&gt;), and it keeps the VM if the export fails. devvm reads the VM&amp;rsquo;s export through a writer that stops at 2 GiB (&lt;code&gt;bounded&lt;/code&gt;): past that, it stops the VM&amp;rsquo;s command, deletes what it wrote and warns (&lt;code&gt;history_too_large&lt;/code&gt;), and the delete goes on, as it does for a remake. &lt;code&gt;devvm rm&lt;/code&gt; asks first in a terminal (&lt;code&gt;rm_confirm&lt;/code&gt;), and where devvm can&amp;rsquo;t ask it refuses unless &lt;code&gt;--force&lt;/code&gt;, the question&amp;rsquo;s refusal naming &lt;code&gt;--force&lt;/code&gt; (&lt;code&gt;no_input&lt;/code&gt;). &lt;code&gt;devvm rm --no-export&lt;/code&gt; deletes the VM without the export, the clone&amp;rsquo;s checks still run and ask only in a terminal, and a VM whose creation didn&amp;rsquo;t finish gets neither, because it never ran.&lt;/p&gt;
&lt;h3 data-hextra-search-id="saved-branches"&gt;Saved branches&lt;span class="hx:absolute hx:-mt-20" id="saved-branches"&gt;&lt;/span&gt;
&lt;a href="#saved-branches" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The local branches are named &lt;code&gt;saved/&amp;lt;remote&amp;gt;/&amp;lt;branch&amp;gt;&lt;/code&gt;, after the remote, and devvm never overwrites a branch. If a branch named &lt;code&gt;saved/&amp;lt;remote&amp;gt;&lt;/code&gt; exists, or one under it, or one it would sit under, devvm uses &lt;code&gt;saved/&amp;lt;remote&amp;gt;-2&lt;/code&gt; instead, then &lt;code&gt;-3&lt;/code&gt;, and so on up to &lt;code&gt;-99&lt;/code&gt;. If none of those names is free, for example because a branch is named &lt;code&gt;saved&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; refuses before it fetches anything and keeps the VM. When that happens as devvm is about to remove the remote, it leaves the remote and its branches in place. Branch names come from the VM, so devvm quotes them when it shows them, and it skips any name that git refuses as a branch name.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-folder-made-again"&gt;A folder made again&lt;span class="hx:absolute hx:-mt-20" id="a-folder-made-again"&gt;&lt;/span&gt;
&lt;a href="#a-folder-made-again" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s state records its project folder&amp;rsquo;s path (&lt;code&gt;dir&lt;/code&gt;) and the folder&amp;rsquo;s identity (&lt;code&gt;folder&lt;/code&gt;), which &lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt; describes. When either differs from the folder you&amp;rsquo;re in, the folder was deleted and made again, or another repo was cloned where the old one was. devvm then refuses the VM in every command that opens, stops or changes it (&lt;code&gt;vm_other_folder&lt;/code&gt;), and only &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm adopt&lt;/code&gt; act on it. Each of them asks first, so without a terminal each one refuses (&lt;code&gt;vm_other_folder_rm&lt;/code&gt;, &lt;code&gt;vm_other_folder_adopt&lt;/code&gt;), unless &lt;code&gt;devvm adopt --force&lt;/code&gt;. &lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-made-again"&gt;A folder made again&lt;/a&gt; says what each one does, and devvm does it as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm rm&lt;/code&gt; asks with &lt;code&gt;delete_other_folder_vm&lt;/code&gt;, then deletes the VM without checking a clone, because the VM&amp;rsquo;s folder is gone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm adopt&lt;/code&gt; asks with &lt;code&gt;adopt_vm&lt;/code&gt;, then records this folder&amp;rsquo;s path and identity in the VM&amp;rsquo;s state and clears the inode of &lt;code&gt;.git&lt;/code&gt; it recorded, so the next launch locks &lt;code&gt;.git&lt;/code&gt; as if it had just appeared (&lt;code&gt;vm_adopted&lt;/code&gt;). In a folder the VM already belongs to, it changes nothing (&lt;code&gt;vm_already_here&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="a-moved-folder"&gt;A moved folder&lt;span class="hx:absolute hx:-mt-20" id="a-moved-folder"&gt;&lt;/span&gt;
&lt;a href="#a-moved-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s folder in the data folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, is named by the hash at the end of the VM&amp;rsquo;s name, which the backend&amp;rsquo;s machine has too, so neither changes when the project folder moves. What changes is the state&amp;rsquo;s &lt;code&gt;dir&lt;/code&gt;, and devvm finds a folder&amp;rsquo;s VM by the state that records its path (&lt;a href="#a-vms-folder"&gt;a VM&amp;rsquo;s folder&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;When the folder devvm runs in has no VM, devvm looks through every VM&amp;rsquo;s state for one made for this folder at another path (&lt;a href="#listing-vms"&gt;listing VMs&lt;/a&gt;). A state matches when its &lt;code&gt;folder&lt;/code&gt; identity is this folder&amp;rsquo;s, its &lt;code&gt;dir&lt;/code&gt; is another path, nothing is at that path any more on the folder&amp;rsquo;s device (&lt;code&gt;gone&lt;/code&gt;, &lt;a href="#a-vm-whose-folder-is-gone"&gt;a VM whose folder is gone&lt;/a&gt;) or only a symlink that resolves to this folder is, its creation finished, and it isn&amp;rsquo;t a &lt;code&gt;--clone&lt;/code&gt; VM. The folder must be this user&amp;rsquo;s, and its identity must be one that no other folder can have had. It must have the folder&amp;rsquo;s birth time, which tells a folder apart from a deleted one with the same inode number, and from a folder with the same inode number on another volume that a later mount gave the same device number, and on macOS the folder must be on APFS or HFS+, which never give a new folder a deleted one&amp;rsquo;s inode number. On Linux it must be on ext4, XFS, Btrfs, tmpfs, ZFS, F2FS or bcachefs, local file systems that keep a file&amp;rsquo;s inode number for its life and report its birth time, which devvm reads by the file system&amp;rsquo;s type from &lt;code&gt;statfs&lt;/code&gt;. FUSE, network shares, 9p, overlayfs and FAT may make inode numbers up, so a folder on one never matches. A copy has a new inode, so it never matches, and a folder made again at the old path doesn&amp;rsquo;t either. At another path, the identity must also match the device in the state&amp;rsquo;s &lt;code&gt;folder&lt;/code&gt;. So a folder that moved after a boot numbered its disk anew, before its VM started again, isn&amp;rsquo;t offered the VM, and you move the VM to it with &lt;code&gt;devvm adopt VM&lt;/code&gt;. When more than one state matches, devvm moves none (&lt;code&gt;vms_moved_here&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;For one match, devvm asks in a terminal (&lt;code&gt;move_vm&lt;/code&gt;), with no as the default, and refuses without one (&lt;code&gt;vm_moved_here&lt;/code&gt;). &lt;code&gt;devvm adopt --force&lt;/code&gt; moves it without asking. A no leaves the folder without a VM, so &lt;code&gt;devvm&lt;/code&gt; makes a new one. A yes first checks the folder as a new VM&amp;rsquo;s folder is checked (&lt;a href="https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses"&gt;project folders devvm refuses&lt;/a&gt;). Then devvm takes the &lt;a href="#locks"&gt;creation locks&lt;/a&gt; of the VM and of the new VM the folder would get, so no other devvm deletes the VM or makes one for the folder meanwhile, and checks again that no state records the folder, and that the folder at the path is still the one it asked about (&lt;code&gt;move_folder_changed&lt;/code&gt;). A running VM still mounts the old path, so devvm stops it as &lt;code&gt;devvm stop&lt;/code&gt; does, with its proxy, port forwarder and link session (&lt;code&gt;stopped&lt;/code&gt;). Last, it records the folder&amp;rsquo;s path and identity under the VM&amp;rsquo;s &lt;code&gt;lock&lt;/code&gt;, refusing a state whose &lt;code&gt;dir&lt;/code&gt; or &lt;code&gt;folder&lt;/code&gt; changed since it was read (&lt;code&gt;create_running&lt;/code&gt;), and says so (&lt;code&gt;vm_adopted&lt;/code&gt;). In the same write, it records the old path in the state&amp;rsquo;s &lt;code&gt;moved&lt;/code&gt; section as &lt;code&gt;from&lt;/code&gt;, the path that the agents in the VM keep the folder&amp;rsquo;s history under. A second move before the VM&amp;rsquo;s next start keeps the first move&amp;rsquo;s old path there, because the history is still under it, and a move back to that path clears the section. The &lt;code&gt;.git&lt;/code&gt; protection&amp;rsquo;s record stays as it was, because a folder that moved keeps its &lt;code&gt;.git&lt;/code&gt;, whose identity and locks move with it, so the next check compares &lt;code&gt;.git&lt;/code&gt; with what it locked.&lt;/p&gt;
&lt;p&gt;The backend gets the new path at the VM&amp;rsquo;s next start, because a start makes a stopped VM what its state asks for, its project folder&amp;rsquo;s mount included, and Lima does it in the same &lt;code&gt;limactl edit&lt;/code&gt; as the rest (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;what devvm sets on a VM&lt;/a&gt;). A VM that runs with its project folder at another path all the same, such as one started outside devvm, mounts that path until it starts again, so devvm asks whether to restart it as it opens the VM (&lt;code&gt;restart_now&lt;/code&gt;), with yes as the default, as for agent folders, and otherwise warns that it mounts the folder at the new path only when it next starts (&lt;code&gt;next_start_folder&lt;/code&gt;, then &lt;code&gt;next_start&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s setup, which runs on every launch, moves Claude Code&amp;rsquo;s history for the folder. Claude Code keeps a folder&amp;rsquo;s sessions in &lt;code&gt;~/.claude/projects/SLUG&lt;/code&gt;, where SLUG is the folder&amp;rsquo;s path with each character other than an ASCII letter or digit replaced by a dash, counted in UTF-16 units as JavaScript counts them. A SLUG longer than 200 characters is cut at 200 and gets a dash and the path&amp;rsquo;s hash in base 36, the 32-bit hash that multiplies by 31 and adds each UTF-16 unit. That rule is Claude Code&amp;rsquo;s own, read from its 2.1 release. Claude Code also keeps the folder&amp;rsquo;s trust and MCP servers under the path itself in &lt;code&gt;~/.claude.json&lt;/code&gt;&amp;rsquo;s &lt;code&gt;projects&lt;/code&gt;. When the state has a &lt;code&gt;moved&lt;/code&gt; section, devvm sends the setup a &lt;code&gt;moved&lt;/code&gt; file with both paths and both slugs, and the setup&amp;rsquo;s &lt;code&gt;claude.sh&lt;/code&gt; renames the old slug&amp;rsquo;s folder to the new slug. When the new slug&amp;rsquo;s folder exists already, the setup moves each of the old folder&amp;rsquo;s entries that the new one doesn&amp;rsquo;t have into it, and leaves the rest. It moves the &lt;code&gt;projects&lt;/code&gt; entry of the old path to the new path, unless the new path has one of its own, and leaves a &lt;code&gt;~/.claude.json&lt;/code&gt; that isn&amp;rsquo;t JSON as it is, with a warning in the run log. A folder or file that is a symlink stays as it is. All of this runs in the VM, as the VM&amp;rsquo;s user, on the VM&amp;rsquo;s own files, and never on the host&amp;rsquo;s. Running it again changes nothing, so a setup that fails after it moved the history does no harm when it runs again. Once the setup succeeds, devvm clears the &lt;code&gt;moved&lt;/code&gt; section under the VM&amp;rsquo;s &lt;code&gt;lock&lt;/code&gt;, unless another move recorded a different path meanwhile. devvm moves nothing of Codex&amp;rsquo;s or opencode&amp;rsquo;s. Codex records each session&amp;rsquo;s folder in the session, and opencode keeps a git repo&amp;rsquo;s sessions by the repo&amp;rsquo;s first commit and other folders&amp;rsquo; sessions by their path (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-moved-or-renamed-folder"&gt;a moved or renamed folder&lt;/a&gt;). Links and groups go by the VM&amp;rsquo;s name, so they stay as they were, and a link&amp;rsquo;s TARGET given as a path finds the VM whose &lt;code&gt;dir&lt;/code&gt; is that path. A new VM made at the old path can&amp;rsquo;t use the folder the moved VM keeps, so its name ends with the next hash of that path that names a free folder.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm adopt VM&lt;/code&gt; moves the VM it names, found as &lt;code&gt;devvm rm VM&lt;/code&gt; finds one, to the folder devvm runs in, for a copy of the folder, such as one on another disk. It refuses a &lt;code&gt;--clone&lt;/code&gt; VM (&lt;code&gt;adopt_clone&lt;/code&gt;), a VM its backend no longer has (&lt;code&gt;rm_vm_lost&lt;/code&gt;), a VM whose creation didn&amp;rsquo;t finish, a VM whose folder is there (&lt;code&gt;adopt_folder_there&lt;/code&gt;), and a folder with a VM of its own (&lt;code&gt;adopt_has_vm&lt;/code&gt;). It asks in a terminal (&lt;code&gt;adopt_move_vm&lt;/code&gt;), which &lt;code&gt;--force&lt;/code&gt; answers, and refuses without either (&lt;code&gt;adopt_move_refused&lt;/code&gt;). It moves the VM as a match does, and also clears the &lt;code&gt;.git&lt;/code&gt; protection&amp;rsquo;s record, as &lt;code&gt;devvm adopt&lt;/code&gt; does, because the copy&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; is another folder. A VM whose &lt;code&gt;dir&lt;/code&gt; is this folder goes through &lt;code&gt;devvm adopt&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-vm-whose-folder-is-gone"&gt;A VM whose folder is gone&lt;span class="hx:absolute hx:-mt-20" id="a-vm-whose-folder-is-gone"&gt;&lt;/span&gt;
&lt;a href="#a-vm-whose-folder-is-gone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s folder is there, gone or not connected, which &lt;code&gt;devvm ls --json&lt;/code&gt; gives as &lt;code&gt;folder_state&lt;/code&gt;. It&amp;rsquo;s there when something is at the path its state records as &lt;code&gt;dir&lt;/code&gt; (&lt;a href="#a-vms-state"&gt;a VM&amp;rsquo;s state&lt;/a&gt;), so a folder made again at that path is there too, and &lt;a href="#a-folder-made-again"&gt;a folder made again&lt;/a&gt; covers it, and so is a path devvm can&amp;rsquo;t read for another reason, such as its permissions. When nothing is at the path, devvm walks up to the nearest folder above it that exists and compares that folder&amp;rsquo;s device with the device in the &lt;code&gt;folder&lt;/code&gt; identity the state records, or, for a state that records the folder&amp;rsquo;s volume (&lt;code&gt;folder_volume&lt;/code&gt;), that folder&amp;rsquo;s volume with it, so a disk that a restart numbered anew isn&amp;rsquo;t taken for another (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;). The same device means the folder was deleted or moved from that filesystem, so it&amp;rsquo;s gone. Another device means it was on a disk or share that isn&amp;rsquo;t mounted, so it&amp;rsquo;s not connected, and a folder moved to another disk and then deleted counts as not connected too, which is the safe mistake. A state with no &lt;code&gt;folder&lt;/code&gt; identity, or a device devvm can&amp;rsquo;t read, counts as gone. &lt;code&gt;devvm ls&lt;/code&gt; and &lt;code&gt;devvm space&lt;/code&gt; check every VM&amp;rsquo;s path when they list it, and neither &lt;code&gt;devvm gc&lt;/code&gt; nor retention treats such a VM as leftover state, because its backend still has it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm rm VM&lt;/code&gt; finds the VM by the &lt;code&gt;name&lt;/code&gt; or &lt;code&gt;alias&lt;/code&gt; in each state file, and nothing else, so a folder&amp;rsquo;s name never matches (&lt;code&gt;rm_unknown_vm&lt;/code&gt;). A VM whose &lt;code&gt;dir&lt;/code&gt; is the folder devvm runs in goes through &lt;code&gt;devvm rm&lt;/code&gt; when it&amp;rsquo;s that folder&amp;rsquo;s own VM, the one the folder&amp;rsquo;s lookup finds (&lt;a href="#a-vms-folder"&gt;a VM&amp;rsquo;s folder&lt;/a&gt;). A VM whose &lt;code&gt;dir&lt;/code&gt; names a folder with another VM of its own, which only a state changed by hand can, is a VM whose folder is there, so &lt;code&gt;devvm rm VM&lt;/code&gt; never sends the command to that folder&amp;rsquo;s own VM. Otherwise devvm refuses a VM whose folder is there (&lt;code&gt;rm_vm_folder_there&lt;/code&gt;), and one that its backend no longer has (&lt;code&gt;rm_vm_lost&lt;/code&gt;). It then refuses a &lt;code&gt;--clone&lt;/code&gt; VM unless &lt;code&gt;--no-clone-check&lt;/code&gt; (&lt;code&gt;rm_gone_clone&lt;/code&gt;), because there&amp;rsquo;s no repo to fetch the clone&amp;rsquo;s work into. When the VM has an agent and &lt;code&gt;--no-export&lt;/code&gt; isn&amp;rsquo;t given, it refuses a stopped VM that mounts its folder (&lt;code&gt;rm_gone_stopped&lt;/code&gt;), because Lima makes a missing folder that a VM mounts as the VM starts, and the export would make the project folder again. It asks next (&lt;code&gt;delete_gone_folder_vm&lt;/code&gt;), which &lt;code&gt;--force&lt;/code&gt; answers, and where devvm can&amp;rsquo;t ask it refuses unless &lt;code&gt;--force&lt;/code&gt; (&lt;code&gt;no_input&lt;/code&gt;). For a folder that isn&amp;rsquo;t connected, it refuses where devvm can&amp;rsquo;t ask, even with &lt;code&gt;--force&lt;/code&gt; (&lt;code&gt;rm_vm_not_connected&lt;/code&gt;), and otherwise it asks (&lt;code&gt;delete_not_connected_folder_vm&lt;/code&gt;), which &lt;code&gt;--force&lt;/code&gt; never answers. Once you answer, it reads the VM&amp;rsquo;s state again and checks that the folder is still in the state it found, and the VM&amp;rsquo;s status when it&amp;rsquo;s to be exported, once more, because the folder may have come back while it asked, another devvm may have made the VM again, or stopped it: each of those keeps the VM, with the same refusals. Last, it exports the history from the running VM, or from a &lt;code&gt;--clone&lt;/code&gt; VM it starts, and deletes the VM as &lt;code&gt;devvm rm&lt;/code&gt; does (&lt;a href="#deleting-a-vm"&gt;deleting a VM&lt;/a&gt;). A failed export keeps the VM (&lt;code&gt;export_failed_kept&lt;/code&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-subfolders-vm"&gt;A subfolder&amp;rsquo;s VM&lt;span class="hx:absolute hx:-mt-20" id="a-subfolders-vm"&gt;&lt;/span&gt;
&lt;a href="#a-subfolders-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm finds a folder&amp;rsquo;s VM by the state that records the folder&amp;rsquo;s physical path (&lt;a href="#a-vms-folder"&gt;a VM&amp;rsquo;s folder&lt;/a&gt;), so devvm in a subfolder finds no state file and names a new VM that doesn&amp;rsquo;t exist. When the backend has no VM by that name and devvm has no state file for the folder, and no VM whose folder moved there (&lt;a href="#a-moved-folder"&gt;a moved folder&lt;/a&gt;), devvm checks the folders the current folder is inside, nearest first (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-subfolder"&gt;a subfolder&lt;/a&gt;). It finds each parent&amp;rsquo;s state file by that parent&amp;rsquo;s path in the same way, and it passes over only the parents that have no state file. The search stops at the first parent with a state file. devvm uses that parent&amp;rsquo;s VM when its backend has the VM and the state&amp;rsquo;s &lt;code&gt;dir&lt;/code&gt; and &lt;code&gt;folder&lt;/code&gt; match that folder. Otherwise the current folder has no VM, so a command that needs one says there&amp;rsquo;s no VM for it, and &lt;code&gt;devvm&lt;/code&gt; makes a new one. A parent that was deleted and made again since its VM was made fails the folder check, and so does a nested project folder that a VM replaced through its mount, because a folder made again gets a new device and inode. Stopping there keeps devvm from skipping the nested folder&amp;rsquo;s VM for the VM of a folder further out, such as the VM that replaced it. A folder with a state file of its own uses a parent&amp;rsquo;s VM only with &lt;code&gt;--parent&lt;/code&gt;, even when its backend has lost its own, so &lt;code&gt;devvm rm&lt;/code&gt; there never reaches past it to a parent&amp;rsquo;s unless you ask for that. The current folder&amp;rsquo;s path is physical, with its links resolved, so a subfolder that is a link to a folder elsewhere is looked up from where it points, never from the folder that holds the link. devvm reads the current folder only for a command that acts on a folder&amp;rsquo;s VM, so &lt;code&gt;devvm build&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt;, &lt;code&gt;devvm images&lt;/code&gt;, &lt;code&gt;devvm space&lt;/code&gt; and &lt;code&gt;devvm gc&lt;/code&gt; also run in a folder that has been deleted.&lt;/p&gt;
&lt;p&gt;The lookup stops before the home folder, compared by its physical path, and before the filesystem root. Those folders are refused as project folders anyway, but a VM made for one with &lt;code&gt;--unsafe-folder&lt;/code&gt; would otherwise open in every folder below it. Using a parent&amp;rsquo;s VM changes nothing about what it mounts, because the current folder is already inside its project folder at the same path.&lt;/p&gt;
&lt;p&gt;Every command that acts on the folder&amp;rsquo;s VM, &lt;code&gt;devvm&lt;/code&gt; included, decides in one place which VM the folder uses, from what it found and the command&amp;rsquo;s &lt;code&gt;--here&lt;/code&gt; or &lt;code&gt;--parent&lt;/code&gt;, so they all decide the same way, with or without a terminal. By default, the folder&amp;rsquo;s own VM wins when it has a state file or its backend has the VM. Otherwise the parent&amp;rsquo;s VM is used, unless a repo of its own is in between, and otherwise the folder has none. A repo in between doesn&amp;rsquo;t count when the parent&amp;rsquo;s VM is a &lt;a href="https://next.devvm.dev/docs/using/clone/#folders-of-repos"&gt;workspace clone&lt;/a&gt; whose state records that repo, by its path relative to the parent&amp;rsquo;s folder (&lt;code&gt;clone.repos&lt;/code&gt;), because that VM has the repo&amp;rsquo;s clone at the same path and mounts nothing of this machine, so its folders are the VM&amp;rsquo;s as the parent&amp;rsquo;s own are. &lt;code&gt;--here&lt;/code&gt; takes the folder&amp;rsquo;s own VM and never looks at the parents. &lt;code&gt;--parent&lt;/code&gt; looks at the parents even when the folder has a VM of its own, takes the parent&amp;rsquo;s VM across a repo of its own, and fails when no parent has a VM (&lt;code&gt;no_parent_vm&lt;/code&gt;). A command that uses a parent&amp;rsquo;s VM first names the VM and its folder (&lt;code&gt;using_parent_vm&lt;/code&gt;) and asks nothing more, except &lt;code&gt;devvm rm&lt;/code&gt; and the commands that give the VM more access. &lt;code&gt;devvm rm&lt;/code&gt; then asks before deleting a parent&amp;rsquo;s VM (&lt;code&gt;delete_parent_vm&lt;/code&gt;), with or without &lt;code&gt;-f&lt;/code&gt;, and without a terminal it refuses (&lt;code&gt;rm_parent_vm&lt;/code&gt;). The commands that give a parent&amp;rsquo;s VM more access, which &lt;a href="https://next.devvm.dev/docs/using/vms/#a-subfolder"&gt;a subfolder&lt;/a&gt; lists, ask before changing the VM (&lt;code&gt;widen_parent_vm&lt;/code&gt;, &lt;code&gt;[y/N]&lt;/code&gt;) and refuse without a terminal (&lt;code&gt;widen_parent_vm_refused&lt;/code&gt;). They ask because the parent folder&amp;rsquo;s project chose its VM&amp;rsquo;s access, and a subfolder can be a project of its own that only happens to sit inside it. &lt;code&gt;devvm adopt&lt;/code&gt; looks only for the VM of this folder&amp;rsquo;s own path, and &lt;code&gt;devvm --clone&lt;/code&gt; skips the lookup, as &lt;code&gt;--here&lt;/code&gt; does, so it makes the folder&amp;rsquo;s own VM. devvm passes the current folder to the backend as the shell&amp;rsquo;s working folder, and &lt;code&gt;devvm host&lt;/code&gt; and &lt;code&gt;devvm code&lt;/code&gt; use it as the folder to open. For a &lt;code&gt;--clone&lt;/code&gt; VM, devvm first checks in the VM that the clone has the folder, and uses the clone&amp;rsquo;s top folder when it doesn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;On the way up, devvm also notes the nearest folder below the parent&amp;rsquo;s that has a &lt;code&gt;.git&lt;/code&gt; of its own, a folder or a file, starting with the current folder. When there is one, the current folder belongs to a separate repo, so without &lt;code&gt;--parent&lt;/code&gt; the parent&amp;rsquo;s VM is passed over. &lt;code&gt;devvm&lt;/code&gt; then makes the folder&amp;rsquo;s own VM without asking, and every other command fails with &lt;code&gt;no_vm&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="listing-vms"&gt;Listing VMs&lt;span class="hx:absolute hx:-mt-20" id="listing-vms"&gt;&lt;/span&gt;
&lt;a href="#listing-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every command that reads all the VMs, such as &lt;code&gt;devvm ls&lt;/code&gt;, &lt;code&gt;devvm space&lt;/code&gt;, &lt;code&gt;devvm gc&lt;/code&gt; and the writing of the ssh config, reads them in one place. It reads each VM&amp;rsquo;s state file on its own, then asks the backends for their VMs, each within 30 seconds, so one that hangs makes only its own VMs unknown. &lt;code&gt;devvm ls&lt;/code&gt; and &lt;code&gt;devvm space&lt;/code&gt; ask every backend, so they see a VM whose state is gone too. The ssh config and &lt;code&gt;devvm gc --orphans&lt;/code&gt; ask only the backends that some VM&amp;rsquo;s state names, so a backend you don&amp;rsquo;t use, such as one that isn&amp;rsquo;t installed, never slows them down. The commands that need only what the states say read the states alone and ask no backend. They are &lt;code&gt;devvm secret&lt;/code&gt;&amp;rsquo;s list, &lt;code&gt;devvm rm VM&lt;/code&gt;, &lt;code&gt;devvm adopt VM&lt;/code&gt; and &lt;code&gt;devvm link add&lt;/code&gt; finding a VM by its name, finding a folder&amp;rsquo;s VM by the folder its state records and a VM whose folder moved there (&lt;a href="#a-moved-folder"&gt;a moved folder&lt;/a&gt;), the links&amp;rsquo; checks, and the check of whether a key for devvm&amp;rsquo;s SSH agent is in a folder that a VM mounts, so that check counts the folders of stopped VMs too.&lt;/p&gt;
&lt;p&gt;All of them fail in the same cases. A backend that can&amp;rsquo;t list its VMs, for example because Lima isn&amp;rsquo;t installed, fails &lt;code&gt;devvm ls&lt;/code&gt; and the writing of the ssh config only when a VM&amp;rsquo;s state names that backend, and the ssh config then stays as it was rather than lose the entries of that backend&amp;rsquo;s VMs. &lt;code&gt;devvm space&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; name such a backend and leave its VMs alone instead. A state file that can&amp;rsquo;t be read never stops the others being read. Its VM never starts, so the commands that only read or show VMs leave it out, and &lt;code&gt;devvm ls&lt;/code&gt; lists it with its name and status alone, when its backend has it. The commands that delete by what the states say, such as &lt;code&gt;devvm gc&lt;/code&gt; with the shared tools that VMs use, and devvm&amp;rsquo;s SSH agent with the folders that VMs mount, fail and name the file, because that VM may use any shared tool or mount any folder (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-file-devvm-cant-read"&gt;a file devvm can&amp;rsquo;t read&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm waits 5 seconds at most to find out whether a VM&amp;rsquo;s project folder is there, for &lt;code&gt;devvm ls&lt;/code&gt;, &lt;code&gt;devvm space&lt;/code&gt;, &lt;code&gt;devvm rm VM&lt;/code&gt;, &lt;code&gt;devvm adopt VM&lt;/code&gt; and a moved folder&amp;rsquo;s match, so a folder on a network share that hangs counts as there, never as gone. Every cell of its table, and of devvm&amp;rsquo;s other tables, is shown on one line without control characters, so a folder or a status with an escape sequence or a newline in it can&amp;rsquo;t change what the terminal shows.&lt;/p&gt;
&lt;h2 data-hextra-search-id="state-files"&gt;State files&lt;span class="hx:absolute hx:-mt-20" id="state-files"&gt;&lt;/span&gt;
&lt;a href="#state-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm writes nothing into the project folder. It keeps its files in two folders, and the folder a file is in says who writes it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;~/.config/devvm&lt;/code&gt; (&lt;code&gt;$XDG_CONFIG_HOME/devvm&lt;/code&gt;) holds what you write: &lt;code&gt;config.toml&lt;/code&gt;, your rules for every VM in &lt;code&gt;policy&lt;/code&gt;, and your own layers and CAs. devvm never rewrites a file of yours there. It changes single lines of &lt;code&gt;policy&lt;/code&gt; when &lt;code&gt;devvm network&lt;/code&gt; adds or removes a rule for every VM, it writes a new layer&amp;rsquo;s files when you run &lt;code&gt;devvm layer new&lt;/code&gt;, and it writes the folder&amp;rsquo;s &lt;code&gt;version&lt;/code&gt; (&lt;a href="#the-layout-version"&gt;the layout version&lt;/a&gt;). &lt;a href="https://next.devvm.dev/docs/using/settings/#your-settings"&gt;Your settings&lt;/a&gt; lists the folder file by file.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.local/share/devvm&lt;/code&gt; (&lt;code&gt;$XDG_DATA_HOME/devvm&lt;/code&gt;) holds everything devvm writes itself, and you never edit it. &lt;a href="https://next.devvm.dev/docs/using/space/#devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;/a&gt; lists it file by file, with how each one is cleaned up, and &lt;a href="https://next.devvm.dev/docs/using/space/"&gt;what devvm keeps on this machine&lt;/a&gt; also lists what Lima keeps outside it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The two folders use two formats. &lt;code&gt;config.toml&lt;/code&gt; is TOML, which devvm reads strictly, so a key it doesn&amp;rsquo;t know or a value that a key can&amp;rsquo;t take stops the command, and devvm names the file and the line (&lt;a href="https://next.devvm.dev/docs/using/settings/#when-devvm-cant-read-it"&gt;when devvm can&amp;rsquo;t read it&lt;/a&gt;). devvm&amp;rsquo;s own records are JSON: &lt;code&gt;settings.json&lt;/code&gt;, each VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt;, each image&amp;rsquo;s record and each shared tool image&amp;rsquo;s record. devvm ignores a field it doesn&amp;rsquo;t know in them, so a field that a newer devvm adds doesn&amp;rsquo;t stop an older one, and a change that an older devvm would read wrongly goes through the &lt;a href="#the-layout-version"&gt;layout version&lt;/a&gt;. devvm&amp;rsquo;s other files are small ones of its own, such as pid files, the ssh config and the pinned host keys.&lt;/p&gt;
&lt;p&gt;In the data folder, each VM has a folder of its own, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt; (&lt;a href="#a-vms-folder"&gt;a VM&amp;rsquo;s folder&lt;/a&gt;), and the rest is shared by every VM:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;settings.json&lt;/code&gt; holds the defaults devvm&amp;rsquo;s commands save, below &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/using/settings/#where-a-default-comes-from"&gt;where a default comes from&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ssh_config&lt;/code&gt; is the &lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;ssh config&lt;/a&gt; for running VMs, and each entry checks its VM against the host keys in the VM&amp;rsquo;s own folder.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent-keys.json&lt;/code&gt; lists the keys added to &lt;a href="https://next.devvm.dev/docs/using/ssh/#devvms-own-agent"&gt;devvm&amp;rsquo;s own SSH agent&lt;/a&gt;, with each one&amp;rsquo;s file, fingerprint, &lt;code&gt;confirm&lt;/code&gt; and &lt;code&gt;lifetime&lt;/code&gt;, and &lt;code&gt;agent.sock&lt;/code&gt; is that agent&amp;rsquo;s socket.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;secrets/&lt;/code&gt; holds each &lt;a href="https://next.devvm.dev/docs/internals/network/#where-secrets-are-saved"&gt;secret&lt;/a&gt; in a file of its own, on hosts without a Keychain.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;custom-secrets.json&lt;/code&gt; holds the definitions of &lt;a href="https://next.devvm.dev/docs/internals/network/#where-secrets-are-saved"&gt;your own secrets&lt;/a&gt;, their hosts, headers, variables and prefixes, never their values.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;images/&amp;lt;key&amp;gt;/record.json&lt;/code&gt; is each image&amp;rsquo;s record, and &lt;code&gt;images/rebuilds.json&lt;/code&gt; holds the &lt;a href="https://next.devvm.dev/docs/internals/images/#rebuilding"&gt;rebuild counters&lt;/a&gt;, by backend, &lt;code&gt;--from&lt;/code&gt; and image. &lt;code&gt;images/ubuntu.json&lt;/code&gt; is the &lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;Ubuntu cloud image&lt;/a&gt; that base starts from on this machine, and &lt;code&gt;images/ubuntu/&lt;/code&gt; holds the cloud images themselves, each &lt;code&gt;&amp;lt;sha256&amp;gt;.img&lt;/code&gt;, with a download that stopped as &lt;code&gt;.img.part&lt;/code&gt; and a copy from Lima&amp;rsquo;s cache that stopped as &lt;code&gt;.img.import&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tools/&lt;/code&gt; holds the &lt;a href="https://next.devvm.dev/docs/internals/images/#the-share"&gt;shared tools&lt;/a&gt;, each image with its record. Beside it are the tools lock, &lt;code&gt;mise.lock&lt;/code&gt;, the &lt;code&gt;mise.toml&lt;/code&gt; it was resolved from, &lt;code&gt;mise.lock.toml&lt;/code&gt;, and &lt;code&gt;mise.lock.checked&lt;/code&gt;, which says when devvm last &lt;a href="https://next.devvm.dev/docs/internals/images/#versions"&gt;checked&lt;/a&gt; for newer versions.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;logs/runs/&lt;/code&gt; holds the &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;run logs&lt;/a&gt;, and &lt;code&gt;logs/tools-check.log&lt;/code&gt; the daily tools check&amp;rsquo;s output.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;exports/&lt;/code&gt; holds the agents&amp;rsquo; history that &lt;code&gt;devvm history export&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; save.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lima/&lt;/code&gt; is devvm&amp;rsquo;s own &lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;Lima home&lt;/a&gt;, unless &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; moves it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;cache/&lt;/code&gt; holds only what devvm makes again whenever it needs it, so it may be deleted at any time. That&amp;rsquo;s devvm&amp;rsquo;s own mise (&lt;code&gt;cache/mise/&lt;/code&gt;), the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt; (&lt;code&gt;cache/nix-cache/&lt;/code&gt;) and the &lt;a href="https://next.devvm.dev/docs/internals/images/#digests"&gt;digests&lt;/a&gt; of the container images that &lt;code&gt;--from&lt;/code&gt; bases start from (&lt;code&gt;cache/from-digests.json&lt;/code&gt;). &lt;code&gt;run/&lt;/code&gt; holds what running VMs need that isn&amp;rsquo;t one VM&amp;rsquo;s, or whose path must be short: the QEMU wrapper on Linux hosts, the claims lock and, while devvm makes a folder&amp;rsquo;s VM, the folder&amp;rsquo;s creation lock (&lt;a href="#locks"&gt;locks&lt;/a&gt;), the sockets of port forwarders and link sessions, named by hashes, in &lt;code&gt;build-ports/&lt;/code&gt; the ssh port of each build VM that&amp;rsquo;s starting (&lt;a href="#locks"&gt;locks&lt;/a&gt;), and in &lt;code&gt;builds/&amp;lt;name&amp;gt;/&lt;/code&gt; each build VM&amp;rsquo;s folder, laid out as a VM&amp;rsquo;s folder is. devvm deletes a build VM&amp;rsquo;s folder once its image is built, because an image&amp;rsquo;s VM never starts again, and otherwise when it deletes the build VM.&lt;/p&gt;
&lt;p&gt;Each write replaces a file whole, so a file is never left half written. devvm makes its files readable only by you (mode 600), and the programs it keeps to run, such as its mise and QEMU wrapper, are mode 700, as are its folders. Before every command, devvm makes the data folder and &lt;code&gt;~/.config/devvm&lt;/code&gt; when they&amp;rsquo;re missing and sets both to mode 700, whatever mode they had. A wider mode on anything beneath them then opens nothing to others, and when devvm can&amp;rsquo;t set a folder&amp;rsquo;s mode, it warns and goes on. The folders that hold history, logs, keys or secrets (&lt;code&gt;exports/&lt;/code&gt;, &lt;code&gt;logs/&lt;/code&gt;, &lt;code&gt;logs/runs/&lt;/code&gt;, &lt;code&gt;run/&lt;/code&gt;, &lt;code&gt;secrets/&lt;/code&gt;, and the &lt;code&gt;run/&lt;/code&gt;, &lt;code&gt;run/ca/&lt;/code&gt; and &lt;code&gt;logs/&lt;/code&gt; folders in each VM&amp;rsquo;s folder) are set to mode 700 again whenever devvm writes an export, a log, a key or a secret into them, whatever mode they had before. devvm refuses to use one of those folders when it&amp;rsquo;s a symbolic link or not a folder at all, so it never sets the mode of whatever a link points to. The data folder and &lt;code&gt;~/.config/devvm&lt;/code&gt; may be symbolic links, such as into a dotfiles repo, and devvm follows them. When a file can&amp;rsquo;t be read, devvm names the file and the line, and you fix the line or delete the file.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-run-log"&gt;The run log&lt;span class="hx:absolute hx:-mt-20" id="the-run-log"&gt;&lt;/span&gt;
&lt;a href="#the-run-log" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each run that runs a command has one log, &lt;code&gt;~/.local/share/devvm/logs/runs/&amp;lt;date&amp;gt;-&amp;lt;time&amp;gt;-&amp;lt;pid&amp;gt;.log&lt;/code&gt;, which only you can read. devvm keeps the newest 20, or as many as &lt;code&gt;logs.runs&lt;/code&gt; sets, and deletes older ones once the logs take more than 256 MiB together. It never deletes the newest log, or the log of a run whose process still runs, which it tells from the pid in the log&amp;rsquo;s name, so a background process or another devvm never loses the log it&amp;rsquo;s writing (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;a command fails&lt;/a&gt;). In the log, each command appears as a &lt;code&gt;+&lt;/code&gt; line with its arguments, followed by its output, and a numbered step adds a &lt;code&gt;# [2/5] &amp;lt;step&amp;gt;&lt;/code&gt; line first. A command that devvm runs in a VM adds at most 4 MiB of output to the log, because a VM could otherwise fill this machine&amp;rsquo;s disk with it, and a &lt;code&gt;devvm: truncated&lt;/code&gt; line marks where devvm left out the rest. A run writes at most 128 MiB to its log in all, because a run that lasts, such as &lt;code&gt;devvm desktop&lt;/code&gt;&amp;rsquo;s, could otherwise log without end, and a &lt;code&gt;devvm: truncated&lt;/code&gt; line also marks where that limit cut the log.&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s proxy key and the build proxy&amp;rsquo;s password are written as &lt;code&gt;devvm:&amp;lt;key&amp;gt;@&lt;/code&gt;. Any other password in a URL, in a command&amp;rsquo;s arguments or its output, is written as &lt;code&gt;user:&amp;lt;password&amp;gt;@&lt;/code&gt;, and so is the password in a proxy&amp;rsquo;s address without a scheme, such as &lt;code&gt;user:[email protected]:8080&lt;/code&gt;, when the address has a port. So a company proxy&amp;rsquo;s password from your shell&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, which Lima can print as it starts a VM, stays out of the log, even when a command writes it in pieces. This covers the output of the commands devvm runs in a VM too, such as a VM&amp;rsquo;s setup or a &lt;code&gt;devcontainer.json&lt;/code&gt;&amp;rsquo;s commands.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;-v&lt;/code&gt;, the lines devvm shows are the log&amp;rsquo;s own, so a VM&amp;rsquo;s proxy key is hidden in them as it is in the log, and devvm drops the control characters a command prints, so its output can&amp;rsquo;t move the cursor or change your terminal.&lt;/p&gt;
&lt;p&gt;Lima keeps a log of its own for each VM, &lt;code&gt;ha.stderr.log&lt;/code&gt; in the VM&amp;rsquo;s folder in devvm&amp;rsquo;s Lima home, and it writes a proxy password into that log as it starts the VM. Lima also keeps a log of each of the VM&amp;rsquo;s serial consoles there, &lt;code&gt;serial.log&lt;/code&gt;, &lt;code&gt;serialp.log&lt;/code&gt; or &lt;code&gt;serialv.log&lt;/code&gt;, and its boot scripts write the VM&amp;rsquo;s proxy URL, with the VM&amp;rsquo;s proxy password, to the console as they set up the VM&amp;rsquo;s environment. Once Lima has started the VM, devvm replaces each password in those logs with as many &lt;code&gt;*&lt;/code&gt;, so the log keeps its length and Lima goes on writing to it. If devvm can&amp;rsquo;t change the file, it warns you and names it, and you can delete the file, which Lima makes again at the VM&amp;rsquo;s next start. While the VM runs, its proxy also replaces each password that these logs gain, within a second of its line ending, so a reboot inside the VM, which on Linux hosts QEMU carries out in place and which runs the boot scripts again, can&amp;rsquo;t leave the password in the console&amp;rsquo;s log. The proxy also holds the disk space that each of these logs takes to 10 MiB, with a &lt;code&gt;.1&lt;/code&gt; file of as much, on a file system with holes (&lt;a href="https://next.devvm.dev/docs/internals/processes/#limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;/a&gt;). A rotation&amp;rsquo;s copy, such as &lt;code&gt;ha.stderr.log.1&lt;/code&gt;, has each password replaced, whether the start had ended or not.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-vms-folder"&gt;A VM&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="a-vms-folder"&gt;&lt;/span&gt;
&lt;a href="#a-vms-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each VM&amp;rsquo;s folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, is named by the hash at the end of the VM&amp;rsquo;s name, which is the hash of its project folder&amp;rsquo;s physical path when devvm made the VM, and it holds every file that devvm keeps for the VM in the data folder:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vm.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s state (&lt;a href="#a-vms-state"&gt;a VM&amp;rsquo;s state&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the lock that each change to &lt;code&gt;vm.json&lt;/code&gt; holds (&lt;a href="#locks"&gt;locks&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s own &lt;a href="https://next.devvm.dev/docs/internals/network/#policy-files"&gt;network rules&lt;/a&gt;, which &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;run/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what the VM&amp;rsquo;s runs leave: its &lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;host keys&lt;/a&gt; for its current start (&lt;code&gt;known_hosts&lt;/code&gt;), which every ssh of devvm&amp;rsquo;s to the VM checks, its &lt;a href="https://next.devvm.dev/docs/internals/ports/#its-process-and-files"&gt;port forwarder&lt;/a&gt;&amp;rsquo;s &lt;code&gt;ports.pid&lt;/code&gt;, &lt;code&gt;ports.status&lt;/code&gt; and &lt;code&gt;ports.lock&lt;/code&gt;, its &lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;proxy&lt;/a&gt;&amp;rsquo;s config, &lt;code&gt;proxy.json&lt;/code&gt;, which holds everything the proxy started with, its password and the &lt;a href="https://next.devvm.dev/docs/internals/network/#through-a-company-proxy"&gt;company proxy&lt;/a&gt;&amp;rsquo;s from the environment among it (&lt;a href="https://next.devvm.dev/docs/internals/network/#devvm-_proxy"&gt;devvm _proxy&lt;/a&gt;), and its &lt;code&gt;proxy.pid&lt;/code&gt; and &lt;code&gt;proxy.status&lt;/code&gt;, its broker&amp;rsquo;s child&amp;rsquo;s &lt;code&gt;proxy-child.pid&lt;/code&gt; and how the child is confined, &lt;code&gt;proxy.confined&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/processes/#a-vms-proxy"&gt;processes&lt;/a&gt;), the VM&amp;rsquo;s own &lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;CA&lt;/a&gt; and the next one in &lt;code&gt;ca/&lt;/code&gt; (&lt;code&gt;ca.pem&lt;/code&gt; and &lt;code&gt;ca.key&lt;/code&gt;, &lt;code&gt;next.pem&lt;/code&gt; and &lt;code&gt;next.key&lt;/code&gt;, and their &lt;code&gt;lock&lt;/code&gt;), whose keys never leave this machine, its &lt;a href="https://next.devvm.dev/docs/internals/network/#how-the-proxy-puts-them-in"&gt;secrets&lt;/a&gt;&amp;rsquo; bindings (&lt;code&gt;secrets.json&lt;/code&gt;, &lt;code&gt;secrets.policy&lt;/code&gt;), its &lt;a href="https://next.devvm.dev/docs/internals/ports/#the-link-session"&gt;link session&lt;/a&gt;&amp;rsquo;s &lt;code&gt;links.pid&lt;/code&gt; and &lt;code&gt;links.json&lt;/code&gt;, the &lt;a href="#making-a-vm-again"&gt;remake lock&lt;/a&gt; (&lt;code&gt;remake.lock&lt;/code&gt;), the hostagent it was started on (&lt;code&gt;started&lt;/code&gt;), the &lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;ssh port&lt;/a&gt; its last start held for a minute (&lt;code&gt;ports.ssh-hold&lt;/code&gt;), and on macOS the hostagent&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;sandbox profile&lt;/a&gt; (&lt;code&gt;sandbox.sb&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;logs/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its proxy&amp;rsquo;s decisions (&lt;code&gt;network.jsonl&lt;/code&gt;) and its proxy&amp;rsquo;s broker&amp;rsquo;s and child&amp;rsquo;s own output (&lt;code&gt;proxy.log&lt;/code&gt;), which the &lt;a href="https://next.devvm.dev/docs/internals/network/#log-files"&gt;log files&lt;/a&gt; describe, its link session&amp;rsquo;s output (&lt;code&gt;links.log&lt;/code&gt;) and its port forwarder&amp;rsquo;s (&lt;code&gt;ports.log&lt;/code&gt;), each held to 1 MiB with one &lt;code&gt;.1&lt;/code&gt; file. The proxy&amp;rsquo;s child writes this folder, so devvm never opens the files in it through a link&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;home.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s home folder, only while devvm &lt;a href="#making-a-vm-again"&gt;makes the VM again&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;devvm finds a folder&amp;rsquo;s VM by the state that records the folder&amp;rsquo;s path as its &lt;code&gt;dir&lt;/code&gt;, first in the VM folder that the hash of that path names and then in every other VM&amp;rsquo;s (&lt;a href="#a-moved-folder"&gt;a moved folder&lt;/a&gt;), so an existing VM has the name and the backend its state records, whichever backend you ask for. Only a new VM gets a name, which fits its backend&amp;rsquo;s limit, and when the VM folder that the path&amp;rsquo;s hash names holds another VM&amp;rsquo;s state, the new VM&amp;rsquo;s name ends with the hash of the path and a number instead, the first whose folder is free. The VM&amp;rsquo;s folder lasts as long as the VM, because &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop what runs for the VM, delete what devvm keeps for it outside the folder, and then delete the folder whole (&lt;a href="#deleting-a-vm"&gt;deleting a VM&lt;/a&gt;), so the next devvm in that folder starts fresh.&lt;/p&gt;
&lt;p&gt;No VM&amp;rsquo;s folder holds a socket, because a unix socket&amp;rsquo;s path has fewer than 104 characters and ssh adds 17 to a control socket&amp;rsquo;s while it makes it. The sockets that VMs need are in &lt;code&gt;run/&lt;/code&gt;, named by hashes: each port forwarder&amp;rsquo;s control socket, &lt;code&gt;run/port-&amp;lt;hash&amp;gt;.ctl&lt;/code&gt;, and each link session&amp;rsquo;s &lt;code&gt;run/link-&amp;lt;hash&amp;gt;.sock&lt;/code&gt; and &lt;code&gt;run/link-&amp;lt;hash&amp;gt;.ctl&lt;/code&gt;. With the default data folder, every socket fits for a home folder of up to 37 characters, and the ssh control sockets are the longest.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-vms-state"&gt;A VM&amp;rsquo;s state&lt;span class="hx:absolute hx:-mt-20" id="a-vms-state"&gt;&lt;/span&gt;
&lt;a href="#a-vms-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM&amp;rsquo;s state is &lt;code&gt;vm.json&lt;/code&gt;, a JSON file that only devvm writes. It starts with the fields every VM has: the file&amp;rsquo;s &lt;code&gt;version&lt;/code&gt;, the VM&amp;rsquo;s random &lt;code&gt;id&lt;/code&gt;, its &lt;code&gt;name&lt;/code&gt; and its ssh &lt;code&gt;alias&lt;/code&gt;, the &lt;code&gt;image&lt;/code&gt; the VM came from with its build &lt;code&gt;chain&lt;/code&gt; and the &lt;code&gt;from&lt;/code&gt; image its base started from, its project folder (&lt;code&gt;dir&lt;/code&gt;) and that folder&amp;rsquo;s identity (&lt;code&gt;folder&lt;/code&gt;), the volume it&amp;rsquo;s on (&lt;code&gt;folder_volume&lt;/code&gt;, bound to the folder&amp;rsquo;s inode and birth time, where devvm can tell it), &lt;code&gt;folder_unchecked&lt;/code&gt; while that volume is still to check after a renumbering (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;), its &lt;code&gt;backend&lt;/code&gt; and where that backend kept it (&lt;code&gt;backend_at&lt;/code&gt;), &lt;code&gt;created&lt;/code&gt;, the time its backend finished making it, and &lt;code&gt;made_by&lt;/code&gt;, the version of the devvm that made it, which later changes keep. A VM without &lt;code&gt;created&lt;/code&gt; never starts, because its creation didn&amp;rsquo;t finish. devvm takes the &lt;code&gt;alias&lt;/code&gt; only when it&amp;rsquo;s one devvm could have chosen for the VM, which is &lt;code&gt;devvm-&amp;lt;folder&amp;gt;&lt;/code&gt; with the folder part of the VM&amp;rsquo;s own name, or the full name. An alias edited to anything else never reaches the ssh config and names no VM, so the VM is reached by its full name. After those fields comes one section for each part of devvm that keeps something of the VM&amp;rsquo;s:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Section&lt;/th&gt;
&lt;th&gt;Kept by&lt;/th&gt;
&lt;th&gt;Holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;network tier&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s &lt;code&gt;tier&lt;/code&gt;, and what devvm made for it: the proxy&amp;rsquo;s password, the salt that ends its placeholders and the last &lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;self-check&lt;/a&gt;&amp;rsquo;s result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/internals/git-protection/"&gt;.git protection&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;the mode, the mode chosen while the VM ran, and what locking found: &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s identity, the git folders it locked besides &lt;code&gt;.git&lt;/code&gt;, and a hash of what the locked files hand over to the project folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the port allocator&lt;/td&gt;
&lt;td&gt;which ports the VM forwards, and the host ports devvm chose for its ssh, its proxy and its desktop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;SSH agent forwarding&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s choice, the start devvm last started it with, and whether that start forwarded its proxy&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;relay&lt;/a&gt; of the agent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the shared tools&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s shared tools by name, and their images and C library&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;secrets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;secrets&lt;/td&gt;
&lt;td&gt;the secrets bound to the VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;size&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm size&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the CPUs, memory and disk asked for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;clone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether the VM has its own clone, the repo&amp;rsquo;s remote for it, and whether its branches were copied in; a folder of repos&amp;rsquo; repos, each with the same; and each repo&amp;rsquo;s submodules the VM has a clone of (&lt;code&gt;submodules&lt;/code&gt;), nested ones too, each with its path in its repo&amp;rsquo;s folder, its remote and whether it was copied, so &lt;code&gt;devvm clone fetch&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s check go over each one the VM has, even when this machine&amp;rsquo;s repo no longer has it. An older devvm ignores &lt;code&gt;submodules&lt;/code&gt;, so its &lt;code&gt;devvm rm&lt;/code&gt; wouldn&amp;rsquo;t check them, which matters only after a downgrade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devcontainer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a devcontainer.json&lt;/td&gt;
&lt;td&gt;the file the VM was made from, its variables and commands, which of them ran, and what of the VM came from the file and what from you (&lt;a href="#reading-the-devcontainerjson-again"&gt;reading it again&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the desktop&amp;rsquo;s password&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;links&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;links and groups&lt;/td&gt;
&lt;td&gt;the ports the VM publishes, its links and its group&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;remake&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt;, &lt;code&gt;devvm update&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;while devvm &lt;a href="#making-a-vm-again"&gt;makes the VM again&lt;/a&gt;: the new image, the command, whether the home folder is kept and the history exported, what &lt;code&gt;devvm update&lt;/code&gt; read again of the &lt;code&gt;devcontainer.json&lt;/code&gt;, whether the new machine was made and what the VM had before it, and whether it&amp;rsquo;s done&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;moved&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#a-moved-folder"&gt;a moved folder&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;the path the folder had before it moved, until the VM&amp;rsquo;s next setup moves Claude Code&amp;rsquo;s history from it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Each section keeps what you asked for apart from what devvm made, which sits under the section&amp;rsquo;s &lt;code&gt;made&lt;/code&gt;. devvm reads fields it doesn&amp;rsquo;t know without complaint and keeps them when it writes the file. A file that isn&amp;rsquo;t JSON, lacks one of &lt;code&gt;version&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt;, &lt;code&gt;dir&lt;/code&gt; or &lt;code&gt;backend&lt;/code&gt;, or holds a section devvm can&amp;rsquo;t read is refused, and devvm names the file.&lt;/p&gt;
&lt;p&gt;A new VM&amp;rsquo;s whole state is written once, with everything you asked for, before its backend makes the VM.&lt;/p&gt;
&lt;h3 data-hextra-search-id="locks"&gt;Locks&lt;span class="hx:absolute hx:-mt-20" id="locks"&gt;&lt;/span&gt;
&lt;a href="#locks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Reading a VM&amp;rsquo;s state takes no lock, because each write replaces the file whole. Each change takes the VM&amp;rsquo;s &lt;code&gt;lock&lt;/code&gt;, reads the file again, makes the change and writes the file once, so a command&amp;rsquo;s changes land together or not at all, and two devvms changing one VM at once lose neither&amp;rsquo;s change. Deleting a VM&amp;rsquo;s folder takes the VM&amp;rsquo;s &lt;code&gt;lock&lt;/code&gt; too, so a change that another devvm is making to the VM&amp;rsquo;s state lands before the folder goes and never after it, and a VM made again in the project folder keeps its own state. A command holds one VM&amp;rsquo;s lock at a time. A change to other VMs, such as removing every link to a VM that &lt;code&gt;devvm rm&lt;/code&gt; deletes, lets go of the first VM&amp;rsquo;s lock and then takes each other VM&amp;rsquo;s lock in turn, reading each one&amp;rsquo;s state again before it changes it. What no two VMs may have, a new VM&amp;rsquo;s ssh alias and the host ports devvm chooses, is chosen under the claims lock, &lt;code&gt;run/claims.lock&lt;/code&gt;, which devvm takes after the VM&amp;rsquo;s own lock and holds until the VM&amp;rsquo;s state is written. A build VM has no state, so devvm chooses its ssh port under the claims lock alone and records it in &lt;code&gt;run/build-ports/&amp;lt;name&amp;gt;&lt;/code&gt; while the VM starts, which keeps any other VM from getting that port until Lima has bound it. Each project VM&amp;rsquo;s start records the ssh port it holds in the VM&amp;rsquo;s own folder, as &lt;code&gt;run/ports.ssh-hold&lt;/code&gt;. Each choice of a port reads that file for a minute while Lima binds the port, so no other start or build takes it, whether the start kept the VM&amp;rsquo;s port or chose a new one (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;the ssh port&lt;/a&gt;). The port is never the one that the build VM&amp;rsquo;s config kept from the image it&amp;rsquo;s a clone of, so its start always sets the new port and a build&amp;rsquo;s numbered steps are the same each time. The devvm that starts the build holds a file lock on the record while it&amp;rsquo;s there, so a record whose lock no process holds was left by a devvm that was killed. Once such a record is 15 minutes old, longer than Lima waits for a VM&amp;rsquo;s ssh, devvm deletes it the next time it chooses a port.&lt;/p&gt;
&lt;p&gt;A folder&amp;rsquo;s creation lock, &lt;code&gt;run/create-&amp;lt;hash&amp;gt;.lock&lt;/code&gt;, keeps two devvms from making one folder&amp;rsquo;s VM at once. It lives outside the VM&amp;rsquo;s folder because a new VM&amp;rsquo;s creation deletes that folder and makes it again. When &lt;code&gt;devvm&lt;/code&gt; finds that the folder has no VM, or has its own VM whose creation didn&amp;rsquo;t finish, it takes the lock before the new VM&amp;rsquo;s questions and reads the VM&amp;rsquo;s state again under it. If another devvm made the VM meanwhile, devvm opens that VM as it is. devvm holds the lock until it has recorded that it made the VM, and lets go of it before the VM&amp;rsquo;s first start, so another devvm in the folder then opens the VM. After an interrupt, devvm lets go of the lock only once it has deleted what it made. A second devvm that finds the lock held refuses at once (&lt;code&gt;create_running&lt;/code&gt;) and never waits on the first one&amp;rsquo;s questions. &lt;code&gt;devvm rm&lt;/code&gt; takes the lock too before it deletes a VM, because a VM whose creation didn&amp;rsquo;t finish may be one another devvm is making, and one whose machine the backend lost may be being made again. It refuses while another devvm holds the lock, and refuses as well when it finds the VM&amp;rsquo;s state changed once it has the lock. &lt;code&gt;devvm gc --orphans&lt;/code&gt; and retention&amp;rsquo;s &lt;code&gt;orphans.age&lt;/code&gt; take the lock too before they forget a VM, because a VM that a devvm is making again has its state before its backend has it, however old that state is, and they refuse while another devvm holds the lock.&lt;/p&gt;
&lt;p&gt;Every lock devvm takes is an OS file lock on an open file, which the system lets go of when the devvm holding it ends, however it ends. So a lock file is empty, it stays when its lock is let go of, and a devvm that was killed never leaves a lock held. The creation lock is the one exception that doesn&amp;rsquo;t stay: the devvm holding it deletes the file as it lets go, so no file named by the VM stays outside its folder, and a VM&amp;rsquo;s teardown deletes one that a killed devvm left. Besides each VM&amp;rsquo;s &lt;code&gt;lock&lt;/code&gt; and the claims lock, the data folder has these:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lock&lt;/th&gt;
&lt;th&gt;Held by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;version.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each devvm checking the &lt;a href="#the-layout-version"&gt;layout version&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/ports.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whatever stops a VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/ports/#its-process-and-files"&gt;port forwarder&lt;/a&gt; and starts the next one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/ca/lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each launch readying the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;CAs&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/remake.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the devvm &lt;a href="#making-a-vm-again"&gt;making a VM again&lt;/a&gt; or finishing its remake, which a second devvm finds held and refuses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;run/create-&amp;lt;hash&amp;gt;.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the devvm making a project folder&amp;rsquo;s &lt;a href="#a-new-vm"&gt;new VM&lt;/a&gt;, from before its questions until it has recorded that it made the VM, and &lt;code&gt;devvm rm&lt;/code&gt; deleting a VM, which a second devvm finds held and refuses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;images/locks/&amp;lt;key&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the devvm &lt;a href="https://next.devvm.dev/docs/internals/images/#building"&gt;building an image&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;images/locks/rebuilds&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a devvm &lt;a href="https://next.devvm.dev/docs/internals/images/#rebuilding"&gt;changing a rebuild counter&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;images/locks/ubuntu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the devvm &lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;pinning Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;images/locks/ubuntu-image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the devvm &lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;downloading Ubuntu&amp;rsquo;s cloud image&lt;/a&gt; or taking it from Lima&amp;rsquo;s cache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cache/mise/download.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the devvm &lt;a href="https://next.devvm.dev/docs/internals/images/#versions"&gt;downloading its own mise&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;oci-build.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a Lima build of a base &lt;a href="https://next.devvm.dev/docs/internals/images/#how-its-converted"&gt;from a container image&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tools.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a devvm &lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;writing to the share&lt;/a&gt; or swapping the tools lock&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;making.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each devvm making a VM or giving one new shared tools, shared, and &lt;code&gt;devvm gc --tool-images --force&lt;/code&gt;, alone (&lt;a href="https://next.devvm.dev/docs/internals/images/#listing-and-cleaning-up"&gt;cleaning up&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;groups.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a devvm &lt;a href="https://next.devvm.dev/docs/contributing/design/#groups"&gt;joining or leaving a group&lt;/a&gt;, or working its links out again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agents.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a devvm writing the agent store: &lt;a href="https://next.devvm.dev/docs/internals/agents/#importing"&gt;an import, a save, or a start cleaning Claude Code&amp;rsquo;s plugins&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;custom-secrets.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a devvm &lt;a href="https://next.devvm.dev/docs/internals/network/#where-secrets-are-saved"&gt;saving or deleting a secret of yours, or binding a VM to one&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;retention.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the devvm applying the &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention settings&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-hextra-search-id="the-layout-version"&gt;The layout version&lt;span class="hx:absolute hx:-mt-20" id="the-layout-version"&gt;&lt;/span&gt;
&lt;a href="#the-layout-version" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The layout version says which folders and files devvm keeps in its two folders, and in which formats. This devvm&amp;rsquo;s is 1. The data folder and &lt;code&gt;~/.config/devvm&lt;/code&gt; each record theirs in a file named &lt;code&gt;version&lt;/code&gt;, which holds the number alone. Before every command, after it makes both folders private, devvm takes &lt;code&gt;version.lock&lt;/code&gt; in the data folder with an OS file lock and reads both files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When both have this devvm&amp;rsquo;s version, the command runs.&lt;/li&gt;
&lt;li&gt;When a folder has no &lt;code&gt;version&lt;/code&gt; file, as a new folder doesn&amp;rsquo;t, devvm writes its own version there.&lt;/li&gt;
&lt;li&gt;When either one is older, devvm changes the folders to its own layout, one version at a time, and then writes its version into both files. A change that fails stops the command and leaves the versions as they were, so the next command tries again.&lt;/li&gt;
&lt;li&gt;When either one is newer, a newer devvm changed the folders, so this one would misread them. The command stops before it does anything, with a message that names the file and both versions (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-newer-devvm-changed-devvms-folders"&gt;a newer devvm changed devvm&amp;rsquo;s folders&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;version&lt;/code&gt; file that doesn&amp;rsquo;t hold a whole number from 1 up stops the command too, naming the file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Help, completion, &lt;code&gt;devvm --version&lt;/code&gt; and the commands that devvm runs itself, such as the proxy, skip the check. Each VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt;, each image&amp;rsquo;s record and each shared tool image&amp;rsquo;s record also hold &lt;code&gt;made_by&lt;/code&gt;, the version of the devvm that made it, so a file from another devvm can be told apart.&lt;/p&gt;</description></item><item><title>Testing on other hosts</title><link>https://next.devvm.dev/docs/contributing/testing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/testing/</guid><description>
&lt;p&gt;For contributors. The everyday tests, CLI tests and end-to-end tests are in &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;Contributing&lt;/a&gt;, and how to raise a package&amp;rsquo;s coverage baseline is in &lt;a href="https://next.devvm.dev/docs/contributing/tests/#coverage"&gt;Coverage&lt;/a&gt;; this page is about running them on a host other than your Mac.&lt;/p&gt;
&lt;h2 data-hextra-search-id="whats-platform-specific"&gt;What&amp;rsquo;s platform-specific&lt;span class="hx:absolute hx:-mt-20" id="whats-platform-specific"&gt;&lt;/span&gt;
&lt;a href="#whats-platform-specific" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The same code and tests run on macOS and Linux; what differs is behind build tags in &lt;code&gt;internal/platform&lt;/code&gt; and the backend&amp;rsquo;s own checks:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VMs&lt;/td&gt;
&lt;td&gt;Lima on Apple&amp;rsquo;s Virtualization framework (&lt;code&gt;vz&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Lima on QEMU with KVM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mounts&lt;/td&gt;
&lt;td&gt;virtiofs&lt;/td&gt;
&lt;td&gt;9p, one mount per share per guest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project VM disks&lt;/td&gt;
&lt;td&gt;APFS copy-on-write clones of the image&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;qcow2 overlays of the image&amp;rsquo;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Confined tiers&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s Lima process under a macOS sandbox&lt;/td&gt;
&lt;td&gt;QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt; and a &lt;code&gt;guestfwd&lt;/code&gt; to the proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/td&gt;
&lt;td&gt;locked with &lt;code&gt;chflags&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;read-only in QEMU&amp;rsquo;s namespace, or, where the kernel refuses it, watched, and devvm says so (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#linux-hosts"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Set-id files&lt;/td&gt;
&lt;td&gt;dropped by virtiofs&lt;/td&gt;
&lt;td&gt;reach the host: new VMs check for them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tokens&lt;/td&gt;
&lt;td&gt;the Keychain&lt;/td&gt;
&lt;td&gt;files only you can read, in &lt;code&gt;~/.local/share/devvm/secrets/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The CA&lt;/td&gt;
&lt;td&gt;kept out of Time Machine&lt;/td&gt;
&lt;td&gt;no backup to keep it out of&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The end-to-end tests check each side where they run: on Linux, the &lt;code&gt;.git&lt;/code&gt; protection checks look at QEMU&amp;rsquo;s namespace and what root in the VM can do, or, on a host whose kernel refuses the namespace, that it&amp;rsquo;s off and devvm says so, and the Keychain check is left out. The CLI tests run as on a Linux host that can&amp;rsquo;t pin (&lt;code&gt;DEVVM_PINS&lt;/code&gt;), whatever the host&amp;rsquo;s kernel allows, and the unit tests that pin for real (&lt;code&gt;TestRunPinned&lt;/code&gt;, &lt;code&gt;TestProbePin&lt;/code&gt;) run only on a Linux host that allows it.&lt;/p&gt;
&lt;p&gt;On macOS, the end-to-end tests also need OpenSSL as &lt;code&gt;openssl&lt;/code&gt;, because its CA checks serve HTTPS with &lt;code&gt;openssl s_server&lt;/code&gt;, and the LibreSSL that macOS ships as &lt;code&gt;/usr/bin/openssl&lt;/code&gt; cuts the VM&amp;rsquo;s OpenSSL client off mid-request. Install it with &lt;code&gt;brew install openssl@3&lt;/code&gt;, then put &lt;code&gt;$(brew --prefix openssl@3)/bin&lt;/code&gt; first on your &lt;code&gt;PATH&lt;/code&gt;, because Homebrew doesn&amp;rsquo;t link it into its own &lt;code&gt;bin&lt;/code&gt;. On Linux, &lt;code&gt;openssl&lt;/code&gt; is OpenSSL, and Ubuntu&amp;rsquo;s images have it installed, as &lt;code&gt;ca-certificates&lt;/code&gt; needs it.&lt;/p&gt;
&lt;p&gt;Before it builds anything, the runner checks every command of this machine&amp;rsquo;s that the chosen sections use. It always checks &lt;code&gt;limactl&lt;/code&gt; and &lt;code&gt;pkill&lt;/code&gt;, and each section lists the others it needs in &lt;code&gt;tests/e2e/sections_test.go&lt;/code&gt;, such as &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;openssl&lt;/code&gt;, which must be OpenSSL and not LibreSSL, OpenSSH&amp;rsquo;s &lt;code&gt;ssh&lt;/code&gt;, &lt;code&gt;ssh-agent&lt;/code&gt;, &lt;code&gt;ssh-add&lt;/code&gt; and &lt;code&gt;ssh-keygen&lt;/code&gt;, &lt;code&gt;tar&lt;/code&gt;, &lt;code&gt;ps&lt;/code&gt;, &lt;code&gt;lsof&lt;/code&gt; on macOS or &lt;code&gt;ss&lt;/code&gt; on Linux, and &lt;code&gt;python3&lt;/code&gt;. When any of them is missing, e2e lists each one with the command that installs it, through Homebrew on macOS or &lt;code&gt;apt-get&lt;/code&gt; or &lt;code&gt;dnf&lt;/code&gt; on Linux, and stops. It needs Go too, or mise, which installs the repo&amp;rsquo;s pinned Go.&lt;/p&gt;
&lt;h2 data-hextra-search-id="linux-hosts"&gt;Linux hosts&lt;span class="hx:absolute hx:-mt-20" id="linux-hosts"&gt;&lt;/span&gt;
&lt;a href="#linux-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Test in a Lima VM with nested virtualization, which needs an M3 or newer and macOS 15 or newer. Give it a Lima home of its own, so its VMs stay apart from yours:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Make it from Lima&amp;rsquo;s Ubuntu template, with nested virtualization, room for nested VMs, its user at uid 1000, and only the repo mounted, read-only:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; /tmp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;LIMA_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/.lt-linux-go
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;limactl create --name&lt;span class="o"&gt;=&lt;/span&gt;linuxhost --tty&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; --vm-type&lt;span class="o"&gt;=&lt;/span&gt;vz --cpus&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;8&lt;/span&gt; --memory&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;16&lt;/span&gt; --disk&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;150&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --containerd&lt;span class="o"&gt;=&lt;/span&gt;none --set &lt;span class="s1"&gt;&amp;#39;.nestedVirtualization=true | .user.uid=1000&amp;#39;&lt;/span&gt; --mount &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; template:ubuntu-24.04
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;limactl edit --tty&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; --set &lt;span class="s1"&gt;&amp;#39;.mounts=[{&amp;#34;location&amp;#34;:&amp;#34;&amp;#39;&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#34;,&amp;#34;writable&amp;#34;:false}]&amp;#39;&lt;/span&gt; linuxhost
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;limactl start --tty&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; linuxhost&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Run it from the main checkout of the repo, which the VM mounts at the same path, and not from a git worktree. A worktree&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; is a file that points into the main checkout&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; folder, outside the mount, so git in the VM can&amp;rsquo;t read it, and the VM&amp;rsquo;s only mount goes when the worktree does. &lt;code&gt;--mount&lt;/code&gt; alone keeps the template&amp;rsquo;s home mount, hence the edit. Lima gives the VM&amp;rsquo;s user your Mac&amp;rsquo;s uid unless &lt;code&gt;user.uid&lt;/code&gt; sets another, and a Mac&amp;rsquo;s first user has uid 501. Most Linux hosts&amp;rsquo; first user has uid 1000, and so does the user that some container images ship, such as the &lt;code&gt;ubuntu&lt;/code&gt; user of Ubuntu&amp;rsquo;s images. With the VM&amp;rsquo;s user at uid 1000, the end-to-end tests&amp;rsquo; &lt;code&gt;from&lt;/code&gt; section meets that clash, as devvm does on most Linux hosts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Inside it, install the packages, then Lima and mise from their release tarballs, each checked against its release&amp;rsquo;s checksums (&lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHASUMS256.txt&lt;/code&gt;) with &lt;code&gt;sha256sum -c&lt;/code&gt;, and add yourself to the &lt;code&gt;kvm&lt;/code&gt; group:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt-get install -y qemu-system-arm qemu-utils qemu-efi-aarch64 virtiofsd build-essential git curl jq rsync
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo usermod -aG kvm &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$USER&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then restart the VM, so a fresh login has the group.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the repo into the VM&amp;rsquo;s home, so the read-only mount stays untouched, install the pinned tools and run the gate, then the end-to-end tests:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rsync -a --delete /path/to/your/checkout/ ~/devvm/ &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise trust &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise install
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run fmt &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise run lint &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise run &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --from&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The copy keeps the checkout&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; folder, which the gate needs, because &lt;code&gt;mise run lint&lt;/code&gt; finds the shell scripts it checks with &lt;code&gt;git ls-files&lt;/code&gt;, and the docs&amp;rsquo; build reads each page&amp;rsquo;s git information (&lt;code&gt;enableGitInfo&lt;/code&gt;). A copy without &lt;code&gt;.git&lt;/code&gt;, such as one that &lt;code&gt;git archive&lt;/code&gt; makes, fails the lint. To test a branch that a worktree has checked out, commit it, and clone that branch from the main checkout instead of copying the checkout, because a worktree&amp;rsquo;s branches are the main checkout&amp;rsquo;s too:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -rf ~/devvm &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git clone --branch BRANCH /path/to/your/checkout ~/devvm &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A clone has only what&amp;rsquo;s committed, so commit a change before you test it this way.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first &lt;code&gt;--from&lt;/code&gt; run builds every image and takes about half an hour on an M3 Max. Later ones reuse them, because every section but &lt;code&gt;tools&lt;/code&gt; uses the pinned shared tools&amp;rsquo; versions and &lt;code&gt;--from&lt;/code&gt; images, and those images stay valid until &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; or &lt;code&gt;scripts/bump.sh e2e-from&lt;/code&gt; moves a pin (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt;). Stop the VM when done (&lt;code&gt;limactl stop linuxhost&lt;/code&gt;); it keeps its images for the next run.&lt;/p&gt;
&lt;p&gt;Gotchas of this setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Linux host&amp;rsquo;s home and its VMs&amp;rsquo; homes are both &lt;code&gt;/home/&amp;lt;user&amp;gt;.guest&lt;/code&gt;, so a file under &lt;code&gt;$HOME&lt;/code&gt; in a VM isn&amp;rsquo;t proof of a mount: the end-to-end tests check the VM&amp;rsquo;s mounts list instead.&lt;/li&gt;
&lt;li&gt;A VM booting while another one works boots degraded and its downloads time out: the end-to-end tests stop a VM it&amp;rsquo;s done with before starting the next.&lt;/li&gt;
&lt;li&gt;minisign, for signing releases, has no linux/arm64 build, so mise skips it there.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="x86_64-hosts"&gt;x86_64 hosts&lt;span class="hx:absolute hx:-mt-20" id="x86_64-hosts"&gt;&lt;/span&gt;
&lt;a href="#x86_64-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;These need real x86_64 hardware, or an x86_64 VM on such hardware with nested virtualization. An emulated x86_64 VM on a Mac (&lt;code&gt;--arch=x86_64&lt;/code&gt;, QEMU TCG; Lima needs its &lt;code&gt;lima-additional-guestagents&lt;/code&gt;) runs the unit tests, but VMs nested in it crash in their firmware.&lt;/p&gt;
&lt;p&gt;A bare-metal x86_64 Linux host, such as Fedora 43 with SELinux enforcing, runs the gate and &lt;code&gt;mise run e2e -- --from&lt;/code&gt; as the &lt;a href="#linux-hosts"&gt;Linux host above&lt;/a&gt; does, from a clone of the repo, and it can run &lt;code&gt;--slots 3&lt;/code&gt; (&lt;a href="#slots-for-each-host"&gt;slots for each host&lt;/a&gt;). Those runs check the x86_64 side of what devvm builds: the &lt;code&gt;_amd64&lt;/code&gt; pins of base, every layer and feature, the shared tools&amp;rsquo; &lt;code&gt;linux-x64&lt;/code&gt; lock entries and their checksums, &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion, whose VM reads its scripts over 9p, and the confined tiers through &lt;code&gt;devvm _qemu&lt;/code&gt; and &lt;code&gt;qemu-system-x86_64&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The tests don&amp;rsquo;t cover the release itself, so check it by hand on that host. Build the archives with &lt;code&gt;scripts/release.sh --head&lt;/code&gt;, with &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt; and &lt;code&gt;DEVVM_MINISIGN_PUB&lt;/code&gt; naming a test key so the signature is checked too, and install &lt;code&gt;devvm-&amp;lt;version&amp;gt;-linux-amd64.tar.gz&lt;/code&gt; from them in a throwaway &lt;code&gt;HOME&lt;/code&gt;, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/"&gt;maintaining&lt;/a&gt; shows, with &lt;code&gt;main --yes&lt;/code&gt; in place of &lt;code&gt;main --no-deps&lt;/code&gt;. With only the system&amp;rsquo;s folders on &lt;code&gt;PATH&lt;/code&gt;, the script finds no Lima, so it installs Lima&amp;rsquo;s latest release into that &lt;code&gt;HOME&lt;/code&gt;&amp;rsquo;s &lt;code&gt;~/.local&lt;/code&gt;. When the host already has QEMU and access to &lt;code&gt;/dev/kvm&lt;/code&gt;, nothing it runs needs sudo. Then run the installed &lt;code&gt;devvm --version&lt;/code&gt; and &lt;code&gt;devvm doctor&lt;/code&gt;, and check with &lt;code&gt;file&lt;/code&gt; that the binary is statically linked.&lt;/p&gt;
&lt;p&gt;devvm hasn&amp;rsquo;t been tested on an Intel Mac. Its release has a &lt;code&gt;darwin-amd64&lt;/code&gt; archive, and that binary runs under Rosetta on Apple silicon, but nobody has run the tests or a VM on Intel hardware.&lt;/p&gt;
&lt;p&gt;GitHub&amp;rsquo;s Linux runners are x86_64 with KVM, and the E2E workflow (&lt;code&gt;.github/workflows/e2e.yml&lt;/code&gt;) runs &lt;code&gt;mise run e2e -- --only project&lt;/code&gt; on one as a trial. Start it from the repo&amp;rsquo;s Actions tab, with Run workflow on the E2E workflow, because it has no other trigger yet. It installs QEMU, gives the runner&amp;rsquo;s user &lt;code&gt;/dev/kvm&lt;/code&gt; as Lima&amp;rsquo;s own CI does, installs Lima at a pinned version checked against its checksum, and runs the section up to three times. It caches Ubuntu&amp;rsquo;s cloud image under the release that the end-to-end tests pin, and the built images under a hash of &lt;code&gt;assets/&lt;/code&gt;, &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;, that release and Lima&amp;rsquo;s version, because devvm&amp;rsquo;s image keys are only known once it builds. When the run fails, it uploads the e2e logs, devvm&amp;rsquo;s run logs and each Lima instance&amp;rsquo;s serial logs as the &lt;code&gt;e2e-logs&lt;/code&gt; artifact.&lt;/p&gt;
&lt;h2 data-hextra-search-id="slots-for-each-host"&gt;Slots for each host&lt;span class="hx:absolute hx:-mt-20" id="slots-for-each-host"&gt;&lt;/span&gt;
&lt;a href="#slots-for-each-host" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;mise run e2e -- --slots N&lt;/code&gt; runs the end-to-end sections in N sandboxes at once (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#slots"&gt;slots&lt;/a&gt;), and each slot runs its own VMs, up to three at a time in the link section. How many slots a host can run depends on its cores and memory:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Host&lt;/th&gt;
&lt;th&gt;Slots&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A bare-metal Linux host with 32 cores and 124 GB of memory&lt;/td&gt;
&lt;td&gt;3 or 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A Mac&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A Linux host nested in a VM, such as &lt;a href="#linux-hosts"&gt;the Linux host above&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1, the default: a VM booting while another one works boots degraded there&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A Mac clones the images it gives each slot, because &lt;code&gt;/tmp&lt;/code&gt; and your home folder are on the same APFS volume. A Linux host reflinks the Lima instances in your home folder when its file system can, as XFS made with &lt;code&gt;reflink=1&lt;/code&gt; and Btrfs can, but a &lt;code&gt;/tmp&lt;/code&gt; on tmpfs can&amp;rsquo;t reflink, so there each slot other than slot 0 builds its own tool images. Every slot keeps its images between runs, so only its first run builds them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="end-to-end-tests-in-go"&gt;End-to-end tests in Go&lt;span class="hx:absolute hx:-mt-20" id="end-to-end-tests-in-go"&gt;&lt;/span&gt;
&lt;a href="#end-to-end-tests-in-go" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The end-to-end tests are in Go, in &lt;code&gt;tests/e2e&lt;/code&gt;, a file for each section. That package builds only with the &lt;code&gt;e2e&lt;/code&gt; build tag, and its &lt;code&gt;TestE2E&lt;/code&gt; is the run.&lt;/p&gt;
&lt;h3 data-hextra-search-id="running-the-runner"&gt;Running the runner&lt;span class="hx:absolute hx:-mt-20" id="running-the-runner"&gt;&lt;/span&gt;
&lt;a href="#running-the-runner" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;mise run e2e&lt;/code&gt; runs &lt;code&gt;TestE2E&lt;/code&gt; from &lt;code&gt;tests/e2e&lt;/code&gt;, with the run&amp;rsquo;s flags after &lt;code&gt;--&lt;/code&gt;. You can also run &lt;code&gt;go test&lt;/code&gt; yourself from that folder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --only gc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; tests/e2e &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;CGO_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; go &lt;span class="nb"&gt;test&lt;/span&gt; -tags e2e -count&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; -timeout &lt;span class="m"&gt;0&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^TestE2E$&amp;#39;&lt;/span&gt; -args --only gc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;go test&lt;/code&gt; from &lt;code&gt;tests/e2e&lt;/code&gt; without naming a package, because only then does &lt;code&gt;go test&lt;/code&gt; show the run&amp;rsquo;s lines as they come, and in a package list it holds them until the package ends. &lt;code&gt;TestE2E&lt;/code&gt; refuses any &lt;code&gt;-timeout&lt;/code&gt; but &lt;code&gt;0&lt;/code&gt;, because &lt;code&gt;go test&lt;/code&gt;&amp;rsquo;s default of 10 minutes would end a long section in the middle of a check, and &lt;code&gt;-count=1&lt;/code&gt; keeps &lt;code&gt;go test&lt;/code&gt; from showing a cached result. The run&amp;rsquo;s flags, which &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;Contributing&lt;/a&gt; lists, come after &lt;code&gt;-args&lt;/code&gt;. &lt;code&gt;--reuse&lt;/code&gt; keeps the VMs that a section makes with &lt;code&gt;Reuse&lt;/code&gt; for the next run, which takes each one as it finds it when it&amp;rsquo;s still running, so iterating on one check doesn&amp;rsquo;t launch its VM again.&lt;/p&gt;
&lt;p&gt;The runner uses a sandbox for each slot, with its own fixed ports, it refuses your real Lima home, and it builds devvm from the checkout into &lt;code&gt;src-go&lt;/code&gt; in the sandbox&amp;rsquo;s state folder, as a test build with its files embedded. It writes a &lt;code&gt;config.toml&lt;/code&gt; that chooses base&amp;rsquo;s features, so nothing asks, and puts the pinned tool lock in place, after checking the lock&amp;rsquo;s first line. Base starts from the dated Ubuntu release in &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; (&lt;code&gt;tests/e2e/sandbox_test.go&lt;/code&gt;), which &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; moves. The runner takes the slot&amp;rsquo;s lock, a symlink to its pid, and it deletes only the VMs, files and project folders that it made, which include any VM whose folder is in one of the run&amp;rsquo;s project folders, even one that a failed check made without registering it. Before the first section, it stops with a setup failure when the slot&amp;rsquo;s Lima home has a project VM that an earlier run left, unless &lt;code&gt;--reuse&lt;/code&gt; keeps them, and it prints the commands that delete each one and its state folder. Before anything else, it names each host command that the chosen sections need and this machine lacks, with what installs it. Its lines are each section&amp;rsquo;s &lt;code&gt;== name&lt;/code&gt; heading, then &lt;code&gt;PASS&lt;/code&gt;, &lt;code&gt;FAIL&lt;/code&gt;, &lt;code&gt;SKIP&lt;/code&gt; or &lt;code&gt;RETRY&lt;/code&gt; with &lt;code&gt;[n/N]&lt;/code&gt;, the check&amp;rsquo;s title, its time, the run&amp;rsquo;s time and the time left. A heartbeat every minute shows the newest line of the check&amp;rsquo;s output or devvm&amp;rsquo;s run log, and the run ends with a summary line. It keeps each section&amp;rsquo;s times in slot 0&amp;rsquo;s timings folder, under its tier, and beside them a checksum of &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s Go files, so a section&amp;rsquo;s check count is compared only with a run of the same Go files. With &lt;code&gt;--slots&lt;/code&gt;, it plans, seeds and runs the slots, each slot a run of the same test binary, and it adds up their results. On macOS it seeds each slot with APFS clones (&lt;code&gt;clonefile&lt;/code&gt;), and on Linux with reflinks. With &lt;code&gt;--newest-base&lt;/code&gt;, its last lines name the release Ubuntu lists as its newest and the one devvm pinned, and a failure is named as upstream drift.&lt;/p&gt;
&lt;p&gt;Each check&amp;rsquo;s time limit is three times its longest time in its section&amp;rsquo;s last complete run, and the steps between two checks get an hour. Each command a check runs is in a process group of its own, and when the check&amp;rsquo;s time runs out, the group gets TERM, then KILL 30 seconds later. The check then fails with the heartbeat&amp;rsquo;s last line, and the run goes on to the next check. The runner&amp;rsquo;s own tests, the &lt;code&gt;TestHarness&lt;/code&gt; tests, need no VM, and &lt;code&gt;mise run test&lt;/code&gt; runs them with the &lt;code&gt;e2e&lt;/code&gt; tag.&lt;/p&gt;
&lt;h3 data-hextra-search-id="writing-a-check"&gt;Writing a check&lt;span class="hx:absolute hx:-mt-20" id="writing-a-check"&gt;&lt;/span&gt;
&lt;a href="#writing-a-check" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A section is a function that takes the running section, &lt;code&gt;*S&lt;/code&gt;, and calls &lt;code&gt;s.Check&lt;/code&gt; once for each check:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;gc deletes a tool image no VM uses, with its record&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;.json&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;the old tool image or its record is still there&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The check passes when its function returns nil. Its title is its key in the timings, so a changed title starts its times again: give a new check a title that says what it proves. When a check fails, the runner prints its error, each line led by &lt;code&gt;failed:&lt;/code&gt;, and then the last 5 lines that its commands printed, or as many as &lt;code&gt;Tail(n)&lt;/code&gt; asks for. It also copies every proxy log in the sandbox that has lines, each VM&amp;rsquo;s and each build&amp;rsquo;s, into &lt;code&gt;proxy-logs/&lt;/code&gt; in the sandbox&amp;rsquo;s state folder, because the run deletes the VMs and builds that wrote them, and it prints that folder and the last 5 lines of each log written since the check began. The next run empties &lt;code&gt;proxy-logs/&lt;/code&gt; before its first check. A check that the run has nothing for is &lt;code&gt;s.Skip(title, why)&lt;/code&gt;, which counts it, so that runs compare their counts.&lt;/p&gt;
&lt;p&gt;The commands a check runs go through the section, so that they run in the sandbox&amp;rsquo;s environment and within the check&amp;rsquo;s time limit, and their output goes into the check&amp;rsquo;s log:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Helper&lt;/th&gt;
&lt;th&gt;What it runs or reads&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Devvm(dir, args…)&lt;/code&gt;, &lt;code&gt;s.DevvmNames(dir, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the run&amp;rsquo;s devvm in &lt;code&gt;dir&lt;/code&gt;, with no input; &lt;code&gt;DevvmNames&lt;/code&gt; in names mode (&lt;code&gt;DEVVM_MESSAGES=names&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Msg(name, &amp;quot;k=v&amp;quot;…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a message&amp;rsquo;s text, from &lt;code&gt;devvm _msg&lt;/code&gt;, so a check never repeats its wording&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Limactl(args…)&lt;/code&gt;, &lt;code&gt;s.InVM(vm, script)&lt;/code&gt;, &lt;code&gt;s.Status(vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl&lt;/code&gt; in the sandbox&amp;rsquo;s Lima home, a script in the VM&amp;rsquo;s login shell with no input, and a VM&amp;rsquo;s status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Run(Cmd{…})&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any command, with its own folder, input or variables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.NewProject(name)&lt;/code&gt;, &lt;code&gt;s.Launch(dir, input, args…)&lt;/code&gt;, &lt;code&gt;s.Reuse(name, input, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a new project folder, deleted at the end, and devvm launched in a folder, its VM recorded for the cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.State(vm)&lt;/code&gt;, &lt;code&gt;s.Paths.VMOf(dir)&lt;/code&gt;, &lt;code&gt;s.Paths.VMDir(vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt;, flattened as the CLI tests&amp;rsquo; &lt;code&gt;vm_state&lt;/code&gt; does, the VM a folder has, and its folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.KeysOf(image)&lt;/code&gt;, &lt;code&gt;s.Paths.Record(key, field)&lt;/code&gt;, &lt;code&gt;s.Own(image)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an image&amp;rsquo;s keys and records, and its images made the run&amp;rsquo;s to delete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Layer(name, script)&lt;/code&gt;, &lt;code&gt;s.Paths&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a layer of the run&amp;rsquo;s (&lt;code&gt;e2e*&lt;/code&gt;), deleted at the end, and the sandbox&amp;rsquo;s folders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Golden(name, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;--golden&lt;/code&gt;, a &lt;a href="#golden-fixtures"&gt;golden fixture&lt;/a&gt; captured from what &lt;code&gt;args&lt;/code&gt; printed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.GoE2E(test, pkg, &amp;quot;VAR=value&amp;quot;…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a Go test in &lt;code&gt;internal/pkg&lt;/code&gt; that needs a real VM, such as &lt;code&gt;TestE2EExecQuoting&lt;/code&gt;, with its variables in its environment and never in a process&amp;rsquo;s arguments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Until(timeout, fn)&lt;/code&gt;, &lt;code&gt;Settle&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a wait for what the check looks for, trying each second, and the one fixed wait, before looking for something that must not have happened&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Port(p)&lt;/code&gt;, &lt;code&gt;s.Defer(fn)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;one of slot 0&amp;rsquo;s fixed ports as this slot has it, and a cleanup of the section&amp;rsquo;s own&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Three options change how a check runs. &lt;code&gt;Flaky(reason)&lt;/code&gt; marks a check that&amp;rsquo;s known to flake: when it fails, the runner shows its output and runs it once more, and only a second failure fails it. Its result says &lt;code&gt;retried once&lt;/code&gt;, and its timings line and the summary say so too, and every other check fails on its first failure. &lt;code&gt;Builds()&lt;/code&gt; marks a check whose own command can build base or a &lt;code&gt;--from&lt;/code&gt; base, so it gets at least an hour. &lt;code&gt;Needs(backend.FeatureLink)&lt;/code&gt; names the backend features that a check proves: on a backend that has one of them neither natively nor emulated and reviewed, as &lt;code&gt;devvm doctor --json&lt;/code&gt; shows its features, the check is skipped and counted, so a check is written once for every backend that has its features. A section whose every check proves a feature takes it once with &lt;code&gt;s.Needing(...)&lt;/code&gt;, as link takes &lt;code&gt;FeatureLink&lt;/code&gt;, nix &lt;code&gt;FeatureNixLayer&lt;/code&gt; and &lt;code&gt;--from&lt;/code&gt; &lt;code&gt;FeatureFrom&lt;/code&gt;, and a section&amp;rsquo;s own checks of the docker or nix layer and of ports name theirs with &lt;code&gt;Needs&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="adding-a-section"&gt;Adding a section&lt;span class="hx:absolute hx:-mt-20" id="adding-a-section"&gt;&lt;/span&gt;
&lt;a href="#adding-a-section" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each section is a file of its own in &lt;code&gt;tests/e2e&lt;/code&gt;, such as &lt;code&gt;gc_test.go&lt;/code&gt;, so sections can change at the same time without touching each other&amp;rsquo;s files. A new check goes in its section&amp;rsquo;s function, where its setup steps run, because a check&amp;rsquo;s time counts from the end of the one before it. To add a section:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Write &lt;code&gt;&amp;lt;section&amp;gt;Section(s *S)&lt;/code&gt; in &lt;code&gt;tests/e2e/&amp;lt;section&amp;gt;_test.go&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add it to &lt;code&gt;sections&lt;/code&gt; (&lt;code&gt;tests/e2e/sections_test.go&lt;/code&gt;), in the order the run runs it, with a guess of its time for &lt;code&gt;--slots&lt;/code&gt; to place it before it has run, and the host commands it needs beyond &lt;code&gt;limactl&lt;/code&gt; and &lt;code&gt;pkill&lt;/code&gt;, each with what installs it.&lt;/li&gt;
&lt;li&gt;Run it with &lt;code&gt;mise run e2e -- --only &amp;lt;section&amp;gt;&lt;/code&gt; on a Mac and on a Linux host, and check that each check passes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A helper that more than one section needs goes in the harness&amp;rsquo;s files, beside those above, so that every section shares one copy, and a fixture that two sections share, such as an image, stays in the sandbox&amp;rsquo;s cache. These are the ones the sections share so far, each with what it does in a shell&amp;rsquo;s terms:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Helper&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;In a shell&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Start(Cmd{…})&lt;/code&gt;, &lt;code&gt;Proc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs a command in the background, past the check that starts it, in a process group of its own, until &lt;code&gt;Stop&lt;/code&gt; or the run&amp;rsquo;s end, with its output in &lt;code&gt;Out&lt;/code&gt; and never in the check&amp;rsquo;s log&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cmd &amp;amp;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;StartCorp(s)&lt;/code&gt;, &lt;code&gt;Corp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;starts a company proxy, a &lt;code&gt;devvm _proxy&lt;/code&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt; at slot 0&amp;rsquo;s port 18766 as the slot has it, with a password of its own, allowing any host, and waits for it to listen; &lt;code&gt;Env&lt;/code&gt; gives a command &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and &lt;code&gt;HTTP_PROXY&lt;/code&gt; with its password, &lt;code&gt;Saw&lt;/code&gt; looks for one of its events, and &lt;code&gt;Addr&lt;/code&gt; is its address without the password&lt;/td&gt;
&lt;td&gt;&lt;code&gt;corp_start&lt;/code&gt;, &lt;code&gt;corp_stop&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WriteProxyConfig(s, file, proxy.Config{…})&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;writes a config for &lt;code&gt;devvm _proxy -config&lt;/code&gt;, mode 600, with the proxy&amp;rsquo;s own &lt;code&gt;Config&lt;/code&gt; type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;proxy_config&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NewCA(s)&lt;/code&gt;, &lt;code&gt;CA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;makes the run&amp;rsquo;s throwaway CA once, with a server certificate for &lt;code&gt;host.lima.internal&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt; and &lt;code&gt;127.0.0.1&lt;/code&gt;; &lt;code&gt;Trust&lt;/code&gt; and &lt;code&gt;Untrust&lt;/code&gt; put it in devvm&amp;rsquo;s CA folder and take the folder away, &lt;code&gt;Serve(port)&lt;/code&gt; serves HTTPS with it on every address until &lt;code&gt;StopServing&lt;/code&gt;, &lt;code&gt;Sign&lt;/code&gt; makes another server certificate, and &lt;code&gt;GoneFrom(s, vm)&lt;/code&gt; checks that a VM keeps none of devvm&amp;rsquo;s CA files&lt;/td&gt;
&lt;td&gt;&lt;code&gt;e2e_ca&lt;/code&gt;, &lt;code&gt;ca_serve&lt;/code&gt;, &lt;code&gt;ca_stop&lt;/code&gt;, &lt;code&gt;ca_gone&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NoLeak(secrets, paths…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;fails when a regular file under the paths holds one of the secrets, or can&amp;rsquo;t be read, reading only where each file has data, as &lt;code&gt;SEEK_DATA&lt;/code&gt; and &lt;code&gt;SEEK_HOLE&lt;/code&gt; find it, so a VM&amp;rsquo;s sparse disk takes seconds, and naming the file but never the secret; every check that a secret is in no file on this machine uses it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;no_leak&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GuestHasNone(s, vm, secrets, dirs…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;fails when a file under the folders in the VM holds one of the secrets, searched as root, the secrets on &lt;code&gt;grep&lt;/code&gt;&amp;rsquo;s input&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo grep -rqsFf /dev/stdin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WatchProcs(s)&lt;/code&gt;, &lt;code&gt;ProcWatch&lt;/code&gt;, &lt;code&gt;ProcsHave(s, secret)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;samples every host process&amp;rsquo;s command line every 0.1 s until &lt;code&gt;Stop&lt;/code&gt;, into a file of the sandbox&amp;rsquo;s, and &lt;code&gt;Saw&lt;/code&gt; looks for a secret in the samples, while &lt;code&gt;ProcsHave&lt;/code&gt; looks in one sample taken now; a check that reads either is &lt;code&gt;ProcsFlaky()&lt;/code&gt;, as a listing can catch a short-lived process mid-start&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ps_watch&lt;/code&gt;, &lt;code&gt;ps_unwatch&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.ToolVersion(tool)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the tool&amp;rsquo;s version in the shared tools&amp;rsquo; lock&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lockv&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.RunLogs()&lt;/code&gt;, &lt;code&gt;s.Paths.RunLogHas(line)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s run logs by name, the one reader of that folder, and whether one of them has the line, whole: what a build&amp;rsquo;s script printed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;logs/runs/*.log&lt;/code&gt;, &lt;code&gt;grep -qx&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MountLine(s, vm)&lt;/code&gt;, &lt;code&gt;MountsOf(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the host folders a VM&amp;rsquo;s Lima config mounts, each with a space after it, or one a line&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list --format '{{range .Config.Mounts}}…'&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HasLine&lt;/code&gt;, &lt;code&gt;CaptureLine&lt;/code&gt;, &lt;code&gt;ExitStatus&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether text has a line, whole; the first group of the first line a regular expression matches; the exit status a command&amp;rsquo;s error says&lt;/td&gt;
&lt;td&gt;&lt;code&gt;grep -qx&lt;/code&gt;, &lt;code&gt;sed -n 's/…/\1/p'&lt;/code&gt;, &lt;code&gt;$?&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;launchWith(s, dir, env, args…)&lt;/code&gt;, &lt;code&gt;devvmCmd(s, dir, input, env, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Launch&lt;/code&gt; and devvm with variables of their own in devvm&amp;rsquo;s environment, such as a fake token, a &lt;code&gt;HOME&lt;/code&gt; of the section&amp;rsquo;s or &lt;code&gt;NoDocker&lt;/code&gt;&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, never in its arguments&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HOME=… &amp;quot;$D&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vmHas(s, vm, login, script, secrets…)&lt;/code&gt;, &lt;code&gt;vmGrep(s, vm, script, re)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether what a script prints in the VM holds one of the secrets, or matches &lt;code&gt;re&lt;/code&gt;, looked for in the VM with the secrets on its shell&amp;rsquo;s input, so neither they nor what the script printed reach the check&amp;rsquo;s log&lt;/td&gt;
&lt;td&gt;&lt;code&gt;in_vm … | grep -qF&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limaListens(s, proto, port)&lt;/code&gt;, &lt;code&gt;loopbackOnly(s, port)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether Lima&amp;rsquo;s own processes listen on a port of this machine, and whether what listens on one listens on loopback alone, with &lt;code&gt;lsof&lt;/code&gt; on macOS and &lt;code&gt;ss&lt;/code&gt; on Linux&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lima_listens&lt;/code&gt;, &lt;code&gt;loopback_only&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DevvmIn(s, dir, input, env, args…)&lt;/code&gt;, &lt;code&gt;OwnVM(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs &lt;code&gt;devvmCmd&lt;/code&gt;&amp;rsquo;s command, and makes a VM that a step launched the run&amp;rsquo;s, so that the cleanup deletes it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(cd DIR &amp;amp;&amp;amp; VAR=… &amp;quot;$D&amp;quot; …)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SaidLine(out, msg)&lt;/code&gt;, &lt;code&gt;FirstLine&lt;/code&gt;, &lt;code&gt;LastLine&lt;/code&gt;, &lt;code&gt;tailLines(text, n)&lt;/code&gt;, &lt;code&gt;Trim&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether one of output&amp;rsquo;s lines is one of a message&amp;rsquo;s, a message&amp;rsquo;s first or last line, text&amp;rsquo;s last lines, and output without its trailing newlines&lt;/td&gt;
&lt;td&gt;&lt;code&gt;grep -qxF &amp;quot;$(m …)&amp;quot;&lt;/code&gt;, &lt;code&gt;head -1&lt;/code&gt;, &lt;code&gt;tail -n&lt;/code&gt;, &lt;code&gt;$(…)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Listed(s, vm)&lt;/code&gt;, &lt;code&gt;Locked(s, file)&lt;/code&gt;, &lt;code&gt;Procs(s)&lt;/code&gt;, &lt;code&gt;Forwarders(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether &lt;code&gt;limactl&lt;/code&gt; lists a VM, whether a file has macOS&amp;rsquo;s user immutable flag, every host process&amp;rsquo;s command line, which stays out of the check&amp;rsquo;s log as &lt;code&gt;WatchProcs&lt;/code&gt;&amp;rsquo;s samples do, and a VM&amp;rsquo;s port forwarders here&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list -q&lt;/code&gt;, &lt;code&gt;ls -lOd&lt;/code&gt;, &lt;code&gt;ps -axww&lt;/code&gt;, &lt;code&gt;pgrep -f '[_]ports -vm VM '&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Reaches(s, addr)&lt;/code&gt;, &lt;code&gt;ReachesWithin&lt;/code&gt;, &lt;code&gt;Answer(s, addr)&lt;/code&gt;, &lt;code&gt;Local(port)&lt;/code&gt;, &lt;code&gt;Local6(port)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether something takes a TCP connection on an address, at once or within a time, and what a connection reads before it closes, within 2 seconds&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nc -z&lt;/code&gt;, &lt;code&gt;nc -w 2&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;transparentRuns(s, vm, dir, title)&lt;/code&gt;, &lt;code&gt;fromTransparent(s, vm, dir, title, env)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the checks of &lt;a href="https://next.devvm.dev/docs/internals/network/#tools-that-skip-the-proxy"&gt;transparent mode&lt;/a&gt; in a confined VM on any base: its service and listeners, names, curl without proxy settings to an allowed host and a blocked one, another port refused; &lt;code&gt;fromTransparent&lt;/code&gt; puts a &lt;code&gt;--from&lt;/code&gt; VM on the allowlist tier for one start first&lt;/td&gt;
&lt;td&gt;&lt;code&gt;in_vm 'curl --noproxy …'&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;withoutTransparent(s, vm, fn)&lt;/code&gt;, &lt;code&gt;dnsAnswers(sentinel, servers…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs &lt;code&gt;fn&lt;/code&gt; with the VM&amp;rsquo;s transparent mode stopped, as root could stop it, checked first, then starts it again; a script that asks each server for &lt;code&gt;example.com&lt;/code&gt; over UDP and TCP and passes when none answers, or, with &lt;code&gt;sentinel&lt;/code&gt;, when the answer is the stand-in address with TTL 0&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemctl stop devvm-transparent&lt;/code&gt;, &lt;code&gt;python3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HostProgram(s, addr, answer)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a program on this machine that holds a port, every IPv4 address with &lt;code&gt;:port&lt;/code&gt;, and answers each connection with &lt;code&gt;host-program&lt;/code&gt; or accepts none&lt;/td&gt;
&lt;td&gt;&lt;code&gt;perl -MIO::Socket::INET&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LimaServe(s, vm, ports…)&lt;/code&gt;, &lt;code&gt;VMSay(s, vm, addr, port, word)&lt;/code&gt;, &lt;code&gt;LimaBoot(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;starts servers in a VM, on every address or on one address with a word of their own, and reads the VM&amp;rsquo;s boot&amp;rsquo;s ID&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lima_serve&lt;/code&gt;, &lt;code&gt;vm_say&lt;/code&gt;, &lt;code&gt;lima_boot&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PortsLive(s, dir, vm, port, serve, boot)&lt;/code&gt;, &lt;code&gt;HostPortKept(s, dir, vm, port, control, serve)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;checks that &lt;code&gt;devvm ports add&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; apply to a running VM at once without a restart, and that a listed port a program here holds stays its own until it&amp;rsquo;s freed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ports_live&lt;/code&gt;, &lt;code&gt;host_port_kept&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TTYRun(s, dir, input, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs a command on a terminal of its own, &lt;code&gt;script&lt;/code&gt; on macOS and Python&amp;rsquo;s pty on Linux, and types the input once a &lt;code&gt;[y/N]&lt;/code&gt; or &lt;code&gt;[Y/n]&lt;/code&gt; question shows&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tty_run&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WatchSees(s, vm, dir, by, nested)&lt;/code&gt;, &lt;code&gt;WatchMisses(s, vm, dir)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs a file watcher in the VM and checks which changes, made in the VM or on this machine, it sees&lt;/td&gt;
&lt;td&gt;&lt;code&gt;watch_sees&lt;/code&gt;, &lt;code&gt;watch_misses&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SSHAgent(s, sock)&lt;/code&gt;, &lt;code&gt;KeyComments(out)&lt;/code&gt;, &lt;code&gt;RfwdLinks(s, host, sock, ssh…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;starts a throwaway &lt;code&gt;ssh-agent&lt;/code&gt;, reads the keys&amp;rsquo; comments from &lt;code&gt;ssh-add -l&lt;/code&gt;, and checks that a VM&amp;rsquo;s sshd binds remote forwards only on links&amp;rsquo; addresses&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ssh-agent -a&lt;/code&gt;, &lt;code&gt;awk '{ print $3 }'&lt;/code&gt;, &lt;code&gt;rfwd_links&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ExecQuoting(s, vm)&lt;/code&gt;, &lt;code&gt;ServeDesktop(s, dir, args…)&lt;/code&gt;, &lt;code&gt;Desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs &lt;code&gt;TestE2EExecQuoting&lt;/code&gt; on a VM, and runs &lt;code&gt;devvm desktop --no-open&lt;/code&gt; in the background until it says where the desktop is, which &lt;code&gt;View&lt;/code&gt; checks with &lt;code&gt;TestE2EDesktop&lt;/code&gt; and &lt;code&gt;End&lt;/code&gt; ends with Ctrl+C&lt;/td&gt;
&lt;td&gt;&lt;code&gt;go_e2e&lt;/code&gt;, &lt;code&gt;desktop_serve&lt;/code&gt;, &lt;code&gt;desktop_view&lt;/code&gt;, &lt;code&gt;desktop_end&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Note(s, format, …)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;adds a line of the check&amp;rsquo;s own to its log, which a failure shows among its last lines&lt;/td&gt;
&lt;td&gt;a check&amp;rsquo;s &lt;code&gt;echo&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SetState(s.Paths, vm, key, json)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;sets a dotted key of a VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt; to a JSON value by hand, as nothing devvm runs would, keeping the rest&lt;/td&gt;
&lt;td&gt;&lt;code&gt;vm_set&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NoDocker(s)&lt;/code&gt;, &lt;code&gt;DockerCalls(s)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a &lt;code&gt;PATH&lt;/code&gt; with a docker first on it that&amp;rsquo;s installed but not running, which logs what devvm asked it to the file &lt;code&gt;DockerCalls&lt;/code&gt; names&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NewestLog(s.Paths)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s newest run log, the last devvm&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;&lt;code&gt;newest_log&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A secret that a check looks for is never in a process&amp;rsquo;s arguments, where other users can see it. The company proxy&amp;rsquo;s password is in its config file and in the environment of the commands that &lt;code&gt;Env&lt;/code&gt; is given to, and each helper above takes a secret as a Go value, so it reaches &lt;code&gt;grep&lt;/code&gt; on its input and is never on a command line.&lt;/p&gt;
&lt;h2 data-hextra-search-id="test-builds"&gt;Test builds&lt;span class="hx:absolute hx:-mt-20" id="test-builds"&gt;&lt;/span&gt;
&lt;a href="#test-builds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The tests run a test build of devvm, which is one made with &lt;code&gt;-ldflags &amp;quot;-X github.com/devvmhq/devvm/internal/testbuild.testBuild=yes&amp;quot;&lt;/code&gt;, as the end-to-end tests and the CLI tests make theirs. Only a test build reads the environment variables that stand in for what devvm would find on this machine. Releases (GoReleaser, the Homebrew formula) don&amp;rsquo;t set the flag, so a release ignores every one of these variables, whatever its environment says. devvm reads them in one place, &lt;code&gt;readOverrides&lt;/code&gt; in &lt;code&gt;internal/cli/overrides.go&lt;/code&gt;, into an &lt;code&gt;Overrides&lt;/code&gt; struct, and passes each one to the package that uses it:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Stands in for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s pinned and checked mise on the host&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TOOL_SLOTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;backend.MaxToolSlots&lt;/code&gt;, the most tool images that build side by side, which the host&amp;rsquo;s memory, CPUs and free space lower further&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_KVM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Linux&amp;rsquo;s &lt;code&gt;/dev/kvm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UBUNTU_URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://cloud-images.ubuntu.com/releases/resolute&lt;/code&gt;, where devvm finds Ubuntu&amp;rsquo;s dated releases and downloads the cloud image from. A &lt;code&gt;file://&lt;/code&gt; address is read from disk, and devvm copies the image into its own folder as it does a download&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_LIMA_TEMPLATES&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder of Lima&amp;rsquo;s own templates beside &lt;code&gt;limactl&lt;/code&gt;, whose cloud images &lt;code&gt;devvm gc --caches&lt;/code&gt; never frees from Lima&amp;rsquo;s cache: the CLI tests&amp;rsquo; stub &lt;code&gt;limactl&lt;/code&gt; has none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UBUNTU_RELEASE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the newest dated release, which devvm pins base to: the end-to-end tests pin their own, &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, so its images stay cached between runs, and devvm checks it as it does the newest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UNREVIEWED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the refusal of unreviewed emulations (&lt;a href="#unreviewed-emulations"&gt;unreviewed emulations&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_SSH_PORTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the 17 ports every browser refuses, which VMs&amp;rsquo; ssh comes from (&lt;code&gt;ports.SSHPorts&lt;/code&gt;). It&amp;rsquo;s a comma-separated list of the CLI test sandbox&amp;rsquo;s own ports, so sandboxes running at once never share them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_CPUS&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_MEMORY_GIB&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_FREE_GIB&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_LIST_TIMEOUT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;this machine&amp;rsquo;s size and how long devvm waits for a backend&amp;rsquo;s listings (&lt;a href="#a-host-of-any-size"&gt;a host of any size&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_PIPED_ANSWERS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a terminal to answer questions in: with &lt;code&gt;1&lt;/code&gt;, each question reads its answer as a line of input that isn&amp;rsquo;t a terminal, without its prompt, where devvm would refuse it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_VOLUME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the volume of every folder, such as &lt;code&gt;uuid:…&lt;/code&gt;, in place of &lt;code&gt;diskutil&lt;/code&gt;&amp;rsquo;s on macOS and the file system&amp;rsquo;s ID on Linux, as devvm records and matches it when it makes, launches, adopts, moves, deletes or lists a VM, so a script needn&amp;rsquo;t depend on the real one, and &lt;code&gt;fail&lt;/code&gt; makes each lookup fail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_HISTORY_MAX&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the 2 GiB that an export of agents&amp;rsquo; history holds at most, in bytes, so a script whose VM writes an export without end reaches the cap at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;where devvm paste finds the clipboard tools: macOS&amp;rsquo;s &lt;code&gt;/usr/bin/osascript&lt;/code&gt; and &lt;code&gt;/usr/bin/pbcopy&lt;/code&gt;, and &lt;code&gt;wl-paste&lt;/code&gt;, &lt;code&gt;wl-copy&lt;/code&gt; and &lt;code&gt;xclip&lt;/code&gt; in Linux&amp;rsquo;s system folders, so the tests&amp;rsquo; stand-ins run in their place&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_PASTE_WAIT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;how long devvm paste waits for its script in the VM, in seconds, in place of 10 minutes for a write and 2 for a count or a delete, so a script whose VM never answers reaches the limit at once&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The settings that the &lt;a href="https://next.devvm.dev/docs/using/settings/#environment"&gt;environment table&lt;/a&gt; lists, such as &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt; and &lt;code&gt;DEVVM_NO_TOOL_CHECK&lt;/code&gt;, are yours to set, so every build reads them. Sandboxes for manual runs that have data folders of their own but share one &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; lock only their own shared tools, so don&amp;rsquo;t build shared tools or run &lt;code&gt;devvm gc&lt;/code&gt; in two of them at once: either can delete a build VM that the other is still using (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="tests-on-real-lima"&gt;Tests on real Lima&lt;span class="hx:absolute hx:-mt-20" id="tests-on-real-lima"&gt;&lt;/span&gt;
&lt;a href="#tests-on-real-lima" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Most Go tests run the &lt;code&gt;limactl&lt;/code&gt; stub, which can&amp;rsquo;t tell whether real Lima accepts what devvm gives it. The tests in &lt;code&gt;internal/backend/lima/real_test.go&lt;/code&gt; run the real &lt;code&gt;limactl&lt;/code&gt; instead, on dummy instances, as Lima&amp;rsquo;s own tests do. A dummy instance&amp;rsquo;s image is a small local file, so it can&amp;rsquo;t boot, but &lt;code&gt;limactl&lt;/code&gt; still creates, clones, edits, lists and deletes it. The tests run in a sandbox of their own, with a Lima home under &lt;code&gt;/tmp&lt;/code&gt; and a &lt;code&gt;HOME&lt;/code&gt; of their own, so they never touch your VMs or your Lima home, and they never start a VM. They run in &lt;code&gt;mise run test&lt;/code&gt; wherever &lt;code&gt;limactl&lt;/code&gt; is on &lt;code&gt;PATH&lt;/code&gt;, and where it isn&amp;rsquo;t, they skip and say why.&lt;/p&gt;
&lt;p&gt;Each test walks through &lt;code&gt;scenario&lt;/code&gt;, which makes every kind of Lima config devvm makes, through the same code devvm runs. It makes base from Ubuntu&amp;rsquo;s image and from a &lt;code&gt;--from&lt;/code&gt; conversion, a layer, the shared tools&amp;rsquo; build VM, the conversion&amp;rsquo;s VM, and a project VM with its mounts, ports, size and environment. Then it makes the edits that a build&amp;rsquo;s start makes, and those of the project VM&amp;rsquo;s starts: its first start, a confined start with the proxy&amp;rsquo;s password that changes its agents&amp;rsquo; folders, agent forwarding and size in the same edit, and an open start and one with no network. In the end it deletes everything. &lt;code&gt;TestLimaConfigsValid&lt;/code&gt; runs &lt;code&gt;limactl validate&lt;/code&gt; on every instance&amp;rsquo;s &lt;code&gt;lima.yaml&lt;/code&gt; after each step. That covers the proxy&amp;rsquo;s password too, which devvm writes into &lt;code&gt;lima.yaml&lt;/code&gt; itself, so &lt;code&gt;limactl edit&lt;/code&gt; never checks it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TestLimactlStubContract&lt;/code&gt; in &lt;code&gt;contract_test.go&lt;/code&gt; keeps the &lt;code&gt;limactl&lt;/code&gt; stub in &lt;code&gt;internal/stubtest/stub&lt;/code&gt; honest, because the CLI tests and most Go tests trust it to act as Lima does. It runs &lt;code&gt;scenario&lt;/code&gt; twice, once through the real &lt;code&gt;limactl&lt;/code&gt; and once through the stub, and after each step it compares every instance as devvm reads it from &lt;code&gt;limactl list --json&lt;/code&gt;. It compares the order of the instances, each one&amp;rsquo;s status, size, mounts, agent forwarding, ssh port and networks, and the edits each kind of start would make to it. When Lima and the stub differ, the test names the step and the fields that differ, and the stub gets fixed to match Lima.&lt;/p&gt;
&lt;h2 data-hextra-search-id="golden-fixtures"&gt;Golden fixtures&lt;span class="hx:absolute hx:-mt-20" id="golden-fixtures"&gt;&lt;/span&gt;
&lt;a href="#golden-fixtures" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The golden fixtures are what the real tools printed, kept in &lt;code&gt;testdata/golden/darwin/&lt;/code&gt; and &lt;code&gt;testdata/golden/linux/&lt;/code&gt;, so the tests can check both devvm&amp;rsquo;s parsers and the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#stubs"&gt;stubs&lt;/a&gt; against real output on any machine. Each system&amp;rsquo;s folder holds what its tools printed there:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fixture&lt;/th&gt;
&lt;th&gt;The real output of&lt;/th&gt;
&lt;th&gt;Captured from&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limactl-version.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestLimactlStubContract&lt;/code&gt;&amp;rsquo;s run on real Lima&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limactl-list-stopped.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the contract test&amp;rsquo;s dummy instances, after the step that leaves the most&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limactl-list-running.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list --json&lt;/code&gt; of a running VM&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;project&lt;/code&gt; section&amp;rsquo;s first VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qemu-img-info.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;qemu-img info -U --output=json&lt;/code&gt; of base&amp;rsquo;s disk&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;images&lt;/code&gt; section, on Linux&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qemu-img-info-overlay.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the same, of a project VM&amp;rsquo;s overlay disk&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;project&lt;/code&gt; section, on Linux&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;security-missing.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;security find-generic-password&lt;/code&gt; for an item that isn&amp;rsquo;t there, and its exit status&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;images&lt;/code&gt; section, on macOS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tmutil-isexcluded.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tmutil isexcluded&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;images&lt;/code&gt; section, on macOS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;mise run e2e -- --golden&lt;/code&gt; captures them on a real machine, into the checkout, and you commit what changed. It runs the contract test with &lt;code&gt;STUB_GOLDEN&lt;/code&gt; set to the system&amp;rsquo;s folder for the dummy instances&amp;rsquo; fixtures, and runs the other commands itself, so a run needs the &lt;code&gt;images&lt;/code&gt; section, and the &lt;code&gt;project&lt;/code&gt; section for a running VM. Each fixture has this machine&amp;rsquo;s home folder replaced with &lt;code&gt;/home/me&lt;/code&gt;, the user&amp;rsquo;s name with &lt;code&gt;me&lt;/code&gt;, and the user&amp;rsquo;s full name, the timezone and a VM&amp;rsquo;s environment made up, so it holds nothing of yours. A capture isn&amp;rsquo;t a check, so a run with &lt;code&gt;--golden&lt;/code&gt; runs as many checks as one without, and a capture that fails says so and keeps the fixture it had. Run it on a Mac and on a &lt;a href="#linux-hosts"&gt;Linux host&lt;/a&gt; after Lima or QEMU changes what it prints.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TestGoldenLimactlVersion&lt;/code&gt;, &lt;code&gt;TestGoldenLimactlList&lt;/code&gt; and &lt;code&gt;TestGoldenQemuImgInfo&lt;/code&gt; in &lt;code&gt;internal/backend/lima/golden_test.go&lt;/code&gt; read every system&amp;rsquo;s fixtures with devvm&amp;rsquo;s own parsers, so a change in what the tools print that devvm would misread fails them on any machine. Each also runs the stub and checks that its output has the same form, or the same shape for JSON: every field the stub prints is one that the real tool prints, with a value of the same kind. For &lt;code&gt;limactl list --json&lt;/code&gt;, the stub&amp;rsquo;s output is its listing after the contract test&amp;rsquo;s scenario. &lt;code&gt;TestGoldenSecurityTmutil&lt;/code&gt; in &lt;code&gt;internal/platform&lt;/code&gt; checks the stub&amp;rsquo;s &lt;code&gt;security&lt;/code&gt; and &lt;code&gt;tmutil&lt;/code&gt; against macOS&amp;rsquo;s fixtures the same way, on macOS.&lt;/p&gt;
&lt;h2 data-hextra-search-id="unreviewed-emulations"&gt;Unreviewed emulations&lt;span class="hx:absolute hx:-mt-20" id="unreviewed-emulations"&gt;&lt;/span&gt;
&lt;a href="#unreviewed-emulations" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm refuses an emulated feature until its review passes, yet the review needs end-to-end checks of it. In a &lt;a href="#test-builds"&gt;test build&lt;/a&gt;, &lt;code&gt;DEVVM_UNREVIEWED&lt;/code&gt; lets the ones it names through, as &lt;code&gt;backend:feature&lt;/code&gt; pairs, comma-separated, each time with a warning (&lt;code&gt;backend_unreviewed_used&lt;/code&gt;). A release ignores it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;DEVVM_UNREVIEWED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lima:ports-all devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It&amp;rsquo;s for tests only, of an emulation before its review: none needs it now, as every emulation is reviewed. It never makes a feature a backend lacks usable, and &lt;code&gt;devvm doctor&lt;/code&gt; still shows the feature &lt;code&gt;unreviewed&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-host-of-any-size"&gt;A host of any size&lt;span class="hx:absolute hx:-mt-20" id="a-host-of-any-size"&gt;&lt;/span&gt;
&lt;a href="#a-host-of-any-size" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm reads this machine&amp;rsquo;s CPUs, its memory and the free space on its disks when it fits base to the host, checks a size you give it, checks free space before a build or a new VM, and warns in &lt;code&gt;devvm doctor&lt;/code&gt;. All of these reads go through &lt;code&gt;platform.Host&lt;/code&gt;, so the CLI tests can stand in for a host of any size and pass the same way on a large Mac and on a small CI runner. In a test build, three environment variables replace what &lt;code&gt;platform.Host&lt;/code&gt; reads:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Replaces&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_CPUS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the number of CPUs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_MEMORY_GIB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the memory, in GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_FREE_GIB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the free space in GiB, on every disk&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Only a &lt;a href="#test-builds"&gt;test build&lt;/a&gt; reads them, and a release ignores all three, so no variable can make devvm see more free space or more memory than this machine has. Each one that isn&amp;rsquo;t set leaves the machine&amp;rsquo;s own value. &lt;code&gt;internal/cli/script_test.go&lt;/code&gt; sets a large host in every script: 8 CPUs, 16 GiB of memory and 500 GiB free, which is more than base asks for and more than any build checks for. A script that tests a small host sets its own values with &lt;code&gt;env&lt;/code&gt;, as &lt;code&gt;small_host.txtar&lt;/code&gt; does with 2 CPUs, 7 GiB and 1 GiB free:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;env DEVVM_TEST_CPUS=2
env DEVVM_TEST_MEMORY_GIB=7
! exec devvm size -g --cpus 3
stderr &amp;#39;^devvm: too_many_cpus have=2 want=3$&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To go back to the large host later in the same script, set the large values again, because an empty value leaves the machine&amp;rsquo;s own. The fake host covers only size and free space. What differs between operating systems, such as Lima&amp;rsquo;s disk floors on Linux, ports already in use, Docker on &lt;code&gt;PATH&lt;/code&gt;, or tmpfs and 9p mounts, still differs, and the Linux CI job is what catches it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="any-time-zone"&gt;Any time zone&lt;span class="hx:absolute hx:-mt-20" id="any-time-zone"&gt;&lt;/span&gt;
&lt;a href="#any-time-zone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The tests pass in any time zone and on any date, because a test that compares times counts them from an instant it parsed or fixed, or works in UTC, and never sets &lt;code&gt;time.Local&lt;/code&gt;. A testscript that needs an old file uses a date far in the past, such as &lt;code&gt;touch -t 202001010000&lt;/code&gt;, and one that needs a file that stays new uses a date far in the future, such as an export named &lt;code&gt;20991231-235959&lt;/code&gt;, so the scripts keep passing as the calendar moves on. CI runs &lt;code&gt;mise run test&lt;/code&gt; on macOS in UTC and on Linux with &lt;code&gt;TZ=America/Los_Angeles&lt;/code&gt;, which has daylight saving time, so a test that only passes in one zone fails in CI and not only on a laptop. To check a change the same way, run the tests with another zone, including one with an odd offset or a half-hour DST change:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;TZ&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;America/Los_Angeles mise run &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;TZ&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Pacific/Chatham mise run &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;TZ&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Australia/Lord_Howe mise run test&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="fuzzing"&gt;Fuzzing&lt;span class="hx:absolute hx:-mt-20" id="fuzzing"&gt;&lt;/span&gt;
&lt;a href="#fuzzing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s fuzz targets use Go&amp;rsquo;s built-in fuzzing, and each one checks a property of what it fuzzes, not only that nothing panics. &lt;code&gt;go test&lt;/code&gt; runs only each target&amp;rsquo;s seed inputs, the ones its &lt;code&gt;f.Add&lt;/code&gt; lines give and the files in its package&amp;rsquo;s &lt;code&gt;testdata/fuzz/&amp;lt;target&amp;gt;/&lt;/code&gt; folder, so every run of the tests checks them. To fuzz one target on your machine, or to run one failing input again:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^$&amp;#39;&lt;/span&gt; -fuzz &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy$&amp;#39;&lt;/span&gt; -fuzztime 2m ./internal/proxy &lt;span class="c1"&gt;# fuzz one target for two minutes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^$&amp;#39;&lt;/span&gt; -fuzz &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy$&amp;#39;&lt;/span&gt; -parallel &lt;span class="m"&gt;2&lt;/span&gt; ./internal/proxy &lt;span class="c1"&gt;# with two workers, on a busy machine&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^$&amp;#39;&lt;/span&gt; -fuzz &lt;span class="s1"&gt;&amp;#39;^FuzzUnpack$&amp;#39;&lt;/span&gt; -fuzzminimizetime 1000x ./internal/upgrade &lt;span class="c1"&gt;# minimizing each new input in 1,000 runs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy/e9e4d242dc7b413a$&amp;#39;&lt;/span&gt; ./internal/proxy &lt;span class="c1"&gt;# one input in testdata/fuzz/FuzzNoProxy/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When a target fails, &lt;code&gt;go test&lt;/code&gt; writes the input that broke it to the package&amp;rsquo;s &lt;code&gt;testdata/fuzz/&amp;lt;target&amp;gt;/&lt;/code&gt; folder. Fix the code, add a test of the fix beside the code&amp;rsquo;s other tests, and commit the input with them, because &lt;code&gt;go test&lt;/code&gt; then runs it as a seed every time.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-nightly-run"&gt;The nightly run&lt;span class="hx:absolute hx:-mt-20" id="the-nightly-run"&gt;&lt;/span&gt;
&lt;a href="#the-nightly-run" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Fuzz workflow (&lt;code&gt;.github/workflows/fuzz.yml&lt;/code&gt;) fuzzes every target for five minutes each night, eight targets at a time, and you can start it by hand from the Actions tab. It minimizes each new input in at most 1,000 runs (&lt;code&gt;-fuzzminimizetime 1000x&lt;/code&gt;), because by default &lt;code&gt;go test&lt;/code&gt; minimizes each one for up to a minute, and a target whose runs write files, such as &lt;code&gt;FuzzUnpack&lt;/code&gt;, would spend its five minutes doing that. It finds the targets by reading each &lt;code&gt;func Fuzz&lt;/code&gt; in the tests, so a new target is fuzzed without any change to the workflow, and the proxy&amp;rsquo;s targets run first. A target&amp;rsquo;s name must be its own across the packages, because the workflow names the target&amp;rsquo;s artifacts and its line in the issue after it, and two targets of one name fail the run.&lt;/p&gt;
&lt;p&gt;Each target starts from its corpus, the inputs that its earlier nights found reaching new code, so each night goes further than the last rather than starting again from the seeds. &lt;code&gt;go test&lt;/code&gt; keeps a target&amp;rsquo;s corpus in the &lt;code&gt;fuzz&lt;/code&gt; folder of &lt;code&gt;GOCACHE&lt;/code&gt;, and the workflow restores it from a cache of the target&amp;rsquo;s own before fuzzing and saves it afterwards, whether the target failed or not. When a target fails, the workflow uploads the input that broke it as an artifact named &lt;code&gt;crash-&amp;lt;target&amp;gt;&lt;/code&gt;, and it adds the input to the target&amp;rsquo;s corpus, so the target fails on it again each night until the fix is on &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The workflow keeps the failures in one issue, &amp;ldquo;Fuzzing found failing inputs&amp;rdquo;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It opens the issue&lt;/strong&gt; on the first night a target fails. The issue lists each failing target with its package and how its run ended, and links the night&amp;rsquo;s run, where the &lt;code&gt;crash-&amp;lt;target&amp;gt;&lt;/code&gt; artifacts are. A target whose job reported nothing also counts as failing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It comments on the issue&lt;/strong&gt; when the failing targets change, so a new failure notifies you, and otherwise it only updates the issue&amp;rsquo;s link to the latest run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It closes the issue&lt;/strong&gt; on the first night every target passes, the inputs that failed included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only a run on &lt;code&gt;main&lt;/code&gt; updates the issue,&lt;/strong&gt; so a run started on another branch never closes it. The fuzz jobs run the repo&amp;rsquo;s code with read access alone, and the issue job, the only one that can write issues, runs none of it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="what-each-target-checks"&gt;What each target checks&lt;span class="hx:absolute hx:-mt-20" id="what-each-target-checks"&gt;&lt;/span&gt;
&lt;a href="#what-each-target-checks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The parsers of what a VM can write, its output and its files, and of what comes from the network fail closed, so they take only what their format allows, within its caps. A secret&amp;rsquo;s value goes only where it&amp;rsquo;s bound, and a redaction leaves no planted secret behind. The host readers&amp;rsquo; targets are differential, which means each one checks one reader against a frozen copy of how it read a host before devvm read every host in one form, and allows only the differences that &lt;a href="https://next.devvm.dev/docs/contributing/design/#one-form-of-a-host"&gt;One form of a host&lt;/a&gt; lists.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;What it checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzCursorFrames&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A reply from a Cursor host, of any type, encodings, body and trailers, read in reads of any size, passes only what came, from its start. A Connect or gRPC stream passes whole messages alone, none over &lt;code&gt;frameMax&lt;/code&gt; as it came or as it decompresses, so a gzip bomb is refused, and none holding a JWT&amp;rsquo;s start once decompressed and, in JSON, with its escapes undone. Another body passes no JWT&amp;rsquo;s start of up to &lt;code&gt;jwtWindow&lt;/code&gt; bytes, and a trailer holding one never lets the body end cleanly.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzInject&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever a request&amp;rsquo;s host, method, path and headers, each binding&amp;rsquo;s value goes in only for a host the binding names, judged apart from the policy&amp;rsquo;s matcher, in &lt;code&gt;NormHost&lt;/code&gt;&amp;rsquo;s form, for a path and methods it allows. It goes in its own header alone, once, and only when exactly one of that header&amp;rsquo;s values held its exact placeholder. Every other header stays as it came.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseBindings&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A bindings file is read only at a version the proxy knows, with each binding&amp;rsquo;s kind, path, methods and scheme ones it takes, and none of version 1 that a proxy of that version reads otherwise. A file that&amp;rsquo;s read reads back as itself from what &lt;code&gt;Encode&lt;/code&gt; writes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzLinkList&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A links list is read only at its version, and a host and port find only an entry that names them, at a link&amp;rsquo;s address in &lt;code&gt;127.77.0.0/16&lt;/code&gt; as &lt;code&gt;netip&lt;/code&gt; writes it, whose socket is this VM&amp;rsquo;s link&amp;rsquo;s for that address and port.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzBrokerFrames&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever frame a child sends, the broker&amp;rsquo;s read never panics, refuses a frame past 2 MiB without reading it, takes only a frame of a type the protocol&amp;rsquo;s version knows, with its fields alone, and answers a request only with what its own config names: a value looked up with its own binding, a file of its own list, no link its list lacks, a token exchange at its own endpoints for its own VM, a lookup of a host name alone, and a connection only to an address that its own floor allows, never this machine&amp;rsquo;s loopback or its own address, which no rule of its names.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzFrameStreams&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever stream of frames reaches either side, the broker answers each request with a frame of its ID and type and one of the protocol&amp;rsquo;s error codes alone, the child takes no reply to a request it never sent, nor a second start, and both end at the first frame that breaks the rules or at the stream&amp;rsquo;s end, never panicking or hanging.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseUpstream&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A company proxy&amp;rsquo;s URL is taken only as &lt;code&gt;http://&lt;/code&gt;, with a host, a port that is one or none, and no path but &lt;code&gt;/&lt;/code&gt; or query, and the upstream made of it has that host and port and Basic credentials only when it names a user. Its errors hold no more of the URL than its scheme.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzNoProxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Each &lt;code&gt;NO_PROXY&lt;/code&gt; entry sends directly only what it names: every host for &lt;code&gt;*&lt;/code&gt;, addresses alone for an address or a CIDR, a name and the names under it, only those after a leading &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;*.&lt;/code&gt;, and only the port an entry names. A list sends directly what any of its entries does.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseNarinfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A narinfo is taken only when &lt;code&gt;cache.nixos.org-1&lt;/code&gt; signed it, for the path asked for, and what the signature doesn&amp;rsquo;t cover keeps to its forms: a NAR&amp;rsquo;s URL named by its &lt;code&gt;NarHash&lt;/code&gt; or &lt;code&gt;FileHash&lt;/code&gt;, and sizes from 1 byte to 1 TiB.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseTokenRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A token request is read only as a form, or with no type, or as one JSON object alone, with no field named twice however its name is written, and its fields are what it sent.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzRedact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No secret planted in an agent&amp;rsquo;s settings file, JSON or TOML, survives into the VM&amp;rsquo;s copy, which reads back: a known key&amp;rsquo;s shape as a value or among other words, a URL&amp;rsquo;s password or query value, a value under a secret-looking key, an env or headers table&amp;rsquo;s value, and a flag&amp;rsquo;s argument. Claude Code&amp;rsquo;s own settings in its top-level &lt;code&gt;env&lt;/code&gt; stay, as Redact keeps them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzCapture&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever an agent&amp;rsquo;s token endpoint replies to whatever request, for every agent whose login devvm captures, the VM&amp;rsquo;s reply is a JSON object holding none of the reply&amp;rsquo;s tokens, and a reply that isn&amp;rsquo;t captured leaves the store unwritten.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzSplit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/redact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A password that &lt;code&gt;String&lt;/code&gt; finds in a line, in a URL of at most the tail&amp;rsquo;s length, never reaches the log when the line comes in parts of any size and is written after each part as far as &lt;code&gt;Split&lt;/code&gt; lets it, as the run log writes it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzStrip&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/jsonc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Strip&lt;/code&gt; keeps every offset, blanking bytes with spaces and keeping newlines, leaves JSON as it is, and, against &lt;code&gt;encoding/json&lt;/code&gt;, makes JSON with comments, trailing commas and a byte order mark read as the same value as the JSON without them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParsePublicKey&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A minisign public key is read only from one base64 line, alone or after its untrusted comment, as exactly its key ID and its Ed25519 key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzCheck&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A signature checks out only for the data its key&amp;rsquo;s holder signed, and only with the trusted comment that was signed, exactly.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzKeysCheck&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A manifest checks out only as the one signed, for the subject signed, and when at least two roles&amp;rsquo; files are each a signature of it by that role&amp;rsquo;s own key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzSumOf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A file&amp;rsquo;s hash in &lt;code&gt;SHA256SUMS&lt;/code&gt; is the first field of the first line that is exactly a 64-character hash and the file&amp;rsquo;s name, and such a line is always found.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzEntryName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;An archive&amp;rsquo;s entry is taken only as the release&amp;rsquo;s folder or as a regular file right in it, which lands in the folder &lt;code&gt;unpack&lt;/code&gt; makes and nowhere else.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzUnpack&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;unpack&lt;/code&gt; writes only regular files right in the folder it makes, &lt;code&gt;devvm&lt;/code&gt; among them, each as the archive has it, &lt;code&gt;devvm&lt;/code&gt; executable and the rest not, at most &lt;code&gt;unpackCap&lt;/code&gt; in all and nothing outside the folder. An archive it refuses leaves no folder.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseHostKeys&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Each host key taken from what a VM shows is of a type ssh has, with no certificate, marker or pattern, in strict base64 of at most &lt;code&gt;keyMax&lt;/code&gt; that names its own type, from a line of the VM&amp;rsquo;s own, in order. Its line in the record is three fields, which read back as that key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParsePorts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A forwarder&amp;rsquo;s record, which other VMs&amp;rsquo; forwarders read, gives only ports that are ones, each an entry of its line, in order, and the ports it writes read back as themselves.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseCloneState&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s answer to the check is taken only whole: every repo asked for is gone or has its branches and status, within &lt;code&gt;cloneRefsMax&lt;/code&gt; branches in all and &lt;code&gt;cloneWorktreesMax&lt;/code&gt; worktrees a repo, each worktree once, at a clean path below the project folder, with a commit&amp;rsquo;s name or none for its HEAD. Nothing taken is more than the answer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseInit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The VM&amp;rsquo;s answer to its repos&amp;rsquo; setup names a seed as landed, or of another format, only when a line names that seed&amp;rsquo;s path, and an old git only by what &lt;code&gt;git --version&lt;/code&gt; prints, else as unknown.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseKept&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;What a seed&amp;rsquo;s apply kept, which devvm only shows, is the VM&amp;rsquo;s own lines and names as it wrote them, none of them empty.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseLFSPointer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A blob is taken as a Git LFS pointer only as the spec writes one, with its version line first and each line ended, one oid of 64 lowercase hex digits, which names its object&amp;rsquo;s path, and one size of at least 0.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzHandshakeVM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The relay&amp;rsquo;s handshake with the VM&amp;rsquo;s VNC server succeeds only for version 3.8 or later, a list of security types that has None, and an OK result, and reads no more than those. It writes only version 3.8, then None, and None only from a list that has it, and its error, which goes in the log, stays short.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzHostSites&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Each of the proxy&amp;rsquo;s readers of a host reads it as its frozen copy did, except for the listed differences.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzClaudeHostSite&lt;/code&gt;, &lt;code&gt;FuzzPromisorHostSite&lt;/code&gt;, &lt;code&gt;FuzzPublicHostSite&lt;/code&gt;, &lt;code&gt;FuzzRiskSites&lt;/code&gt;, &lt;code&gt;FuzzCheckHostSite&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;, &lt;code&gt;internal/vm&lt;/code&gt;, &lt;code&gt;internal/from&lt;/code&gt;, &lt;code&gt;internal/netpolicy&lt;/code&gt;, &lt;code&gt;internal/secrets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The other readers of a host, an MCP server&amp;rsquo;s, a promisor remote&amp;rsquo;s, &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registry&amp;rsquo;s, &lt;code&gt;devvm network lock&lt;/code&gt;&amp;rsquo;s and a secret&amp;rsquo;s &lt;code&gt;--host&lt;/code&gt;, read it as their frozen copies did, except for the listed differences.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseRule&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A rule&amp;rsquo;s text parses back to the same rule, a host rule never holds a space or a slash, and &lt;code&gt;ParsePolicy&lt;/code&gt; marks a line a rule exactly when &lt;code&gt;ValidRule&lt;/code&gt; takes it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A request target the proxy accepts is a plain host, and the allow command it suggests allows exactly that host and port.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzDenyBypass&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A deny of &lt;code&gt;/gists/&lt;/code&gt; and of &lt;code&gt;POST&lt;/code&gt; holds however a request spells the path or the method.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzClientHello&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reading a tunnel&amp;rsquo;s first bytes never hangs, a stream whose first byte starts a TLS record counts as TLS, and only a whole record of TLS&amp;rsquo;s version is returned.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzTransparent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever its first bytes, a transparent connection to a proxy whose policy allows nothing reaches nothing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzNixPath&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;What &lt;code&gt;nixPath&lt;/code&gt; takes is one of the cache&amp;rsquo;s exact forms and names a file inside its folder.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParse&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/devcontainer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;devcontainer.json&lt;/code&gt; refuses &lt;code&gt;${localEnv:…}&lt;/code&gt; and &lt;code&gt;${env:…}&lt;/code&gt;. The check reads each variable as devvm does, from &lt;code&gt;${&lt;/code&gt; to the first &lt;code&gt;}&lt;/code&gt; after it, so a nested one such as &lt;code&gt;${${localEnv:HOME}}&lt;/code&gt; is left as text. Its environment variables are names and shell words the environment file holds as they are, and nothing it keeps has a NUL.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseRef&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/from&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any image reference parses into a tag without &lt;code&gt;/&lt;/code&gt; or &lt;code&gt;:&lt;/code&gt;, and a valid one parses the same once written out in full.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzRestrictNetdev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/backend/lima&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RestrictNetdev&lt;/code&gt; refuses, or returns at most one network, restricted, with nothing else changed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzQuote&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/shell&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A string that &lt;code&gt;Quote&lt;/code&gt; quotes reaches a shell as itself.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="manual-checks"&gt;Manual checks&lt;span class="hx:absolute hx:-mt-20" id="manual-checks"&gt;&lt;/span&gt;
&lt;a href="#manual-checks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What the end-to-end tests leave out, as it would change something of yours or needs something it doesn&amp;rsquo;t have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Screen Sharing on &lt;code&gt;devvm desktop&lt;/code&gt;:&lt;/strong&gt; e2e speaks VNC itself (&lt;code&gt;TestE2EDesktop&lt;/code&gt;), because it can&amp;rsquo;t drive a window. In a VM made with &lt;code&gt;--layers desktop&lt;/code&gt;, run &lt;code&gt;devvm desktop&lt;/code&gt;. Screen Sharing opens and asks for the password devvm shows, and the Xfce desktop answers the mouse and keys. A wrong password gets refused. With Edit &amp;gt; Use Shared Clipboard on, text you copy on this machine doesn&amp;rsquo;t paste in the VM, and with &lt;code&gt;devvm desktop --clipboard&lt;/code&gt; it does. &lt;code&gt;~/.local/share/devvm/logs/runs/&lt;/code&gt; has no line saying the relay doesn&amp;rsquo;t know a message (&lt;code&gt;which the relay doesn't know&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A VM&amp;rsquo;s clock after this machine sleeps:&lt;/strong&gt; e2e can&amp;rsquo;t sleep a Mac, and hosted CI can&amp;rsquo;t either. With an open VM and an allowlist VM running, compare each VM&amp;rsquo;s &lt;code&gt;date +%s.%N&lt;/code&gt; over ssh with this machine&amp;rsquo;s clock, halfway through the ssh round trip. Then sleep the Mac for over 30 minutes and compare again right after it wakes and 2 minutes later. Each VM stays within about 0.1 s of this machine, the same as before the sleep, and the clock catches up without NTP: chrony in the allowlist VM has never synced, yet it stays right, while chrony in each VM logs &lt;code&gt;Forward time jump detected!&lt;/code&gt; after the wake. Before you sleep the Mac, check that &lt;code&gt;pmset -g assertions&lt;/code&gt; shows &lt;code&gt;PreventSystemSleep 0&lt;/code&gt;. An app running &lt;code&gt;caffeinate -s&lt;/code&gt; on AC power turns a sleep into a dark wake where the CPU keeps running, so the VMs never pause and the check proves nothing. In a real sleep, a measurement you run every few minutes in the background leaves a gap.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;workerd under &lt;code&gt;wrangler dev&lt;/code&gt;, without proxy settings:&lt;/strong&gt; e2e stands in for it with curl and a static Go client, because npm&amp;rsquo;s download of workerd would make the run depend on it. In a node VM on the allowlist tier with &lt;code&gt;devvm network allow api.open-meteo.com&lt;/code&gt;, make a Worker whose &lt;code&gt;fetch&lt;/code&gt; handler returns &lt;code&gt;fetch(&amp;quot;https://api.open-meteo.com/v1/forecast?latitude=0&amp;amp;longitude=0&amp;amp;current=temperature_2m&amp;quot;)&lt;/code&gt;, then run &lt;code&gt;npx wrangler dev&lt;/code&gt; and &lt;code&gt;curl localhost:8787&lt;/code&gt; in the VM. It answers with the forecast, and &lt;code&gt;devvm network log&lt;/code&gt; has &lt;code&gt;api.open-meteo.com:443&lt;/code&gt; &lt;code&gt;without proxy settings&lt;/code&gt;. With the host taken out of the rules, the Worker&amp;rsquo;s &lt;code&gt;fetch&lt;/code&gt; fails with the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt; or a certificate error, as workerd may not trust the VM&amp;rsquo;s CA, and the log has the block. With &lt;code&gt;devvm network transparent off&lt;/code&gt; and a launch, the &lt;code&gt;fetch&lt;/code&gt; fails at once, and &lt;code&gt;wrangler dev&lt;/code&gt;&amp;rsquo;s output has &lt;code&gt;Temporary failure in name resolution&lt;/code&gt;. Run it from a folder in the VM&amp;rsquo;s home, such as a copy in &lt;code&gt;~/wk&lt;/code&gt;, because workerd&amp;rsquo;s SQLite fails with &lt;code&gt;SQLITE_IOERR_SHMMAP&lt;/code&gt; in the project folder on a Linux host&amp;rsquo;s 9p mount.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt; an image only Docker has&lt;/strong&gt; (built locally, never pushed): it would build an image in your Docker. Build a small one (&lt;code&gt;docker build -t devvm-local-test .&lt;/code&gt; from a &lt;code&gt;Dockerfile&lt;/code&gt; with &lt;code&gt;FROM alpine:3&lt;/code&gt;), run &lt;code&gt;devvm --from devvm-local-test&lt;/code&gt; in a new folder, check the VM boots from it, then &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;docker image rm devvm-local-test&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>.git protection</title><link>https://next.devvm.dev/docs/safety/git-protection/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/safety/git-protection/</guid><description>
&lt;p&gt;The project folder is read-write in the VM, so without protection anything in the VM could add a git hook, or set &lt;code&gt;core.fsmonitor&lt;/code&gt;, &lt;code&gt;core.hooksPath&lt;/code&gt; or &lt;code&gt;core.sshCommand&lt;/code&gt; in &lt;code&gt;.git/config&lt;/code&gt;, and your next git command on this machine would run it. devvm protects them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;On macOS,&lt;/strong&gt; devvm locks the git hooks and config with a flag that even root in the VM can&amp;rsquo;t clear, so nothing the VM does runs through them on this machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On Linux,&lt;/strong&gt; devvm makes them read-only in the VM&amp;rsquo;s own view of the folder, which root in the VM can&amp;rsquo;t change either (&lt;a href="#linux-hosts"&gt;Linux hosts&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nested repos:&lt;/strong&gt; it does the same for each git repo nested in the folder that it has found, such as the repos of a folder that holds several, but a repo or a submodule that the VM adds while it runs is git&amp;rsquo;s to use before devvm finds it (&lt;a href="#nested-repos"&gt;nested repos&lt;/a&gt;, &lt;a href="#not-covered"&gt;not covered&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Only &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; keeps the VM&amp;rsquo;s code away from git on this machine.&lt;/p&gt;
&lt;p&gt;Every new VM gets &lt;code&gt;.git&lt;/code&gt; protection. &lt;code&gt;--no-git-protect&lt;/code&gt; creates a VM without it, and &lt;a href="#turning-it-on-or-off"&gt;&lt;code&gt;devvm git-protect&lt;/code&gt;&lt;/a&gt; changes it later. &lt;a href="https://next.devvm.dev/docs/internals/git-protection/"&gt;How it works › .git protection&lt;/a&gt; lists what devvm locks and when it checks the locks again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-still-works"&gt;What still works&lt;span class="hx:absolute hx:-mt-20" id="what-still-works"&gt;&lt;/span&gt;
&lt;a href="#what-still-works" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;git in the VM can commit, branch, check out, stash, fetch and pull, and &lt;code&gt;git worktree add&lt;/code&gt; works on this machine. Commands that write &lt;code&gt;.git/config&lt;/code&gt; fail in the VM, and on macOS they fail on this machine too, with &lt;code&gt;Operation not permitted&lt;/code&gt;. Those are &lt;code&gt;git config&lt;/code&gt;, &lt;code&gt;git remote add&lt;/code&gt;, &lt;code&gt;push -u&lt;/code&gt; to a new branch, and hook installers such as husky or pre-commit. On macOS, &lt;code&gt;git worktree remove&lt;/code&gt; and &lt;code&gt;prune&lt;/code&gt; also fail for the worktrees that were there when devvm locked &lt;code&gt;.git&lt;/code&gt;. On Linux, these commands work on this machine as usual, and the VM sees what they change (&lt;a href="#linux-hosts"&gt;Linux hosts&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;To run them on macOS, stop the VM, unlock &lt;code&gt;.git&lt;/code&gt;, run the commands on this machine, and lock it again:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm stop
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm git-protect off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git config …
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm git-protect on&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="turning-it-on-or-off"&gt;Turning it on or off&lt;span class="hx:absolute hx:-mt-20" id="turning-it-on-or-off"&gt;&lt;/span&gt;
&lt;a href="#turning-it-on-or-off" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm git-protect &lt;span class="c1"&gt;# show this folder&amp;#39;s VM&amp;#39;s protection: on, off or clone&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm git-protect off &lt;span class="c1"&gt;# take the locks off&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm git-protect on &lt;span class="c1"&gt;# lock .git as it is now&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm git-protect&lt;/code&gt; shows the VM&amp;rsquo;s protection, which is &lt;code&gt;on&lt;/code&gt;, &lt;code&gt;off&lt;/code&gt;, or &lt;code&gt;clone&lt;/code&gt; for a &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; VM, which mounts no &lt;code&gt;.git&lt;/code&gt;. &lt;code&gt;devvm git-protect on&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt; changes it at once when the VM is stopped. A running VM could race the locks, so for a running VM devvm saves your choice and asks in a terminal whether to restart the VM now, which stops anything running in it. If you answer no, or there&amp;rsquo;s no terminal, or you pass &lt;code&gt;--no-input&lt;/code&gt;, devvm says it saved the choice. It applies the choice the next time it finds the VM stopped: at the restart you agreed to, at &lt;code&gt;devvm stop&lt;/code&gt;, at &lt;code&gt;devvm restart&lt;/code&gt;, or, when the VM was stopped some other way, at the next launch, before the VM starts. Until then, &lt;code&gt;devvm git-protect&lt;/code&gt; shows the protection the VM has, and a later choice replaces the saved one. Launches lock only a stopped VM for the same reason.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;on&lt;/code&gt; locks &lt;code&gt;.git&lt;/code&gt; as it is now and takes it as yours, so a &lt;code&gt;.git&lt;/code&gt; that was replaced since the last lock isn&amp;rsquo;t reported, and the next launches compare with this one. It reports what &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#what-a-lock-cant-stop"&gt;a lock can&amp;rsquo;t stop&lt;/a&gt; and what&amp;rsquo;s &lt;a href="#not-covered"&gt;not covered&lt;/a&gt;, as devvm did when it made the VM. If the folder has no &lt;code&gt;.git&lt;/code&gt; yet, devvm locks it on the first launch after one appears. The locks don&amp;rsquo;t reach a submodule or a nested repo that the VM adds while it runs, so git on this machine runs what that repo&amp;rsquo;s config and hooks say, such as its &lt;code&gt;core.fsmonitor&lt;/code&gt;, until &lt;code&gt;devvm stop&lt;/code&gt; or the next launch that finds the VM stopped names it and locks it (&lt;a href="#not-covered"&gt;not covered&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;off&lt;/code&gt; takes the locks off. The VM can then change &lt;code&gt;.git&lt;/code&gt; hooks and config, which run on your machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On an existing VM, devvm ignores &lt;code&gt;--no-git-protect&lt;/code&gt; and warns you. A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s protection can&amp;rsquo;t be changed. &lt;code&gt;devvm clone on&lt;/code&gt; takes the locks off once it has made the VM again with its own clone, and &lt;code&gt;devvm clone off&lt;/code&gt; makes it mount the folder again with protection as a new VM gets it (&lt;a href="https://next.devvm.dev/docs/using/clone/#switching-a-vm-that-exists"&gt;switching a VM that exists&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-git-protect-json"&gt;devvm git-protect &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-git-protect-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-git-protect-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm git-protect --json&lt;/code&gt; prints the VM&amp;rsquo;s protection as one JSON object with &lt;code&gt;mode&lt;/code&gt;, which is &lt;code&gt;on&lt;/code&gt;, &lt;code&gt;off&lt;/code&gt; or &lt;code&gt;clone&lt;/code&gt;, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. With &lt;code&gt;--json&lt;/code&gt; the command only shows, so devvm refuses &lt;code&gt;on&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt; with it.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;mode&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;on&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="vms-that-were-strict"&gt;VMs that were strict&lt;span class="hx:absolute hx:-mt-20" id="vms-that-were-strict"&gt;&lt;/span&gt;
&lt;a href="#vms-that-were-strict" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm git-protect&lt;/code&gt; takes only &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt;. &lt;code&gt;devvm git-protect strict&lt;/code&gt; is a usage error that points to &lt;code&gt;devvm clone on&lt;/code&gt;, which keeps the VM&amp;rsquo;s code away from git on this machine.&lt;/p&gt;
&lt;p&gt;An earlier devvm&amp;rsquo;s &lt;code&gt;strict&lt;/code&gt; set &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; in the locked &lt;code&gt;.git/config&lt;/code&gt;, so that &lt;code&gt;git status&lt;/code&gt; and &lt;code&gt;git diff&lt;/code&gt; on this machine skipped the submodules the VM adds. That couldn&amp;rsquo;t keep git on this machine out of them. A &lt;code&gt;.gitmodules&lt;/code&gt; line that the VM writes, such as &lt;code&gt;ignore = none&lt;/code&gt;, makes &lt;code&gt;git status&lt;/code&gt; enter a submodule again, and &lt;code&gt;git add -A&lt;/code&gt;, &lt;code&gt;git add -u&lt;/code&gt;, &lt;code&gt;git describe --dirty&lt;/code&gt;, &lt;code&gt;git diff-index&lt;/code&gt;, &lt;code&gt;git diff-files&lt;/code&gt;, &lt;code&gt;git fetch&lt;/code&gt; and &lt;code&gt;git pull&lt;/code&gt; enter one whatever the setting says, as does &lt;code&gt;--ignore-submodules&lt;/code&gt; on the command line.&lt;/p&gt;
&lt;p&gt;A VM that was made strict shows as &lt;code&gt;on&lt;/code&gt; at once, in &lt;code&gt;devvm ls&lt;/code&gt;, &lt;code&gt;devvm git-protect&lt;/code&gt; and its &lt;code&gt;--json&lt;/code&gt;, and its locks stay as they are while it runs. The first time devvm finds it stopped, at a launch, at &lt;code&gt;devvm stop&lt;/code&gt;, or at &lt;code&gt;devvm clone on&lt;/code&gt;, or when devvm undoes a &lt;code&gt;devvm clone off&lt;/code&gt; that didn&amp;rsquo;t finish, devvm takes &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; out of the &lt;code&gt;.git/config&lt;/code&gt; of the folder&amp;rsquo;s own repo and of each nested repo the VM protected, unlocking each file for the moment and locking it again. Then it records the VM as &lt;code&gt;on&lt;/code&gt; and says so once, unless you chose &lt;code&gt;devvm git-protect off&lt;/code&gt; while it ran, which it applies next. &lt;code&gt;devvm git-protect on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; take the setting out the same way, without saying so.&lt;/p&gt;
&lt;p&gt;devvm leaves the setting where it can&amp;rsquo;t tell that it set it, and names what it leaves:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;strict doesn&amp;rsquo;t record a value that the setting had before it sets its own, so devvm can&amp;rsquo;t put one back. It takes out only the value &lt;code&gt;all&lt;/code&gt;, so a value that you set since, such as &lt;code&gt;none&lt;/code&gt; or &lt;code&gt;dirty&lt;/code&gt;, stays.&lt;/li&gt;
&lt;li&gt;devvm leaves the setting alone in a repo whose &lt;code&gt;.git&lt;/code&gt; isn&amp;rsquo;t the one it recorded, because strict never set it there: a &lt;code&gt;.git&lt;/code&gt; that the VM replaced, which devvm names, a nested repo that it finds for the first time at that check, and every repo of a VM it has no record of, such as one that &lt;code&gt;devvm adopt&lt;/code&gt; moved. When such a config sets &lt;code&gt;all&lt;/code&gt;, devvm names it once.&lt;/li&gt;
&lt;li&gt;On a Linux host that watches &lt;code&gt;.git&lt;/code&gt;, it also leaves a config that changed since the check read it, which the next check names.&lt;/li&gt;
&lt;li&gt;If git can&amp;rsquo;t change a config, devvm names it, and &lt;code&gt;git status&lt;/code&gt; and &lt;code&gt;git diff&lt;/code&gt; on this machine go on skipping that repo&amp;rsquo;s submodules until you take the setting out yourself.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;.git/config&lt;/code&gt; that another VM&amp;rsquo;s protection also keeps locked keeps the setting, because unlocking it would let that VM change the file if it runs, and devvm names the file and that VM at each launch that finds this VM stopped. devvm takes the setting out at such a check once the other VM no longer keeps the file locked.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To take the setting out of a repo yourself, if you didn&amp;rsquo;t set it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm stop &lt;span class="c1"&gt;# in this VM&amp;#39;s folder, and in the other VM&amp;#39;s when another VM locks the file too&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm git-protect off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git config --file .git/config --unset-all diff.ignoreSubmodules &lt;span class="s1"&gt;&amp;#39;^all$&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;# in that repo&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm git-protect on &lt;span class="c1"&gt;# lock .git again as it is then&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Stop both VMs when another VM keeps the file locked too, because a running VM could change the file while it&amp;rsquo;s unlocked, and a launch into a running VM locks nothing. In that case, run &lt;code&gt;chflags nouchg .git/config&lt;/code&gt; on macOS in place of &lt;code&gt;devvm git-protect off&lt;/code&gt;, and the next launch of either VM finds it stopped and locks the file again, and on Linux the other VM&amp;rsquo;s watch names the change.&lt;/p&gt;
&lt;h2 data-hextra-search-id="when-devvm-reports-git"&gt;When devvm reports .git&lt;span class="hx:absolute hx:-mt-20" id="when-devvm-reports-git"&gt;&lt;/span&gt;
&lt;a href="#when-devvm-reports-git" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every launch of an existing VM, and &lt;code&gt;devvm stop&lt;/code&gt;, check &lt;code&gt;.git&lt;/code&gt; again, and devvm reports what it finds there that it didn&amp;rsquo;t lock. When it names one of these, check it before you run git in the folder, because git on this machine would run what the VM put there:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A repo that appeared&lt;/strong&gt; in the folder after its VM was made, the folder&amp;rsquo;s own or a &lt;a href="#nested-repos"&gt;nested one&lt;/a&gt;. devvm locks it from then on, but if you didn&amp;rsquo;t make it, check its hooks and config.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A submodule that appeared&lt;/strong&gt; with its git folder in the project folder. devvm locks it from then on, but git on this machine may already have run what its config and hooks say (&lt;a href="#not-covered"&gt;not covered&lt;/a&gt;), so if you didn&amp;rsquo;t add it, check them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A nested repo that&amp;rsquo;s gone or moved,&lt;/strong&gt; which the VM could have moved aside to put another in its place.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hooks in a folder devvm hadn&amp;rsquo;t locked,&lt;/strong&gt; because the folder wasn&amp;rsquo;t there to lock or belongs to a new submodule.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A submodule whose git folder isn&amp;rsquo;t one.&lt;/strong&gt; The VM can name any folder in the project as a submodule&amp;rsquo;s git folder, such as your &lt;code&gt;src&lt;/code&gt;, so devvm locks nothing in a folder that doesn&amp;rsquo;t look like a git folder, and names the submodule instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A path that&amp;rsquo;s a symlink or under one.&lt;/strong&gt; devvm never locks anything through a symlink, because the VM could point one at a file elsewhere on this machine, so it leaves that path unlocked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A path that moved while devvm locked it.&lt;/strong&gt; devvm leaves it unlocked and takes the lock off wherever it landed, so check &lt;code&gt;.git&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-each-launch"&gt;How it works › .git protection&lt;/a&gt; lists every check.&lt;/p&gt;
&lt;h2 data-hextra-search-id="nested-repos"&gt;Nested repos&lt;span class="hx:absolute hx:-mt-20" id="nested-repos"&gt;&lt;/span&gt;
&lt;a href="#nested-repos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A folder can hold git repos of its own besides its submodules, such as &lt;code&gt;ws/repo-a&lt;/code&gt; and &lt;code&gt;ws/repo-b&lt;/code&gt; in a folder &lt;code&gt;ws&lt;/code&gt;, whether &lt;code&gt;ws&lt;/code&gt; is a repo itself or only a folder of repos. The VM can write all of them, and git on this machine runs what their &lt;code&gt;.git&lt;/code&gt; holds when you run git there, so devvm protects each one it finds as it protects the folder&amp;rsquo;s own &lt;code&gt;.git&lt;/code&gt;: it locks them on macOS, makes them read-only in the VM on Linux, and watches them on a Linux host that can&amp;rsquo;t lock. It finds them this way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;When:&lt;/strong&gt; when it creates the VM, at each launch that finds the VM stopped and at &lt;code&gt;devvm stop&lt;/code&gt;. A launch into a running VM doesn&amp;rsquo;t look again, and it doesn&amp;rsquo;t check the nested repos either, so they&amp;rsquo;re checked at the next launch that finds the VM stopped, or at &lt;code&gt;devvm stop&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where:&lt;/strong&gt; up to four folders below the project folder, for anything named &lt;code&gt;.git&lt;/code&gt; (on macOS, &lt;code&gt;.GIT&lt;/code&gt; as well). It doesn&amp;rsquo;t look in the folders that package managers and build tools fill, &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;vendor&lt;/code&gt;, &lt;code&gt;.venv&lt;/code&gt;, &lt;code&gt;__pycache__&lt;/code&gt; and &lt;code&gt;.terraform&lt;/code&gt;, nor in a folder on another disk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How many:&lt;/strong&gt; it protects the first 100 it finds and names the rest, at every check.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What &lt;a href="#what-still-works"&gt;still works&lt;/a&gt; and what doesn&amp;rsquo;t is the same in a nested repo as in the folder&amp;rsquo;s own: &lt;code&gt;git config&lt;/code&gt;, &lt;code&gt;git remote add&lt;/code&gt; and hook installers fail there on macOS, so run them with protection off. devvm keeps protecting a nested repo for as long as anything is at its &lt;code&gt;.git&lt;/code&gt;, even when that &lt;code&gt;.git&lt;/code&gt; no longer looks like a repo&amp;rsquo;s, because the VM can change it back at any time.&lt;/p&gt;
&lt;p&gt;When you don&amp;rsquo;t need the VM to write your working trees, &lt;code&gt;devvm --clone&lt;/code&gt; in a folder of repos keeps the VM out of all of them instead:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ws &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm --clone &lt;span class="c1"&gt;# a VM with its own clone of each repo you choose, mounting none of them&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone fetch &lt;span class="c1"&gt;# bring the VM&amp;#39;s work back&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The VM gets a clone of each repo you choose, at the same path, and mounts nothing of this machine, so it can&amp;rsquo;t reach any repo&amp;rsquo;s working tree or &lt;code&gt;.git&lt;/code&gt; here, and none of what this page describes applies to it (&lt;a href="https://next.devvm.dev/docs/using/clone/#folders-of-repos"&gt;folders of repos&lt;/a&gt;). You get its work back with &lt;code&gt;devvm clone fetch&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;devvm can&amp;rsquo;t protect a repo before it has found it, so when you run git in a folder of a VM&amp;rsquo;s project while the VM runs, the protection holds only for the repos devvm has already found:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A repo the VM makes in the folder while it runs, by cloning one or by making a &lt;code&gt;.git&lt;/code&gt; in a folder of yours, is git&amp;rsquo;s repo for that folder from the moment it&amp;rsquo;s there: your &lt;code&gt;git status&lt;/code&gt; in the folder, and the shell prompts and editors that run git as you open it, run what its config says.&lt;/li&gt;
&lt;li&gt;devvm names such a repo only at the next launch that finds the VM stopped, or at &lt;code&gt;devvm stop&lt;/code&gt;, with the settings in its config and the hooks that run programs, and then locks it as it is, so check what it names before you run git there.&lt;/li&gt;
&lt;li&gt;A repo the VM makes more than four folders down, or in a folder devvm doesn&amp;rsquo;t look in, is never named, only counted where devvm walks the folder for set-id files on Linux.&lt;/li&gt;
&lt;li&gt;On Linux the VM can also move a nested repo&amp;rsquo;s folder aside and put another repo in its place while it runs, which devvm names only if it&amp;rsquo;s still in place when the VM stops (&lt;a href="#linux-hosts"&gt;Linux hosts&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="bare-repos"&gt;Bare repos&lt;span class="hx:absolute hx:-mt-20" id="bare-repos"&gt;&lt;/span&gt;
&lt;a href="#bare-repos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;git also takes a folder shaped like a git folder, with a &lt;code&gt;HEAD&lt;/code&gt;, &lt;code&gt;objects&lt;/code&gt; and &lt;code&gt;refs&lt;/code&gt;, for a bare repo, and its config can name a work tree, so git run in a folder below one uses it, &lt;code&gt;core.fsmonitor&lt;/code&gt; and all. The VM can make one anywhere in the folder. devvm names the ones it finds up to four folders down that aren&amp;rsquo;t a repo&amp;rsquo;s own git folder, and &lt;code&gt;devvm doctor&lt;/code&gt; gives a tip when git on this machine takes a bare repo it isn&amp;rsquo;t told to use. git 2.38 and newer can refuse that: &lt;code&gt;git config --global safe.bareRepository explicit&lt;/code&gt; makes git use a bare repo only when you name it, with &lt;code&gt;--git-dir&lt;/code&gt; or &lt;code&gt;GIT_DIR&lt;/code&gt;. devvm only checks the setting, and never changes your git config.&lt;/p&gt;
&lt;h3 data-hextra-search-id="vms-an-earlier-devvm-made"&gt;VMs an earlier devvm made&lt;span class="hx:absolute hx:-mt-20" id="vms-an-earlier-devvm-made"&gt;&lt;/span&gt;
&lt;a href="#vms-an-earlier-devvm-made" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM that an earlier devvm made protects only the folder&amp;rsquo;s own repo. The first time devvm finds nested repos in its folder, it names them once and tells you to run &lt;code&gt;devvm git-protect on&lt;/code&gt;, which protects them all from then on. Until you do, devvm names each nested repo it finds that it hadn&amp;rsquo;t named before.&lt;/p&gt;
&lt;h3 data-hextra-search-id="two-vms-one-repo"&gt;Two VMs, one repo&lt;span class="hx:absolute hx:-mt-20" id="two-vms-one-repo"&gt;&lt;/span&gt;
&lt;a href="#two-vms-one-repo" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A nested repo can have a VM of its own, and then two VMs protect it. On macOS, the flag that locks it is the same for both, so &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm git-protect off&lt;/code&gt; for one VM leaves locked what the other VM still protects, and names that VM. Run &lt;code&gt;devvm git-protect off&lt;/code&gt; for the other VM too when you want the locks off. When devvm can&amp;rsquo;t read another VM&amp;rsquo;s state, it leaves locked what that VM may protect, and names the state to fix. On Linux, each VM has its own read-only view, so each protects the repo from its own VM.&lt;/p&gt;
&lt;p&gt;A nested repo devvm stopped protecting, because it&amp;rsquo;s gone or moved, keeps its locks until devvm takes them off with the rest, at &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm git-protect off&lt;/code&gt;. When it&amp;rsquo;s no longer in the folder, devvm can&amp;rsquo;t find it to unlock it, so it names it, and &lt;code&gt;chflags -R nouchg&lt;/code&gt; on its &lt;code&gt;.git/hooks&lt;/code&gt; and &lt;code&gt;.git/config&lt;/code&gt; takes the locks off.&lt;/p&gt;
&lt;h2 data-hextra-search-id="not-covered"&gt;Not covered&lt;span class="hx:absolute hx:-mt-20" id="not-covered"&gt;&lt;/span&gt;
&lt;a href="#not-covered" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The lock covers &lt;code&gt;.git&lt;/code&gt;, and the VM can still put things elsewhere that git on this machine runs. devvm tells you about each of these, so read what it reports before you run git in the folder, and use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; for a repo you don&amp;rsquo;t trust.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hooks in the working tree&lt;/strong&gt;, such as husky&amp;rsquo;s &lt;code&gt;.husky/&lt;/code&gt; with &lt;code&gt;core.hooksPath=.husky&lt;/code&gt;, or an absolute path into the project folder. The VM can edit them, and they run on this machine. devvm warns about them when it creates the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What the locked files hand over to the project folder&lt;/strong&gt;, which is an &lt;code&gt;include.path&lt;/code&gt; or &lt;code&gt;includeIf.*.path&lt;/code&gt; that leads into it, or a hook that&amp;rsquo;s a symlink into it. The VM can edit those files, and git on this machine reads or runs them. devvm warns about them when it creates the VM, and on a launch after they change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Submodules whose git folder is outside the project.&lt;/strong&gt; devvm can&amp;rsquo;t lock that folder, because another project&amp;rsquo;s VM may write it, and &lt;code&gt;git status&lt;/code&gt; on this machine reads its config. devvm names these submodules when it creates the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A submodule the VM adds.&lt;/strong&gt; The VM writes &lt;code&gt;.git/index&lt;/code&gt;, because it has to in order to commit, so it can add a submodule with a git folder of its own anywhere in the project folder. Whenever git on this machine enters that submodule, it reads the submodule&amp;rsquo;s config and runs its hooks, so its &lt;code&gt;core.fsmonitor&lt;/code&gt; runs on this machine. &lt;code&gt;git status&lt;/code&gt;, &lt;code&gt;git diff&lt;/code&gt;, &lt;code&gt;git add -A&lt;/code&gt; and &lt;code&gt;git describe --dirty&lt;/code&gt; all enter it, and so do the shell prompts and editors that run them. devvm names the submodule and locks its git folder only at &lt;code&gt;devvm stop&lt;/code&gt; or at the next launch that finds the VM stopped (&lt;a href="#when-devvm-reports-git"&gt;when devvm reports .git&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A replaced &lt;code&gt;.git&lt;/code&gt;.&lt;/strong&gt; The VM can rename &lt;code&gt;.git&lt;/code&gt; and put a new one in its place, or point git at another config. devvm reports this on each launch but doesn&amp;rsquo;t undo it (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#what-a-lock-cant-stop"&gt;what a lock can&amp;rsquo;t stop&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Some of the git repos nested in the folder.&lt;/strong&gt; devvm protects each repo it finds below the project folder (&lt;a href="#nested-repos"&gt;nested repos&lt;/a&gt;), but not one more than four folders down, one in a folder that a package manager fills, such as &lt;code&gt;node_modules&lt;/code&gt;, one on another disk, or one past the first 100. It doesn&amp;rsquo;t lock the git folder that a nested repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; file names unless that&amp;rsquo;s another repo&amp;rsquo;s that devvm locks, and a git folder outside the project folder it can&amp;rsquo;t lock at all. The VM can set &lt;code&gt;core.fsmonitor&lt;/code&gt; in such a repo&amp;rsquo;s config, and your next &lt;code&gt;git status&lt;/code&gt; there runs it. devvm names the ones it finds and doesn&amp;rsquo;t protect, and counts those on other disks, so check them before you run git there, or move them out of the folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo the VM makes while it runs&lt;/strong&gt;, and a &lt;a href="#bare-repos"&gt;bare repo&lt;/a&gt; it makes. git on this machine uses either as soon as it&amp;rsquo;s there, and devvm finds it only once the VM stops (&lt;a href="#nested-repos"&gt;nested repos&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="linux-hosts"&gt;Linux hosts&lt;span class="hx:absolute hx:-mt-20" id="linux-hosts"&gt;&lt;/span&gt;
&lt;a href="#linux-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On Linux, devvm runs each VM&amp;rsquo;s QEMU in a user namespace of its own, without root, and there it makes the paths that macOS&amp;rsquo;s flag would lock read-only: the hooks and config of &lt;code&gt;.git&lt;/code&gt; and of its submodules, and the rest of &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#whats-locked"&gt;what&amp;rsquo;s locked&lt;/a&gt;. The VM reaches the project folder only through QEMU, so root in the VM gets &lt;code&gt;Read-only file system&lt;/code&gt; when it writes one of them, and &lt;code&gt;Device or resource busy&lt;/code&gt; when it renames or removes one, or renames &lt;code&gt;.git&lt;/code&gt; itself.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;a href="#nested-repos"&gt;nested repo&lt;/a&gt;&amp;rsquo;s own folder isn&amp;rsquo;t pinned, so the VM can still rename the folder, &lt;code&gt;.git&lt;/code&gt; and all, and put another repo in its place, which devvm reports at the next check as a replaced &lt;code&gt;.git&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Nothing changes on this machine: your own git commands write &lt;code&gt;.git/config&lt;/code&gt; as usual, and the read-only view ends when the VM stops.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm git-protect&lt;/code&gt; works as it does on macOS, and a change to a running VM&amp;rsquo;s protection applies at its next start.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="devvm-callout devvm-callout-warning"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 1h1v1H5ZM4 2h1v1H4ZM6 2h1v1H6ZM4 3h1v1H4ZM6 3h1v1H6ZM3 4h1v1H3ZM7 4h1v1H7ZM3 5h1v1H3ZM5 5h1v1H5ZM7 5h1v1H7ZM2 6h1v1H2ZM5 6h1v1H5ZM8 6h1v1H8ZM2 7h1v1H2ZM5 7h1v1H5ZM8 7h1v1H8ZM1 8h1v1H1ZM9 8h1v1H9ZM1 9h1v1H1ZM5 9h1v1H5ZM9 9h1v1H9ZM0 10h1v1H0ZM10 10h1v1H10ZM0 11h11v1H0Z"/&gt;&lt;/svg&gt; Warning&lt;/p&gt;&lt;p&gt;Start VMs with devvm. A VM that &lt;code&gt;limactl start&lt;/code&gt; starts runs without the read-only view, and so does one whose view went for another reason, so each launch of a running VM, and &lt;code&gt;devvm stop&lt;/code&gt;, check that the VM still can&amp;rsquo;t rename &lt;code&gt;.git&lt;/code&gt; and still sees its hooks and config read-only, and name what it doesn&amp;rsquo;t: run &lt;code&gt;devvm restart&lt;/code&gt; then. If devvm&amp;rsquo;s own process that runs the VM ends, the VM ends with it at once, as if you pulled its power, so it never runs without the view.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;Because a lock in the VM&amp;rsquo;s view covers one name of a file, devvm also &lt;a href="#when-devvm-names-a-change"&gt;watches&lt;/a&gt; &lt;code&gt;.git&lt;/code&gt; as a Linux host without locks does, and names what changed at each launch that finds the VM stopped and at &lt;code&gt;devvm stop&lt;/code&gt;. That includes your own changes, such as a &lt;code&gt;git remote add&lt;/code&gt; or &lt;code&gt;git push -u&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="when-git-on-this-machine-replaces-a-locked-file"&gt;When git on this machine replaces a locked file&lt;span class="hx:absolute hx:-mt-20" id="when-git-on-this-machine-replaces-a-locked-file"&gt;&lt;/span&gt;
&lt;a href="#when-git-on-this-machine-replaces-a-locked-file" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The VM sees your changes, because its view is the same folder. A git command on this machine that writes &lt;code&gt;.git/config&lt;/code&gt;, such as &lt;code&gt;git config&lt;/code&gt;, &lt;code&gt;git remote add&lt;/code&gt; or &lt;code&gt;git push -u&lt;/code&gt;, writes a new file and renames it over the old one, and the new file isn&amp;rsquo;t read-only in the VM until devvm locks it again. devvm watches the folders of what it locks, so it locks the new file within milliseconds, but until then the VM can change it, replace it with a file of its own, which devvm then locks as yours, or open it to write it later, which the lock doesn&amp;rsquo;t stop. A VM running code that watches for that moment can use it, so this is a real gap whenever you change a locked file on this machine while the VM runs.&lt;/p&gt;
&lt;p&gt;devvm doesn&amp;rsquo;t stop it, but it names it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At &lt;code&gt;devvm stop&lt;/code&gt;, or at the next launch when the VM stopped another way, devvm names each file it locked again, once however often it happened, and the watch names each one whose contents changed.&lt;/li&gt;
&lt;li&gt;If devvm couldn&amp;rsquo;t record whether its locks held while the VM ran, it says so then, and you should check &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s hooks and config yourself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Check what it names before you run git in the folder, or stop the VM before you change its &lt;code&gt;.git&lt;/code&gt; on this machine.&lt;/p&gt;
&lt;h3 data-hextra-search-id="hard-links"&gt;Hard links&lt;span class="hx:absolute hx:-mt-20" id="hard-links"&gt;&lt;/span&gt;
&lt;a href="#hard-links" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A lock in the VM&amp;rsquo;s view covers one name of a file, and macOS&amp;rsquo;s flag covers the file itself, whatever its names. So devvm doesn&amp;rsquo;t start a VM whose &lt;code&gt;.git/config&lt;/code&gt;, or a hook in a locked hooks folder, has another name (a hard link), because the VM could change the file through that other name. Make it a file of its own, by copying it and moving the copy over it, and start the VM again. A file that gets another name while the VM runs isn&amp;rsquo;t locked again, and devvm names it when the VM stops.&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-else-differs-in-the-vm"&gt;What else differs in the VM&lt;span class="hx:absolute hx:-mt-20" id="what-else-differs-in-the-vm"&gt;&lt;/span&gt;
&lt;a href="#what-else-differs-in-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Two more things work differently in the VM. The VM sees &lt;code&gt;.git&lt;/code&gt; as a file system of its own, so renaming a file between the working tree and &lt;code&gt;.git&lt;/code&gt; fails with &lt;code&gt;Invalid cross-device link&lt;/code&gt;, which &lt;code&gt;mv&lt;/code&gt; handles by copying the file, and git never does. And the VM can&amp;rsquo;t remove or rename a submodule&amp;rsquo;s git folder, so &lt;code&gt;git submodule absorbgitdirs&lt;/code&gt;, or &lt;code&gt;rm -rf&lt;/code&gt; on a submodule, fails while the VM runs.&lt;/p&gt;
&lt;p&gt;A VM that a devvm without these locks made on this machine stays off, and each launch says that devvm can lock it now: run &lt;code&gt;devvm git-protect on&lt;/code&gt; to lock it, or &lt;code&gt;devvm git-protect off&lt;/code&gt; to keep it off and stop the warning.&lt;/p&gt;
&lt;h3 data-hextra-search-id="when-linux-cant-lock"&gt;When Linux can&amp;rsquo;t lock&lt;span class="hx:absolute hx:-mt-20" id="when-linux-cant-lock"&gt;&lt;/span&gt;
&lt;a href="#when-linux-cant-lock" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The locks need a kernel that lets a program make a user namespace and mount in it, which Debian, Fedora, RHEL, openSUSE and Arch do by default. Where the kernel doesn&amp;rsquo;t, devvm doesn&amp;rsquo;t lock &lt;code&gt;.git&lt;/code&gt;, and it &lt;a href="#when-devvm-names-a-change"&gt;watches&lt;/a&gt; it instead. &lt;code&gt;devvm doctor&lt;/code&gt; says why, and what lets devvm lock:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AppArmor&lt;/strong&gt;, on Ubuntu 23.10 and newer, lets only programs that a profile names use a user namespace (&lt;a href="#ubuntu"&gt;Ubuntu&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;kernel.unprivileged_userns_clone&lt;/code&gt; is 0&lt;/strong&gt;, as on Arch&amp;rsquo;s &lt;code&gt;linux-hardened&lt;/code&gt; kernel. &lt;code&gt;sudo sysctl kernel.unprivileged_userns_clone=1&lt;/code&gt; lets devvm lock, until the next boot unless you set it in &lt;code&gt;/etc/sysctl.d/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;user.max_user_namespaces&lt;/code&gt; is 0&lt;/strong&gt;, which &lt;code&gt;sudo sysctl user.max_user_namespaces=15000&lt;/code&gt; changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without the locks, VMs get &lt;code&gt;off&lt;/code&gt; as their mode, devvm refuses &lt;code&gt;devvm git-protect on&lt;/code&gt;, and &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; keeps the VM out of &lt;code&gt;.git&lt;/code&gt; instead, so use it for any repo where you don&amp;rsquo;t trust what runs in the VM. A VM that&amp;rsquo;s on, made when the kernel let devvm lock, doesn&amp;rsquo;t start until it can again, or until you run &lt;code&gt;devvm git-protect off&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="ubuntu"&gt;Ubuntu&lt;span class="hx:absolute hx:-mt-20" id="ubuntu"&gt;&lt;/span&gt;
&lt;a href="#ubuntu" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Ubuntu 23.10 and newer set &lt;code&gt;kernel.apparmor_restrict_unprivileged_userns&lt;/code&gt; to 1, so a program gets a user namespace with the rights to mount in it only when an AppArmor profile names the program with the &lt;code&gt;userns&lt;/code&gt; rule. Ubuntu does that to keep programs that don&amp;rsquo;t need one out of the kernel code behind it. devvm&amp;rsquo;s binary lives in a folder you can write, such as &lt;code&gt;~/.local/lib/devvm/&lt;/code&gt;, and a profile for that path would let any program running as you put itself there and get the same rights, which undoes what Ubuntu set the restriction for. So devvm doesn&amp;rsquo;t ask for a profile, and on Ubuntu with the restriction on it doesn&amp;rsquo;t lock &lt;code&gt;.git&lt;/code&gt;: it &lt;a href="#when-devvm-names-a-change"&gt;watches&lt;/a&gt; it, and &lt;code&gt;devvm doctor&lt;/code&gt; and each launch say so. Use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; there for any repo where you don&amp;rsquo;t trust what runs in the VM.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-warning-at-each-launch"&gt;The warning at each launch&lt;span class="hx:absolute hx:-mt-20" id="the-warning-at-each-launch"&gt;&lt;/span&gt;
&lt;a href="#the-warning-at-each-launch" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On a Linux host that can&amp;rsquo;t lock, each launch of a VM that mounts a folder with a &lt;code&gt;.git&lt;/code&gt;, or with &lt;a href="#nested-repos"&gt;nested repos&lt;/a&gt;, warns that the VM can change their hooks and config, which run on this machine, and names the nested repos devvm doesn&amp;rsquo;t watch. That includes the launch that creates the VM, and launches of a VM that&amp;rsquo;s already running. Once you&amp;rsquo;ve read the warning and decided to go on without protection, run &lt;code&gt;devvm git-protect off&lt;/code&gt; in the folder. devvm records that you chose it and stops warning for that VM, but it still names the changes that the next section describes. A VM that you create with &lt;code&gt;--no-git-protect&lt;/code&gt; doesn&amp;rsquo;t warn either, and a &lt;code&gt;--clone&lt;/code&gt; VM never warns, because it mounts no &lt;code&gt;.git&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="when-devvm-names-a-change"&gt;When devvm names a change&lt;span class="hx:absolute hx:-mt-20" id="when-devvm-names-a-change"&gt;&lt;/span&gt;
&lt;a href="#when-devvm-names-a-change" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On a Linux host that can&amp;rsquo;t lock, devvm can&amp;rsquo;t stop the VM from changing &lt;code&gt;.git&lt;/code&gt;, and on one that locks, the VM can change a file that git on this machine &lt;a href="#when-git-on-this-machine-replaces-a-locked-file"&gt;replaced&lt;/a&gt;, but devvm notices the change afterwards on both. When devvm creates a VM, it records a hash of each of these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;each path that a lock would cover on macOS, which are the hooks in &lt;code&gt;.git/hooks&lt;/code&gt;, &lt;code&gt;.git/config&lt;/code&gt; and the rest of &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#whats-locked"&gt;what&amp;rsquo;s locked&lt;/a&gt;, submodules&amp;rsquo; and &lt;a href="#nested-repos"&gt;nested repos&amp;rsquo;&lt;/a&gt; included&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.git/commondir&lt;/code&gt;, whether it&amp;rsquo;s there or not&lt;/li&gt;
&lt;li&gt;what the config hands over to the project folder: the files that an &lt;code&gt;include.path&lt;/code&gt; leads to, and the hooks folder that &lt;code&gt;core.hooksPath&lt;/code&gt; names, such as husky&amp;rsquo;s &lt;code&gt;.husky&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each launch that finds the VM stopped, and &lt;code&gt;devvm stop&lt;/code&gt;, hash them again and name every path that changed since the last check, such as &lt;code&gt;.git/config&lt;/code&gt; and &lt;code&gt;.git/hooks/pre-commit&lt;/code&gt;. A warning names ten paths at most, and then how many more changed. The same checks report what a lock can&amp;rsquo;t stop either, as they do on macOS: a &lt;code&gt;.git&lt;/code&gt; that was replaced, a &lt;code&gt;commondir&lt;/code&gt;, a repo or submodule that appeared, and includes, hook links and a &lt;code&gt;core.hooksPath&lt;/code&gt; into the project folder (&lt;a href="#not-covered"&gt;not covered&lt;/a&gt;). A launch of a VM that&amp;rsquo;s already running checks nothing, so run &lt;code&gt;devvm stop&lt;/code&gt; when you want the check. A VM that devvm has no hashes for yet, such as one that an older devvm made, records them at its first check and names nothing.&lt;/p&gt;
&lt;p&gt;devvm names a change only after it happened, so git on this machine may already have run a changed hook or read a changed config. devvm can&amp;rsquo;t tell who made a change, so it also names your own, such as a &lt;code&gt;git remote add&lt;/code&gt; or &lt;code&gt;git push -u&lt;/code&gt; that you ran on this machine. When it names a path that you didn&amp;rsquo;t change, check it before you run git in the folder:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git config --list --show-origin&lt;/code&gt; shows each setting of the repo and the file it comes from. Look for settings that run a program, such as &lt;code&gt;core.fsmonitor&lt;/code&gt;, &lt;code&gt;core.hooksPath&lt;/code&gt;, &lt;code&gt;core.sshCommand&lt;/code&gt;, &lt;code&gt;core.pager&lt;/code&gt;, &lt;code&gt;filter.*&lt;/code&gt; and &lt;code&gt;include.path&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ls -la .git/hooks&lt;/code&gt; lists the hooks, and git runs a hook there by its name, such as &lt;code&gt;pre-commit&lt;/code&gt;, so read every file whose name doesn&amp;rsquo;t end in &lt;code&gt;.sample&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you find something that you didn&amp;rsquo;t put there, remove it, and use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; for that repo.&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-the-watch-cant-see"&gt;What the watch can&amp;rsquo;t see&lt;span class="hx:absolute hx:-mt-20" id="what-the-watch-cant-see"&gt;&lt;/span&gt;
&lt;a href="#what-the-watch-cant-see" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The watch isn&amp;rsquo;t a security boundary, and it doesn&amp;rsquo;t stop anything. It compares what&amp;rsquo;s in &lt;code&gt;.git&lt;/code&gt; when the VM is stopped with what was there at the last check, so it misses a change that the VM made and then undid before it stopped, even though git on this machine may have run the change in between. It also can&amp;rsquo;t fully watch some paths, and it names them at every check until they&amp;rsquo;re gone:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A symlink, or a path under one,&lt;/strong&gt; such as a hook that&amp;rsquo;s a symlink, or a &lt;code&gt;.git&lt;/code&gt; that&amp;rsquo;s a symlink. devvm never follows a symlink out of the project folder, so it can&amp;rsquo;t see changes to what such a link points to. For a link that stays inside the project folder, it hashes what the link leads to as well.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file larger than 16 MiB,&lt;/strong&gt; which devvm records by its size, inode and change time, so it notices a change that keeps the size but can&amp;rsquo;t hash the file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A hooks folder with more than 1,000 entries,&lt;/strong&gt; which devvm records by its count and change time. It always hashes the hooks that git runs, at the folder&amp;rsquo;s top, before the rest. The VM can fill a hooks folder to blind the watch, the folder&amp;rsquo;s own or a nested repo&amp;rsquo;s, so devvm names such a folder at every check.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What&amp;rsquo;s past 2,000 paths in all,&lt;/strong&gt; across every git folder and hooks folder of the folder&amp;rsquo;s own repo, or past 200 paths of each &lt;a href="#nested-repos"&gt;nested repo&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A repo rarely has any of these, so when devvm names one that you didn&amp;rsquo;t make, check what it holds, and use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; for that repo.&lt;/p&gt;</description></item><item><title>Installing and updating</title><link>https://next.devvm.dev/docs/internals/install/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/install/</guid><description>
&lt;p&gt;This page explains what devvm&amp;rsquo;s install script downloads and checks, what &lt;code&gt;devvm doctor&lt;/code&gt; checks and what &lt;code&gt;devvm doctor --json&lt;/code&gt; reports, where devvm keeps its own files, what happens to older versions when you upgrade, and how &lt;code&gt;devvm upgrade&lt;/code&gt; checks and installs a release. &lt;a href="https://next.devvm.dev/docs/getting-started/install/"&gt;Installing&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/using/upgrading/"&gt;Upgrading and uninstalling&lt;/a&gt; cover the commands you run.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-install-script"&gt;The install script&lt;span class="hx:absolute hx:-mt-20" id="the-install-script"&gt;&lt;/span&gt;
&lt;a href="#the-install-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The script installs the release it comes with, or the one that &lt;code&gt;--version&lt;/code&gt; names, which may be a prerelease, such as &lt;code&gt;0.2.0-rc.1&lt;/code&gt;. Without either, it installs the latest release, never a prerelease. Before it downloads anything, it checks whether Homebrew installed devvm, which it does when &lt;code&gt;brew&lt;/code&gt; is on &lt;code&gt;PATH&lt;/code&gt;. The check never runs &lt;code&gt;brew&lt;/code&gt;, because Homebrew can download its own Ruby when it runs. Instead, the script looks for a version folder in &lt;code&gt;Cellar/devvm&lt;/code&gt; or &lt;code&gt;Cellar/devvm-rc&lt;/code&gt;, the kegs of Homebrew&amp;rsquo;s two formulas, in each place Homebrew keeps its Cellar: the folder next to the &lt;code&gt;brew&lt;/code&gt; it found on &lt;code&gt;PATH&lt;/code&gt; (&lt;code&gt;&amp;lt;brew's folder&amp;gt;/../Cellar&lt;/code&gt;), &lt;code&gt;HOMEBREW_CELLAR&lt;/code&gt; and &lt;code&gt;HOMEBREW_PREFIX/Cellar&lt;/code&gt; when they&amp;rsquo;re set, and the Cellar in &lt;code&gt;/opt/homebrew&lt;/code&gt;, &lt;code&gt;/usr/local&lt;/code&gt; and &lt;code&gt;/home/linuxbrew/.linuxbrew&lt;/code&gt;. When Homebrew has devvm, the script stops with an error that says to run &lt;code&gt;brew upgrade devvm&lt;/code&gt;, or &lt;code&gt;brew uninstall devvm&lt;/code&gt; first, each naming &lt;code&gt;devvm-rc&lt;/code&gt; for its keg, and exits with status 1, in a terminal or without one. &lt;code&gt;--force&lt;/code&gt; skips this check. Then it installs in four steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It downloads the archive for this machine and the release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt;, over HTTPS only. The archive is &lt;code&gt;devvm-&amp;lt;version&amp;gt;-&amp;lt;os&amp;gt;-&amp;lt;arch&amp;gt;.tar.gz&lt;/code&gt;, where the OS is &lt;code&gt;darwin&lt;/code&gt; or &lt;code&gt;linux&lt;/code&gt; and the processor is &lt;code&gt;arm64&lt;/code&gt; or &lt;code&gt;amd64&lt;/code&gt;. On Apple silicon, the script picks &lt;code&gt;arm64&lt;/code&gt; even when it runs under Rosetta.&lt;/li&gt;
&lt;li&gt;It checks the signatures of &lt;code&gt;SHA256SUMS&lt;/code&gt;, then the archive&amp;rsquo;s checksum, as &lt;a href="#the-signature-and-what-it-trusts"&gt;the signature&lt;/a&gt; describes. When either check fails, it installs nothing.&lt;/li&gt;
&lt;li&gt;It puts devvm, which is one binary with its README, changelog and license, in &lt;code&gt;~/.local/lib/devvm/&amp;lt;version&amp;gt;&lt;/code&gt;, and links &lt;code&gt;~/.local/bin/devvm&lt;/code&gt; to it. When &lt;code&gt;~/.local/bin&lt;/code&gt; isn&amp;rsquo;t on &lt;code&gt;PATH&lt;/code&gt;, the script says how to add it.&lt;/li&gt;
&lt;li&gt;Unless you pass &lt;code&gt;--no-deps&lt;/code&gt;, it runs &lt;code&gt;devvm doctor --json&lt;/code&gt; and offers the &lt;a href="#devvm-doctor---json"&gt;fixes&lt;/a&gt; that devvm reports, asking before each one. Then it runs &lt;code&gt;devvm doctor&lt;/code&gt;, which shows doctor&amp;rsquo;s warnings too, even when nothing is missing.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;At the end, when &lt;code&gt;~/.local/bin&lt;/code&gt; is on &lt;code&gt;PATH&lt;/code&gt;, the script looks up which devvm &lt;code&gt;PATH&lt;/code&gt; finds first with &lt;code&gt;command -v devvm&lt;/code&gt;. It resolves that path&amp;rsquo;s links and those of &lt;code&gt;~/.local/bin/devvm&lt;/code&gt; with &lt;code&gt;readlink -f&lt;/code&gt;, and when they differ it warns, naming the other copy&amp;rsquo;s path and saying to remove it or to put &lt;code&gt;~/.local/bin&lt;/code&gt; first. It only looks the other copy up and never runs it. When &lt;code&gt;~/.local/bin&lt;/code&gt; isn&amp;rsquo;t on &lt;code&gt;PATH&lt;/code&gt;, the script prints only how to add it, so you don&amp;rsquo;t get both.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm doctor&lt;/code&gt; makes the same check. It looks up &lt;code&gt;devvm&lt;/code&gt; on &lt;code&gt;PATH&lt;/code&gt;, resolves its links and those of the running binary, and when they differ it prints a warning naming both. It skips the check when no devvm is on &lt;code&gt;PATH&lt;/code&gt;. The warning doesn&amp;rsquo;t change its exit status, and &lt;code&gt;--json&lt;/code&gt; lists it among the warnings rather than the problems, so the install script doesn&amp;rsquo;t offer it as a fix.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-signature-and-what-it-trusts"&gt;The signature and what it trusts&lt;span class="hx:absolute hx:-mt-20" id="the-signature-and-what-it-trusts"&gt;&lt;/span&gt;
&lt;a href="#the-signature-and-what-it-trusts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;curl … | bash&lt;/code&gt; trusts everything in the release, and Homebrew checks the same archive against a checksum kept outside it. Both install the release&amp;rsquo;s own binary, the one &lt;code&gt;SHA256SUMS&lt;/code&gt; lists and its signature covers, and Homebrew installs only the binary from it:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 534px; --devvm-diagram-width: 397px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 397 534" width="397" height="534" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="dacd40653b3642272--title" aria-describedby="dacd40653b3642272--desc"&gt;&lt;title id="dacd40653b3642272--title"&gt;How each install checks the release&lt;/title&gt;&lt;desc id="dacd40653b3642272--desc"&gt;In the GitHub release, install.sh, with the public key, checks the signature on SHA256SUMS, signed in .minisig, and SHA256SUMS checks the archive for this machine. Homebrew's formula, in a repository of its own, checks the same archive against its own checksum.&lt;/desc&gt;&lt;g class="pele-clusters"&gt;&lt;g class="pele-cluster" data-id="release"&gt;&lt;rect x="96.89" y="135" width="291.8" height="391" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="242.78" y="158.4" text-anchor="middle"&gt;the GitHub release&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_script_sums_0"&gt;&lt;path d="M270.5,252L270.5,312"/&gt;&lt;path class="pele-marker" d="M270.5,319L267.14,311L273.86,311Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_sums_archive_0"&gt;&lt;path d="M270.5,379L270.5,439"/&gt;&lt;path class="pele-marker" d="M270.5,446L267.14,438L273.86,438Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_formula_archive_0"&gt;&lt;path d="M141.82,68L141.82,439"/&gt;&lt;path class="pele-marker" d="M141.82,446L138.46,438L145.18,438Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_script_sums_0"&gt;&lt;rect x="177.41" y="276.5" width="186.18" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="270.5" y="289.7" text-anchor="middle"&gt;checks the signature&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_sums_archive_0"&gt;&lt;rect x="181.86" y="403.5" width="177.27" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="270.5" y="416.7" text-anchor="middle"&gt;checks the checksum&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_formula_archive_0"&gt;&lt;rect x="53.18" y="92.5" width="177.27" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="141.82" y="105.7" text-anchor="middle"&gt;checks its checksum&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="script" transform="translate(270.5,222)"&gt;&lt;rect x="-89.27" y="-30" width="178.55" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;install.sh, with&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;the public key&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="sums" transform="translate(270.5,349)"&gt;&lt;rect x="-98.18" y="-30" width="196.36" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;SHA256SUMS,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;signed in .minisig&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="archive" transform="translate(206.16,476)"&gt;&lt;rect x="-89.27" y="-30" width="178.55" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;the archive&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;for this machine&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="formula" transform="translate(141.82,38)"&gt;&lt;rect x="-133.82" y="-30" width="267.64" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;Homebrew's formula,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;in a repository of its own&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;The release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; lists the checksums of its archives and of its &lt;code&gt;install.sh&lt;/code&gt;, and minisign signatures beside it say who made it. devvm has room for three release keys, CI&amp;rsquo;s, the co-signer&amp;rsquo;s and a recovery key, and a script that holds them accepts &lt;code&gt;SHA256SUMS&lt;/code&gt; when any two of them signed it, each in its own file, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;, &lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt; or &lt;code&gt;SHA256SUMS.recovery.minisig&lt;/code&gt;. Each signature must check out with its own file&amp;rsquo;s key, two different keys must have made them, and each one&amp;rsquo;s trusted comment, which minisign&amp;rsquo;s global signature covers, must be &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt; for the version being installed, so a &lt;code&gt;SHA256SUMS&lt;/code&gt; signed for another release is refused. The script also accepts the signature of the old release key, the maintainer&amp;rsquo;s minisign key, which has signed every release so far, in &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, with the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;. While releases bridge from that key to the three, that signature alone is enough, so the script can install a release from before the three keys, and the devvm upgrade of a devvm from before them can check a release from after, because each release is signed by the old key too.&lt;/p&gt;
&lt;p&gt;The release keys aren&amp;rsquo;t made yet, so the script holds none, and it checks the old key&amp;rsquo;s signature alone, never downloading the release keys&amp;rsquo; signatures. Once they&amp;rsquo;re made, their public halves are in the script, and the old key&amp;rsquo;s is in the script that comes with a release. Without &lt;a href="https://jedisct1.github.io/minisign/" target="_blank" rel="noopener"&gt;minisign&lt;/a&gt; (&lt;code&gt;brew install minisign&lt;/code&gt;), the script says that only the checksum is checked, which can&amp;rsquo;t tell who made the release, prints the commands to check the signatures by hand, and checks only the checksum. A script that isn&amp;rsquo;t from a release has no old key, so for a release without the release keys&amp;rsquo; signatures it also checks only the checksum, and until the release keys are made it has none of those either, so it checks only the checksum of every release.&lt;/p&gt;
&lt;p&gt;The signature catches an archive or a &lt;code&gt;SHA256SUMS&lt;/code&gt; that someone replaced, which the checksum alone can&amp;rsquo;t. It can&amp;rsquo;t catch a release that was replaced whole, because &lt;code&gt;curl … | bash&lt;/code&gt; runs the &lt;code&gt;install.sh&lt;/code&gt; from that same release, key included, so the one-liner trusts GitHub&amp;rsquo;s release files. Homebrew doesn&amp;rsquo;t trust them, because the formula&amp;rsquo;s checksum lives in a repository of its own, and a replaced GitHub release wouldn&amp;rsquo;t match it. You can also download &lt;code&gt;install.sh&lt;/code&gt;, read it and &lt;a href="#checking-the-install-script"&gt;check it&lt;/a&gt; with the key from these docs before you run it, which catches a replaced release too, because that key doesn&amp;rsquo;t come from the release.&lt;/p&gt;
&lt;h3 data-hextra-search-id="checking-the-install-script"&gt;Checking the install script&lt;span class="hx:absolute hx:-mt-20" id="checking-the-install-script"&gt;&lt;/span&gt;
&lt;a href="#checking-the-install-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The release key&amp;rsquo;s public half is:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RWSjzFsn7ETaijKJ2y7F4DtZobXmyv+LmdclJwZP/KmAkLUwOCzWF/2b&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm&amp;rsquo;s README and security policy show the same key. To check the install script with it, you need &lt;a href="https://jedisct1.github.io/minisign/" target="_blank" rel="noopener"&gt;minisign&lt;/a&gt; (&lt;code&gt;brew install minisign&lt;/code&gt;). Download the script, &lt;code&gt;SHA256SUMS&lt;/code&gt; and its signature from the release:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;base&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://github.com/devvmhq/devvm/releases/latest/download
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL -O &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$base&lt;/span&gt;&lt;span class="s2"&gt;/install.sh&amp;#34;&lt;/span&gt; -O &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$base&lt;/span&gt;&lt;span class="s2"&gt;/SHA256SUMS&amp;#34;&lt;/span&gt; -O &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$base&lt;/span&gt;&lt;span class="s2"&gt;/SHA256SUMS.minisig&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then check that the release key signed &lt;code&gt;SHA256SUMS&lt;/code&gt;, check the script against it, and run the script once both checks pass:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;minisign -Vm SHA256SUMS -P RWSjzFsn7ETaijKJ2y7F4DtZobXmyv+LmdclJwZP/KmAkLUwOCzWF/2b
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;shasum -a &lt;span class="m"&gt;256&lt;/span&gt; -c --ignore-missing SHA256SUMS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bash install.sh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;minisign prints &lt;code&gt;Signature and comment signature verified&lt;/code&gt; and a trusted comment that names the release, as in &lt;code&gt;Trusted comment: devvm 0.1.0&lt;/code&gt;, and &lt;code&gt;shasum&lt;/code&gt; prints &lt;code&gt;install.sh: OK&lt;/code&gt;. On Linux without &lt;code&gt;shasum&lt;/code&gt;, &lt;code&gt;sha256sum -c --ignore-missing SHA256SUMS&lt;/code&gt; does the same. When either check fails, don&amp;rsquo;t run the script. The script takes the same options as &lt;code&gt;curl … | bash -s --&lt;/code&gt;, as in &lt;code&gt;bash install.sh --yes&lt;/code&gt;, and it still checks the signature and the archive&amp;rsquo;s checksum itself, as &lt;a href="#the-install-script"&gt;the install script&lt;/a&gt; describes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-devvm-doctor-checks"&gt;What devvm doctor checks&lt;span class="hx:absolute hx:-mt-20" id="what-devvm-doctor-checks"&gt;&lt;/span&gt;
&lt;a href="#what-devvm-doctor-checks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm doctor&lt;/code&gt; checks what &lt;a href="https://next.devvm.dev/docs/backends/lima/#requirements"&gt;Lima&lt;/a&gt;, devvm&amp;rsquo;s backend, needs. It lists everything that&amp;rsquo;s missing, each with what to do, which is the command that installs it when there&amp;rsquo;s one to run. It then lists what Lima can do, which it calls Lima&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt;, each as &lt;code&gt;native&lt;/code&gt;, &lt;code&gt;emulated&lt;/code&gt;, &lt;code&gt;unreviewed&lt;/code&gt; for an emulation that devvm refuses until it&amp;rsquo;s reviewed, or &lt;code&gt;none&lt;/code&gt;. It also says whether Docker is installed, which only &lt;code&gt;--from&lt;/code&gt; with &lt;a href="https://next.devvm.dev/docs/using/from/#images-only-docker-has"&gt;an image only Docker has&lt;/a&gt; needs. When &lt;code&gt;HTTPS_PROXY&lt;/code&gt; is set and &lt;code&gt;~/.config/devvm/ca&lt;/code&gt; has no CA certificates, it says that a proxy that inspects TLS needs its CA there (&lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;It warns in these cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;another devvm comes first on your &lt;code&gt;PATH&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/upgrading/#one-devvm"&gt;one devvm&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;the disk that devvm&amp;rsquo;s images and VMs go on has less free space than building base needs (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#free-space"&gt;free space&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;this machine has less than the 8 GiB of memory or the 4 CPUs that devvm recommends (&lt;a href="https://next.devvm.dev/docs/getting-started/install/#requirements"&gt;requirements&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;a line of your policy files isn&amp;rsquo;t a rule, which VMs&amp;rsquo; proxies skip (&lt;a href="https://next.devvm.dev/docs/safety/network/#rules"&gt;rules&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;a VM&amp;rsquo;s state, its &lt;code&gt;vm.json&lt;/code&gt;, can&amp;rsquo;t be read, or has a section that the package which owns that section can&amp;rsquo;t read, as every command also checks for the VM it finds for a folder. doctor names the VM, or its folder when the file can&amp;rsquo;t be read, and gives the reason, which names the file, and it leaves the file as it is. It doesn&amp;rsquo;t check a value that reads but that a launch refuses, such as a size that isn&amp;rsquo;t a number (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-file-devvm-cant-read"&gt;a file devvm can&amp;rsquo;t read&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;a running VM&amp;rsquo;s proxy runs without its sandbox, or with only part of it, such as on a Linux kernel whose Landlock is older than ABI 6. The proxy writes how it&amp;rsquo;s confined in the VM&amp;rsquo;s &lt;code&gt;run/proxy.confined&lt;/code&gt; once it starts, and doctor names what that file says. doctor also names a proxy with no such file that another devvm binary started, which it tells by the &lt;code&gt;devvm_sha256&lt;/code&gt; in the proxy&amp;rsquo;s config, because that&amp;rsquo;s an older devvm&amp;rsquo;s single process, which has no sandbox. A proxy that this devvm started and that hasn&amp;rsquo;t written the file yet is still starting, so it gets no warning (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It also gives a tip, which isn&amp;rsquo;t a warning, when &lt;code&gt;safe.bareRepository&lt;/code&gt; isn&amp;rsquo;t &lt;code&gt;explicit&lt;/code&gt; in your global or system git config, or in the files that &lt;code&gt;GIT_CONFIG_GLOBAL&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_SYSTEM&lt;/code&gt; name: git then takes any folder shaped like a git folder for a bare repo, so a VM can make one that git run below it uses (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#bare-repos"&gt;bare repos&lt;/a&gt;). doctor only reads the setting.&lt;/p&gt;
&lt;p&gt;Then it says devvm has everything it needs, or it fails. The warnings and tips never make it fail, so a small machine with everything installed passes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-doctor-json"&gt;devvm doctor &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-doctor-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-doctor-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm doctor --json&lt;/code&gt; prints what doctor finds as one JSON object, for scripts such as the install script, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. It prints nothing else, because its problems and warnings are in the JSON, and it succeeds whatever is missing. A failure that stops the check, such as a data folder devvm can&amp;rsquo;t read, still goes to standard error and makes it fail.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;backend&lt;/code&gt; is the backend that doctor checked, &lt;code&gt;lima&lt;/code&gt;, which every new VM gets.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;problems&lt;/code&gt; has what that backend is missing, each with its &lt;code&gt;key&lt;/code&gt;, the &lt;code&gt;fix&lt;/code&gt; command, and the &lt;code&gt;message&lt;/code&gt; that &lt;code&gt;devvm doctor&lt;/code&gt; prints for it. The &lt;code&gt;fix&lt;/code&gt; is a command whose words are separated by spaces, without shell syntax, or &lt;code&gt;null&lt;/code&gt; when there&amp;rsquo;s none to run, for example when virtualization is turned off in the firmware.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;warnings&lt;/code&gt; has the messages of doctor&amp;rsquo;s warnings, which have no keys, because there&amp;rsquo;s nothing for a script to fix. They&amp;rsquo;re about another devvm on &lt;code&gt;PATH&lt;/code&gt;, low free space, a machine with less than 8 GiB of memory or fewer than 4 CPUs, each line of &lt;code&gt;~/.config/devvm/policy&lt;/code&gt;, &lt;code&gt;~/.config/devvm/layers/*.policy&lt;/code&gt; and &lt;code&gt;~/.local/share/devvm/vms/*/policy&lt;/code&gt; that isn&amp;rsquo;t a rule (&lt;code&gt;policy_not_rule&lt;/code&gt;), and each running VM whose proxy runs without its sandbox (&lt;code&gt;proxy_unconfined&lt;/code&gt; and the &lt;code&gt;proxy_unconfined_*&lt;/code&gt; messages, one for each reason).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tips&lt;/code&gt; has the messages of doctor&amp;rsquo;s tips, which aren&amp;rsquo;t problems: git&amp;rsquo;s &lt;code&gt;safe.bareRepository&lt;/code&gt; (&lt;code&gt;doctor_git_bare&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker&lt;/code&gt; says whether Docker is installed, which only &lt;code&gt;--from&lt;/code&gt; with an image that only Docker has needs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;features&lt;/code&gt; has, for each backend, how it has each feature, as &lt;code&gt;native&lt;/code&gt;, &lt;code&gt;emulated&lt;/code&gt;, &lt;code&gt;unreviewed&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;. The example below shows two of Lima&amp;rsquo;s features.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;problems&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;key&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;fix&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;brew install lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;message&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Lima isn&amp;#39;t installed. Run brew install lima to install it.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;warnings&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tips&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;docker&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;features&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;agent-forwarding&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;native&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;disk&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;native&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;These are the keys:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Missing&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;os&lt;/code&gt;, &lt;code&gt;arch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a host the backend runs on&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;macos&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;macOS at the backend&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/backends/lima/#requirements"&gt;minimum&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lima&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lima at its &lt;a href="https://next.devvm.dev/docs/backends/lima/#requirements"&gt;minimum&lt;/a&gt;, working&lt;/td&gt;
&lt;td&gt;&lt;code&gt;brew install lima&lt;/code&gt; (&lt;code&gt;upgrade&lt;/code&gt;, &lt;code&gt;reinstall&lt;/code&gt;) with Homebrew, otherwise none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qemu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;QEMU, on Linux&lt;/td&gt;
&lt;td&gt;your package manager&amp;rsquo;s install (apt, dnf, pacman or zypper), otherwise none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/dev/kvm&lt;/code&gt;, on Linux&lt;/td&gt;
&lt;td&gt;none: turn on virtualization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kvm-access&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;access to &lt;code&gt;/dev/kvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo usermod -aG kvm USER&lt;/code&gt;, then log in again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lima-config&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;no Lima global configs in devvm&amp;rsquo;s Lima home (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;none: move them out&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The install script reads &lt;code&gt;problems&lt;/code&gt; with &lt;code&gt;awk&lt;/code&gt;, so it needs no JSON tool on this machine. It relies on the layout that devvm writes, with one field on each line, and it reads a problem&amp;rsquo;s &lt;code&gt;key&lt;/code&gt;, &lt;code&gt;fix&lt;/code&gt; and &lt;code&gt;message&lt;/code&gt; from their lines, with their escapes undone. It offers to fix three of these keys, asking first, and prints the message for the others:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For &lt;code&gt;lima&lt;/code&gt;, it runs the fix when there is one, which is Homebrew&amp;rsquo;s. Without Homebrew, it offers Lima&amp;rsquo;s latest release instead, which it checks against that release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; and installs into &lt;code&gt;~/.local&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For &lt;code&gt;qemu&lt;/code&gt; and &lt;code&gt;kvm-access&lt;/code&gt;, it runs the fix when there is one, and the fix uses sudo. After you join the &lt;code&gt;kvm&lt;/code&gt; group, the script doesn&amp;rsquo;t run &lt;code&gt;devvm doctor&lt;/code&gt;, because the group applies only to new logins, and it tells you to log out and back in first.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With &lt;code&gt;--yes&lt;/code&gt;, the script answers yes to every question. Without a terminal and without &lt;code&gt;--yes&lt;/code&gt;, it installs none of the fixes and says so.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvms-own-files"&gt;devvm&amp;rsquo;s own files&lt;span class="hx:absolute hx:-mt-20" id="devvms-own-files"&gt;&lt;/span&gt;
&lt;a href="#devvms-own-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm is one binary. Its own files are built into it, so a copy of it runs anywhere. They are &lt;code&gt;base.yaml&lt;/code&gt;, base&amp;rsquo;s scripts and policy, the features, the shared tools&amp;rsquo; config and build script, what devvm sends into VMs, and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion. The binary is the only copy, and devvm never writes them to a folder of its own that outlives a run. Lima gets &lt;code&gt;base.yaml&lt;/code&gt; on &lt;code&gt;limactl create&lt;/code&gt;&amp;rsquo;s standard input, VMs&amp;rsquo; proxies read devvm&amp;rsquo;s built-in policies from the binary, and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s build writes the conversion&amp;rsquo;s scripts into its own temporary folder, which it deletes when the build ends. So editing a file on disk can&amp;rsquo;t change devvm&amp;rsquo;s built-in rules or what goes into an image.&lt;/p&gt;
&lt;h2 data-hextra-search-id="upgrading"&gt;Upgrading&lt;span class="hx:absolute hx:-mt-20" id="upgrading"&gt;&lt;/span&gt;
&lt;a href="#upgrading" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When the script installs a new version, it removes the older versions in &lt;code&gt;~/.local/lib/devvm&lt;/code&gt;, except a version that a running VM&amp;rsquo;s proxy, or QEMU on Linux, still runs. A later install removes that version once nothing runs it. A VM&amp;rsquo;s proxy moves to the new version at the VM&amp;rsquo;s next launch (&lt;code&gt;devvm&lt;/code&gt; in its folder), and QEMU moves when the VM next starts.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-upgrade"&gt;devvm upgrade&lt;span class="hx:absolute hx:-mt-20" id="devvm-upgrade"&gt;&lt;/span&gt;
&lt;a href="#devvm-upgrade" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm upgrade&lt;/code&gt; installs a release in Go, with the same files and checks as the install script, and it never runs the script. It reads the newest release&amp;rsquo;s version from where GitHub&amp;rsquo;s &lt;code&gt;releases/latest&lt;/code&gt; redirects, &lt;code&gt;releases/tag/v&amp;lt;version&amp;gt;&lt;/code&gt;, as the script does, so it needs no API and has no rate limit. Every request goes over HTTPS, and a redirect to anything else is refused.&lt;/p&gt;
&lt;p&gt;GitHub&amp;rsquo;s &lt;code&gt;releases/latest&lt;/code&gt; skips the releases marked as prereleases, which are the versions with a suffix, such as &lt;code&gt;0.2.0-rc.1&lt;/code&gt;. devvm upgrade, the daily release check and the install script also refuse a prerelease there, so none of them installs or announces one as the newest release, and a prerelease is installed only when &lt;code&gt;--to&lt;/code&gt; or the script&amp;rsquo;s &lt;code&gt;--version&lt;/code&gt; names it. A record of the daily check that names a prerelease as the newest release counts as no record, and the next check replaces it. Versions compare as semver orders them: the numbers as numbers, a prerelease before its release, and a prerelease&amp;rsquo;s suffix part by part, a number below a word and numbers as numbers, so &lt;code&gt;0.2.0-rc.9&lt;/code&gt; comes before &lt;code&gt;0.2.0-rc.10&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Homebrew&amp;rsquo;s &lt;code&gt;devvm-rc&lt;/code&gt; formula is the one exception, because it follows prereleases. For a devvm that &lt;code&gt;devvm-rc&lt;/code&gt; installed, devvm upgrade and the daily check read the repository&amp;rsquo;s releases feed, &lt;code&gt;releases.atom&lt;/code&gt;, which lists the newest releases, prereleases among them, and needs no API either. The newest version in it, a prerelease or a release, is the newest release for that devvm. The daily check records it as &lt;code&gt;newest&lt;/code&gt; in its record, beside &lt;code&gt;latest&lt;/code&gt;, the newest release in the feed that isn&amp;rsquo;t a prerelease, which stays as it was when the feed lists only prereleases.&lt;/p&gt;
&lt;h3 data-hextra-search-id="how-it-tells-how-devvm-was-installed"&gt;How it tells how devvm was installed&lt;span class="hx:absolute hx:-mt-20" id="how-it-tells-how-devvm-was-installed"&gt;&lt;/span&gt;
&lt;a href="#how-it-tells-how-devvm-was-installed" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;It follows the links of the running binary&amp;rsquo;s path, and it reads only that path, never running anything:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It&amp;rsquo;s the install script&amp;rsquo;s when the binary is &lt;code&gt;devvm&lt;/code&gt; in &lt;code&gt;&amp;lt;prefix&amp;gt;/lib/devvm/&amp;lt;version&amp;gt;&lt;/code&gt;, with a release&amp;rsquo;s version as the folder&amp;rsquo;s name, and &lt;code&gt;&amp;lt;prefix&amp;gt;/bin/devvm&lt;/code&gt; is a link that resolves to that same binary. The prefix comes from the binary&amp;rsquo;s own path, so &lt;code&gt;DEVVM_PREFIX&lt;/code&gt; needs no setting.&lt;/li&gt;
&lt;li&gt;It&amp;rsquo;s Homebrew&amp;rsquo;s when the path has &lt;code&gt;Cellar/devvm/&lt;/code&gt; in it, a keg of Homebrew&amp;rsquo;s &lt;code&gt;devvm&lt;/code&gt; formula, or &lt;code&gt;Cellar/devvm-rc/&lt;/code&gt;, a keg of its &lt;code&gt;devvm-rc&lt;/code&gt; formula, which follows prereleases.&lt;/li&gt;
&lt;li&gt;Anything else is another way. A devvm whose version isn&amp;rsquo;t a release&amp;rsquo;s, such as a checkout&amp;rsquo;s pseudo-version or &lt;code&gt;(devel)&lt;/code&gt;, was built from the source. One with a release&amp;rsquo;s version that wasn&amp;rsquo;t set when it was built, as &lt;code&gt;go install&lt;/code&gt; gives, was installed with &lt;code&gt;go install&lt;/code&gt;. One that has a release&amp;rsquo;s version is a copy of a release somewhere else.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="the-release-keys-and-the-signatures"&gt;The release keys and the signatures&lt;span class="hx:absolute hx:-mt-20" id="the-release-keys-and-the-signatures"&gt;&lt;/span&gt;
&lt;a href="#the-release-keys-and-the-signatures" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The public halves of the three release keys, CI&amp;rsquo;s, the co-signer&amp;rsquo;s and the recovery key&amp;rsquo;s, are built into devvm from &lt;code&gt;packaging/keys&lt;/code&gt;, the same keys the script holds, once they&amp;rsquo;re made. Until then devvm has none of them, and checks each release with the old release key alone, so a release that only the release keys signed is refused. The old release key&amp;rsquo;s public half is built in too, from &lt;code&gt;packaging/minisign.pub&lt;/code&gt;, the file the script that comes with a release gets its key from. So devvm upgrade trusts the keys in the devvm you have, never ones that come with the release. A key that devvm can&amp;rsquo;t read is no key, and so is a set of release keys with a key missing or with one key in two roles, and devvm upgrade refuses to install a release without a key it can read.&lt;/p&gt;
&lt;p&gt;devvm checks minisign&amp;rsquo;s signatures itself. Each signature file holds a signature and a trusted comment, each signed with the file&amp;rsquo;s key. devvm accepts only minisign&amp;rsquo;s default, prehashed signature, marked &lt;code&gt;ED&lt;/code&gt;, which is Ed25519 over the BLAKE2b-512 hash of &lt;code&gt;SHA256SUMS&lt;/code&gt;, and refuses the legacy one, marked &lt;code&gt;Ed&lt;/code&gt;, over the file itself. The signature&amp;rsquo;s key ID must be its key&amp;rsquo;s, and the global signature, Ed25519 over the signature followed by the trusted comment, must verify too. devvm accepts &lt;code&gt;SHA256SUMS&lt;/code&gt; in either of two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Two of the three release keys, in a devvm that has them:&lt;/strong&gt; it downloads &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;, &lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt; and &lt;code&gt;SHA256SUMS.recovery.minisig&lt;/code&gt;, and checks each against its own role&amp;rsquo;s key, never another&amp;rsquo;s. Two of them must check out, with the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt; exactly, and two different keys must have made them, as each role&amp;rsquo;s key is a different key with a different key ID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The old release key, while releases bridge from it:&lt;/strong&gt; when two of the release keys&amp;rsquo; signatures don&amp;rsquo;t check out, it downloads &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; and checks it against the old key, with the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, as the release script writes it. Every release so far is signed this way, and so is each release while the bridge lasts, so the devvm upgrade of 0.1 and 0.2, which knows only this key, can check it. While the bridge lasts, a release that only the old key signed is still accepted.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Either way, a &lt;code&gt;SHA256SUMS&lt;/code&gt; signed for one release can&amp;rsquo;t stand in for another&amp;rsquo;s, and a signature of one form can&amp;rsquo;t stand in for the other&amp;rsquo;s, because their trusted comments differ. When neither way checks out, devvm upgrade installs nothing, and it says the signatures couldn&amp;rsquo;t be downloaded when none of them could. Then the archive for this machine, &lt;code&gt;devvm-&amp;lt;version&amp;gt;-&amp;lt;os&amp;gt;-&amp;lt;arch&amp;gt;.tar.gz&lt;/code&gt; for the binary&amp;rsquo;s own OS and processor, must match its line in &lt;code&gt;SHA256SUMS&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The archive is unpacked into &lt;code&gt;&amp;lt;prefix&amp;gt;/lib/devvm/.&amp;lt;version&amp;gt;.new.&amp;lt;pid&amp;gt;&lt;/code&gt;, beside the version that runs. Only its one top-level folder and the regular files in it are unpacked, at most 512 MiB in all, and an archive with a link, a folder inside that one, or a path out of it is refused. devvm is unpacked with mode 755 and the other files with mode 644.&lt;/p&gt;
&lt;h3 data-hextra-search-id="rollbacks"&gt;Rollbacks&lt;span class="hx:absolute hx:-mt-20" id="rollbacks"&gt;&lt;/span&gt;
&lt;a href="#rollbacks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A server, or someone in the way of one, can offer an older release that&amp;rsquo;s still properly signed. devvm upgrade refuses a newest release older than the running devvm, whatever the flags, and installs an older one only when &lt;code&gt;--to&lt;/code&gt; names it, after a question that says it&amp;rsquo;s older. When the running devvm is a prerelease, an older newest release is what&amp;rsquo;s expected before the prerelease&amp;rsquo;s own release is out, so devvm upgrade says so and installs nothing, without failing. It can&amp;rsquo;t tell a server that keeps offering the release you already have from one with nothing newer, which is a limit of reading the newest release from the server.&lt;/p&gt;
&lt;h3 data-hextra-search-id="switching-the-link"&gt;Switching the link&lt;span class="hx:absolute hx:-mt-20" id="switching-the-link"&gt;&lt;/span&gt;
&lt;a href="#switching-the-link" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;The unpacked folder&amp;rsquo;s devvm runs with &lt;code&gt;--version&lt;/code&gt;, which must print the release&amp;rsquo;s version.&lt;/li&gt;
&lt;li&gt;The folder is renamed to &lt;code&gt;&amp;lt;prefix&amp;gt;/lib/devvm/&amp;lt;version&amp;gt;&lt;/code&gt;. A folder of that version from before is set aside first, and it&amp;rsquo;s put back if a later step fails.&lt;/li&gt;
&lt;li&gt;The link switches in one step: a new link to the new devvm is made beside &lt;code&gt;&amp;lt;prefix&amp;gt;/bin/devvm&lt;/code&gt; and renamed over it, so the link is never missing or half made.&lt;/li&gt;
&lt;li&gt;The new devvm runs again, through the link. When it fails, the link is switched back to the devvm that ran devvm upgrade, and the new folder goes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Then devvm upgrade removes the other versions in &lt;code&gt;&amp;lt;prefix&amp;gt;/lib/devvm&lt;/code&gt;, as the script does: it keeps the new version, the one that ran devvm upgrade, and any version that a running process&amp;rsquo;s command line names, such as a VM&amp;rsquo;s proxy, which it lists with &lt;code&gt;ps&lt;/code&gt;. When &lt;code&gt;ps&lt;/code&gt; fails, it keeps them all. An interrupted upgrade leaves a &lt;code&gt;.&amp;lt;version&amp;gt;.new.&amp;lt;pid&amp;gt;&lt;/code&gt; folder at most. The next upgrade removes it once no process has that pid, so it never takes the folder of an upgrade that&amp;rsquo;s still running, and the script&amp;rsquo;s next install removes it too.&lt;/p&gt;
&lt;p&gt;With Homebrew, devvm upgrade runs &lt;code&gt;brew upgrade devvm&lt;/code&gt;, or &lt;code&gt;brew upgrade devvm-rc&lt;/code&gt; for a &lt;code&gt;devvm-rc&lt;/code&gt; keg, into the run log, after asking, and checks nothing of its own, because Homebrew checks the source against the formula&amp;rsquo;s checksum.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-release-check"&gt;The release check&lt;span class="hx:absolute hx:-mt-20" id="the-release-check"&gt;&lt;/span&gt;
&lt;a href="#the-release-check" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you run devvm in a terminal, it checks at most once a day for a newer release (&lt;a href="https://next.devvm.dev/docs/using/settings/#the-release-check"&gt;the release check&lt;/a&gt;). The check reads only where GitHub&amp;rsquo;s latest devvm release is, over HTTPS, and sends nothing about you or your machine. The latest release is never a prerelease, so the check never announces one. The exception is a devvm that Homebrew&amp;rsquo;s &lt;code&gt;devvm-rc&lt;/code&gt; formula installed, which follows prereleases: its check reads GitHub&amp;rsquo;s list of devvm&amp;rsquo;s newest releases instead, as &lt;a href="#devvm-upgrade"&gt;devvm upgrade&lt;/a&gt; describes, and it announces a newer prerelease or release, whichever is newest.&lt;/p&gt;
&lt;p&gt;The check runs beside the launch, so it never makes devvm wait, and when you&amp;rsquo;re offline it says nothing and tries again the next day. The line comes from what the last check found, so a release that came out since then shows up at the launch after the next check. devvm keeps what the check found in &lt;code&gt;~/.local/share/devvm/cache/release.json&lt;/code&gt;, and &lt;code&gt;devvm doctor&lt;/code&gt; shows it.&lt;/p&gt;</description></item><item><title>Maintaining</title><link>https://next.devvm.dev/docs/contributing/maintaining/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/maintaining/</guid><description>
&lt;p&gt;For maintainers: version bumps and releases. Run the scripts with mise, which puts the pinned minisign on &lt;code&gt;PATH&lt;/code&gt;: &lt;code&gt;mise exec -- scripts/release.sh&lt;/code&gt;. A release you build yourself builds in a container, so you also need podman or Docker for that, though not to push a release&amp;rsquo;s tag for CI.&lt;/p&gt;
&lt;h2 data-hextra-search-id="updating-pinned-versions"&gt;Updating pinned versions&lt;span class="hx:absolute hx:-mt-20" id="updating-pinned-versions"&gt;&lt;/span&gt;
&lt;a href="#updating-pinned-versions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;scripts/bump.sh&lt;/code&gt; moves every version pinned in the repo, so preparing a release&amp;rsquo;s pins is one command:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh --check &lt;span class="c1"&gt;# every pin, by group, against upstream; changes nothing&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh &lt;span class="c1"&gt;# every patch and minor bump, then a summary for the commit message&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh docker pele &lt;span class="c1"&gt;# only these tools, with a named images or e2e tool&amp;#39;s major&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--check&lt;/code&gt; prints each group&amp;rsquo;s pins under its name in brackets, such as &lt;code&gt;[go]&lt;/code&gt;, with each pin&amp;rsquo;s current version and upstream&amp;rsquo;s newest, and whether a bump would be a patch, a minor or a major, or a new digest, commit, checksum or release for a pin that isn&amp;rsquo;t a version. A held pin says which version holds it, and a line that the run wouldn&amp;rsquo;t apply says how to apply it. When upstream&amp;rsquo;s latest is older than a pin, as when a release marker hasn&amp;rsquo;t moved yet, &lt;code&gt;--check&lt;/code&gt; says the pin is newer and &lt;code&gt;bump.sh&lt;/code&gt; leaves it as it is.&lt;/li&gt;
&lt;li&gt;With no tools named, &lt;code&gt;bump.sh&lt;/code&gt; applies every patch and minor bump. It never applies a major, a held pin or a tool that it applies only when named. Naming an images or e2e tool also applies its major. &lt;code&gt;e2e-tools&lt;/code&gt; always applies one, because users get the shared tools&amp;rsquo; new majors as well, and &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; holds what stays.&lt;/li&gt;
&lt;li&gt;It writes a value only if it has the shape of a pin (a version, a 64-hex checksum, a dated release, a commit, an image digest), since some of the edited files run on the host, and it edits nothing unless every value is good. Then it runs the commands that finish a bump: &lt;code&gt;mise lock&lt;/code&gt; for Go and the dev tools, &lt;code&gt;go get&lt;/code&gt; and &lt;code&gt;go mod tidy&lt;/code&gt; for the modules, &lt;code&gt;go get&lt;/code&gt; and &lt;code&gt;hugo mod tidy&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt; for Hextra, &lt;code&gt;npm install --ignore-scripts&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt; and then &lt;code&gt;mise run docs:diagrams&lt;/code&gt; for pele, and actionlint and zizmor for the workflows. If one of those fails, the pins are already edited, and &lt;code&gt;bump.sh&lt;/code&gt; says so.&lt;/li&gt;
&lt;li&gt;It needs &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;jq&lt;/code&gt;, &lt;code&gt;mise&lt;/code&gt; for Go, the dev tools, the end-to-end lock and pele, &lt;code&gt;go&lt;/code&gt; to apply the modules and Hextra, and &lt;code&gt;gh&lt;/code&gt; for the actions.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bump.sh&lt;/code&gt; sends &lt;code&gt;GH_TOKEN&lt;/code&gt;, or else &lt;code&gt;GITHUB_TOKEN&lt;/code&gt;, when one is set, with its calls to GitHub&amp;rsquo;s API and to nothing else, through a header file rather than curl&amp;rsquo;s command line. Without a token, GitHub allows 60 calls an hour from one address, which a CI runner shares with other jobs, and once they&amp;rsquo;re spent it refuses the rest with a &lt;code&gt;403&lt;/code&gt;. A fetch that fails names its URL.&lt;/li&gt;
&lt;li&gt;Every Monday the Pins workflow (&lt;code&gt;.github/workflows/pins.yml&lt;/code&gt;) runs &lt;code&gt;scripts/bump.sh --check&lt;/code&gt; with the workflow&amp;rsquo;s token and opens or updates one issue, &amp;ldquo;Pinned versions to bump&amp;rdquo;, which lists the outdated pins under their groups and the shared tools that &lt;code&gt;e2e-tools&lt;/code&gt; waits for, and closes it once none is left. It never bumps anything, so you run &lt;code&gt;scripts/bump.sh&lt;/code&gt;, then the &lt;code&gt;--from&lt;/code&gt; tier of the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt; when an images or e2e pin moved, because those bumps change images.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tools, by group, as &lt;code&gt;--check&lt;/code&gt; prints them:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;Tools&lt;/th&gt;
&lt;th&gt;What they move&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;images&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;nix&lt;/code&gt;, &lt;code&gt;direnv&lt;/code&gt;, &lt;code&gt;nix-direnv&lt;/code&gt;, &lt;code&gt;mise&lt;/code&gt;, &lt;code&gt;git-lfs&lt;/code&gt;, &lt;code&gt;rustup&lt;/code&gt;, &lt;code&gt;crane&lt;/code&gt;, &lt;code&gt;omb&lt;/code&gt;, &lt;code&gt;eza&lt;/code&gt;, &lt;code&gt;tealdeer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the downloads pinned in &lt;code&gt;assets/&lt;/code&gt;, and devvm&amp;rsquo;s host mise, so &lt;code&gt;scripts/bump.sh nix direnv nix-direnv&lt;/code&gt; moves the &lt;a href="https://next.devvm.dev/docs/internals/images/#the-nix-layer"&gt;nix layer&lt;/a&gt;&amp;rsquo;s three pins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;shared-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cursor&lt;/code&gt;, only when named&lt;/td&gt;
&lt;td&gt;Cursor&amp;rsquo;s CLI in &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;, the one shared tool pinned for users&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;e2e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;e2e-tools&lt;/code&gt;, &lt;code&gt;e2e-from&lt;/code&gt;, &lt;code&gt;e2e-curl&lt;/code&gt;, &lt;code&gt;e2e-ubuntu&lt;/code&gt;, &lt;code&gt;e2e-lima&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the end-to-end tests&amp;rsquo; own pins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;go&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;go&lt;/code&gt;, &lt;code&gt;go-minor&lt;/code&gt; only when named, &lt;code&gt;go-mods&lt;/code&gt;, &lt;code&gt;deadcode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go, its modules and the deadcode task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dev-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dev-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s tools except Go, with their &lt;code&gt;mise.lock&lt;/code&gt; entries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ci&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ci-mise&lt;/code&gt;, &lt;code&gt;actions&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the mise the workflows install, and their actions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;release&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;release-image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the container that every release is built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;docs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hextra&lt;/code&gt;, &lt;code&gt;pele&lt;/code&gt; only when named&lt;/td&gt;
&lt;td&gt;the docs site&amp;rsquo;s theme, and pele, which draws its diagrams&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;go&lt;/code&gt; moves Go to its newest patch release of the minor that &lt;code&gt;go.mod&lt;/code&gt; names, from &lt;code&gt;go.dev/dl&lt;/code&gt;. It edits the &lt;code&gt;go&lt;/code&gt; lines of &lt;code&gt;go.mod&lt;/code&gt; and &lt;code&gt;docs/go.mod&lt;/code&gt;, &lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;go&lt;/code&gt;, and its &lt;code&gt;mise.lock&lt;/code&gt; entries. &lt;code&gt;--check&lt;/code&gt; reports a newer minor on the &lt;code&gt;go-minor&lt;/code&gt; line, and &lt;code&gt;scripts/bump.sh go-minor&lt;/code&gt; moves the same files to it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;go-mods&lt;/code&gt; moves &lt;code&gt;go.mod&lt;/code&gt;&amp;rsquo;s direct modules, the ones the depguard allowlist allows and the tests&amp;rsquo; own, to their newest patch or minor release from the Go module proxy, with &lt;code&gt;go get&lt;/code&gt; and &lt;code&gt;go mod tidy&lt;/code&gt;. The indirect ones move as &lt;code&gt;go mod tidy&lt;/code&gt; needs them. A module&amp;rsquo;s next major has a new path, so &lt;code&gt;--check&lt;/code&gt; reports it and you move it by hand. &lt;code&gt;deadcode&lt;/code&gt; moves the deadcode task&amp;rsquo;s version in &lt;code&gt;mise.toml&lt;/code&gt; to golang.org/x/tools&amp;rsquo; newest release.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dev-tools&lt;/code&gt; moves each of &lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s tools except Go to mise&amp;rsquo;s newest version of it, edits its line and runs &lt;code&gt;mise lock&lt;/code&gt;, so &lt;code&gt;mise.lock&lt;/code&gt; keeps every platform&amp;rsquo;s checksum, and markdownlint-cli2&amp;rsquo;s lock folder in &lt;code&gt;.mise/locks/&lt;/code&gt; moves with it. nilaway has no releases, so its pin is a pseudo-version, which &lt;code&gt;mise latest&lt;/code&gt; prints nothing for. &lt;code&gt;dev-tools&lt;/code&gt; moves a Go tool pinned to a pseudo-version to its newest commit&amp;rsquo;s, from the Go module proxy&amp;rsquo;s &lt;code&gt;@latest&lt;/code&gt; for the module that holds the tool, the longest prefix of its path that the proxy has. A tool with no newest version stops the run with an error, never a change, and so does any failed request to the proxy, except its answer that a prefix isn&amp;rsquo;t a module.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ci-mise&lt;/code&gt; moves the &lt;code&gt;version&lt;/code&gt; that the workflows give jdx/mise-action to base&amp;rsquo;s mise, as the run leaves it, so &lt;code&gt;scripts/bump.sh mise ci-mise&lt;/code&gt; moves both. &lt;code&gt;actions&lt;/code&gt; moves each workflow&amp;rsquo;s &lt;code&gt;uses:&lt;/code&gt; to its newest release&amp;rsquo;s tag, as the tag&amp;rsquo;s commit from &lt;code&gt;gh api&lt;/code&gt;, with the tag in the comment after it, and reports a newer major without applying it. An action in a folder of its repo, such as &lt;code&gt;actions/cache/restore&lt;/code&gt;, moves with its repo&amp;rsquo;s releases.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;release-image&lt;/code&gt; moves &lt;code&gt;release_image&lt;/code&gt; in &lt;code&gt;scripts/release.sh&lt;/code&gt;, the container that every release is built in, to the digest of Docker Hub&amp;rsquo;s newest index of &lt;code&gt;buildpack-deps:trixie-scm&lt;/code&gt;. The digest is the SHA-256 of the index it fetched, which every pull checks the registry&amp;rsquo;s index against, and before it records the digest, it checks that the index has a &lt;code&gt;linux/amd64&lt;/code&gt; and a &lt;code&gt;linux/arm64&lt;/code&gt; image, the two that builders run. Every release trusts this image, because its git, awk, tar and gzip write the release&amp;rsquo;s files, so read what changed in it before you commit a bump (docker-library&amp;rsquo;s &lt;code&gt;repo-info&lt;/code&gt; repository lists each image&amp;rsquo;s packages), and run &lt;code&gt;scripts/repro-check.sh&lt;/code&gt; after it (&lt;a href="#reproducible-releases"&gt;Reproducible releases&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hextra&lt;/code&gt; moves the docs site&amp;rsquo;s theme in &lt;code&gt;docs/go.mod&lt;/code&gt;, and it reminds you to compare the copies of Hextra&amp;rsquo;s files in &lt;code&gt;docs/layouts/&lt;/code&gt; with the new release&amp;rsquo;s. &lt;code&gt;pele&lt;/code&gt; moves pele only when named, because the diagrams need a look on the built site. It runs &lt;code&gt;npm install&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt; with the exact version and no install scripts, which writes &lt;code&gt;docs/package.json&lt;/code&gt; and &lt;code&gt;docs/package-lock.json&lt;/code&gt;, and then draws the diagrams again with &lt;code&gt;mise run docs:diagrams&lt;/code&gt;. The drawing script&amp;rsquo;s self-check fails that step when the new pele no longer measures and writes its small text, such as edge labels, as the script expects (&lt;a href="https://next.devvm.dev/docs/contributing/docs/#writing-docs"&gt;diagrams&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cursor&lt;/code&gt; moves Cursor&amp;rsquo;s CLI only when named, to the release that Cursor&amp;rsquo;s install script fetches, with each platform&amp;rsquo;s SHA-256 computed from its download, because Cursor publishes no checksums. devvm&amp;rsquo;s login and proxy code was read against the pinned release, so read the new one where that code names it, then run &lt;code&gt;e2e-tools&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A hold keeps a pin below a version, and &lt;code&gt;--check&lt;/code&gt; shows the newest version beside it. Go modules and actions take Dependabot&amp;rsquo;s ignore list in &lt;code&gt;.github/dependabot.yml&lt;/code&gt;, which keeps pflag below 1.1.0, because pflag 1.1 prints every boolean flag with &lt;code&gt;[=true|false]&lt;/code&gt; in the help. The other holds are in &lt;code&gt;bump.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;holds&lt;/code&gt;, which keeps Node, the one in &lt;code&gt;mise.toml&lt;/code&gt;, on its major.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bump.sh&lt;/code&gt;&amp;rsquo;s header lists every pin with the tool that moves it, or with &lt;code&gt;-&lt;/code&gt; and the reason it&amp;rsquo;s left, as &lt;code&gt;# pin&lt;/code&gt; lines. &lt;code&gt;TestBumpCoversPins&lt;/code&gt; in &lt;code&gt;internal/structure&lt;/code&gt; finds the pins in &lt;code&gt;assets/&lt;/code&gt;, &lt;code&gt;mise.toml&lt;/code&gt;, both &lt;code&gt;go.mod&lt;/code&gt; files, the workflows, &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;, &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s consts, &lt;code&gt;scripts/release.sh&lt;/code&gt;&amp;rsquo;s container, &lt;code&gt;docs/hugo.yaml&lt;/code&gt; and &lt;code&gt;docs/package.json&lt;/code&gt;&amp;rsquo;s dependencies, without the network, and fails on a pin that no line covers or on a line that covers nothing, so a new pin gets a tool or a reason. The header also says why the pins outside those files are left as they are, such as the Lima that &lt;code&gt;install.sh&lt;/code&gt; installs, which is the newest release checked against its &lt;code&gt;SHA256SUMS&lt;/code&gt;, and the Homebrew formula, whose URLs and checksums &lt;code&gt;release.sh&lt;/code&gt; fills in.&lt;/li&gt;
&lt;li&gt;base&amp;rsquo;s Ubuntu cloud image and its apt packages have nothing to bump: devvm pins the newest image on each machine at its first build of base, and records the newest packages for each key of base at its first build (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt;). &lt;code&gt;docker&lt;/code&gt; moves Docker&amp;rsquo;s packages (&lt;code&gt;assets/layers/docker.sh&lt;/code&gt;), read from its repository for base&amp;rsquo;s Ubuntu release, and its signing key. Packages added to &lt;code&gt;assets/layers/base.sh&lt;/code&gt; or &lt;code&gt;assets/features/&lt;/code&gt; need no pin of their own: they change base&amp;rsquo;s key, whose first build records them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mise&lt;/code&gt; moves base&amp;rsquo;s mise (&lt;code&gt;assets/layers/base.sh&lt;/code&gt;) and devvm&amp;rsquo;s host mise (&lt;code&gt;internal/tools/mise.go&lt;/code&gt;) together: the host one writes the lock base&amp;rsquo;s installs from. &lt;code&gt;TestMisePins&lt;/code&gt; fails when their versions or Linux checksums differ, and base&amp;rsquo;s mise version is in the key of each tool image mise installs, so a bump builds them again.&lt;/li&gt;
&lt;li&gt;The shared tools aren&amp;rsquo;t pinned for users, except Cursor&amp;rsquo;s CLI. Holds go in &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; (&lt;code&gt;node = &amp;quot;24&amp;quot;&lt;/code&gt; stays on that major). &lt;code&gt;testdata/mise.lock&lt;/code&gt; is a fixed lock for the tests.&lt;/li&gt;
&lt;li&gt;Their backends are named in &lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[tool_alias]&lt;/code&gt; table, for every tool that isn&amp;rsquo;t one of mise&amp;rsquo;s own &lt;code&gt;core:&lt;/code&gt; tools, because mise&amp;rsquo;s registry can move a tool to another backend in any release (&lt;a href="https://next.devvm.dev/docs/internals/images/#versions"&gt;versions&lt;/a&gt;). A new shared tool gets its alias there, and &lt;code&gt;TestToolBackendsNamed&lt;/code&gt; fails when a tool that isn&amp;rsquo;t a &lt;code&gt;core:&lt;/code&gt; tool has none, or when its alias isn&amp;rsquo;t the backend that &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt; resolved.&lt;/li&gt;
&lt;li&gt;When opencode&amp;rsquo;s major version changes, or a bump of &lt;code&gt;e2e-tools&lt;/code&gt; moves opencode to a version that adds migrations, refresh &lt;code&gt;internal/vm/testdata/opencode-&amp;lt;version&amp;gt;.sql&lt;/code&gt;, the schema of opencode&amp;rsquo;s database that &lt;code&gt;TestOpencodeCleanSchema&lt;/code&gt; cleans. Print it with &lt;code&gt;sqlite3 ~/.local/share/opencode/opencode.db .schema&lt;/code&gt; in a VM with that opencode, after &lt;code&gt;opencode auth list&lt;/code&gt; has made the database, and copy only the schema, never rows. You can also make the file from the release&amp;rsquo;s &lt;code&gt;packages/core/src/database/schema.gen.ts&lt;/code&gt; in opencode&amp;rsquo;s repo: unwrap its SQL and add the &lt;code&gt;migration&lt;/code&gt; table&amp;rsquo;s line at the end, and it matches &lt;code&gt;.schema&lt;/code&gt; line for line. Name the file for the version, and in the test put each new table in its list of tables that devvm empties or keeps, which the test asks for. A table or a column that holds a login also goes into &lt;code&gt;opencodeLogins&lt;/code&gt; (&lt;code&gt;internal/vm/agents.go&lt;/code&gt;) and the design note&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/contributing/design/#opencodes-database-in-history-exports"&gt;opencode&amp;rsquo;s database in history exports&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e2e-tools&lt;/code&gt;, &lt;code&gt;e2e-from&lt;/code&gt;, &lt;code&gt;e2e-curl&lt;/code&gt; and &lt;code&gt;e2e-ubuntu&lt;/code&gt; move the end-to-end tests&amp;rsquo; own pins, which keep their cached images valid between runs. &lt;code&gt;e2e-tools&lt;/code&gt; resolves &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt; again, with devvm&amp;rsquo;s pinned host mise, for both architectures&amp;rsquo; glibc and musl VMs. &lt;code&gt;e2e-from&lt;/code&gt; moves the digests of &lt;code&gt;node:24&lt;/code&gt;, &lt;code&gt;alpine:3&lt;/code&gt; and &lt;code&gt;ubuntu:26.04&lt;/code&gt; in &lt;code&gt;tests/e2e/from_test.go&lt;/code&gt; to Docker Hub&amp;rsquo;s. &lt;code&gt;e2e-curl&lt;/code&gt; moves &lt;code&gt;curlImage&lt;/code&gt; in &lt;code&gt;tests/e2e/transparent_test.go&lt;/code&gt;, the curl image that the network checks run in containers, to curlimages/curl&amp;rsquo;s newest release, by its digest. &lt;code&gt;e2e-ubuntu&lt;/code&gt; moves &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; in &lt;code&gt;tests/e2e/sandbox_test.go&lt;/code&gt;, the dated release of Ubuntu&amp;rsquo;s cloud image that e2e pins base to in place of the newest, to the newest Ubuntu lists. Ubuntu removes dated releases after a few months, and e2e&amp;rsquo;s going stops its first builds of base: bump &lt;code&gt;e2e-ubuntu&lt;/code&gt; before that. Run &lt;code&gt;e2e-tools&lt;/code&gt; after any change to &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;, because the end-to-end tests refuse a lock resolved from another one (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt;). &lt;code&gt;mise run test&lt;/code&gt; catches it first: &lt;code&gt;TestE2ELockPins&lt;/code&gt; checks the lock&amp;rsquo;s first line against &lt;code&gt;mise.toml&lt;/code&gt; and that it locks each of its tools, and &lt;code&gt;TestE2EUbuntuPins&lt;/code&gt; checks that &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; is a dated release of base&amp;rsquo;s Ubuntu release, which &lt;code&gt;e2e-ubuntu&lt;/code&gt; lists, and that &lt;code&gt;scripts/bump.sh&lt;/code&gt; and &lt;code&gt;tests/e2e&lt;/code&gt; name only that release.&lt;/li&gt;
&lt;li&gt;A shared tool&amp;rsquo;s newest release isn&amp;rsquo;t always published for every platform at once, as when its files are still uploading, or for a few days after a Node release until its musl builds appear. &lt;code&gt;e2e-tools&lt;/code&gt; counts a version that is newer than the one in &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt; as unpublished on a platform when its lock entry has no download with a checksum there, or when &lt;code&gt;mise lock&lt;/code&gt; stops with a &lt;code&gt;404&lt;/code&gt; for that platform&amp;rsquo;s download. It then names the tool, the version and the platform, and stops without editing the lock, so you try again later. When devvm resolves the shared tools for users and a lock entry has no download for a platform, it steps back to an older version (&lt;a href="https://next.devvm.dev/docs/internals/images/#versions"&gt;versions&lt;/a&gt;), but &lt;code&gt;e2e-tools&lt;/code&gt; only waits, and its next run tries the newest version again. While a tool waits, &lt;code&gt;e2e-tools&lt;/code&gt; can&amp;rsquo;t resolve the lock again after a change to &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; either.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--check&lt;/code&gt; reports an unpublished version as waiting for upstream and goes on, so the Pins workflow still passes, and its issue lists the line under Waiting for upstream, so the issue stays open while a tool waits. &lt;code&gt;--check&lt;/code&gt; still reports the other shared tools. When &lt;code&gt;mise lock&lt;/code&gt; stopped on the &lt;code&gt;404&lt;/code&gt;, &lt;code&gt;--check&lt;/code&gt; holds that tool back, at the lock&amp;rsquo;s version or left out when the lock has none, and runs &lt;code&gt;mise lock&lt;/code&gt; again, so another tool&amp;rsquo;s failure still stops the run. Applying &lt;code&gt;e2e-tools&lt;/code&gt; prints mise&amp;rsquo;s output before it stops. A &lt;code&gt;404&lt;/code&gt; counts as unpublished only when it&amp;rsquo;s the only error &lt;code&gt;mise lock&lt;/code&gt; printed, apart from the version and &lt;code&gt;--verbose&lt;/code&gt; lines that end its output, and never when mise only warned about it, and only when the download&amp;rsquo;s file name names an architecture and its address holds the version of exactly one of the tools that mise resolved. A version no newer than the lock&amp;rsquo;s that has no download for a platform still stops the run, because upstream published it, and so does any other failure of &lt;code&gt;mise lock&lt;/code&gt;, with mise&amp;rsquo;s output, such as a checksum that doesn&amp;rsquo;t match, even beside a &lt;code&gt;404&lt;/code&gt;, or a network error.&lt;/li&gt;
&lt;li&gt;While a tool waits, a plain &lt;code&gt;scripts/bump.sh&lt;/code&gt; stops at &lt;code&gt;e2e-tools&lt;/code&gt; before it edits anything, so bump the other pins by name, with &lt;code&gt;scripts/bump.sh TOOL…&lt;/code&gt;. A wait usually ends within a few days. When a line has been under Waiting for upstream for two weeks, look at the tool&amp;rsquo;s release, because a wait that long rarely ends on its own: upstream may have renamed the download, mise&amp;rsquo;s registry may build the wrong address for it, or the tool may have stopped publishing checksums. Each of these needs a fix in mise or a hold on the tool in &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;, not more waiting.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e2e-lima&lt;/code&gt; moves the Lima release that CI&amp;rsquo;s end-to-end workflow installs, &lt;code&gt;LIMA_VERSION&lt;/code&gt; in &lt;code&gt;.github/workflows/e2e.yml&lt;/code&gt;, to Lima&amp;rsquo;s newest release, and &lt;code&gt;LIMA_SHA256&lt;/code&gt; to its &lt;code&gt;Linux-x86_64&lt;/code&gt; tarball&amp;rsquo;s line in that release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt;. Lima&amp;rsquo;s release notes print the SHA-256 of &lt;code&gt;SHA256SUMS&lt;/code&gt; itself, so &lt;code&gt;e2e-lima&lt;/code&gt; checks the downloaded file against that value first and edits nothing when they differ.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/layers/ubuntu-cloud.gpg&lt;/code&gt; is Ubuntu&amp;rsquo;s cloud image signing key (fingerprint &lt;code&gt;D2EB44626FDDC30B513D5BB71A5D6C4C7DB87C81&lt;/code&gt;), from keyserver.ubuntu.com. If Ubuntu changes it, pinning a new image (a first build of base, or &lt;code&gt;devvm rebuild base&lt;/code&gt;) stops with &lt;code&gt;ubuntu_bad_signature&lt;/code&gt;: fetch the new key, check its fingerprint against Ubuntu&amp;rsquo;s announcement, and replace the file (&lt;code&gt;gpg --export FPR&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/layers/ubuntu-archive.gpg&lt;/code&gt; is Ubuntu&amp;rsquo;s archive signing key, &amp;ldquo;Ubuntu Archive Automatic Signing Key (2018)&amp;rdquo; (fingerprint &lt;code&gt;F6ECB3762474EDA9D21B7022871920D1991BC93C&lt;/code&gt;), fetched from keyserver.ubuntu.com by that fingerprint, checked against the fingerprint that &lt;a href="https://wiki.ubuntu.com/SecurityTeam/FAQ" target="_blank" rel="noopener"&gt;Ubuntu&amp;rsquo;s security team lists&lt;/a&gt;, and exported with &lt;code&gt;gpg --export-options export-minimal --export FPR&lt;/code&gt;. devvm checks the &lt;code&gt;InRelease&lt;/code&gt; files of a first build of base against it (&lt;code&gt;ubuntu.ArchiveKeyring&lt;/code&gt;). If Ubuntu signs the archive with a new key, that build stops with &lt;code&gt;packages_refused&lt;/code&gt;: fetch the new key, check its fingerprint the same way, and replace the file. The key must be RSA, because &lt;code&gt;internal/ubuntu/pgp.go&lt;/code&gt; checks only RSA signatures. Moving base to a new Ubuntu release (&lt;code&gt;ubuntu.Series&lt;/code&gt;, &lt;code&gt;ubuntu.Version&lt;/code&gt;) also moves &lt;code&gt;ubuntu.Released&lt;/code&gt;, the day Ubuntu released it, which is the date of that release&amp;rsquo;s own &lt;code&gt;InRelease&lt;/code&gt; (&lt;code&gt;dists/&amp;lt;series&amp;gt;/InRelease&lt;/code&gt;), because devvm refuses a release pocket dated before it.&lt;/li&gt;
&lt;li&gt;Edited scripts change image keys, so the affected images rebuild on next use. An edit to &lt;code&gt;assets/prelude.sh&lt;/code&gt; changes the key of every image and every shared tool image. Build them in a sandbox of their own (&lt;code&gt;LIMA_HOME&lt;/code&gt;, &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;XDG_DATA_HOME&lt;/code&gt;, &lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;) before committing (&lt;code&gt;devvm build docker&lt;/code&gt;, or a VM made with the tools whose build script changed), then &lt;code&gt;devvm gc&lt;/code&gt;, and run the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="known-vulnerabilities"&gt;Known vulnerabilities&lt;span class="hx:absolute hx:-mt-20" id="known-vulnerabilities"&gt;&lt;/span&gt;
&lt;a href="#known-vulnerabilities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;govulncheck checks devvm against the Go vulnerability database. &lt;code&gt;mise run vuln&lt;/code&gt; scans the code twice, once as built for Linux and once as built for macOS, because some files build for only one of them, and it reports a vulnerability only when devvm&amp;rsquo;s code calls the vulnerable function. Two workflows run it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CI&amp;rsquo;s &lt;code&gt;vuln&lt;/code&gt; job&lt;/strong&gt; runs &lt;code&gt;mise run vuln&lt;/code&gt; on every push and pull request that CI runs on, as a job of its own, so a vulnerability published since the last change fails that check alone, and &lt;code&gt;lint&lt;/code&gt; and &lt;code&gt;test&lt;/code&gt; still report.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Vulnerabilities workflow&lt;/strong&gt; (&lt;code&gt;.github/workflows/vuln.yml&lt;/code&gt;) runs every Monday, and you can start it by hand from the Actions tab. It scans &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s code for both systems, then downloads the archives of the latest release and of the newest release, prerelease or not, and checks that &lt;code&gt;SHA256SUMS&lt;/code&gt; lists each archive and matches it. Then it scans each platform&amp;rsquo;s binary with &lt;code&gt;govulncheck -mode=binary&lt;/code&gt;, because a release&amp;rsquo;s binaries keep the Go and modules they were built with.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A binary&amp;rsquo;s scan works differently from the code&amp;rsquo;s. It reports the vulnerable code that the binary holds rather than the calls into it, and it can name a package that isn&amp;rsquo;t linked into the binary at all. Before you release for a vulnerability that only a binary&amp;rsquo;s scan found, check that the binary has it, with &lt;code&gt;go version -m BINARY&lt;/code&gt; for its Go and modules and &lt;code&gt;govulncheck -mode=binary -show traces BINARY&lt;/code&gt; for the code it holds.&lt;/p&gt;
&lt;p&gt;The workflow keeps its findings in one issue, &amp;ldquo;Known vulnerabilities in devvm&amp;rdquo;, which lists each scan&amp;rsquo;s vulnerabilities with the version found and the version that fixes it, and links each one&amp;rsquo;s entry in the database. It comments on the issue whenever the findings change, so a new vulnerability notifies you, and closes the issue once every scan finds nothing. When govulncheck itself fails, the job fails and leaves the issue as it is. Only a scan job with read access runs govulncheck. A second job, the only one that can write issues, reads the scan&amp;rsquo;s findings and updates the issue, and it does so only in a run on &lt;code&gt;main&lt;/code&gt;, so a run started on another branch never closes it. The scans cover devvm&amp;rsquo;s Go code alone, not the packages in the VM images, the pinned tools, Lima, or releases older than the two they scan.&lt;/p&gt;
&lt;p&gt;To fix a vulnerability, move what it&amp;rsquo;s in to the version that fixes it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run vuln &lt;span class="c1"&gt;# what govulncheck finds in your checkout, and the calls that reach it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh go &lt;span class="c1"&gt;# Go&amp;#39;s newest patch release, for one in the standard library&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh go-minor &lt;span class="c1"&gt;# Go&amp;#39;s newest minor release, when only a newer minor has the fix&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh go-mods &lt;span class="c1"&gt;# the direct modules&amp;#39; newest patches and minors, for one in a module&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A module that only &lt;code&gt;go.mod&lt;/code&gt;&amp;rsquo;s indirect requirements hold moves with &lt;code&gt;go get &amp;lt;module&amp;gt;@&amp;lt;fixed version&amp;gt;&lt;/code&gt; and &lt;code&gt;go mod tidy&lt;/code&gt;. Once &lt;code&gt;main&lt;/code&gt; is fixed, its scan passes, but the issue stays open while the latest release or the newest release still has the vulnerability, and it closes only when a release with the fix is the latest. A vulnerability that affects devvm&amp;rsquo;s users calls for a release (&lt;a href="#releasing"&gt;Releasing&lt;/a&gt;), and one that devvm&amp;rsquo;s code reaches only in a way that doesn&amp;rsquo;t matter can wait for the next one.&lt;/p&gt;
&lt;h2 data-hextra-search-id="fuzzing-failures"&gt;Fuzzing failures&lt;span class="hx:absolute hx:-mt-20" id="fuzzing-failures"&gt;&lt;/span&gt;
&lt;a href="#fuzzing-failures" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Fuzz workflow (&lt;code&gt;.github/workflows/fuzz.yml&lt;/code&gt;) fuzzes every target each night and keeps its failures in one issue, &amp;ldquo;Fuzzing found failing inputs&amp;rdquo;, which names each failing target and links the night&amp;rsquo;s run. For each target there, download its &lt;code&gt;crash-&amp;lt;target&amp;gt;&lt;/code&gt; artifact from that run, and fix it as &lt;a href="https://next.devvm.dev/docs/contributing/testing/#fuzzing"&gt;Fuzzing&lt;/a&gt; says:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp ~/Downloads/crash-FuzzNoProxy/* internal/proxy/testdata/fuzz/FuzzNoProxy/ &lt;span class="c1"&gt;# the input, in its target&amp;#39;s seeds&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy$&amp;#39;&lt;/span&gt; ./internal/proxy &lt;span class="c1"&gt;# fails until the code is fixed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Commit the input with the fix and its test. The input stays in the target&amp;rsquo;s corpus, so the target fails on it each night until the fix is on &lt;code&gt;main&lt;/code&gt;, and the issue closes on the first night every target passes (&lt;a href="https://next.devvm.dev/docs/contributing/testing/#the-nightly-run"&gt;the nightly run&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="checking-base-against-ubuntus-newest"&gt;Checking base against Ubuntu&amp;rsquo;s newest&lt;span class="hx:absolute hx:-mt-20" id="checking-base-against-ubuntus-newest"&gt;&lt;/span&gt;
&lt;a href="#checking-base-against-ubuntus-newest" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The end-to-end tests pin base to &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, so they never build base the way a user&amp;rsquo;s first build does, from Ubuntu&amp;rsquo;s newest cloud image and the mirrors&amp;rsquo; newest packages. An upstream change can break those builds before any test sees it. For example, vz&amp;rsquo;s direct kernel boot needs an uncompressed arm64 kernel, and a VM shuts down only when its kernel has &lt;code&gt;gpio_keys&lt;/code&gt;. &lt;code&gt;mise run e2e -- --newest-base&lt;/code&gt; builds base as a user&amp;rsquo;s first build does and runs the checks that prove it works: &lt;code&gt;images&lt;/code&gt;, then &lt;code&gt;project&lt;/code&gt; (a VM that boots, stops, starts again and shuts down) and &lt;code&gt;tools&lt;/code&gt;. &lt;code&gt;--only&lt;/code&gt; chooses other sections in their place.&lt;/p&gt;
&lt;p&gt;The run gives devvm no release to pin. It reads the newest release from Ubuntu&amp;rsquo;s listing, as &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; does, and prints it at its start next to &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;. It runs in a sandbox of its own, which is slot 0&amp;rsquo;s with &lt;code&gt;-newest&lt;/code&gt; added to its Lima home, state folder, Keychain service and lock (&lt;code&gt;~/.lt-e2e-go-newest&lt;/code&gt;, &lt;code&gt;/tmp/devvm-go-e2e-newest&lt;/code&gt;, &lt;code&gt;devvm-go-e2e-newest&lt;/code&gt; and &lt;code&gt;/tmp/devvm-go-e2e-newest.lock&lt;/code&gt;), with each fixed port slot 0&amp;rsquo;s plus 1000. So the cached pinned images in the other sandboxes stay as they are. Each run first deletes its sandbox&amp;rsquo;s images, tool images and package cache, so base is built from nothing, with its packages from the mirrors. The images section checks that devvm pinned the release Ubuntu listed as its newest and that base booted from it. When the newest doesn&amp;rsquo;t boot, a user&amp;rsquo;s devvm falls back to the release before it (&lt;code&gt;origin_no_boot&lt;/code&gt;), so that check fails on the fallback. Its times go in &lt;code&gt;timings/plain-newest/&lt;/code&gt; in slot 0&amp;rsquo;s state folder, apart from the cached runs&amp;rsquo;. &lt;code&gt;--newest-base&lt;/code&gt; can&amp;rsquo;t be combined with &lt;code&gt;--slots&lt;/code&gt; or &lt;code&gt;--slot&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Run it before each release and every week or two between them, on an arm64 Mac (vz) and on a Linux host (QEMU) when you can, because the two boot base differently. At its end, it prints the release Ubuntu listed and the release devvm pinned. When a check fails, it says &lt;code&gt;UPSTREAM DRIFT&lt;/code&gt; and names the release, because a user&amp;rsquo;s first build of base gets the same failure now. Then:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Read the failed check&amp;rsquo;s output and the run log of base&amp;rsquo;s build, which the build&amp;rsquo;s output names (&lt;code&gt;log_details&lt;/code&gt;), in the sandbox&amp;rsquo;s state folder under &lt;code&gt;data/devvm/logs/runs/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;mise run e2e -- --only images&lt;/code&gt; on the pinned release. If it passes, the failure is upstream&amp;rsquo;s, from the newer image or its packages. If it fails too, the fault is devvm&amp;rsquo;s own, so fix that first.&lt;/li&gt;
&lt;li&gt;Fix devvm for the new release, such as a change to &lt;code&gt;assets/layers/base.sh&lt;/code&gt; or to the Lima template. Then run &lt;code&gt;--newest-base&lt;/code&gt; again until it passes.&lt;/li&gt;
&lt;li&gt;Bump &lt;code&gt;e2e-ubuntu&lt;/code&gt; to that release once it passes, so the other end-to-end runs test it too.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Until a fix ships, users can still build base, because devvm&amp;rsquo;s fallback to the release before covers a newest release that doesn&amp;rsquo;t boot. A package that breaks base has no fallback, so a fix for one goes in the next release.&lt;/p&gt;
&lt;h2 data-hextra-search-id="releasing"&gt;Releasing&lt;span class="hx:absolute hx:-mt-20" id="releasing"&gt;&lt;/span&gt;
&lt;a href="#releasing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Once, GitHub:&lt;/strong&gt; the release environment, the rulesets, immutable releases and the co-signer&amp;rsquo;s GitHub App, as &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/"&gt;Setting up GitHub for releases&lt;/a&gt; lists them in order. Until that&amp;rsquo;s done, releases go out with &lt;code&gt;scripts/publish.sh --local&lt;/code&gt;, as &lt;a href="#publishing-from-this-machine"&gt;Publishing from this machine&lt;/a&gt; describes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Once, the keys:&lt;/strong&gt; the three release keys, as &lt;a href="#release-keys"&gt;Release keys&lt;/a&gt; describes, the old release key, a minisign key that signs each release while releases bridge from it, &lt;code&gt;minisign -G -p packaging/minisign.pub -s ~/.minisign/devvm.key&lt;/code&gt; (commit &lt;code&gt;packaging/minisign.pub&lt;/code&gt;; the secret key and its password never go in the repo), and a key git signs tags with (&lt;code&gt;git config user.signingkey&lt;/code&gt;, GPG, or SSH with &lt;code&gt;gpg.format ssh&lt;/code&gt;) that &lt;code&gt;git tag -v&lt;/code&gt; verifies on this machine. Commit its fingerprint in &lt;code&gt;packaging/release-signer&lt;/code&gt;, one per line (&lt;code&gt;#&lt;/code&gt; comments): the GPG fingerprint (&lt;code&gt;gpg --fingerprint&lt;/code&gt;, no spaces), or the SSH key&amp;rsquo;s &lt;code&gt;SHA256:…&lt;/code&gt; (&lt;code&gt;ssh-keygen -lf KEY.pub&lt;/code&gt;). &lt;code&gt;release.sh&lt;/code&gt; refuses a tag signed by any other key, even one git trusts. To rotate, add the new key&amp;rsquo;s line, tag with it, then remove the old one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Between releases,&lt;/strong&gt; each change on &lt;code&gt;main&lt;/code&gt; that someone could notice adds its line to the &lt;code&gt;## Unreleased&lt;/code&gt; section at the bottom of &lt;code&gt;CHANGELOG.md&lt;/code&gt;, in the group of the people who notice it, and its full story as a section of the next release&amp;rsquo;s page in &lt;code&gt;releases/&lt;/code&gt;, in the same commit. A line under the page&amp;rsquo;s title links Unreleased, so the top of the page shows the latest release. Unreleased has no Highlights, because they&amp;rsquo;re written at the release, and a change that affects nobody, such as a refactor, adds no line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Before the release commit, sort the lines by audience.&lt;/strong&gt; List every Unreleased line in a table for the maintainer, with the group it goes in, who notices it and the line itself, and name the close calls, the lines that could go in either of two groups, with the case for each. Once the maintainer approves the table, write the Highlights and the lines as it says. Then someone who didn&amp;rsquo;t write the lines, such as a fresh agent, reviews them with the docs-voice skill, reading the visible part as a user would on GitHub and then each collapsed group, and flags what&amp;rsquo;s vague, padded, repeated across groups or about the notes themselves. Fold in the fixes until the review finds nothing to change.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Each release:&lt;/strong&gt; bump &lt;code&gt;VERSION&lt;/code&gt;, move the Unreleased lines to the top as the release&amp;rsquo;s &lt;code&gt;## &amp;lt;version&amp;gt;&lt;/code&gt; entry, leaving the empty &lt;code&gt;## Unreleased&lt;/code&gt; section at the bottom, and commit it on &lt;code&gt;main&lt;/code&gt;. Then tag main&amp;rsquo;s HEAD and push it, and CI and the co-signer do the rest:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git tag -s v&amp;lt;version&amp;gt; &lt;span class="c1"&gt;# sign the tag with your SSH key&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/publish.sh &lt;span class="c1"&gt;# check the tag, then push main and the tag&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise &lt;span class="nb"&gt;exec&lt;/span&gt; -- scripts/publish.sh --sign-legacy &lt;span class="c1"&gt;# once the co-signer&amp;#39;s draft is there, while the bridge lasts&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Approve the Release workflow&amp;rsquo;s run in the Actions tab, and GitHub emails you when it waits. Approve only a run for the tag you just pushed, because the run is that tag&amp;rsquo;s own workflow, and approving it gives CI&amp;rsquo;s release key to the tag&amp;rsquo;s code. Within the hour, the co-signer rebuilds the release, signs it and makes its draft release, or tells you through its notify command why not. While releases bridge from the old release key, &lt;code&gt;--sign-legacy&lt;/code&gt; adds that key&amp;rsquo;s signature to the draft, asking for its password, and at its next run the co-signer publishes the release and updates the tap. The old key&amp;rsquo;s secret half never leaves this machine, and only minisign reads it, so no CI job and no GitHub secret ever has it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;If a final release changed the state format,&lt;/strong&gt; freeze &lt;code&gt;testdata/v&amp;lt;version&amp;gt;/&lt;/code&gt; once the tag exists: run its &lt;code&gt;generate.sh&lt;/code&gt; against the tag on a Mac and on Linux, and add its tests, as &lt;a href="https://next.devvm.dev/docs/contributing/structure/#freezing-a-releases-state"&gt;Freezing a release&amp;rsquo;s state&lt;/a&gt; says. A release that changes nothing on disk adds no fixture, and a release candidate adds none either, because its final release&amp;rsquo;s fixture holds the state it changed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A prerelease,&lt;/strong&gt; such as a release candidate or a beta, goes out the same way, with a version of the form &lt;code&gt;x.y.z-&amp;lt;word&amp;gt;.N&lt;/code&gt;: &lt;code&gt;VERSION&lt;/code&gt; holds &lt;code&gt;0.2.0-rc.1&lt;/code&gt;, &lt;code&gt;CHANGELOG.md&lt;/code&gt; gets an entry &lt;code&gt;## 0.2.0-rc.1&lt;/code&gt;, and the tag is &lt;code&gt;v0.2.0-rc.1&lt;/code&gt;. The word is lowercase letters, such as &lt;code&gt;rc&lt;/code&gt;, &lt;code&gt;beta&lt;/code&gt; or &lt;code&gt;alpha&lt;/code&gt;, and &lt;code&gt;release.sh&lt;/code&gt; refuses any other form of &lt;code&gt;VERSION&lt;/code&gt;. The co-signer, or &lt;code&gt;scripts/publish.sh --local&lt;/code&gt;, marks a prerelease&amp;rsquo;s GitHub release as a prerelease, so GitHub&amp;rsquo;s latest release skips it, and so do the install script&amp;rsquo;s default, devvm upgrade and the daily release check. In the tap it changes only &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, the formula that follows prereleases, in a commit titled &lt;code&gt;devvm-rc &amp;lt;version&amp;gt;&lt;/code&gt;, so the formula &lt;code&gt;devvm&lt;/code&gt; stays on the last release. At the end, &lt;code&gt;--local&lt;/code&gt; prints how to check the prerelease with &lt;code&gt;brew upgrade devvm-rc&lt;/code&gt; or &lt;code&gt;brew install devvmhq/tap/devvm-rc&lt;/code&gt;, and the prerelease&amp;rsquo;s install script line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The tap&amp;rsquo;s two formulas&lt;/strong&gt; are &lt;code&gt;devvm&lt;/code&gt;, the newest release&amp;rsquo;s, and &lt;code&gt;devvm-rc&lt;/code&gt;, the newest prerelease&amp;rsquo;s or release&amp;rsquo;s, whichever is newer. &lt;code&gt;devvm-rc&lt;/code&gt; only moves forward: each publish, a release&amp;rsquo;s or a prerelease&amp;rsquo;s, points &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt; at the version it publishes, unless the tap&amp;rsquo;s &lt;code&gt;devvm-rc&lt;/code&gt; already names a newer one. So a release moves &lt;code&gt;devvm-rc&lt;/code&gt; users onto it once it&amp;rsquo;s newer than their prerelease, and a patch release of an older line, or a prerelease older than the tap&amp;rsquo;s, leaves &lt;code&gt;devvm-rc&lt;/code&gt; where it is. The co-signer and &lt;code&gt;--local&lt;/code&gt; follow the same rule. &lt;code&gt;--local&lt;/code&gt;&amp;rsquo;s printout says which way it goes, and when nothing in the tap changes, as for such a prerelease, it has no tap step and prints the install script line and devvm upgrade &lt;code&gt;--to&lt;/code&gt; for checking it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The changelog&amp;rsquo;s entry is sorted by who notices each change.&lt;/strong&gt; Each line goes where a reader asking &amp;ldquo;does this affect me?&amp;rdquo; looks for it, so the question for a line is who notices it: everyone upgrading, the users of one feature, only a hostile VM, or nobody in practice. The entry starts with a paragraph that says which release it is and how to install it, then a line that links the release page, then its groups in this order, each one only when it has something:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Highlights:&lt;/strong&gt; three to five concrete lines on what the release means for you, such as what now works or which reported bugs are fixed. A highlight never refers to the notes themselves, such as by pointing at What to do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What to do:&lt;/strong&gt; numbered steps, each an action that someone upgrading takes, such as running &lt;code&gt;devvm update&lt;/code&gt; or restarting each running VM, with why when it isn&amp;rsquo;t plain. A breaking change goes here when it asks something of you.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fixed:&lt;/strong&gt; the bugs that users reported, with their issues, and the ones a typical user plausibly hit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;If you use…:&lt;/strong&gt; a collapsed block for each feature, such as &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;If you use a Linux host&amp;lt;/summary&amp;gt;&lt;/code&gt;, holding the changes that only that feature&amp;rsquo;s users notice.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security hardening:&lt;/strong&gt; a collapsed block whose summary starts &lt;code&gt;Security hardening:&lt;/code&gt; and says what the hardening means for you, such as &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;Security hardening: a VM that tries to attack your machine can now do much less&amp;lt;/summary&amp;gt;&lt;/code&gt;, with one line for each change that matters only when a VM is hostile.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internal changes:&lt;/strong&gt; a collapsed block, &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;Internal changes&amp;lt;/summary&amp;gt;&lt;/code&gt;, for rare conditions, limits nobody meets, pins, logs, status lines and the rest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A collapsed block renders its list on GitHub&lt;/strong&gt; only with a blank line after its &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;…&amp;lt;/summary&amp;gt;&lt;/code&gt; line and another before its &lt;code&gt;&amp;lt;/details&amp;gt;&lt;/code&gt;. markdownlint allows &lt;code&gt;details&lt;/code&gt; and &lt;code&gt;summary&lt;/code&gt; and no other inline HTML.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each line is one outcome sentence, then its links.&lt;/strong&gt; The sentence says what changes for you and what to do, if anything, in at most 35 words, not counting its links or a credit, and how devvm does it goes on the release page. A step in What to do may run longer, but it says only what to do and why. A line that covers several changes keeps every link of each.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The links come in this form and order:&lt;/strong&gt; the user page to act on, for a step in What to do or a breaking change, then the change&amp;rsquo;s section on the release page, then its issue, then its commit, as in &lt;code&gt;([details](https://next.devvm.dev/docs/releases/0.2.0/#claude-codes-setup-token-login), [#57](https://github.com/devvmhq/devvm/issues/57), [6965efc](https://github.com/devvmhq/devvm/commit/6965efcc0a97f7f6334f00d0530007ecf459972c))&lt;/code&gt;. The issue is a full link, such as &lt;code&gt;[#57](https://github.com/devvmhq/devvm/issues/57)&lt;/code&gt;, or &lt;code&gt;/pull/N&lt;/code&gt; in place of &lt;code&gt;/issues/N&lt;/code&gt; for a pull request, because a bare &lt;code&gt;#57&lt;/code&gt; links only in GitHub&amp;rsquo;s view of the release&amp;rsquo;s notes, and not in &lt;code&gt;CHANGELOG.md&lt;/code&gt; or anywhere else the entry is read. &lt;code&gt;gh api repos/devvmhq/devvm/issues/N --jq .pull_request&lt;/code&gt; tells them apart: it prints nothing for an issue. Every reference to an issue or a pull request in the changelog is written this way, a credit&amp;rsquo;s included, and the release page writes them the same way. The commit is the one that made the change, or the main one of several, linked by its full SHA and shown by its first seven characters. Find each one with &lt;code&gt;git log v&amp;lt;last release&amp;gt;..main&lt;/code&gt; and its messages, and &lt;code&gt;git log -G&lt;/code&gt; on &lt;code&gt;CHANGELOG.md&lt;/code&gt; names the commit that added a line. Credits, such as thanks for a report, stay in the line&amp;rsquo;s text, after its sentence and before its links.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The links point at next.devvm.dev&lt;/strong&gt; in a release candidate&amp;rsquo;s entry, because devvm.dev shows the latest release&amp;rsquo;s docs, which don&amp;rsquo;t have its release page yet, and at devvm.dev in a release&amp;rsquo;s entry. Each anchor is the heading&amp;rsquo;s ID as Hugo makes it, such as &lt;code&gt;#a-no_proxy-entrys-port&lt;/code&gt; for A &lt;code&gt;NO_PROXY&lt;/code&gt; entry&amp;rsquo;s port, so check a new one against the built page. lychee checks the docs&amp;rsquo; links offline, so it doesn&amp;rsquo;t check these.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestChangelogShape&lt;/code&gt; keeps the shape,&lt;/strong&gt; in &lt;code&gt;internal/cli/docgen/changelog_test.go&lt;/code&gt;, which &lt;code&gt;mise run lint:docs&lt;/code&gt; and &lt;code&gt;mise run test&lt;/code&gt; run. For each entry from 0.2.0-rc.1 on, and for Unreleased once it has a line, it checks the groups and their order, three to five Highlights in a release&amp;rsquo;s entry, each collapsed group&amp;rsquo;s &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; and blank lines, each line&amp;rsquo;s 35 words outside What to do, its &lt;code&gt;details&lt;/code&gt; link to a &lt;code&gt;releases/&lt;/code&gt; page, and a full link for every issue and pull request. The entries before 0.2.0-rc.1 are history, and the test leaves them as they are.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The release page holds each change&amp;rsquo;s full story,&lt;/strong&gt; and it is &lt;code&gt;docs/content/docs/releases/&amp;lt;major&amp;gt;.&amp;lt;minor&amp;gt;.0.md&lt;/code&gt;, such as &lt;code&gt;releases/0.2.0.md&lt;/code&gt;, which covers the release and its release candidates. Each release candidate adds its changes there, in the same commit as its changelog entry, so the page is written as the release is made. Each change gets a section of its own with its full story, under Breaking changes, Changes, Fixes and Hardening, as &lt;a href="https://next.devvm.dev/docs/contributing/docs/#writing-docs"&gt;Writing docs&lt;/a&gt; describes, and the Releases section&amp;rsquo;s own page lists the page. Every fact a changelog line leaves out is in its section, so a line can stay one sentence. A change that two lines describe, such as a step in What to do and a line in Fixed, can share one section, which both link, and a line that covers several changes links each one&amp;rsquo;s section.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A prerelease&amp;rsquo;s changelog entry&lt;/strong&gt; lists what changed since the version before it, whether that&amp;rsquo;s a release or another prerelease, and it becomes that prerelease&amp;rsquo;s notes on GitHub. When the release itself goes out, its entry, such as &lt;code&gt;## 0.2.0&lt;/code&gt;, replaces its prereleases&amp;rsquo; entries and lists everything since the last release, so someone who upgrades from that release reads one entry. Each prerelease&amp;rsquo;s notes stay on its GitHub release.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;scripts/publish.sh&lt;/code&gt;&lt;/strong&gt;, with no flag, checks and stops with nothing done when a check fails. The working tree has to be clean. The tag &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt; has to pass &lt;code&gt;scripts/release.sh --check-tag&lt;/code&gt;, which runs &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s checks of the tag and the release keys and needs no container runtime, so the tag exists, is signed, and is signed by a key in &lt;code&gt;packaging/release-signer&lt;/code&gt;. Its commit has to hold the release keys in &lt;code&gt;packaging/keys&lt;/code&gt;, because CI&amp;rsquo;s workflow refuses one without, and without them it stops, pointing at &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#1-the-release-keys"&gt;step 1 of Setting up GitHub for releases&lt;/a&gt; and at &lt;code&gt;--local&lt;/code&gt;. &lt;code&gt;CHANGELOG.md&lt;/code&gt; has to have an entry for the version, which the co-signer makes the release&amp;rsquo;s notes from. The tag&amp;rsquo;s commit has to be &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s HEAD, &lt;code&gt;origin&lt;/code&gt;&amp;rsquo;s &lt;code&gt;main&lt;/code&gt; has to be an ancestor of it, and if &lt;code&gt;origin&lt;/code&gt; already has the tag, it has to be the same tag. Then it prints the version, the tag&amp;rsquo;s commit and its two steps, each marked done or to do, and asks &lt;code&gt;Push main and v&amp;lt;version&amp;gt; to origin? [y/N]&lt;/code&gt; on the terminal. It pushes &lt;code&gt;main&lt;/code&gt;, then the tag, and prints what comes next. &lt;code&gt;--dry-run&lt;/code&gt; stops before the question. It needs git alone, and it builds and publishes nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;scripts/publish.sh --sign-legacy&lt;/code&gt;&lt;/strong&gt; adds the old release key&amp;rsquo;s signature to the co-signer&amp;rsquo;s draft, while releases bridge from that key. It needs &lt;code&gt;gh&lt;/code&gt;, logged in, and minisign. It reads &lt;code&gt;VERSION&lt;/code&gt;&amp;rsquo;s GitHub release, which has to be a draft holding &lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt; and &lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt;, and says so and stops when there&amp;rsquo;s no draft yet, when the co-signer&amp;rsquo;s signature isn&amp;rsquo;t on it yet, when it&amp;rsquo;s published, or when it holds &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; already. It downloads those three files, and &lt;code&gt;scripts/release.sh --sign-legacy DIR&lt;/code&gt; checks both signatures with this checkout&amp;rsquo;s &lt;code&gt;packaging/keys&lt;/code&gt;, refusing when it has no release keys, and the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, so the old key signs only what both builders built and signed. Then it signs &lt;code&gt;SHA256SUMS&lt;/code&gt; with the old key, &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt; or &lt;code&gt;~/.minisign/devvm.key&lt;/code&gt;, as &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; with the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, which minisign asks the password for, and checks it with &lt;code&gt;packaging/minisign.pub&lt;/code&gt;. It prints &lt;code&gt;SHA256SUMS&lt;/code&gt;, asks &lt;code&gt;Upload SHA256SUMS.minisig to devvm &amp;lt;version&amp;gt;'s draft release? [y/N]&lt;/code&gt;, and uploads it with &lt;code&gt;gh release upload&lt;/code&gt;. &lt;code&gt;--dry-run&lt;/code&gt; signs it but uploads nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="publishing-from-this-machine"&gt;Publishing from this machine&lt;span class="hx:absolute hx:-mt-20" id="publishing-from-this-machine"&gt;&lt;/span&gt;
&lt;a href="#publishing-from-this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;scripts/publish.sh --local&lt;/code&gt; builds, signs and publishes a release from this machine, as releases went out before CI and the co-signer. Its release carries the old key&amp;rsquo;s signature alone, which devvm accepts while the bridge lasts, and it needs no release keys in &lt;code&gt;packaging/keys&lt;/code&gt;, so it&amp;rsquo;s the way releases go out until they&amp;rsquo;re made. The tag it pushes still starts CI&amp;rsquo;s Release workflow, which stops at its first step while there are no keys, so that failed run is expected: reject it when it waits for your approval, or leave it. Use it until GitHub is set up and the first release through CI is published, and it goes when the bridge ends at the latest, because a release that only the old key signed is then one no devvm accepts. A release it publishes after the co-signer&amp;rsquo;s &lt;code&gt;init&lt;/code&gt; is one the co-signer alerts on, because the co-signer didn&amp;rsquo;t publish it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Before it builds,&lt;/strong&gt; &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; checks what it needs and stops with nothing done when a check fails. The tag &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt; has to pass &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s own checks, so it exists, is signed, and is signed by a key in &lt;code&gt;packaging/release-signer&lt;/code&gt;. The tag&amp;rsquo;s commit has to be &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s HEAD, and &lt;code&gt;origin&lt;/code&gt;&amp;rsquo;s &lt;code&gt;main&lt;/code&gt; has to be an ancestor of it, so that the push is a fast-forward. If &lt;code&gt;origin&lt;/code&gt; already has the tag, it has to be the same tag. The working tree has to be clean, &lt;code&gt;gh&lt;/code&gt; has to be installed and logged in (&lt;code&gt;gh auth status&lt;/code&gt;), and minisign, curl and podman or Docker have to be installed. A published GitHub release for the tag is refused unless it already has every file, which is the case when an earlier run stopped after it, and unless GitHub marks it as a prerelease exactly when the version is one. The refusal names the &lt;code&gt;gh release edit&lt;/code&gt; command that fixes the mark. The tap&amp;rsquo;s checkout, a clone of &lt;code&gt;devvmhq/homebrew-tap&lt;/code&gt;, has to exist, be clean and be on &lt;code&gt;main&lt;/code&gt;, for a prerelease too, and its &lt;code&gt;origin&lt;/code&gt; has to have no commits that its &lt;code&gt;main&lt;/code&gt; lacks. The checkout is &lt;code&gt;DEVVM_TAP_DIR&lt;/code&gt;, or &lt;code&gt;../homebrew-tap&lt;/code&gt; next to this repo by default.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Then it builds and shows the release.&lt;/strong&gt; It runs &lt;code&gt;scripts/release.sh&lt;/code&gt;, which builds &lt;code&gt;dist/&lt;/code&gt; and signs &lt;code&gt;SHA256SUMS&lt;/code&gt;, and where minisign asks for the password. It prints the version, the tag&amp;rsquo;s commit, each file with its size and SHA-256, the release notes, which are the &lt;code&gt;CHANGELOG.md&lt;/code&gt; entry for the version, and the tap&amp;rsquo;s changes as a &lt;code&gt;git diff&lt;/code&gt; of each formula it writes: &lt;code&gt;Formula/devvm.rb&lt;/code&gt; for a release, and &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, with a line saying when a release moves it too, or when it stays on a newer version. It lists the four steps, each marked done or to do, and when nothing in the tap changes, the fourth says so. Then it asks &lt;code&gt;Publish devvm &amp;lt;version&amp;gt;? [y/N]&lt;/code&gt; on the terminal, and any answer but y stops it with nothing published. &lt;code&gt;--dry-run&lt;/code&gt; stops before the question, so it pushes and publishes nothing and makes no commit in the tap, and &lt;code&gt;--help&lt;/code&gt; describes the script.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Then it publishes, in this order.&lt;/strong&gt; It pushes &lt;code&gt;main&lt;/code&gt; and then the tag to &lt;code&gt;origin&lt;/code&gt;. It makes the GitHub release &lt;code&gt;devvmhq/devvm&lt;/code&gt; &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt; with &lt;code&gt;gh release create --verify-tag&lt;/code&gt;, titled &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, with the release notes and the archives, the source tarball, &lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; and &lt;code&gt;install.sh&lt;/code&gt;. The release starts as a draft and is published only once every file is uploaded, so nobody sees a release that is missing files. Last, it copies &lt;code&gt;dist/devvm.rb&lt;/code&gt; to the tap&amp;rsquo;s &lt;code&gt;Formula/devvm.rb&lt;/code&gt; and &lt;code&gt;dist/devvm-rc.rb&lt;/code&gt; to its &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, each only when it&amp;rsquo;s one the tap gets and it differs, commits them in one commit, &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt; for a release or &lt;code&gt;devvm-rc &amp;lt;version&amp;gt;&lt;/code&gt; for a prerelease, with the tap&amp;rsquo;s own commit signing, and pushes the tap. It uses &lt;code&gt;gh&lt;/code&gt; for GitHub and never puts a GitHub token on a command line. At the end it prints how to check the release: &lt;code&gt;brew update &amp;amp;&amp;amp; brew upgrade devvm&lt;/code&gt;, or &lt;code&gt;brew trust --formula devvmhq/tap/devvm&lt;/code&gt; and then &lt;code&gt;brew install devvmhq/tap/devvm&lt;/code&gt;, with &lt;code&gt;devvm-rc&lt;/code&gt; in place of &lt;code&gt;devvm&lt;/code&gt; for a prerelease, and the install script&amp;rsquo;s &lt;code&gt;curl&lt;/code&gt; line.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When a step fails,&lt;/strong&gt; it says which steps it published and which it didn&amp;rsquo;t. Fix what failed and run &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; again, because every step skips what&amp;rsquo;s already done: a pushed &lt;code&gt;main&lt;/code&gt; or tag, a published release whose &lt;code&gt;SHA256SUMS&lt;/code&gt; matches the new build&amp;rsquo;s, and a tap whose formulas are already this build&amp;rsquo;s. A draft release that an earlier run left gets this build&amp;rsquo;s files again before it&amp;rsquo;s published. A release published from another build, whose &lt;code&gt;SHA256SUMS&lt;/code&gt; doesn&amp;rsquo;t match, is refused. To finish by hand instead, run the steps it didn&amp;rsquo;t do in order: &lt;code&gt;git push origin main&lt;/code&gt;, &lt;code&gt;git push origin v&amp;lt;version&amp;gt;&lt;/code&gt;, the &lt;code&gt;gh release create&lt;/code&gt; above (or &lt;code&gt;gh release upload --clobber&lt;/code&gt; to a draft, then &lt;code&gt;gh release edit v&amp;lt;version&amp;gt; --draft=false&lt;/code&gt;), each with &lt;code&gt;--prerelease&lt;/code&gt; for a prerelease, and then copy the formulas the printout listed, &lt;code&gt;dist/devvm.rb&lt;/code&gt; and &lt;code&gt;dist/devvm-rc.rb&lt;/code&gt;, to the tap&amp;rsquo;s &lt;code&gt;Formula/&lt;/code&gt;, commit them and push it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="the-release-script"&gt;The release script&lt;span class="hx:absolute hx:-mt-20" id="the-release-script"&gt;&lt;/span&gt;
&lt;a href="#the-release-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh&lt;/code&gt; checks the tag with &lt;code&gt;git tag -v&lt;/code&gt; and its signer against this checkout&amp;rsquo;s &lt;code&gt;packaging/release-signer&lt;/code&gt;, then builds &lt;code&gt;dist/&lt;/code&gt; from the tagged commit with GoReleaser (&lt;code&gt;.goreleaser.yaml&lt;/code&gt;), in a repository of its own that holds only the commit and the tag, so only what&amp;rsquo;s committed goes in, with one &lt;code&gt;goreleaser release --skip=publish&lt;/code&gt;. The build runs in the release&amp;rsquo;s container, as &lt;a href="#reproducible-releases"&gt;Reproducible releases&lt;/a&gt; describes. In the container, it checks that the Linux binary for the container&amp;rsquo;s processor prints the version, writes &lt;code&gt;install.sh&lt;/code&gt; and adds its checksum to &lt;code&gt;SHA256SUMS&lt;/code&gt;. Then, outside the container, it signs &lt;code&gt;SHA256SUMS&lt;/code&gt; with &lt;code&gt;~/.minisign/devvm.key&lt;/code&gt; (or &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt;) and verifies it with &lt;code&gt;packaging/minisign.pub&lt;/code&gt;. Nothing is published, because publishing is &lt;code&gt;scripts/publish.sh --local&lt;/code&gt;&amp;rsquo;s, or the co-signer&amp;rsquo;s for CI&amp;rsquo;s build. Before it builds anything, it checks the release keys in the tag&amp;rsquo;s commit, and so do &lt;code&gt;--check&lt;/code&gt; and &lt;code&gt;--tag&lt;/code&gt;, though a snapshot, such as &lt;code&gt;--head&lt;/code&gt;&amp;rsquo;s, skips the check (&lt;a href="#release-keys"&gt;Release keys&lt;/a&gt;). &lt;code&gt;packaging/keys&lt;/code&gt; must hold none of the three or all of them, because a devvm with one or two refuses every upgrade. When it holds none, the commit&amp;rsquo;s &lt;code&gt;install.sh&lt;/code&gt; must have no key in its &lt;code&gt;release_&amp;lt;role&amp;gt;_key&lt;/code&gt; lines. When it holds all three, each must be a minisign public key, a different one, not the old release key, not marked &lt;code&gt;PLACEHOLDER&lt;/code&gt; in its comment, and the same as the commit&amp;rsquo;s &lt;code&gt;install.sh&lt;/code&gt; has in its &lt;code&gt;release_&amp;lt;role&amp;gt;_key&lt;/code&gt; line. &lt;code&gt;scripts/release.sh --check&lt;/code&gt; runs only the tag&amp;rsquo;s checks and the build&amp;rsquo;s preconditions, prints the tag&amp;rsquo;s commit and builds nothing, and &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; runs it first. &lt;code&gt;scripts/release.sh --check-tag&lt;/code&gt; runs the tag&amp;rsquo;s and the keys&amp;rsquo; checks alone, needing no container runtime or signing key, and &lt;code&gt;scripts/publish.sh&lt;/code&gt; runs it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;dist/&lt;/code&gt; then holds:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm-&amp;lt;version&amp;gt;-&amp;lt;os&amp;gt;-&amp;lt;arch&amp;gt;.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the binary, its files (&lt;code&gt;assets/&lt;/code&gt;) embedded, with &lt;code&gt;README.md&lt;/code&gt;, &lt;code&gt;CHANGELOG.md&lt;/code&gt; and &lt;code&gt;LICENSE&lt;/code&gt;, for &lt;code&gt;darwin&lt;/code&gt; and &lt;code&gt;linux&lt;/code&gt;, &lt;code&gt;arm64&lt;/code&gt; and &lt;code&gt;amd64&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm-&amp;lt;version&amp;gt;.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the source, attached to the release for whoever wants to build devvm themselves&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;their checksums and &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s, and the signature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;install.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the install script, set to this release and to &lt;code&gt;packaging/minisign.pub&lt;/code&gt;&amp;rsquo;s key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm-rc.rb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the Homebrew formula &lt;code&gt;devvm-rc&lt;/code&gt;, which follows prereleases, set to each platform&amp;rsquo;s archive, its URL and its checksum from &lt;code&gt;SHA256SUMS&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm.rb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for a release, not a prerelease, the Homebrew formula &lt;code&gt;devvm&lt;/code&gt;, set the same way&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --head&lt;/code&gt; builds from HEAD&amp;rsquo;s commit instead, for testing, with the version in that commit&amp;rsquo;s &lt;code&gt;VERSION&lt;/code&gt;, a release&amp;rsquo;s or a prerelease&amp;rsquo;s, and &lt;code&gt;scripts/release.sh --commit COMMIT&lt;/code&gt; does the same for any other commit. It&amp;rsquo;s unsigned unless &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt; names a test key; &lt;code&gt;DEVVM_MINISIGN_PUB&lt;/code&gt; names its public key in place of &lt;code&gt;packaging/minisign.pub&lt;/code&gt;. A build signed with a test key never replaces a &lt;code&gt;dist/&lt;/code&gt; whose &lt;code&gt;SHA256SUMS&lt;/code&gt; verifies with this checkout&amp;rsquo;s &lt;code&gt;packaging/minisign.pub&lt;/code&gt;, the release key, and stops before it builds anything, so move the release&amp;rsquo;s &lt;code&gt;dist/&lt;/code&gt; first, or set &lt;code&gt;DEVVM_RELEASE_DIST&lt;/code&gt;. &lt;code&gt;DEVVM_RELEASE_URL&lt;/code&gt; points the formula at a test location. A commit without &lt;code&gt;install.sh&lt;/code&gt; is refused.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --tag TAG&lt;/code&gt; builds the tag &lt;code&gt;TAG&lt;/code&gt; as its release is built, with the same checks of the tag and its signer and the tag&amp;rsquo;s version, but doesn&amp;rsquo;t sign it, so another builder can build a release and compare its &lt;code&gt;SHA256SUMS&lt;/code&gt; with the published one. An unsigned build, such as this one, never replaces a &lt;code&gt;dist/&lt;/code&gt; that holds &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, and stops before it builds anything, so move the signed build&amp;rsquo;s &lt;code&gt;dist/&lt;/code&gt; first, or set &lt;code&gt;DEVVM_RELEASE_DIST&lt;/code&gt; to a folder that doesn&amp;rsquo;t exist yet for the unsigned one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --formula-from DIR&lt;/code&gt; writes only the formulas, for &lt;code&gt;VERSION&lt;/code&gt;&amp;rsquo;s release once it&amp;rsquo;s published, and builds nothing: &lt;code&gt;dist/devvm-rc.rb&lt;/code&gt;, and &lt;code&gt;dist/devvm.rb&lt;/code&gt; too when &lt;code&gt;VERSION&lt;/code&gt; isn&amp;rsquo;t a prerelease. Download the release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; and &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; into &lt;code&gt;DIR&lt;/code&gt; first. The script checks the signature against &lt;code&gt;packaging/minisign.pub&lt;/code&gt;, and that its trusted comment is &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt; for &lt;code&gt;VERSION&lt;/code&gt;&amp;rsquo;s version, so it refuses another release&amp;rsquo;s files. Then it fills in the formulas the same way a build does, from that &lt;code&gt;SHA256SUMS&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --ci TAG DIR&lt;/code&gt; and &lt;code&gt;--ci-sign TAG DIR&lt;/code&gt; are CI&amp;rsquo;s release workflow&amp;rsquo;s build and signature, as &lt;a href="#cis-release-workflow"&gt;CI&amp;rsquo;s release workflow&lt;/a&gt; describes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To try &lt;code&gt;dist/install.sh&lt;/code&gt; on such a build, copy &lt;code&gt;dist/&lt;/code&gt; to &lt;code&gt;DIR/releases/download/v&amp;lt;version&amp;gt;/&lt;/code&gt;, then in a throwaway &lt;code&gt;HOME&lt;/code&gt; with &lt;code&gt;DEVVM_PREFIX&lt;/code&gt; under it: &lt;code&gt;DEVVM_INSTALL_TEST=1 source dist/install.sh&lt;/code&gt;, set &lt;code&gt;repo_url=file://DIR&lt;/code&gt; and &lt;code&gt;protos='=https,file'&lt;/code&gt; (it downloads over HTTPS only), and run &lt;code&gt;main --no-deps&lt;/code&gt;. Without &lt;code&gt;--no-deps&lt;/code&gt; it offers to install what the host lacks: answer no, or run it with no terminal.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Every build sets the version with &lt;code&gt;-X github.com/devvmhq/devvm/internal/cli.version=&amp;lt;version&amp;gt;&lt;/code&gt;: devvm doesn&amp;rsquo;t read &lt;code&gt;VERSION&lt;/code&gt;. The formula template (&lt;code&gt;packaging/homebrew/devvm.rb&lt;/code&gt;) is both formulas&amp;rsquo; one source, and it builds nothing. It has an archive for each of macOS and Linux on arm64 and Intel, the same archives the install script installs, and it installs the binary alone from the one for this machine. &lt;code&gt;release.sh&lt;/code&gt; fills in each formula&amp;rsquo;s class, &lt;code&gt;Devvm&lt;/code&gt; or &lt;code&gt;DevvmRc&lt;/code&gt;, and the other formula, which it conflicts with by its full name, &lt;code&gt;devvmhq/tap/devvm-rc&lt;/code&gt; or &lt;code&gt;devvmhq/tap/devvm&lt;/code&gt;, because both install the &lt;code&gt;devvm&lt;/code&gt; command. It also fills in each archive&amp;rsquo;s URL and its checksum, which it reads from the &lt;code&gt;SHA256SUMS&lt;/code&gt; it just wrote, on every line that isn&amp;rsquo;t a comment. Both generated formulas pass &lt;code&gt;brew audit --strict --online&lt;/code&gt; and &lt;code&gt;brew style&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Publishing is the maintainer&amp;rsquo;s call, so an agent asks first and never runs &lt;code&gt;scripts/publish.sh&lt;/code&gt;, in any mode, without &lt;code&gt;--dry-run&lt;/code&gt; on its own. The script&amp;rsquo;s tests run it against a local bare repo as &lt;code&gt;origin&lt;/code&gt; and a fake &lt;code&gt;gh&lt;/code&gt;: &lt;code&gt;testdata/script/publish_tag.txtar&lt;/code&gt; the default and &lt;code&gt;--sign-legacy&lt;/code&gt;, and &lt;code&gt;testdata/script/publish.txtar&lt;/code&gt; &lt;code&gt;--local&lt;/code&gt;, with a local bare tap. &lt;code&gt;testdata/script/release_ci.txtar&lt;/code&gt; runs CI&amp;rsquo;s &lt;code&gt;--ci&lt;/code&gt; and &lt;code&gt;--ci-sign&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="release-keys"&gt;Release keys&lt;span class="hx:absolute hx:-mt-20" id="release-keys"&gt;&lt;/span&gt;
&lt;a href="#release-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm upgrade and the install script accept a release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; when any two of three release keys signed it, so one stolen key signs nothing and one lost key stops nothing. &lt;code&gt;internal/minisign&lt;/code&gt; makes the check, and the structure test keeps every other package from checking a signature itself (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;). Each key has a role, and each role signs into a file of its own beside &lt;code&gt;SHA256SUMS&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Who holds the key&lt;/th&gt;
&lt;th&gt;Its signature&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ci&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;GitHub&amp;rsquo;s CI, which builds the release&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cosign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the co-signer, a machine of the maintainer&amp;rsquo;s that builds the same bytes again&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;recovery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the maintainer, offline, to sign in place of a lost key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS.recovery.minisig&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The names&lt;/strong&gt; keep &lt;code&gt;.minisig&lt;/code&gt; last, as minisign&amp;rsquo;s own &lt;code&gt;-x&lt;/code&gt; default does, so tools and readers take each file for a minisign signature, and &lt;code&gt;SHA256SUMS.*.minisig&lt;/code&gt; lists the three. The role, rather than the key&amp;rsquo;s ID, names the file, so the names stay the same when a key is replaced, and none of them is &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, the old release key&amp;rsquo;s, which devvm 0.1 and 0.2 read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The trusted comment&lt;/strong&gt; is &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, such as &lt;code&gt;devvm-release 0.3.0&lt;/code&gt;. minisign&amp;rsquo;s global signature covers it, and devvm compares it with the version it asked for exactly, so a &lt;code&gt;SHA256SUMS&lt;/code&gt; signed for one release can&amp;rsquo;t stand in for another&amp;rsquo;s, and a manifest of another kind can&amp;rsquo;t stand in for a release&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each check counts signers, not files.&lt;/strong&gt; Each file is checked only against its own role&amp;rsquo;s key, and &lt;code&gt;minisign.NewKeys&lt;/code&gt; refuses two roles with the same key or the same key ID, so two signatures are always two signers&amp;rsquo;. &lt;code&gt;TestReleaseKeys&lt;/code&gt; checks that the keys in &lt;code&gt;packaging/keys&lt;/code&gt;, once they&amp;rsquo;re made, are three such keys, and that none of them is the old release key, so the old key&amp;rsquo;s signature and one release key&amp;rsquo;s are never two of three.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each kind has keys of its own.&lt;/strong&gt; A kind is what a manifest describes, so &lt;code&gt;devvm-base&lt;/code&gt; has its own three keys, its own trusted comment and its own key files, &lt;code&gt;packaging/keys/base-&amp;lt;role&amp;gt;.pub&lt;/code&gt;, though devvm doesn&amp;rsquo;t read a published base yet. A key of one kind can&amp;rsquo;t sign another kind&amp;rsquo;s manifest.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The co-signer, &lt;code&gt;devvm-cosign&lt;/code&gt;, holds the &lt;code&gt;cosign&lt;/code&gt; keys. CI&amp;rsquo;s token can only read the repo, so CI hands its build and its signature over as a workflow artifact, and the co-signer signs it only when its own rebuild matches. Then the co-signer makes the release, publishes it once two of the three keys signed it, and updates the tap. Nothing else can make or publish a release but the maintainer, and the co-signer raises an alert for any release published without it since its state began, whatever its tag, as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/"&gt;The co-signer&lt;/a&gt; describes, with its setup.&lt;/p&gt;
&lt;p&gt;The public halves are in &lt;code&gt;packaging/keys&lt;/code&gt;, as &lt;code&gt;release-ci.pub&lt;/code&gt;, &lt;code&gt;release-cosign.pub&lt;/code&gt; and &lt;code&gt;release-recovery.pub&lt;/code&gt;, which &lt;code&gt;packaging.Key&lt;/code&gt; embeds in devvm, and in &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;release_ci_key&lt;/code&gt;, &lt;code&gt;release_cosign_key&lt;/code&gt; and &lt;code&gt;release_recovery_key&lt;/code&gt; lines, which &lt;code&gt;TestInstallScriptKeys&lt;/code&gt; keeps the same as the files. To make a key, run &lt;code&gt;minisign -G -p packaging/keys/release-&amp;lt;role&amp;gt;.pub -s &amp;lt;its secret key's file&amp;gt;&lt;/code&gt; where its holder keeps it, then commit the &lt;code&gt;.pub&lt;/code&gt; file and copy its key into &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s line. The co-signer&amp;rsquo;s key has no password, as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#making-its-keys"&gt;Making its keys&lt;/a&gt; says, because it signs unattended. A secret key never goes in the repo.&lt;/p&gt;
&lt;p&gt;Until the maintainer makes the keys, &lt;code&gt;packaging/keys&lt;/code&gt; has none of them and &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s three lines are empty. A devvm built then has no release keys, so devvm upgrade and its install script check each release with the old release key alone, through &lt;a href="#the-bridge-from-the-old-release-key"&gt;the bridge&lt;/a&gt;, and a release signed by the release keys but not by the old key is refused. &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; builds and signs each release with the old key, as &lt;a href="#publishing-from-this-machine"&gt;Publishing from this machine&lt;/a&gt; describes. CI&amp;rsquo;s Release workflow, &lt;code&gt;scripts/publish.sh&lt;/code&gt; without &lt;code&gt;--local&lt;/code&gt;, &lt;code&gt;--sign-legacy&lt;/code&gt; and the co-signer all need the keys and refuse to run without them, pointing at &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#1-the-release-keys"&gt;step 1 of Setting up GitHub for releases&lt;/a&gt;, which makes them. The keys go in together, all three in &lt;code&gt;packaging/keys&lt;/code&gt; and in &lt;code&gt;install.sh&lt;/code&gt; in one commit, because &lt;code&gt;release.sh&lt;/code&gt; refuses to build a release from a commit with one or two of them, as a devvm with only some of them would refuse every upgrade.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;release.sh&lt;/code&gt; checks the keys of each tag it builds: none, with &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s lines empty or missing, or all three, each a minisign key of its own, none of them the old release key, and each the same as its line in &lt;code&gt;install.sh&lt;/code&gt;. It also refuses a key whose comment holds &lt;code&gt;PLACEHOLDER&lt;/code&gt;, such as a stand-in made for a test, because a devvm built with a key nobody holds could never check a release. The Go tests check the same on the committed keys: &lt;code&gt;TestReleaseKeys&lt;/code&gt; that they&amp;rsquo;re none or three distinct keys and never the old one, &lt;code&gt;TestInstallScriptKeys&lt;/code&gt; that &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s lines match them, and &lt;code&gt;TestReleaseRefusesPlaceholders&lt;/code&gt; that none is marked &lt;code&gt;PLACEHOLDER&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-bridge-from-the-old-release-key"&gt;The bridge from the old release key&lt;span class="hx:absolute hx:-mt-20" id="the-bridge-from-the-old-release-key"&gt;&lt;/span&gt;
&lt;a href="#the-bridge-from-the-old-release-key" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While releases bridge from the old release key, devvm upgrade and the install script also accept &lt;code&gt;SHA256SUMS&lt;/code&gt; when the old key alone signed it, in &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, with the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, as 0.1 and 0.2&amp;rsquo;s releases are. That&amp;rsquo;s what lets 0.1 and 0.2, which know only that key, upgrade to a release that the new keys sign, as long as each such release carries the old key&amp;rsquo;s signature too, and it&amp;rsquo;s what lets devvm upgrade &lt;code&gt;--to&lt;/code&gt; and the install script&amp;rsquo;s &lt;code&gt;--version&lt;/code&gt; install a 0.1 or 0.2 release. While the bridge lasts, the old key alone is still enough to sign a release, as it is today, so the release keys protect a release only once the bridge ends. The bridge is in one place in each:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;devvm upgrade:&lt;/strong&gt; &lt;code&gt;internal/upgrade/legacy.go&lt;/code&gt;, which &lt;code&gt;checkSums&lt;/code&gt; calls when two of the release keys&amp;rsquo; signatures don&amp;rsquo;t check out, with &lt;code&gt;Source.Key&lt;/code&gt;, &lt;code&gt;packaging.MinisignKey&lt;/code&gt; and &lt;code&gt;DEVVM_RELEASE_KEY&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The install script:&lt;/strong&gt; &lt;code&gt;minisign_key&lt;/code&gt;, &lt;code&gt;check_legacy&lt;/code&gt; and the lines of &lt;code&gt;download_signatures&lt;/code&gt; and &lt;code&gt;check_signature&lt;/code&gt; that name them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each release through CI and the co-signer carries the old key&amp;rsquo;s signature beside the two new ones, which you add to the co-signer&amp;rsquo;s draft with &lt;code&gt;scripts/publish.sh --sign-legacy&lt;/code&gt;, and the co-signer waits for it before it publishes, because its config&amp;rsquo;s &lt;code&gt;legacy_key&lt;/code&gt; names the old key (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#what-a-run-does"&gt;What a run does&lt;/a&gt;). A release from &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; carries the old key&amp;rsquo;s signature alone, so devvm upgrade and the install script check it through the bridge.&lt;/p&gt;
&lt;p&gt;The bridge ends with a release, the last one the old key signs, after at least two releases have gone out through CI and the co-signer, so that path is proven, and once 0.1 and 0.2&amp;rsquo;s daily release check has had a few weeks to offer users a release that checks two of three. That release takes out the bridge: devvm upgrade&amp;rsquo;s &lt;code&gt;legacy.go&lt;/code&gt; fallback, the install script&amp;rsquo;s &lt;code&gt;check_legacy&lt;/code&gt;, and &lt;code&gt;minisign_key&lt;/code&gt; with its lines, so its devvm and install script accept only two of the three release keys. It still carries &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; itself, so 0.1 and 0.2 can upgrade to it. Its changelog entry has a What to do step for anyone still on 0.1 or 0.2: upgrade to it by name, with &lt;code&gt;devvm upgrade --to &amp;lt;version&amp;gt;&lt;/code&gt;, before any later release, or install a later release with the install script, because a 0.1 or 0.2 devvm refuses every release after it. After it, the co-signer&amp;rsquo;s config drops &lt;code&gt;legacy_key&lt;/code&gt;, so it publishes without waiting, and &lt;code&gt;scripts/publish.sh&lt;/code&gt; drops &lt;code&gt;--sign-legacy&lt;/code&gt; and &lt;code&gt;--local&lt;/code&gt;, and &lt;code&gt;scripts/release.sh&lt;/code&gt; its old-key signing (&lt;code&gt;--sign-legacy&lt;/code&gt;, and the signature its default build makes).&lt;/p&gt;
&lt;h3 data-hextra-search-id="cis-release-workflow"&gt;CI&amp;rsquo;s release workflow&lt;span class="hx:absolute hx:-mt-20" id="cis-release-workflow"&gt;&lt;/span&gt;
&lt;a href="#cis-release-workflow" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Release workflow, &lt;code&gt;.github/workflows/release.yml&lt;/code&gt;, is CI&amp;rsquo;s half of each release. It runs for each pushed tag that starts with &lt;code&gt;v&lt;/code&gt;, in the &lt;code&gt;release&lt;/code&gt; environment, which waits for the maintainer to approve the run and holds the two things the workflow trusts: the variable &lt;code&gt;RELEASE_TAG_SIGNERS&lt;/code&gt;, the SSH keys that sign release tags, and the secret &lt;code&gt;RELEASE_CI_KEY&lt;/code&gt;, CI&amp;rsquo;s release key (&lt;a href="https://next.devvm.dev/docs/contributing/github-setup/"&gt;Setting up GitHub for releases&lt;/a&gt;). Its job&amp;rsquo;s token can read the repo and nothing else, but for what the attestation needs, so the workflow can&amp;rsquo;t make or publish a release. It takes these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;It checks the tag&lt;/strong&gt; with &lt;code&gt;scripts/release.sh --ci TAG DIR&lt;/code&gt;, against the signers in &lt;code&gt;RELEASE_TAG_SIGNERS&lt;/code&gt;, written to an allowed signers file for git, and never against the tagged commit&amp;rsquo;s &lt;code&gt;packaging/release-signer&lt;/code&gt;, because CI runs the workflow and &lt;code&gt;release.sh&lt;/code&gt; from the tagged commit. The tag has to be an annotated tag of a release&amp;rsquo;s version, signed by one of those keys, whose tag object names the tag itself, so a tag pushed under another name is refused, and its commit has to be on &lt;code&gt;main&lt;/code&gt;. The commit has to hold the three release keys in &lt;code&gt;packaging/keys&lt;/code&gt;, because its devvm checks CI&amp;rsquo;s and the co-signer&amp;rsquo;s signatures with them, and the workflow&amp;rsquo;s first step, before it installs anything, stops a tag without them and points at &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#1-the-release-keys"&gt;step 1 of Setting up GitHub for releases&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It builds the release&lt;/strong&gt; as &lt;code&gt;scripts/release.sh --tag&lt;/code&gt; does, with the same signers as git&amp;rsquo;s allowed signers, under the runner&amp;rsquo;s podman, then copies &lt;code&gt;SHA256SUMS&lt;/code&gt; and exactly the files it lists, each checked against its SHA-256, into &lt;code&gt;DIR&lt;/code&gt;. The formulas aren&amp;rsquo;t among them, because the co-signer renders them itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It signs &lt;code&gt;SHA256SUMS&lt;/code&gt;&lt;/strong&gt; with &lt;code&gt;scripts/release.sh --ci-sign TAG DIR&lt;/code&gt;, which reads CI&amp;rsquo;s release key on its standard input, from the environment&amp;rsquo;s secret through a pipe, so the key is never in a file or an argument. The key has to be an unencrypted minisign secret key, the signature&amp;rsquo;s trusted comment is &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, and the signature has to check out with the tag&amp;rsquo;s &lt;code&gt;packaging/keys/release-ci.pub&lt;/code&gt;, which can&amp;rsquo;t be marked &lt;code&gt;PLACEHOLDER&lt;/code&gt;. The signature is &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It adds an attestation&lt;/strong&gt;, GitHub&amp;rsquo;s signed record of which workflow run built each file &lt;code&gt;SHA256SUMS&lt;/code&gt; lists, which &lt;code&gt;gh attestation verify FILE --repo devvmhq/devvm&lt;/code&gt; checks. devvm doesn&amp;rsquo;t check attestations, and they&amp;rsquo;re a public audit trail.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It hands the build over&lt;/strong&gt; as the artifact &lt;code&gt;release&lt;/code&gt;, which holds &lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt; and the files, side by side, kept for 90 days. The co-signer finds it through the workflow&amp;rsquo;s runs for the tag, as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#what-ci-hands-over"&gt;The co-signer&lt;/a&gt; describes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The workflow installs only minisign, with mise and no cache, and pins every action by its commit. The published base&amp;rsquo;s workflow isn&amp;rsquo;t there yet: it comes with the published base, as a workflow of its own, &lt;code&gt;base.yml&lt;/code&gt;, beside this one, with its own environment, key and artifact, &lt;code&gt;base&lt;/code&gt;, which the co-signer already reads.&lt;/p&gt;
&lt;h3 data-hextra-search-id="reproducible-releases"&gt;Reproducible releases&lt;span class="hx:absolute hx:-mt-20" id="reproducible-releases"&gt;&lt;/span&gt;
&lt;a href="#reproducible-releases" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The same commit or tag, built on any machine, gives byte-identical release files: every archive, the source tarball, &lt;code&gt;install.sh&lt;/code&gt;, &lt;code&gt;SHA256SUMS&lt;/code&gt; and the formulas. To check it, build twice and compare:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/repro-check.sh &lt;span class="c1"&gt;# build HEAD twice and compare every file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/repro-check.sh &amp;lt;commit&amp;gt; &lt;span class="c1"&gt;# the same for another commit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/repro-check.sh v&amp;lt;version&amp;gt; &lt;span class="c1"&gt;# a tag, built as its release is, to compare with its published SHA256SUMS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;repro-check.sh&lt;/code&gt; runs both builds with this checkout&amp;rsquo;s &lt;code&gt;scripts/release.sh&lt;/code&gt;, which runs the commit&amp;rsquo;s own code only in the build&amp;rsquo;s container, never on your machine directly. That code still runs, though, and the container is only as isolated as your container runtime keeps it, so building a commit is running its code. A commit from outside the project, such as a pull request&amp;rsquo;s, is built only with the maintainer&amp;rsquo;s go-ahead for that run, as any outside code is. A commit builds as &lt;code&gt;release.sh --commit&lt;/code&gt; builds it, unsigned. A tag builds as &lt;code&gt;release.sh --tag&lt;/code&gt; builds it, with the tag&amp;rsquo;s checks and version and without the signature, so its &lt;code&gt;SHA256SUMS&lt;/code&gt; matches the published one. A commit or tag whose &lt;code&gt;release.sh&lt;/code&gt; pins no &lt;code&gt;release_image&lt;/code&gt;, from before reproducible builds, is refused. The second build differs from the first in what the fixes below keep out of the bytes, so that losing one of them shows as a difference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A stray tag.&lt;/strong&gt; Build 2 fetches the commit from a repository with a tag, &lt;code&gt;v0.0.0-stray&lt;/code&gt;, at the commit, which Go would stamp into the binary as its version if the build saw it. It&amp;rsquo;s a v0 version because Go ignores a tag whose major version the module&amp;rsquo;s path doesn&amp;rsquo;t name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another user.&lt;/strong&gt; When podman and Docker are both installed, build 1 runs under podman, as root, and build 2 under Docker, as you, and the archives would record each. With one of them, both builds run as the same user, and the script says so.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The archives&amp;rsquo; headers.&lt;/strong&gt; Every file in each platform&amp;rsquo;s archive has to be root&amp;rsquo;s, with mode 0755 or 0644, as &lt;code&gt;tar -tv&lt;/code&gt; lists it, whichever user either build ran as.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It prints each file&amp;rsquo;s SHA-256, says &lt;code&gt;DIFFERS&lt;/code&gt; beside any file whose two builds differ, and exits 1 when one does or when an archive&amp;rsquo;s headers aren&amp;rsquo;t those. Both builds run on this machine, in the same image and on its processor, so to compare two machines, run it on both and diff the printouts, which list the files in the same order on every machine. CI&amp;rsquo;s &lt;code&gt;repro&lt;/code&gt; job runs it under the runner&amp;rsquo;s podman and Docker, on every push and pull request that CI runs on, so the runner needs cgroups v2, with the &lt;code&gt;pids&lt;/code&gt; and &lt;code&gt;memory&lt;/code&gt; controllers delegated to its user for podman. It needs podman or Docker, git and curl, and no mise.&lt;/p&gt;
&lt;p&gt;What makes the bytes the same:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One container.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; runs GoReleaser, writes &lt;code&gt;install.sh&lt;/code&gt; and the formulas, and adds &lt;code&gt;install.sh&lt;/code&gt; to &lt;code&gt;SHA256SUMS&lt;/code&gt; inside one container image, with no network, &lt;code&gt;release_image&lt;/code&gt; at the top of &lt;code&gt;release.sh&lt;/code&gt;: Debian&amp;rsquo;s &lt;code&gt;buildpack-deps:trixie-scm&lt;/code&gt;, pinned by its index&amp;rsquo;s digest, which &lt;code&gt;scripts/bump.sh release-image&lt;/code&gt; moves. So git, which writes the source tarball, and awk, tar and gzip are the same on every builder. The image and the code that runs in the container, &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s build, are the built commit&amp;rsquo;s copies, so a tag builds the same bytes from any checkout, even one whose pin has moved since. It uses podman when it&amp;rsquo;s installed and Docker otherwise, and &lt;code&gt;DEVVM_RELEASE_RUNTIME&lt;/code&gt; names one. The container runs this machine&amp;rsquo;s processor, &lt;code&gt;linux/arm64&lt;/code&gt; or &lt;code&gt;linux/amd64&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Go and GoReleaser from the commit&amp;rsquo;s &lt;code&gt;mise.lock&lt;/code&gt;.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; reads the URL and SHA-256 of the &lt;code&gt;linux-arm64&lt;/code&gt; or &lt;code&gt;linux-x64&lt;/code&gt; download of each from the built commit&amp;rsquo;s &lt;code&gt;mise.lock&lt;/code&gt;, so a tag builds with its own pins. It keeps each download in &lt;code&gt;${XDG_CACHE_HOME:-~/.cache}/devvm-release&lt;/code&gt;, named by its SHA-256, and checks every copy against &lt;code&gt;mise.lock&lt;/code&gt; before the build uses it. A copy that doesn&amp;rsquo;t match stops the build and is deleted from the cache, so the next run downloads it again. A Go toolchain cross-compiles to the same bytes on either processor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Go&amp;rsquo;s modules as &lt;code&gt;go.sum&lt;/code&gt; pins them.&lt;/strong&gt; The modules the commit&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; needs are downloaded before the build, with this checkout&amp;rsquo;s Go, and Go checks each against the commit&amp;rsquo;s &lt;code&gt;go.sum&lt;/code&gt;, so every builder builds from the same module files, whichever Go downloaded them. They come from Go&amp;rsquo;s module proxy, &lt;code&gt;proxy.golang.org&lt;/code&gt;, so rebuilding an old tag needs the proxy to still serve its modules, which it does for good unless a module is taken down, for legal reasons for example.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The same environment inside.&lt;/strong&gt; The build runs with umask 022, &lt;code&gt;TZ=UTC&lt;/code&gt;, &lt;code&gt;LC_ALL=C.UTF-8&lt;/code&gt;, &lt;code&gt;CGO_ENABLED=0&lt;/code&gt;, &lt;code&gt;GOTOOLCHAIN=local&lt;/code&gt;, &lt;code&gt;-mod=readonly&lt;/code&gt;, and no git configuration but &lt;code&gt;safe.directory&lt;/code&gt;. Go&amp;rsquo;s caches, &lt;code&gt;HOME&lt;/code&gt; and the tools go in a folder of the container&amp;rsquo;s own, because Docker Desktop&amp;rsquo;s shared folders lose files that Go&amp;rsquo;s parallel module downloads rename, and &lt;code&gt;-trimpath&lt;/code&gt; keeps their paths out of the binaries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only the tag built from.&lt;/strong&gt; The build&amp;rsquo;s repository holds the commit and, for a tag, &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt;, and no other tags, because Go stamps the binary with a version from the tags it finds, and every machine holds different ones.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fixed archive headers.&lt;/strong&gt; &lt;code&gt;.goreleaser.yaml&lt;/code&gt; sets each archive file&amp;rsquo;s owner and group to &lt;code&gt;root&lt;/code&gt;, its mode (0755 for the binary, 0644 for the rest) and its time to the commit&amp;rsquo;s (&lt;code&gt;builds_info&lt;/code&gt; and each file&amp;rsquo;s &lt;code&gt;info&lt;/code&gt;), in place of GoReleaser&amp;rsquo;s defaults, which copy them from the files on disk, and &lt;code&gt;mod_timestamp&lt;/code&gt; sets the binary&amp;rsquo;s own time to the commit&amp;rsquo;s. Without them, a build under Docker on a Mac records your user and group, and a build under podman records root, so the archives differ.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The signature, &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, is made outside the container, after the build, so it never changes the bytes of the other files.&lt;/p&gt;
&lt;p&gt;What runs on your machine, outside the containers, is this checkout&amp;rsquo;s &lt;code&gt;release.sh&lt;/code&gt;: the tag&amp;rsquo;s checks, the downloads, the checks on what the build wrote, and the signature. It limits what the commit&amp;rsquo;s code, in the build&amp;rsquo;s container, can reach and leave behind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Downloads only from their publishers.&lt;/strong&gt; Each &lt;code&gt;mise.lock&lt;/code&gt; URL has to start with &lt;code&gt;https://dl.google.com/go/&lt;/code&gt; for Go, or &lt;code&gt;https://github.com/goreleaser/goreleaser/releases/download/&lt;/code&gt; for GoReleaser, and it goes to curl as &lt;code&gt;--url&lt;/code&gt;&amp;rsquo;s value, so a lock can&amp;rsquo;t pass curl an option. It can&amp;rsquo;t hold &lt;code&gt;..&lt;/code&gt;, or a &lt;code&gt;%&lt;/code&gt;, which curl would decode, so that &lt;code&gt;%2e%2e&lt;/code&gt; would be &lt;code&gt;..&lt;/code&gt;. curl follows redirects over HTTPS only, and gives up after 30 seconds connecting, after 15 minutes, or past 1 GiB. A lock with two entries for a tool, or two downloads of one for this platform, is refused. The tests&amp;rsquo; lock files use &lt;code&gt;file://&lt;/code&gt; URLs, which &lt;code&gt;release.sh&lt;/code&gt; allows only from the folder that &lt;code&gt;DEVVM_RELEASE_TEST_FILE_URLS&lt;/code&gt; names, and only when that folder exists and isn&amp;rsquo;t &lt;code&gt;/&lt;/code&gt;, so the variable set by mistake reads no other file of yours, and each download is still checked against &lt;code&gt;mise.lock&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repository of the build&amp;rsquo;s own.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; fetches the commit and the tag into a new repository, which has no hooks, none of this checkout&amp;rsquo;s other branches, tags or objects, and no files it shares with this one, as a local clone&amp;rsquo;s hardlinks would be. Its &lt;code&gt;origin&lt;/code&gt; is devvm&amp;rsquo;s repository on GitHub, which GoReleaser reads and nothing fetches from.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No network for the build.&lt;/strong&gt; The Go modules are downloaded first, in a container of their own, which is the only one with the network. Everything it runs is this checkout&amp;rsquo;s, never the commit&amp;rsquo;s: its &lt;code&gt;release_image&lt;/code&gt;, its &lt;code&gt;release.sh&lt;/code&gt;, and the Go that its &lt;code&gt;mise.lock&lt;/code&gt; pins, so the commit can&amp;rsquo;t choose an old Go with a known flaw for the one container with the network. It gets only the commit&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; and &lt;code&gt;go.sum&lt;/code&gt;, read-only, and a commit whose &lt;code&gt;go.mod&lt;/code&gt; needs a newer Go than this checkout&amp;rsquo;s is refused before anything runs, so build it from a checkout at least as new. Go downloads the modules from its module proxy alone, &lt;code&gt;proxy.golang.org&lt;/code&gt;, and checks each against &lt;code&gt;go.sum&lt;/code&gt;, or against Go&amp;rsquo;s checksum database for one that &lt;code&gt;go.sum&lt;/code&gt; lacks, and downloading runs none of the modules&amp;rsquo; code. So every module path that the commit&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; names is looked up on Google&amp;rsquo;s proxy and checksum database, even a private one, which fails there. The build&amp;rsquo;s container then runs with &lt;code&gt;--network none&lt;/code&gt; and reads the modules read-only, as a module proxy&amp;rsquo;s files, so the commit&amp;rsquo;s code can&amp;rsquo;t reach your network or the services on your machine, such as the ones that Docker Desktop and podman machine forward to the Mac&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No capabilities and no new privileges.&lt;/strong&gt; Every container runs with &lt;code&gt;--cap-drop ALL&lt;/code&gt; and &lt;code&gt;--security-opt no-new-privileges&lt;/code&gt;. So root in the container can&amp;rsquo;t give a file another owner or ignore a file&amp;rsquo;s mode, and a setuid file in the commit&amp;rsquo;s image gives no privileges, even under a rootful runtime, where root in the container would otherwise be root on your machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounded processes and memory.&lt;/strong&gt; Every container runs with &lt;code&gt;--pids-limit 8192&lt;/code&gt; and &lt;code&gt;--memory 8g&lt;/code&gt;, so a build that forks without end or keeps allocating stops at those limits rather than using up your machine&amp;rsquo;s, which matters most under rootful Docker on Linux, whose containers share your kernel and have no limit of their own. Rootless podman supports them only on cgroups v2, with the &lt;code&gt;pids&lt;/code&gt; and &lt;code&gt;memory&lt;/code&gt; controllers delegated to your user, as systemd does by default. Disk space has no limit that both runtimes support, so while a build runs, it can fill the disk that holds your temporary folder or the runtime&amp;rsquo;s storage, until the time limit stops it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The right user.&lt;/strong&gt; The container runs as root under a rootless runtime, rootless podman or Docker&amp;rsquo;s rootless mode, which maps root to you, and as you under a rootful one, Docker or Docker Desktop, so the files it writes are yours either way. The runtime&amp;rsquo;s info says which, never its name, so podman behind a &lt;code&gt;docker&lt;/code&gt; command runs as podman does, and a runtime that doesn&amp;rsquo;t answer, such as Docker Desktop when it isn&amp;rsquo;t running, stops the build before it starts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only your own files back.&lt;/strong&gt; The build writes its files to a folder of their own, mounted at &lt;code&gt;/out&lt;/code&gt;, which the container can&amp;rsquo;t swap for a link, because a mount point can&amp;rsquo;t be renamed. Before &lt;code&gt;release.sh&lt;/code&gt; copies, signs or keeps any of them, it checks that the folder is still the one it made, not a link to another, that everything in it is a file or a folder, never a link, that each is yours and is neither setuid, setgid, sticky nor writable by anyone, and that they come to 2 GiB at most, which a release is far under. Then it copies the files to &lt;code&gt;dist/&lt;/code&gt; rather than moving them, so each copy is yours, with mode 0755 or 0644. So neither minisign, &lt;code&gt;publish.sh&lt;/code&gt; nor &lt;code&gt;gh&lt;/code&gt; follows a link that the container made, and no file the container wrote keeps its owner or its mode. &lt;code&gt;release.sh&lt;/code&gt; runs with umask 022 on your machine too, so the signature it adds to &lt;code&gt;dist/&lt;/code&gt; is 0644 as well, even under a umask such as Ubuntu&amp;rsquo;s 0002, which would leave it writable by your group.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A time limit, and no container left behind.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; names each container for its run alone and removes it from your machine once it has run for two hours, or for &lt;code&gt;DEVVM_RELEASE_TIMEOUT&lt;/code&gt; seconds, whatever its image does. It removes it too as soon as &lt;code&gt;release.sh&lt;/code&gt; stops early. Ctrl+C, a closed terminal and &lt;code&gt;kill&lt;/code&gt; stop it at once, and after &lt;code&gt;kill -9&lt;/code&gt; a watchdog that outlives &lt;code&gt;release.sh&lt;/code&gt; removes the container and the build&amp;rsquo;s temporary folder within a few seconds. The container&amp;rsquo;s first process is &lt;code&gt;bash&lt;/code&gt;, so the image&amp;rsquo;s own entrypoint never runs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-docs-sites"&gt;The docs sites&lt;span class="hx:absolute hx:-mt-20" id="the-docs-sites"&gt;&lt;/span&gt;
&lt;a href="#the-docs-sites" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The docs have two sites, and the Docs workflow (&lt;code&gt;.github/workflows/docs.yml&lt;/code&gt;) deploys both. devvm.dev shows the docs of the latest release, so what users read matches the devvm they install. next.devvm.dev shows the docs on &lt;code&gt;main&lt;/code&gt;, for the next release, which is what someone trying a prerelease reads. A pull request that touches the docs gets their lints and a build, and it deploys nothing, so a pull request from a fork never reaches either site or its keys.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;devvm.dev&lt;/strong&gt; is GitHub Pages, in the repo&amp;rsquo;s &lt;code&gt;github-pages&lt;/code&gt; environment, which accepts deployments from &lt;code&gt;main&lt;/code&gt; and from &lt;code&gt;v*&lt;/code&gt; tags, and only admins can create a &lt;code&gt;v*&lt;/code&gt; tag. When a release is published, and it isn&amp;rsquo;t a prerelease, the workflow builds the docs in that release&amp;rsquo;s tag and deploys them. A release event runs the workflow file that the tag has, so a release whose tag predates this workflow doesn&amp;rsquo;t deploy on its own. Pushes to &lt;code&gt;main&lt;/code&gt; never change devvm.dev.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;To deploy a release&amp;rsquo;s docs by hand,&lt;/strong&gt; for a release that didn&amp;rsquo;t deploy on its own or to put devvm.dev back on a release, run the Docs workflow from &lt;code&gt;main&lt;/code&gt; in the repo&amp;rsquo;s Actions tab, or with &lt;code&gt;gh workflow run docs.yml --repo devvmhq/devvm -f site=devvm.dev -f ref=v0.1.0&lt;/code&gt;. The site is &lt;code&gt;devvm.dev&lt;/code&gt; unless you choose another one, and the ref is the release&amp;rsquo;s tag, which has to look like &lt;code&gt;v0.1.0&lt;/code&gt;, so a prerelease&amp;rsquo;s tag is refused. Without a ref, the workflow deploys the latest release, as &lt;code&gt;gh release view&lt;/code&gt; names it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;next.devvm.dev&lt;/strong&gt; is Cloudflare Pages, serving the files on the &lt;code&gt;main&lt;/code&gt; branch of the repo &lt;code&gt;devvmhq/docs-next&lt;/code&gt;, and Cloudflare builds nothing. On each push to &lt;code&gt;main&lt;/code&gt; that touches the docs, the workflow lints and builds &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s docs for next.devvm.dev, then replaces everything in &lt;code&gt;devvmhq/docs-next&lt;/code&gt; but its &lt;code&gt;README.md&lt;/code&gt; with the build, and commits it as &lt;code&gt;Build from devvm &amp;lt;short sha&amp;gt;&lt;/code&gt;. When the build is the same as the last one, it commits nothing. &lt;code&gt;gh workflow run docs.yml --repo devvmhq/devvm -f site=next.devvm.dev&lt;/code&gt; runs it by hand. Nobody edits &lt;code&gt;devvmhq/docs-next&lt;/code&gt; by hand, because the next build replaces it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every build draws the diagrams first,&lt;/strong&gt; with &lt;code&gt;mise run docs:diagrams&lt;/code&gt;, so each of the workflow&amp;rsquo;s jobs installs Node through mise. A release whose tag predates the drawing script, &lt;code&gt;docs/render-diagrams.mjs&lt;/code&gt;, loads Mermaid in its pages instead, so the release job draws them only when the tag has that script.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The deploy key&lt;/strong&gt; that pushes to &lt;code&gt;devvmhq/docs-next&lt;/code&gt; is the secret &lt;code&gt;DOCS_NEXT_DEPLOY_KEY&lt;/code&gt; in the &lt;code&gt;docs-next&lt;/code&gt; environment, which only &lt;code&gt;main&lt;/code&gt; can deploy from. It&amp;rsquo;s an ed25519 key with write access to &lt;code&gt;devvmhq/docs-next&lt;/code&gt; and to nothing else. The workflow checks that repo out with it only after the site is built, so the build never sees the key. To rotate it, make a new key, add its public half to &lt;code&gt;devvmhq/docs-next&lt;/code&gt; as a deploy key with write access, put its private half in the secret, then delete the old deploy key.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The next build&lt;/strong&gt; is &lt;code&gt;hugo -s docs --minify --config hugo.yaml,next.yaml&lt;/code&gt;, which reads &lt;code&gt;docs/next.yaml&lt;/code&gt; over &lt;code&gt;docs/hugo.yaml&lt;/code&gt;. It sets the site&amp;rsquo;s address to &lt;code&gt;https://next.devvm.dev/&lt;/code&gt; and puts a banner on every page that says these docs are for the next devvm and links to devvm.dev. It also sets &lt;code&gt;noindex&lt;/code&gt;, so Hextra gives every page a &lt;code&gt;noindex, nofollow&lt;/code&gt; robots meta tag, and &lt;code&gt;docs/layouts/robots.txt&lt;/code&gt; disallows everything, so search engines don&amp;rsquo;t index the site. devvm.dev&amp;rsquo;s build, &lt;code&gt;hugo -s docs --minify&lt;/code&gt;, never reads &lt;code&gt;docs/next.yaml&lt;/code&gt;, so it has no banner, its pages say &lt;code&gt;index, follow&lt;/code&gt;, and its &lt;code&gt;robots.txt&lt;/code&gt; allows everything.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Toolchains</title><link>https://next.devvm.dev/docs/using/toolchains/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/toolchains/</guid><description>
&lt;p&gt;devvm has these toolchains:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Toolchain&lt;/th&gt;
&lt;th&gt;What it brings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#node"&gt;node&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Node 24, with npm, pnpm, yarn and bun&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#python"&gt;python&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;CPython, with pip and uv&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#rust"&gt;rust&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;rustup, cargo and the stable toolchain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#go"&gt;go&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#dotnet"&gt;dotnet&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;the .NET SDK and its runtimes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A new VM gets the ones its folder&amp;rsquo;s files call for, which the summary of the new VM shows, unless you customize the VM and check others in the list or give others with &lt;code&gt;--tools&lt;/code&gt;, as in &lt;code&gt;devvm --tools node,python&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;). Each section below says what the toolchain brings and which files make devvm choose it. A project that gets its toolchain from Nix uses the &lt;code&gt;nix&lt;/code&gt; layer, which &lt;a href="#nix-projects"&gt;Nix projects&lt;/a&gt; covers.&lt;/p&gt;
&lt;h2 data-hextra-search-id="node"&gt;node&lt;span class="hx:absolute hx:-mt-20" id="node"&gt;&lt;/span&gt;
&lt;a href="#node" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;node brings the newest release of Node 24, with npm, pnpm, yarn through corepack, and bun. devvm stays on Node 24 because newer releases drop corepack.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Files.&lt;/strong&gt; devvm chooses node for a folder with &lt;code&gt;package.json&lt;/code&gt;, &lt;code&gt;bun.lock&lt;/code&gt; or &lt;code&gt;bun.lockb&lt;/code&gt; at its top level.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versions.&lt;/strong&gt; A project&amp;rsquo;s &lt;code&gt;.nvmrc&lt;/code&gt; or &lt;code&gt;.node-version&lt;/code&gt; picks its Node version, which installs into the VM the first time it&amp;rsquo;s used.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Global installs.&lt;/strong&gt; &lt;code&gt;npm i -g&lt;/code&gt; installs into &lt;code&gt;~/.npm-global&lt;/code&gt; in the VM, which is on the &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allowlist.&lt;/strong&gt; On the allowlist tier, the VM can reach npm&amp;rsquo;s, yarn&amp;rsquo;s, pnpm&amp;rsquo;s and bun&amp;rsquo;s registries and Node&amp;rsquo;s downloads, which are &lt;code&gt;registry.npmjs.org&lt;/code&gt;, &lt;code&gt;registry.yarnpkg.com&lt;/code&gt;, &lt;code&gt;repo.yarnpkg.com&lt;/code&gt;, &lt;code&gt;nodejs.org&lt;/code&gt; and &lt;code&gt;bun.sh&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="python"&gt;python&lt;span class="hx:absolute hx:-mt-20" id="python"&gt;&lt;/span&gt;
&lt;a href="#python" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;python brings a prebuilt build of the newest CPython release, and uv, so &lt;code&gt;pip&lt;/code&gt; and &lt;code&gt;uv&lt;/code&gt; work as usual.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Files.&lt;/strong&gt; devvm chooses python for a folder with &lt;code&gt;pyproject.toml&lt;/code&gt;, &lt;code&gt;requirements.txt&lt;/code&gt;, &lt;code&gt;uv.lock&lt;/code&gt;, &lt;code&gt;setup.py&lt;/code&gt; or &lt;code&gt;Pipfile&lt;/code&gt; at its top level.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versions.&lt;/strong&gt; A project&amp;rsquo;s &lt;code&gt;.python-version&lt;/code&gt; picks its Python version, which installs into the VM the first time it&amp;rsquo;s used.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Global installs.&lt;/strong&gt; The shared Python is read-only, so packages go into a project&amp;rsquo;s virtual environment or into your home in the VM, and &lt;code&gt;~/.local/bin&lt;/code&gt; is on the &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allowlist.&lt;/strong&gt; On the allowlist tier, the VM can reach PyPI and the Python downloads that uv uses, which are &lt;code&gt;pypi.org&lt;/code&gt;, &lt;code&gt;files.pythonhosted.org&lt;/code&gt; and &lt;code&gt;releases.astral.sh&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="rust"&gt;rust&lt;span class="hx:absolute hx:-mt-20" id="rust"&gt;&lt;/span&gt;
&lt;a href="#rust" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;rust brings rustup, cargo and the newest stable toolchain, with the &lt;code&gt;rust-src&lt;/code&gt; and &lt;code&gt;rust-analyzer&lt;/code&gt; components already added.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Files.&lt;/strong&gt; devvm chooses rust for a folder with &lt;code&gt;Cargo.toml&lt;/code&gt; at its top level.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versions.&lt;/strong&gt; A project&amp;rsquo;s &lt;code&gt;rust-toolchain.toml&lt;/code&gt; picks its toolchain, which rustup installs into the VM next to the shared one the first time it&amp;rsquo;s used.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Global installs.&lt;/strong&gt; &lt;code&gt;cargo install&lt;/code&gt; installs into &lt;code&gt;~/.cargo/bin&lt;/code&gt; in the VM, which is on the &lt;code&gt;PATH&lt;/code&gt;. &lt;code&gt;rustup component add&lt;/code&gt; can&amp;rsquo;t change the shared toolchain, which is why it comes with &lt;code&gt;rust-src&lt;/code&gt; and &lt;code&gt;rust-analyzer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allowlist.&lt;/strong&gt; On the allowlist tier, the VM can reach crates.io and Rust&amp;rsquo;s toolchain downloads, which are &lt;code&gt;crates.io&lt;/code&gt;, &lt;code&gt;index.crates.io&lt;/code&gt;, &lt;code&gt;static.crates.io&lt;/code&gt; and &lt;code&gt;static.rust-lang.org&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="go"&gt;go&lt;span class="hx:absolute hx:-mt-20" id="go"&gt;&lt;/span&gt;
&lt;a href="#go" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;go brings the newest Go release, and devvm turns Go&amp;rsquo;s telemetry off in the VM.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Files.&lt;/strong&gt; devvm chooses go for a folder with &lt;code&gt;go.mod&lt;/code&gt; at its top level.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versions.&lt;/strong&gt; The &lt;code&gt;toolchain&lt;/code&gt; line in a project&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; picks its Go version, and Go itself downloads that version into the VM the first time it&amp;rsquo;s used.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Global installs.&lt;/strong&gt; &lt;code&gt;go install&lt;/code&gt; installs into &lt;code&gt;~/go/bin&lt;/code&gt; in the VM, which is on the &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allowlist.&lt;/strong&gt; On the allowlist tier, the VM can reach Go&amp;rsquo;s module proxy, its checksum database and Go&amp;rsquo;s downloads, which are &lt;code&gt;proxy.golang.org&lt;/code&gt;, &lt;code&gt;sum.golang.org&lt;/code&gt;, &lt;code&gt;go.dev&lt;/code&gt; and &lt;code&gt;dl.google.com&lt;/code&gt;. Go&amp;rsquo;s telemetry uploads, to &lt;code&gt;telemetry.go.dev&lt;/code&gt;, are a &lt;a href="https://next.devvm.dev/docs/safety/network/#quiet-hosts"&gt;quiet host&lt;/a&gt;, so their blocks never show in the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="dotnet"&gt;dotnet&lt;span class="hx:absolute hx:-mt-20" id="dotnet"&gt;&lt;/span&gt;
&lt;a href="#dotnet" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;dotnet brings the newest release of the .NET SDK, with the .NET and ASP.NET Core runtimes that come with it, and devvm turns off .NET&amp;rsquo;s telemetry and its first-run banner in the VM.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Files.&lt;/strong&gt; devvm chooses dotnet for a folder with a solution (&lt;code&gt;*.sln&lt;/code&gt; or &lt;code&gt;*.slnx&lt;/code&gt;), a C# or F# project (&lt;code&gt;*.csproj&lt;/code&gt; or &lt;code&gt;*.fsproj&lt;/code&gt;) or &lt;code&gt;global.json&lt;/code&gt; at its top level.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versions.&lt;/strong&gt; The &lt;code&gt;sdk.version&lt;/code&gt; in a project&amp;rsquo;s &lt;code&gt;global.json&lt;/code&gt; picks its SDK, which installs into the VM the first time it&amp;rsquo;s used. mise installs exactly that version and doesn&amp;rsquo;t follow &lt;code&gt;rollForward&lt;/code&gt;, so a &lt;code&gt;global.json&lt;/code&gt; that allows a newer SDK still gets the one it names, and a &lt;code&gt;global.json&lt;/code&gt; without an SDK version keeps the shared one. mise installs that SDK with Microsoft&amp;rsquo;s install script, which checks only the download&amp;rsquo;s size, while devvm checks the shared SDK against the SHA-512 that Microsoft publishes for it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Global installs.&lt;/strong&gt; &lt;code&gt;dotnet tool install -g&lt;/code&gt; installs into &lt;code&gt;~/.dotnet/tools&lt;/code&gt; in the VM, which is on the &lt;code&gt;PATH&lt;/code&gt;, and NuGet keeps its packages in &lt;code&gt;~/.nuget/packages&lt;/code&gt;. The shared SDK is read-only, so &lt;code&gt;dotnet workload install&lt;/code&gt; installs workloads into &lt;code&gt;~/.dotnet&lt;/code&gt; in the VM instead of the SDK&amp;rsquo;s folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allowlist.&lt;/strong&gt; On the allowlist tier, the VM can reach NuGet, the revocation lists that NuGet checks packages&amp;rsquo; signatures against and the OCSP responder it asks when a list can&amp;rsquo;t be fetched, and the SDK downloads that a &lt;code&gt;global.json&lt;/code&gt; asks for, which are &lt;code&gt;api.nuget.org&lt;/code&gt;, &lt;code&gt;crl3.digicert.com&lt;/code&gt; and &lt;code&gt;ocsp.digicert.com&lt;/code&gt; on port 80, &lt;code&gt;dot.net&lt;/code&gt; and &lt;code&gt;builds.dotnet.microsoft.com&lt;/code&gt;. Microsoft&amp;rsquo;s telemetry isn&amp;rsquo;t on the allowlist.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="nix-projects"&gt;Nix projects&lt;span class="hx:absolute hx:-mt-20" id="nix-projects"&gt;&lt;/span&gt;
&lt;a href="#nix-projects" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A project whose toolchain comes from Nix gets the &lt;a href="https://next.devvm.dev/docs/using/images/#nix"&gt;&lt;code&gt;nix&lt;/code&gt; layer&lt;/a&gt;, which brings Nix, direnv and nix-direnv into its VM. For a folder with &lt;code&gt;flake.nix&lt;/code&gt;, &lt;code&gt;shell.nix&lt;/code&gt; or &lt;code&gt;devenv.nix&lt;/code&gt; at its top level, or with a &lt;code&gt;default.nix&lt;/code&gt; that makes a shell with &lt;code&gt;mkShell&lt;/code&gt;, the list devvm shows when you customize a new VM names that file in the &lt;code&gt;nix&lt;/code&gt; row, and you choose it there. A layer isn&amp;rsquo;t chosen by default, so a VM made as its summary shows, or without a terminal, gets it only with &lt;code&gt;--layers nix&lt;/code&gt;, as in &lt;code&gt;devvm --layers nix&lt;/code&gt; in a folder with &lt;code&gt;package.json&lt;/code&gt; and &lt;code&gt;flake.nix&lt;/code&gt;, which gives node on the &lt;code&gt;nix&lt;/code&gt; layer.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dev shells.&lt;/strong&gt; Put &lt;code&gt;use flake&lt;/code&gt; (or &lt;code&gt;use nix&lt;/code&gt; for a &lt;code&gt;shell.nix&lt;/code&gt;) in the project&amp;rsquo;s &lt;code&gt;.envrc&lt;/code&gt; and run &lt;code&gt;direnv allow&lt;/code&gt; in the VM once. From then on, each shell that changes into the folder loads the dev shell, and leaving the folder unloads it. This works in your terminal and in the terminals of editors connected over SSH.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The flake&amp;rsquo;s tools come first.&lt;/strong&gt; While the dev shell is loaded, its tools are ahead of the shared tools on the &lt;code&gt;PATH&lt;/code&gt;, so a flake&amp;rsquo;s &lt;code&gt;node&lt;/code&gt; wins over the shared node, and the shared tools come back when you leave the folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Files in the project.&lt;/strong&gt; nix-direnv keeps its cache of the dev shell in your home in the VM, so the project gets no &lt;code&gt;.direnv&lt;/code&gt; folder. Nix itself writes a &lt;code&gt;flake.lock&lt;/code&gt; next to a &lt;code&gt;flake.nix&lt;/code&gt; that has none, and in a git repository it marks that file to be added, as it does on any machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One store per VM.&lt;/strong&gt; Each VM has its own Nix store, so a package one VM builds isn&amp;rsquo;t in another&amp;rsquo;s. &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; works in any VM with the layer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared downloads.&lt;/strong&gt; VMs share their downloads from Nix&amp;rsquo;s binary cache, on every &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt;, an open VM&amp;rsquo;s included, because every VM&amp;rsquo;s Nix goes through its proxy. The first VM that needs a package gets it from cache.nixos.org through devvm, which keeps a copy on this machine, and the other VMs get that copy, so each package downloads once per machine instead of once per VM. Only devvm adds to this shared cache, and only what cache.nixos.org signed, so no VM can change what another VM gets. When the cache doesn&amp;rsquo;t have a package or can&amp;rsquo;t get it, Nix goes to cache.nixos.org itself. The cache keeps to 10 GiB, deleting the packages used least recently first, unless you set another size with &lt;code&gt;devvm retention nix-cache.size=20G&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention&lt;/a&gt;). &lt;code&gt;devvm space&lt;/code&gt; shows what it takes, and &lt;code&gt;devvm gc --nix-cache&lt;/code&gt; empties it (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;how it works&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Trust.&lt;/strong&gt; Only root is a trusted Nix user, so the VM&amp;rsquo;s user can&amp;rsquo;t add caches or signing keys of their own, and Nix ignores &lt;code&gt;--option substituters&lt;/code&gt; from them. &lt;code&gt;sudo nix&lt;/code&gt; works. Nix builds every package in its sandbox, and a build fails rather than run without it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allowlist.&lt;/strong&gt; On the allowlist tier, the VM can reach Nix&amp;rsquo;s binary cache and its channels and flake registry, which are &lt;code&gt;cache.nixos.org&lt;/code&gt;, &lt;code&gt;channels.nixos.org&lt;/code&gt; and &lt;code&gt;releases.nixos.org&lt;/code&gt;, and GitHub, where most flakes&amp;rsquo; inputs come from. A package that isn&amp;rsquo;t in Nix&amp;rsquo;s binary cache builds from source, which downloads its sources from their own hosts, and those are blocked until you allow them (&lt;a href="https://next.devvm.dev/docs/safety/network/#nix"&gt;Nix through the proxy&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="sharing-a-teams-packages"&gt;Sharing a team&amp;rsquo;s packages&lt;span class="hx:absolute hx:-mt-20" id="sharing-a-teams-packages"&gt;&lt;/span&gt;
&lt;a href="#sharing-a-teams-packages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When your team&amp;rsquo;s projects use one flake for their dev shell, you can put that dev shell&amp;rsquo;s packages into an image, so every VM made from the image starts with them in its store and downloads none of them. VMs made from one image share its disk, because on macOS each VM&amp;rsquo;s disk is a copy-on-write clone of the image&amp;rsquo;s, and on Linux hosts it&amp;rsquo;s an overlay of the image&amp;rsquo;s, so the packages take their space once. This works with the stable Nix that the &lt;code&gt;nix&lt;/code&gt; layer installs, on every network tier.&lt;/p&gt;
&lt;p&gt;To do it, make a &lt;a href="https://next.devvm.dev/docs/using/customizing/#your-own-layers"&gt;layer of your own&lt;/a&gt; that builds the dev shell while the image builds, and give it after &lt;code&gt;nix&lt;/code&gt;, so that it runs on top of the &lt;code&gt;nix&lt;/code&gt; layer:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer new myteam
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$EDITOR&lt;/span&gt; ~/.config/devvm/layers/myteam.sh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --layers nix,myteam &lt;span class="c1"&gt;# a new VM of the image nix+myteam&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Put these lines in &lt;code&gt;~/.config/devvm/layers/myteam.sh&lt;/code&gt;, below the starter&amp;rsquo;s &lt;code&gt;set -euo pipefail&lt;/code&gt;, with your team&amp;rsquo;s flake at the commit you want:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# The team&amp;#39;s flake at a commit, so the image holds exactly that dev shell.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;flake&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;github:myorg/devshell/0123456789abcdef0123456789abcdef01234567
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/nix/var/nix/profiles/default/bin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$bin&lt;/span&gt;&lt;span class="s2"&gt;/nix&amp;#34;&lt;/span&gt; develop &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$flake&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; --profile /tmp/myteam-shell --command &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# A garbage collector root in the VM&amp;#39;s home keeps the dev shell&amp;#39;s packages in the store.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir -p ~/.cache/myteam
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$bin&lt;/span&gt;&lt;span class="s2"&gt;/nix-store&amp;#34;&lt;/span&gt; --add-root ~/.cache/myteam/dev-shell --realise &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;readlink -f /tmp/myteam-shell&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -f /tmp/myteam-shell /tmp/myteam-shell-*-link&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;nix develop&lt;/code&gt; builds or downloads every package of the flake&amp;rsquo;s dev shell into the image&amp;rsquo;s store and records the dev shell in a profile. &lt;code&gt;nix-store --add-root&lt;/code&gt; then makes &lt;code&gt;~/.cache/myteam/dev-shell&lt;/code&gt; a garbage collector root, so &lt;code&gt;nix-collect-garbage&lt;/code&gt; in a VM never deletes those packages. A project that loads the same dev shell, with &lt;code&gt;use flake github:myorg/devshell/&amp;lt;commit&amp;gt;&lt;/code&gt; in its &lt;code&gt;.envrc&lt;/code&gt;, finds every package already in its VM&amp;rsquo;s store, and so does most of a project whose own flake pins the same nixpkgs revision. The image is built without your credentials, because &lt;a href="https://next.devvm.dev/docs/internals/security/#read-only-and-confined-builds"&gt;credentials never go into images&lt;/a&gt;, so the flake has to be one that anyone can fetch, such as a public repository.&lt;/p&gt;
&lt;p&gt;What this doesn&amp;rsquo;t cover:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Packages a VM gets after it&amp;rsquo;s made&lt;/strong&gt; stay on that VM&amp;rsquo;s own disk. The &lt;a href="#nix-projects"&gt;shared downloads&lt;/a&gt; at least save downloading them again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A new version of the flake&lt;/strong&gt; needs a new image. Moving &lt;code&gt;flake&lt;/code&gt; to another commit edits the script, so devvm builds the image again the next time it&amp;rsquo;s used, while VMs made earlier keep the packages they have. When the script names a branch instead of a commit, a changed &lt;code&gt;flake.lock&lt;/code&gt; upstream doesn&amp;rsquo;t change the script, so run &lt;code&gt;devvm rebuild myteam&lt;/code&gt; to build the image again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A flake that pins another nixpkgs revision&lt;/strong&gt; shares few packages with the image, and its VM downloads the rest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nix&amp;rsquo;s local overlay store&lt;/strong&gt;, which would let VMs share one store as it changes, is left out until Nix makes it stable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="how-toolchains-are-shared-and-updated"&gt;How toolchains are shared and updated&lt;span class="hx:absolute hx:-mt-20" id="how-toolchains-are-shared-and-updated"&gt;&lt;/span&gt;
&lt;a href="#how-toolchains-are-shared-and-updated" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The toolchains are &lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;shared tools&lt;/a&gt;, like the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#supported-agents"&gt;coding agents&lt;/a&gt;, so they aren&amp;rsquo;t part of any image. devvm builds each version once and mounts it read-only into every VM that has it, and &lt;a href="https://mise.jdx.dev" target="_blank" rel="noopener"&gt;mise&lt;/a&gt; runs it, so each toolchain&amp;rsquo;s commands, such as &lt;code&gt;node&lt;/code&gt; or &lt;code&gt;cargo&lt;/code&gt;, work from any shell in the VM, including &lt;code&gt;bash -c&lt;/code&gt; from agents and from editors over SSH. Because the shared copy is read-only, a toolchain can&amp;rsquo;t update itself, and anything you install globally goes into your home in the VM, as each section above says.&lt;/p&gt;
&lt;p&gt;devvm follows each toolchain&amp;rsquo;s newest release, and Node 24 for node:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#which-bases-they-run-on"&gt;Which bases they run on&lt;/a&gt; says what each one needs from a VM&amp;rsquo;s base.&lt;/li&gt;
&lt;li&gt;&lt;a href="#adding-and-removing-tools"&gt;Adding and removing tools&lt;/a&gt; explains how &lt;code&gt;devvm update&lt;/code&gt; and &lt;code&gt;devvm tools update&lt;/code&gt; move a VM to newer versions, how &lt;code&gt;devvm tools add&lt;/code&gt; adds a toolchain to an existing VM, and how &lt;code&gt;devvm tools rm&lt;/code&gt; takes one out.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;What a new VM gets&lt;/a&gt; explains what happens when a folder calls for more than one toolchain.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="which-bases-they-run-on"&gt;Which bases they run on&lt;span class="hx:absolute hx:-mt-20" id="which-bases-they-run-on"&gt;&lt;/span&gt;
&lt;a href="#which-bases-they-run-on" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every toolchain runs on &lt;code&gt;base&lt;/code&gt; from Ubuntu&amp;rsquo;s own image, and on an Alpine-based image with &lt;a href="https://next.devvm.dev/docs/using/from/"&gt;&lt;code&gt;--from&lt;/code&gt;&lt;/a&gt;, which gets musl builds of the tools. dotnet also needs ICU, the Unicode library that .NET&amp;rsquo;s globalization uses, so devvm installs ICU in &lt;code&gt;base&lt;/code&gt;, whether it&amp;rsquo;s made from Ubuntu&amp;rsquo;s image or &lt;code&gt;--from&lt;/code&gt; a container image. On a Debian- or Ubuntu-based image, each tool needs at least the glibc version that its prebuilt release was built against. devvm measures that version from the tool&amp;rsquo;s files whenever it builds a new version, and it refuses a tool whose version is newer than the image&amp;rsquo;s glibc (&lt;a href="https://next.devvm.dev/docs/using/from/#shared-tools-and-glibc"&gt;shared tools and glibc&lt;/a&gt;). Today the shared tools need these glibc versions, so Debian 10 and Ubuntu 20.04 and newer images run all of them:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shared tool&lt;/th&gt;
&lt;th&gt;arm64&lt;/th&gt;
&lt;th&gt;amd64&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;node&lt;/td&gt;
&lt;td&gt;2.28&lt;/td&gt;
&lt;td&gt;2.28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pnpm and bun, with node&lt;/td&gt;
&lt;td&gt;2.18 and 2.17&lt;/td&gt;
&lt;td&gt;2.18 and 2.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;python&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uv, with python&lt;/td&gt;
&lt;td&gt;2.28&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rust, with rustup&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;go&lt;/td&gt;
&lt;td&gt;none, because its programs need no glibc&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dotnet&lt;/td&gt;
&lt;td&gt;2.27&lt;/td&gt;
&lt;td&gt;2.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;claude, opencode and pi&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;td&gt;2.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;codex&lt;/td&gt;
&lt;td&gt;2.28, for its voice helper&lt;/td&gt;
&lt;td&gt;2.28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cursor&lt;/td&gt;
&lt;td&gt;2.28, for the node it bundles&lt;/td&gt;
&lt;td&gt;2.28&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="adding-and-removing-tools"&gt;Adding and removing tools&lt;span class="hx:absolute hx:-mt-20" id="adding-and-removing-tools"&gt;&lt;/span&gt;
&lt;a href="#adding-and-removing-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A new VM gets the shared tools chosen when devvm makes it, the toolchains and the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#supported-agents"&gt;coding agents&lt;/a&gt;, and keeps those versions. On each launch, devvm warns when there are newer ones and names &lt;code&gt;devvm update&lt;/code&gt;, which moves the VM to them, and also makes the VM again when its image has changed, after asking (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools &lt;span class="c1"&gt;# choose this folder&amp;#39;s VM&amp;#39;s toolchains and agents in a list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools add python claude &lt;span class="c1"&gt;# add tools without the list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools rm python &lt;span class="c1"&gt;# take one out&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools update &lt;span class="c1"&gt;# move the VM to the newest shared tools&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In a terminal, &lt;code&gt;devvm tools&lt;/code&gt; shows the same list as for a new VM, with this folder&amp;rsquo;s VM&amp;rsquo;s toolchains and agents already chosen and its layers greyed out, because they&amp;rsquo;re built into the VM&amp;rsquo;s image, which keeps them until &lt;code&gt;devvm layer add&lt;/code&gt; or &lt;code&gt;devvm layer rm&lt;/code&gt; makes it again. The Layers heading names &lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm layer rm&lt;/code&gt;, which change a VM&amp;rsquo;s layers by making it again (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;). Choose the tools and confirm, and devvm adds and takes out what changed, as &lt;code&gt;devvm tools add&lt;/code&gt; and &lt;code&gt;devvm tools rm&lt;/code&gt; do, then opens a shell in the VM. When a new agent&amp;rsquo;s config folders need the running VM to start again, devvm asks first. When nothing changed, devvm says so and opens nothing.&lt;/p&gt;
&lt;p&gt;Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt; or &lt;code&gt;--json&lt;/code&gt;, &lt;code&gt;devvm tools&lt;/code&gt; shows the tools of this folder&amp;rsquo;s VM in a table, one row per tool, with node&amp;rsquo;s pnpm and bun and python&amp;rsquo;s uv in rows of their own:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TOOL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the tool&amp;rsquo;s name, such as &lt;code&gt;node&lt;/code&gt; or &lt;code&gt;pnpm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;VERSION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the version the VM has&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NEWER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the version in devvm&amp;rsquo;s tools lock when the VM has another build, which is usually a newer version, or &lt;code&gt;-&lt;/code&gt; when the VM has the lock&amp;rsquo;s build&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;BUILT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;yes&lt;/code&gt; when that newer version is built, &lt;code&gt;no&lt;/code&gt; when &lt;code&gt;devvm tools update&lt;/code&gt; builds it first, or &lt;code&gt;-&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The table changes nothing and starts no VM. devvm reads the tools lock as it is, without going online, so a release that came out since devvm last checked isn&amp;rsquo;t in it yet.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-tools-json"&gt;devvm tools &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-tools-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-tools-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm tools --json&lt;/code&gt; prints the same table as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. Each of the &lt;code&gt;tools&lt;/code&gt; has the tool&amp;rsquo;s name and the VM&amp;rsquo;s version. A tool that the lock has another build of also has &lt;code&gt;newer&lt;/code&gt;, which is the lock&amp;rsquo;s version, and &lt;code&gt;newer_built&lt;/code&gt;, which says whether that version is built.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tools&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tool&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;node&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;24.10.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;newer&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;24.11.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;newer_built&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tool&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;pnpm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;10.18.0&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The commands below change the VM&amp;rsquo;s tools from a script or the command line. They don&amp;rsquo;t change the VM&amp;rsquo;s disk, because its tools are mounted, so a change takes effect when devvm then opens a shell in the VM. Each takes the tools&amp;rsquo; names as separate words, as in &lt;code&gt;devvm tools add python claude&lt;/code&gt;, and devvm refuses names joined with &lt;code&gt;+&lt;/code&gt; or a comma.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm tools add TOOL...&lt;/code&gt; builds the tools that the share lacks, and they join the VM&amp;rsquo;s list at once. It says which of the tools the VM has already and leaves those as they are. A new agent&amp;rsquo;s config folders are mounted too, which needs the VM to start again. A stopped VM gets them as it starts, and for a running VM devvm asks before restarting it, because anything running in it stops (&lt;a href="https://next.devvm.dev/docs/using/vms/#restarting-and-stopping"&gt;restarting&lt;/a&gt;). If you answer no, there&amp;rsquo;s no terminal or you pass &lt;code&gt;--no-input&lt;/code&gt;, the VM gets them at its next start.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm tools rm TOOL...&lt;/code&gt; takes tools out. What the VM installed itself, such as other versions or global packages, stays.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm tools update&lt;/code&gt; checks upstream for newer versions, builds what&amp;rsquo;s missing, and moves the VM to them. When the VM already has the newest versions, it builds any of them that are missing. It changes only the shared tools, and never makes the VM again.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm update&lt;/code&gt; does the same first, without asking, and then asks to make the VM again only when the VM&amp;rsquo;s image has changed (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;), or its &lt;code&gt;devcontainer.json&lt;/code&gt; has (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/#updating-a-vm-from-the-file"&gt;updating a VM from the file&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; choose only what a new VM gets, so on a VM that exists they change nothing, and devvm warns and names &lt;code&gt;devvm tools&lt;/code&gt;. Layers aren&amp;rsquo;t shared tools, so &lt;code&gt;devvm tools&lt;/code&gt; can&amp;rsquo;t add or take out a layer such as &lt;code&gt;docker&lt;/code&gt; or &lt;code&gt;nix&lt;/code&gt;. A VM gets its layers when devvm makes it, so &lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm layer rm&lt;/code&gt; change them by making the VM again, after asking (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Your first VM</title><link>https://next.devvm.dev/docs/getting-started/first-vm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/getting-started/first-vm/</guid><description>
&lt;p&gt;This page assumes you&amp;rsquo;ve &lt;a href="https://next.devvm.dev/docs/getting-started/install/"&gt;installed devvm&lt;/a&gt; and that &lt;code&gt;devvm doctor&lt;/code&gt; finds nothing missing.&lt;/p&gt;
&lt;h2 data-hextra-search-id="making-the-vm"&gt;Making the VM&lt;span class="hx:absolute hx:-mt-20" id="making-the-vm"&gt;&lt;/span&gt;
&lt;a href="#making-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run devvm in a project folder.&lt;/strong&gt;&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/some-project
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Answer the first-run questions.&lt;/strong&gt; The first time, devvm asks for the CPUs and memory new VMs get, the coding agents they get, and the optional extras the base image gets, such as oh-my-bash and fzf. These set devvm&amp;rsquo;s defaults for every new VM, and &lt;code&gt;devvm setup&lt;/code&gt; changes them later (&lt;a href="https://next.devvm.dev/docs/using/settings/#devvm-setup"&gt;devvm setup&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check the summary.&lt;/strong&gt; devvm shows what this folder&amp;rsquo;s new VM gets: the toolchains your folder&amp;rsquo;s files call for, the agents and layers you chose for new VMs, its size, its network tier and its ports.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;==&amp;gt; This folder&amp;#39;s new VM, devvm-some-project-71a99b1076d92c, gets:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; toolchain node, for package.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; agent claude, from devvm setup
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; layers: none
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; size: 4 CPUs, 8 GiB of memory and a 100 GiB disk
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; network tier: allowlist
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ports: all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Customize it? [y/N]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Confirm, or customize it.&lt;/strong&gt; Confirm to make the VM as shown, or customize it to choose its toolchains, coding agents, layers, network tier, ports and size first (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;). Flags such as &lt;code&gt;--agents claude&lt;/code&gt; choose a part beforehand, and devvm asks nothing when the flags choose everything.&lt;/p&gt;
&lt;div class="devvm-callout devvm-callout-tip"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M3 1h5v1H3ZM2 2h1v1H2ZM8 2h1v1H8ZM1 3h1v3H1ZM3 3h1v1H3ZM9 3h1v3H9ZM2 6h1v1H2ZM8 6h1v1H8ZM3 7h1v1H3ZM7 7h1v1H7ZM3 8h5v1H3ZM3 10h5v1H3ZM4 11h3v1H4Z"/&gt;&lt;/svg&gt; Tip&lt;/p&gt;&lt;p&gt;Keep allowlist, the default, unless the VM needs more. The allowlist &lt;a href="https://next.devvm.dev/docs/safety/network/"&gt;network tier&lt;/a&gt; limits the VM to the hosts you allow, and every tier keeps your secrets on your machine. When you don&amp;rsquo;t know yet which hosts the project needs, choose &lt;code&gt;learn&lt;/code&gt;: the VM reaches any public host while it learns them, and &lt;code&gt;devvm network lock&lt;/code&gt; then keeps the ones you choose on the allowlist tier (&lt;a href="https://next.devvm.dev/docs/safety/network/#learning-the-hosts-a-vm-needs"&gt;learning the hosts a VM needs&lt;/a&gt;).&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Wait for the base image.&lt;/strong&gt; The first time, devvm builds it with the extras you chose, which takes a few minutes once, and later VMs start in seconds (&lt;a href="https://next.devvm.dev/docs/using/images/"&gt;images&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;==&amp;gt; building image base (e9f517dddef1)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt; a few minutes, and Ubuntu&amp;#39;s cloud image to download the first time
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt; (details: ~/.local/share/devvm/logs/runs/20261024-090616-83541.log)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;==&amp;gt; image base ready
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;==&amp;gt; creating devvm-some-project-71a99b1076d92c from base
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;==&amp;gt; starting devvm-some-project-71a99b1076d92c
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Then devvm opens a shell in the VM at the same path, &lt;code&gt;~/some-project&lt;/code&gt;, with &lt;code&gt;(devvm)&lt;/code&gt; at the start of the prompt.&lt;/p&gt;
&lt;h2 data-hextra-search-id="claude-codes-login"&gt;Claude Code&amp;rsquo;s login&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-login"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If the VM has Claude Code, log it in to your Claude account once. Run this in a terminal on this machine, not the VM&amp;rsquo;s shell, in the project folder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm agent login claude&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Open the address it shows in a browser, approve the login, and paste the code the browser shows. devvm keeps the login on this machine for every VM with Claude Code, and the VMs get only a placeholder (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;Claude Code login&lt;/a&gt;). If you already use an agent on this machine, &lt;code&gt;devvm agent import&lt;/code&gt; copies its settings and logins into devvm&amp;rsquo;s agent store instead (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="starting-the-agent"&gt;Starting the agent&lt;span class="hx:absolute hx:-mt-20" id="starting-the-agent"&gt;&lt;/span&gt;
&lt;a href="#starting-the-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Start the agent in the VM&amp;rsquo;s shell, so it runs in the VM:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;~/some-project $ devvm
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;(devvm) ~/some-project $ claude
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Run the agent the VM has by its name, such as &lt;code&gt;claude&lt;/code&gt;, which the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#supported-agents"&gt;supported agents&lt;/a&gt; table lists (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#running-an-agent"&gt;running an agent&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="whats-in-the-vm"&gt;What&amp;rsquo;s in the VM&lt;span class="hx:absolute hx:-mt-20" id="whats-in-the-vm"&gt;&lt;/span&gt;
&lt;a href="#whats-in-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Your project folder&lt;/strong&gt;, read-write, so your editor and the VM share the same files. It&amp;rsquo;s the only folder of yours the VM sees, and its &lt;code&gt;.git&lt;/code&gt; hooks and config are locked, except on a Linux host that can&amp;rsquo;t lock them, such as Ubuntu 23.10 and newer, where devvm only watches them (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;.git protection&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The toolchains&lt;/strong&gt;, ready at once (&lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;toolchains&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your git name and email&lt;/strong&gt;, so commits made in the VM are yours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ports&lt;/strong&gt;: a dev server on &lt;code&gt;:5173&lt;/code&gt; in the VM opens at &lt;code&gt;localhost:5173&lt;/code&gt; on your machine (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;ports&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;sudo&lt;/strong&gt; without a password, so &lt;code&gt;apt install&lt;/code&gt; works as on any Ubuntu machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="working-on-a-clone-instead"&gt;Working on a clone instead&lt;span class="hx:absolute hx:-mt-20" id="working-on-a-clone-instead"&gt;&lt;/span&gt;
&lt;a href="#working-on-a-clone-instead" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To keep the VM out of your working tree and &lt;code&gt;.git&lt;/code&gt; entirely, make it with its own clone of the repo:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --clone &lt;span class="c1"&gt;# a VM with its own clone of your branches&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git fetch devvm &lt;span class="c1"&gt;# later, on this machine: the VM&amp;#39;s work as devvm/&amp;lt;branch&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git log -p main..devvm/main &lt;span class="c1"&gt;# review it before you merge it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Use it for an agent working unattended, a repo you don&amp;rsquo;t trust, or on a Linux host whose kernel doesn&amp;rsquo;t let devvm protect &lt;code&gt;.git&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;working on a clone&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="coming-back-to-it"&gt;Coming back to it&lt;span class="hx:absolute hx:-mt-20" id="coming-back-to-it"&gt;&lt;/span&gt;
&lt;a href="#coming-back-to-it" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The VM belongs to its folder, and its subfolders use it too (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-subfolder"&gt;a subfolder&lt;/a&gt;):&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="c1"&gt;# a shell in this folder&amp;#39;s VM, started if it&amp;#39;s stopped&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools &lt;span class="c1"&gt;# choose its toolchains and agents&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools add claude &lt;span class="c1"&gt;# add Claude Code to this folder&amp;#39;s VM&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm code &lt;span class="c1"&gt;# open it in VS Code&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm stop &lt;span class="c1"&gt;# stop it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ls &lt;span class="c1"&gt;# list every VM&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm &lt;span class="c1"&gt;# delete it after asking, saving its agents&amp;#39; history first&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/getting-started/commands/"&gt;Everyday commands&lt;/a&gt; lists the rest, and &lt;a href="https://next.devvm.dev/docs/using/vms/"&gt;managing VMs&lt;/a&gt; covers restarting, deleting and moving VMs. Before you let an agent loose in the VM, read &lt;a href="https://next.devvm.dev/docs/safety/#the-habits"&gt;staying safe&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Attack vectors</title><link>https://next.devvm.dev/docs/safety/attack-vectors/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/safety/attack-vectors/</guid><description>
&lt;p&gt;This page lists the common ways that code you didn&amp;rsquo;t write gets to run on a developer&amp;rsquo;s machine or gets data off it, and what devvm does about each one. devvm stops most of them on its own, and the &lt;a href="https://next.devvm.dev/docs/safety/#the-habits"&gt;habits&lt;/a&gt; close most of what&amp;rsquo;s left. &lt;a href="#narrowed-not-closed"&gt;Narrowed, not closed&lt;/a&gt; and &lt;a href="#left-to-you"&gt;Left to you&lt;/a&gt; are the one list of what devvm leaves open, and each entry links to the page that explains its mechanism.&lt;/p&gt;
&lt;h2 data-hextra-search-id="how-devvm-handles-each-attack"&gt;How devvm handles each attack&lt;span class="hx:absolute hx:-mt-20" id="how-devvm-handles-each-attack"&gt;&lt;/span&gt;
&lt;a href="#how-devvm-handles-each-attack" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The rest of this page sorts the attacks by how much of each one devvm stops:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#blocked"&gt;Blocked&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The attack can&amp;rsquo;t work, because what it&amp;rsquo;s after isn&amp;rsquo;t in the VM or the VM can&amp;rsquo;t reach it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#kept-inside-the-vm"&gt;Kept inside the VM&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The attacker&amp;rsquo;s code runs, but it runs in the VM, where it reaches only the project folder and what you gave the VM.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#narrowed-not-closed"&gt;Narrowed, not closed&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;devvm closes part of the attack, and the entry says what&amp;rsquo;s still open.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#left-to-you"&gt;Left to you&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;devvm doesn&amp;rsquo;t stop the attack, and the entry says what to do instead.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Some protections hold only on some &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tiers&lt;/a&gt; or only on macOS, and each entry names its conditions. Everything here rests on the VM&amp;rsquo;s boundary. How devvm does each of these is in the &lt;a href="https://next.devvm.dev/docs/internals/security/"&gt;security model&lt;/a&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="blocked"&gt;Blocked&lt;span class="hx:absolute hx:-mt-20" id="blocked"&gt;&lt;/span&gt;
&lt;a href="#blocked" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 data-hextra-search-id="credentials-on-this-machine"&gt;Credentials on this machine&lt;span class="hx:absolute hx:-mt-20" id="credentials-on-this-machine"&gt;&lt;/span&gt;
&lt;a href="#credentials-on-this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SSH keys.&lt;/strong&gt; Malware on a developer&amp;rsquo;s machine looks in &lt;code&gt;~/.ssh&lt;/code&gt; first, because a private key opens every server and repo that trusts it. A VM never mounts &lt;code&gt;~/.ssh&lt;/code&gt;, and besides the project folder it mounts only the shared tools and the folders of devvm&amp;rsquo;s agent store, read-only, so there&amp;rsquo;s no key in it to copy. &lt;a href="#secrets-and-keys-the-vm-may-use"&gt;Agent forwarding&lt;/a&gt;, which you turn on yourself, lets the VM use your keys but never copy them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloud, cluster and registry logins.&lt;/strong&gt; Worms that steal credentials collect &lt;code&gt;~/.aws&lt;/code&gt;, &lt;code&gt;~/.config/gcloud&lt;/code&gt;, &lt;code&gt;~/.azure&lt;/code&gt;, &lt;code&gt;~/.kube/config&lt;/code&gt;, &lt;code&gt;~/.docker/config.json&lt;/code&gt; and the npm publish token in &lt;code&gt;~/.npmrc&lt;/code&gt;. A VM mounts none of them, so a package that goes looking finds nothing. Secrets you keep in the project folder are a different case, which &lt;a href="#files-the-vm-writes"&gt;Left to you&lt;/a&gt; covers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Keychain, browsers and password managers.&lt;/strong&gt; Stealers read saved passwords, cookies and login sessions from browser profiles and the Keychain. The VM has no browser profile of yours, and it can&amp;rsquo;t reach this machine&amp;rsquo;s Keychain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your coding agents&amp;rsquo; history.&lt;/strong&gt; Agent transcripts hold what you pasted into them, such as secrets and code from other projects. Your history never goes into a VM, and each VM&amp;rsquo;s own history stays in that VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/"&gt;coding agents&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secrets, on every tier.&lt;/strong&gt; Every VM, an open one included, gets a placeholder instead of each secret, such as your GitHub token or Claude Code&amp;rsquo;s token, and the proxy on this machine puts the real value only into requests for that secret&amp;rsquo;s own hosts (&lt;a href="https://next.devvm.dev/docs/safety/network/#secrets"&gt;secrets&lt;/a&gt;). A placeholder copied out of the VM is worthless elsewhere, because it ends in a random value of that VM&amp;rsquo;s own, and an open VM that sends a request around its proxy sends only the placeholder.
&lt;ul&gt;
&lt;li&gt;Another VM, or another user&amp;rsquo;s program on this machine, can&amp;rsquo;t spend the secret through the proxy either, because the proxy needs the VM&amp;rsquo;s own password, which only you can read. A program that runs as you can read it, though, as it can read the rest of your files.&lt;/li&gt;
&lt;li&gt;Codex and opencode logins and the MCP secrets that Claude Code gets from this machine work the same way, and devvm refreshes those OAuth logins on this machine, so a VM never holds their refresh tokens.&lt;/li&gt;
&lt;li&gt;A login to an MCP server that you make with &lt;code&gt;/mcp&lt;/code&gt; in a VM is that VM&amp;rsquo;s own. Claude Code keeps its real tokens in the VM, where code in the VM can read them, and they never leave it (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mcp-servers-logins"&gt;MCP servers&amp;rsquo; logins&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="git-running-code-on-this-machine"&gt;Git running code on this machine&lt;span class="hx:absolute hx:-mt-20" id="git-running-code-on-this-machine"&gt;&lt;/span&gt;
&lt;a href="#git-running-code-on-this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Git hooks and config.&lt;/strong&gt; A VM can write the project folder, so without protection it could add a hook such as &lt;code&gt;.git/hooks/post-checkout&lt;/code&gt;, or set a command in &lt;code&gt;.git/config&lt;/code&gt;: &lt;code&gt;core.fsmonitor&lt;/code&gt;, &lt;code&gt;core.hooksPath&lt;/code&gt;, &lt;code&gt;core.sshCommand&lt;/code&gt;, &lt;code&gt;core.pager&lt;/code&gt;, &lt;code&gt;core.editor&lt;/code&gt;, a &lt;code&gt;filter.*&lt;/code&gt; or &lt;code&gt;diff.*.textconv&lt;/code&gt; driver, a &lt;code&gt;credential.helper&lt;/code&gt; or a &lt;code&gt;!&lt;/code&gt; alias. Your next git command on this machine would run it. On macOS, devvm locks hooks and config with a flag that even root in the VM can&amp;rsquo;t clear, and on Linux it makes them read-only in the VM&amp;rsquo;s view of the folder (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;.git protection&lt;/a&gt;). A Linux host whose kernel doesn&amp;rsquo;t let devvm do that, which &lt;a href="#the-platform"&gt;Left to you&lt;/a&gt; covers, has neither.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm&amp;rsquo;s own git commands.&lt;/strong&gt; devvm runs git on this machine itself, for example to read your name and email for the VM, to check a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s repo for uncommitted changes, and to fetch from the VM. A VM can write a repo that git on this machine reads, such as the project folder&amp;rsquo;s on Linux or a repo inside a folder it mounts, so devvm&amp;rsquo;s git runs none of the programs a repo&amp;rsquo;s config can name:
&lt;ul&gt;
&lt;li&gt;It turns off the repo&amp;rsquo;s fsmonitor, its hooks, including those its config defines, and its filters, it never enters a submodule for &lt;code&gt;git status&lt;/code&gt;, and it uses no transport but ssh, so &lt;code&gt;git status&lt;/code&gt; or a fetch of devvm&amp;rsquo;s runs nothing that the VM wrote into the repo.&lt;/li&gt;
&lt;li&gt;It runs no program a repo&amp;rsquo;s config names to check signatures, and it sees a repo&amp;rsquo;s real history, whatever replace refs or a grafts file say.&lt;/li&gt;
&lt;li&gt;It ignores the git variables of the shell you run devvm in, such as &lt;code&gt;GIT_DIR&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_GLOBAL&lt;/code&gt;, so it never works on another repo or config by mistake, and it never asks you anything (&lt;code&gt;GIT_TERMINAL_PROMPT=0&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Its fetches reach the VM with ssh in batch mode (&lt;code&gt;-o BatchMode=yes&lt;/code&gt;), so the VM&amp;rsquo;s ssh server can&amp;rsquo;t ask you for a password. They always connect to that VM itself, whatever host the repo&amp;rsquo;s config sends them to, accept only the host key devvm pinned for it, and forward neither your agent nor any port.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="getting-out-over-the-network-on-the-allowlist-and-none-tiers"&gt;Getting out over the network, on the allowlist and none tiers&lt;span class="hx:absolute hx:-mt-20" id="getting-out-over-the-network-on-the-allowlist-and-none-tiers"&gt;&lt;/span&gt;
&lt;a href="#getting-out-over-the-network-on-the-allowlist-and-none-tiers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sending data to the attacker&amp;rsquo;s server.&lt;/strong&gt; Most attacks end by sending what they stole to a server the attacker runs. A confined VM reaches only its proxy, and on the allowlist tier the proxy allows only the hosts on the VM&amp;rsquo;s allowlist, and on the none tier only its agents&amp;rsquo; and secrets&amp;rsquo; hosts. On the internet tier, which a VM is on while it &lt;a href="https://next.devvm.dev/docs/safety/network/#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt;, the proxy allows every public host, the attacker&amp;rsquo;s included, so this holds only for this machine and your networks. devvm leaves storage and paste sites out of the default allowlist on purpose, because they&amp;rsquo;re easy ways to send data out (&lt;a href="https://next.devvm.dev/docs/safety/network/#allowlists"&gt;allowlists&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS tunnelling.&lt;/strong&gt; An attacker can encode data into names and look them up at a DNS server of their own. A VM sends no DNS queries out of it, because names resolve in the proxy on this machine. The names that tools look up in the VM are answered in the VM, by &lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt;&amp;rsquo;s dnsmasq, which has no server to ask, and the proxy resolves a name only once the VM&amp;rsquo;s rules allow it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Services on this machine and your network.&lt;/strong&gt; Code in a VM could attack what developers leave open on &lt;code&gt;localhost&lt;/code&gt;, such as databases, dev servers, Docker&amp;rsquo;s API and other VMs&amp;rsquo; ports. It could also attack your router, a NAS, or a cloud provider&amp;rsquo;s metadata service at &lt;code&gt;169.254.169.254&lt;/code&gt;. The proxy refuses this machine&amp;rsquo;s own addresses and internal ones, such as loopback, private, link-local and CGNAT ranges, unless a rule names the address (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS rebinding and address tricks.&lt;/strong&gt; A name can resolve to a public address when it&amp;rsquo;s checked and to an internal one when it&amp;rsquo;s dialed, and an internal address can hide in an IPv6, NAT64 or 6to4 form. The proxy dials only the address it checked, and it sees through NAT64 and 6to4 forms (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Going around the proxy.&lt;/strong&gt; Root in a VM can change its routes and firewall, but devvm confines the VM from outside it, so nothing in the VM reaches anything but the proxy (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;). devvm catches a VM started outside devvm, or one given a second network, with &lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt;. It stops a VM that gets out through a second network, and it offers to restart one started outside devvm confined, or stops it when there&amp;rsquo;s no terminal to ask in.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="spreading-beyond-the-vm"&gt;Spreading beyond the VM&lt;span class="hx:absolute hx:-mt-20" id="spreading-beyond-the-vm"&gt;&lt;/span&gt;
&lt;a href="#spreading-beyond-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Your agents&amp;rsquo; config.&lt;/strong&gt; A rogue agent could add a hook to &lt;code&gt;~/.claude/settings.json&lt;/code&gt; or a skill to &lt;code&gt;~/.claude/skills&lt;/code&gt;, so that it runs the next time you use the agent on this machine. devvm mounts the agents&amp;rsquo; config folders read-only, which this machine enforces, and copies their files in on every launch, so nothing the VM changes goes back (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;mounts&lt;/a&gt;). Only &lt;code&gt;devvm agent save&lt;/code&gt; copies a VM&amp;rsquo;s settings into devvm&amp;rsquo;s agent store, for every VM, and it shows what changed and asks first, so read its diff for hooks, MCP servers and plugins you didn&amp;rsquo;t add (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other projects and other VMs.&lt;/strong&gt; Each project folder gets its own VM with its own disk, and a VM mounts only its own project folder. Each VM&amp;rsquo;s proxy has its own password, so one VM can&amp;rsquo;t use another&amp;rsquo;s secrets. A VM reaches a service in another VM only through a &lt;a href="https://next.devvm.dev/docs/using/links/"&gt;link between VMs&lt;/a&gt; that you add in its folder, to a port that the other VM&amp;rsquo;s folder publishes. A link joins the two VMs&amp;rsquo; trust, because code in one can often run code in the other through its service, so a VM links only to a VM on its own tier or a stricter one, and nothing in a VM can add a link (&lt;a href="https://next.devvm.dev/docs/safety/network/#links-between-vms"&gt;links between VMs&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Images, layers and devvm itself.&lt;/strong&gt; Malware could try to make itself permanent by editing an image, a layer script or devvm&amp;rsquo;s own files. devvm builds images with nothing from this machine mounted, and the shared tools are read-only in every VM. devvm also refuses a project folder that holds its own folders or sits inside them, so a VM can&amp;rsquo;t reach the layer scripts that every build runs or the files devvm runs on this machine (&lt;a href="https://next.devvm.dev/docs/internals/security/#only-the-project-folder"&gt;only the project folder&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A folder made again.&lt;/strong&gt; If you delete a repo and clone another at the same path, the new folder never gets the old VM&amp;rsquo;s disk or anything left in it. devvm knows a folder by its inode and birth time as well as its path, which nothing in a VM can give a new folder, so it refuses and offers &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm adopt&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-made-again"&gt;a folder made again&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A devcontainer.json that reaches this machine.&lt;/strong&gt; Other tools run a devcontainer&amp;rsquo;s &lt;code&gt;initializeCommand&lt;/code&gt; on the host. devvm never runs it, refuses &lt;code&gt;${localEnv:…}&lt;/code&gt;, adds no mounts from the file and doesn&amp;rsquo;t follow a link out of the folder (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/#security"&gt;devcontainer.json&lt;/a&gt;). devvm uses the file&amp;rsquo;s &lt;code&gt;image&lt;/code&gt; only when the image&amp;rsquo;s registry gives it to anyone who asks, and it refuses a registry on this machine or its network. Behind a company proxy, devvm looks the image up through the company proxy and checks only the registry&amp;rsquo;s name, so a company proxy that reaches this machine or its network for a name that looks public takes the lookup there (&lt;a href="https://next.devvm.dev/docs/contributing/design/#devcontainerjson"&gt;the design note&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Impersonating a VM.&lt;/strong&gt; ssh checks a VM against host keys that devvm reads through the VM&amp;rsquo;s backend instead of over the network, so a program that answers on the VM&amp;rsquo;s port in its place is refused (&lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;ssh access by name&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="kept-inside-the-vm"&gt;Kept inside the VM&lt;span class="hx:absolute hx:-mt-20" id="kept-inside-the-vm"&gt;&lt;/span&gt;
&lt;a href="#kept-inside-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The attacks in this section run the attacker&amp;rsquo;s code, and devvm doesn&amp;rsquo;t stop that code from running. It runs in the VM, as the VM&amp;rsquo;s user, who has passwordless sudo. From there it reaches the project folder, or with &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; the VM&amp;rsquo;s own clone of it, and the secrets the VM uses, which are placeholders on every tier. It reaches what the VM&amp;rsquo;s tier allows: the hosts on the allowlist on the allowlist tier, every public host on the internet tier, and the whole network on the open tier. Everything in &lt;a href="#blocked"&gt;Blocked&lt;/a&gt; still holds. What the code writes into the project folder can still reach you when a program on this machine runs it, which &lt;a href="#files-the-vm-writes"&gt;Left to you&lt;/a&gt; covers.&lt;/p&gt;
&lt;h3 data-hextra-search-id="install-and-build-scripts"&gt;Install and build scripts&lt;span class="hx:absolute hx:-mt-20" id="install-and-build-scripts"&gt;&lt;/span&gt;
&lt;a href="#install-and-build-scripts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;npm, yarn, pnpm and bun lifecycle scripts.&lt;/strong&gt; A package&amp;rsquo;s &lt;code&gt;preinstall&lt;/code&gt;, &lt;code&gt;install&lt;/code&gt;, &lt;code&gt;postinstall&lt;/code&gt; and &lt;code&gt;prepare&lt;/code&gt; scripts run any command when the package is installed, and most npm attacks use them. pnpm&amp;rsquo;s build approvals (&lt;code&gt;pnpm approve-builds&lt;/code&gt;) and &lt;code&gt;--ignore-scripts&lt;/code&gt; narrow which packages run scripts, and they&amp;rsquo;re still worth using, but a package you approved runs its scripts all the same, even one compromised after you approved it. In a VM, those scripts reach only what this section&amp;rsquo;s introduction lists.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Python packages.&lt;/strong&gt; Installing a source distribution runs its &lt;code&gt;setup.py&lt;/code&gt; or its build backend, and a &lt;code&gt;.pth&lt;/code&gt; file in &lt;code&gt;site-packages&lt;/code&gt; runs code every time Python starts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ruby gems.&lt;/strong&gt; A gem with a native extension runs its &lt;code&gt;extconf.rb&lt;/code&gt; when it&amp;rsquo;s installed, and Bundler can install gems straight from a git repo.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rust build scripts and procedural macros.&lt;/strong&gt; &lt;code&gt;build.rs&lt;/code&gt; and procedural macros run on &lt;code&gt;cargo build&lt;/code&gt; and &lt;code&gt;cargo check&lt;/code&gt;, and also when rust-analyzer opens the project, so opening the folder in an editor is enough to run them. With &lt;code&gt;devvm code&lt;/code&gt; or &lt;code&gt;devvm cursor&lt;/code&gt;, the editor&amp;rsquo;s extensions, rust-analyzer among them, run in the VM (&lt;a href="https://next.devvm.dev/docs/using/ssh/#devvm-host-devvm-code-and-devvm-cursor"&gt;devvm host, devvm code and devvm cursor&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Go modules.&lt;/strong&gt; Go has no install scripts, but cgo passes flags to the C compiler, &lt;code&gt;go generate&lt;/code&gt; runs commands, a &lt;code&gt;toolchain&lt;/code&gt; line in &lt;code&gt;go.mod&lt;/code&gt; makes Go download another toolchain, and a module&amp;rsquo;s &lt;code&gt;init&lt;/code&gt; functions run in every test and program that imports it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Makefiles, task runners and &lt;code&gt;curl | sh&lt;/code&gt;.&lt;/strong&gt; A &lt;code&gt;Makefile&lt;/code&gt;, a &lt;code&gt;justfile&lt;/code&gt; or a project&amp;rsquo;s install line from its README runs whatever its author wrote.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="bad-packages-and-images"&gt;Bad packages and images&lt;span class="hx:absolute hx:-mt-20" id="bad-packages-and-images"&gt;&lt;/span&gt;
&lt;a href="#bad-packages-and-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Typosquatting, dependency confusion and made-up names.&lt;/strong&gt; Attackers publish packages under names one typo away from popular ones, under a company&amp;rsquo;s internal package names with a higher version, and under names that AI coding agents invent and that attackers then register. Their code runs as the scripts above do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compromised maintainers.&lt;/strong&gt; A trusted package can turn malicious when its maintainer&amp;rsquo;s account is taken over or a new maintainer joins with bad intent, as event-stream (2018) and xz (2024) did. Updating such a package runs its new code in the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Malicious images.&lt;/strong&gt; An image from &lt;a href="https://next.devvm.dev/docs/using/from/"&gt;&lt;code&gt;--from&lt;/code&gt;&lt;/a&gt; or from a devcontainer&amp;rsquo;s &lt;code&gt;image&lt;/code&gt; runs its own code as root in the build VM (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-image-is-untrusted"&gt;the image is untrusted&lt;/a&gt;). devvm uses only images that the registry gives to anyone who asks anonymously, never one that only your Docker or your registry login reaches, and it confines builds (&lt;a href="https://next.devvm.dev/docs/internals/security/#read-only-and-confined-builds"&gt;read-only and confined builds&lt;/a&gt;). On macOS a build can&amp;rsquo;t reach this machine&amp;rsquo;s loopback, but &lt;a href="#the-platform"&gt;Left to you&lt;/a&gt; covers what it still reaches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A devcontainer.json&amp;rsquo;s commands and features.&lt;/strong&gt; A project&amp;rsquo;s &lt;code&gt;postCreateCommand&lt;/code&gt; and its other commands run in the VM as the VM&amp;rsquo;s user, as soon as devvm makes the VM. Its image and features decide what&amp;rsquo;s in the VM, and devvm adds its ports to the ones it forwards to this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, even beyond a list you narrowed, so the VM is the project&amp;rsquo;s from the start. Its features can only be devvm&amp;rsquo;s own layers, so devvm never fetches or runs a feature&amp;rsquo;s script. &lt;code&gt;devvm --no-devcontainer&lt;/code&gt; skips the file for a project you don&amp;rsquo;t trust that far (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/"&gt;devcontainer.json&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="rogue-agents"&gt;Rogue agents&lt;span class="hx:absolute hx:-mt-20" id="rogue-agents"&gt;&lt;/span&gt;
&lt;a href="#rogue-agents" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Prompt injection.&lt;/strong&gt; Instructions hidden in a README, an issue, a code comment, a web page, a dependency&amp;rsquo;s docs or an MCP tool&amp;rsquo;s output can turn a coding agent against you. devvm can&amp;rsquo;t tell an agent&amp;rsquo;s own work from injected work, so it limits what the agent reaches instead. An attack like this needs private data, untrusted input and a way to send the data out. On the allowlist tier, the only way out is the hosts on the allowlist, which &lt;a href="#the-network"&gt;Left to you&lt;/a&gt; covers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agents with their checks off.&lt;/strong&gt; An agent run with &lt;code&gt;claude --dangerously-skip-permissions&lt;/code&gt; or &lt;code&gt;codex --dangerously-bypass-approvals-and-sandbox&lt;/code&gt; acts without asking, and a mistaken &lt;code&gt;rm -rf ~&lt;/code&gt; or &lt;code&gt;sudo&lt;/code&gt; command reaches only the VM. The project folder is still the agent&amp;rsquo;s to change, so commit often, or use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; to keep the agent&amp;rsquo;s work apart until you fetch it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Malware that stays.&lt;/strong&gt; Anything the attacker leaves in the VM, such as a cron job, a changed shell startup file or a backdoored program, stays in that VM&amp;rsquo;s disk and goes into no other VM&amp;rsquo;s, unless you save an agent&amp;rsquo;s settings that it changed with &lt;code&gt;devvm agent save&lt;/code&gt;. What it wrote into the project folder stays there, though, and the folder&amp;rsquo;s next VM gets it, such as a &lt;code&gt;devcontainer.json&lt;/code&gt; command that runs as soon as devvm makes the VM, or a hook in the project&amp;rsquo;s agent settings. devvm never deletes a VM on its own, because it may hold unsaved work, so save what you need and run &lt;code&gt;devvm rm&lt;/code&gt;, then check the folder for what &lt;a href="#files-the-vm-writes"&gt;the VM writes&lt;/a&gt;, or use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt;, before you make the VM again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mining and resource abuse.&lt;/strong&gt; A VM&amp;rsquo;s CPUs, memory and disk are capped by its size, which &lt;code&gt;devvm size&lt;/code&gt; shows and changes (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size"&gt;size&lt;/a&gt;). The VM&amp;rsquo;s proxy on this machine carries at most 1024 tunnels and 2048 connections of every kind for it at once, and on a Linux host devvm carries at most 256 of its connections to the proxy at once, each a process on this machine, so a VM that opens connections without end can&amp;rsquo;t fill this machine with them (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="narrowed-not-closed"&gt;Narrowed, not closed&lt;span class="hx:absolute hx:-mt-20" id="narrowed-not-closed"&gt;&lt;/span&gt;
&lt;a href="#narrowed-not-closed" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 data-hextra-search-id="secrets-and-keys-the-vm-may-use"&gt;Secrets and keys the VM may use&lt;span class="hx:absolute hx:-mt-20" id="secrets-and-keys-the-vm-may-use"&gt;&lt;/span&gt;
&lt;a href="#secrets-and-keys-the-vm-may-use" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Worms that use your GitHub token.&lt;/strong&gt; Shai-Hulud (2025) spread through npm install scripts. It collected npm, GitHub and cloud credentials, then used them to publish repos and new versions of packages. A VM holds no npm or cloud credentials, and its GitHub token is a placeholder. The proxy still puts the real GitHub token into every request to GitHub&amp;rsquo;s hosts, so a worm in the VM can push, make repos and do whatever else the GitHub token&amp;rsquo;s scope allows. Use a fine-grained GitHub token scoped to the repos the VM needs, or bind none (&lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;saving and binding secrets&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A host that sends your secret back.&lt;/strong&gt; The proxy puts a secret only into requests for its own hosts, but it passes their replies to the VM as they are. A host that echoes a request&amp;rsquo;s headers, such as a debug endpoint, or an error page that quotes them, shows the VM the real value. This matters most for &lt;a href="https://next.devvm.dev/docs/safety/network/#your-own-secrets"&gt;your own secrets&lt;/a&gt;, whose hosts you choose, so give each one only hosts that you trust with it. A secret&amp;rsquo;s hosts are on the allowlist of every VM that uses it, on every tier, so on a host where anyone can make an account, code in the VM can also send data to an account of its own there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Minting credentials with a secret.&lt;/strong&gt; A VM that can use a secret can use it to make another credential that outlasts it. The proxy refuses GitHub REST calls that add an SSH key, a deploy key, a self-hosted runner or a webhook with &lt;code&gt;403&lt;/code&gt;, but it can&amp;rsquo;t refuse everything, such as GitHub&amp;rsquo;s GraphQL API, an OAuth app grant or other services.
&lt;ul&gt;
&lt;li&gt;A bound API key can make credentials too. With Google Gemini&amp;rsquo;s key, code in the VM can ask &lt;code&gt;generativelanguage.googleapis.com&lt;/code&gt; for an ephemeral token for Gemini&amp;rsquo;s Live API, which lasts up to about 20 hours and allows as many uses as the VM asks for. With xAI&amp;rsquo;s key it can ask &lt;code&gt;api.x.ai&lt;/code&gt; for a realtime client secret that lasts as long as the VM chooses, and with OpenAI&amp;rsquo;s key it can ask &lt;code&gt;api.openai.com&lt;/code&gt; for one that lasts up to 2 hours.&lt;/li&gt;
&lt;li&gt;These credentials work without the proxy, and the proxy allows the requests that make them, because opencode&amp;rsquo;s experimental voice mode makes them itself (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt;). If a VM may have done this, rotate the secret and check the service&amp;rsquo;s keys, access tokens and runners.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keys devvm can&amp;rsquo;t tell apart.&lt;/strong&gt; devvm takes the keys out of the VM&amp;rsquo;s copies of your agents&amp;rsquo; settings and logins only where it can tell a key from the rest. A key in other text, such as a hook&amp;rsquo;s command, stays when it neither starts like a known key nor follows &lt;code&gt;Bearer&lt;/code&gt; or &lt;code&gt;Basic&lt;/code&gt;. opencode&amp;rsquo;s and pi&amp;rsquo;s keys that devvm can&amp;rsquo;t bind, such as a local model server&amp;rsquo;s, stay on this machine unless you list their provider in &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt;, and then they go in as they are. The agents&amp;rsquo; folders that the VM mounts whole, such as &lt;code&gt;~/.claude/skills&lt;/code&gt; or &lt;code&gt;~/.config/opencode/plugin&lt;/code&gt;, reach the VM with every file in them, so a &lt;code&gt;.env&lt;/code&gt; in one is in the VM, and so is a private plugin marketplace&amp;rsquo;s git config with a password or an access token in its URL. Keep secrets out of those folders (&lt;a href="https://next.devvm.dev/docs/internals/network/#what-stays-in-the-vms-copies"&gt;what stays in the VM&amp;rsquo;s copies&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your SSH agent.&lt;/strong&gt; While &lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;agent forwarding&lt;/a&gt; is on, anything in the VM can use the agent&amp;rsquo;s keys to push, log in to servers or sign any data, though it can&amp;rsquo;t copy them. It also can&amp;rsquo;t remove the agent&amp;rsquo;s keys, lock the agent or add keys to it, so it can&amp;rsquo;t take the agent away from you or from other VMs (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;). A VM that has run since before you upgraded devvm to this release can still do those until its next start, so restart such VMs with &lt;code&gt;devvm restart&lt;/code&gt;. The VM has the agent while you&amp;rsquo;re connected. &lt;code&gt;devvm ssh-agent devvm&lt;/code&gt; limits it to the keys you add to &lt;a href="https://next.devvm.dev/docs/using/ssh/#devvms-own-agent"&gt;devvm&amp;rsquo;s own agent&lt;/a&gt;, and an agent that asks you to approve each use, such as 1Password&amp;rsquo;s or Secretive, narrows it further.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="git"&gt;Git&lt;span class="hx:absolute hx:-mt-20" id="git"&gt;&lt;/span&gt;
&lt;a href="#git" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The shell prompt.&lt;/strong&gt; Many shell prompts and editors run &lt;code&gt;git status&lt;/code&gt; as soon as you &lt;code&gt;cd&lt;/code&gt; into a folder or open it, and &lt;code&gt;git status&lt;/code&gt; runs &lt;code&gt;core.fsmonitor&lt;/code&gt;. Where devvm locks &lt;code&gt;.git&lt;/code&gt;, the lock covers the &lt;code&gt;.git&lt;/code&gt; of the folder and of the nested repos devvm has found, so opening the folder runs nothing that the VM wrote into them. It doesn&amp;rsquo;t cover a submodule the VM adds, a &lt;code&gt;.git&lt;/code&gt; the VM replaces or a repo the VM makes while it runs, which git on this machine reads before devvm&amp;rsquo;s next check, as the entries below describe.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Submodules with their own config.&lt;/strong&gt; The VM writes &lt;code&gt;.git/index&lt;/code&gt; to commit, so it can add a submodule whose config sets &lt;code&gt;core.fsmonitor&lt;/code&gt;. &lt;code&gt;git status&lt;/code&gt;, &lt;code&gt;git diff&lt;/code&gt;, &lt;code&gt;git add -A&lt;/code&gt; and &lt;code&gt;git describe --dirty&lt;/code&gt; on this machine read that config, and run what it names, before devvm stops the VM or the next launch finds the submodule and locks it. No git setting keeps git on this machine out of a submodule that the VM adds, because the VM writes the &lt;code&gt;.gitmodules&lt;/code&gt; file that git reads, and several commands enter a submodule whatever the settings say. So use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; for a repo where you run git on this machine while the VM runs (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#not-covered"&gt;not covered&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Replacing &lt;code&gt;.git&lt;/code&gt;.&lt;/strong&gt; The VM can rename &lt;code&gt;.git&lt;/code&gt; and put a new one in its place, or add a &lt;code&gt;commondir&lt;/code&gt; that points git at another config. devvm reports these on each launch but doesn&amp;rsquo;t prevent them, so check what it names before you run git in the folder (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#what-a-lock-cant-stop"&gt;what a lock can&amp;rsquo;t stop&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nested repos.&lt;/strong&gt; devvm protects the git repos nested in the folder, but the VM can clone a new one while it runs, or move a protected one aside and put another in its place, and git on this machine runs its config before devvm&amp;rsquo;s next check names it. devvm also doesn&amp;rsquo;t protect a nested repo deeper than four folders, in a folder such as &lt;code&gt;node_modules&lt;/code&gt;, or past the first 100, which it counts and names (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#nested-repos"&gt;nested repos&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="network"&gt;Network&lt;span class="hx:absolute hx:-mt-20" id="network"&gt;&lt;/span&gt;
&lt;a href="#network" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Domain fronting.&lt;/strong&gt; The proxy checks the host name that a TLS connection asks for, its SNI, but not the &lt;code&gt;Host&lt;/code&gt; inside the encrypted traffic, so a CDN that serves many sites on one address can route an allowed connection to a site that isn&amp;rsquo;t allowed. The proxy reads the connections to hosts with a bound secret, and it refuses a request in them that names another host. A connection that &lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt; sends to the proxy is judged by its SNI in the same way, and so is a client with an Encrypted Client Hello configuration from somewhere other than DNS, whose outer SNI, the CDN&amp;rsquo;s public name, is what the proxy sees. The VM&amp;rsquo;s own names give no client such a configuration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The first seconds of an open start.&lt;/strong&gt; A VM that was confined and is made open runs transparent mode from its next boot until that launch&amp;rsquo;s setup takes it out, a few seconds later. In that window, its names resolve to the stand-in address and its connections reach its proxy, which is an open one by then, so they reach what the open tier allows, and nothing keeps those answers after.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Model providers that fetch for the VM.&lt;/strong&gt; The proxy allows a bound API key&amp;rsquo;s provider hosts on port 443, and some providers&amp;rsquo; own tools fetch URLs that the request names, such as Google Gemini&amp;rsquo;s URL context and Search grounding, xAI&amp;rsquo;s live search, Groq&amp;rsquo;s compound models and Mistral&amp;rsquo;s agents with web search, as Anthropic&amp;rsquo;s and OpenAI&amp;rsquo;s web fetch and search tools do. Code in the VM can send data out through such a tool to a host that the allowlist doesn&amp;rsquo;t have (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ports the VM listens on.&lt;/strong&gt; devvm forwards the VM&amp;rsquo;s TCP ports from 1024 up to this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, unless you list the ports with &lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;&lt;code&gt;--ports&lt;/code&gt;&lt;/a&gt;, so a VM could take a port that a program on this machine trusts while that port is free, and what the VM serves there reaches whatever connects to it. devvm&amp;rsquo;s forwarder never takes a port that a program on this machine already has, or one that devvm records for a VM, but a program that binds a port on all addresses after devvm forwarded it gets its &lt;code&gt;localhost&lt;/code&gt; connections sent to the VM. &lt;code&gt;devvm ports&lt;/code&gt; limits what a VM forwards, and &lt;code&gt;devvm ports none&lt;/code&gt; forwards nothing, though a project&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; adds its &lt;code&gt;forwardPorts&lt;/code&gt; to that list when devvm makes the VM or &lt;code&gt;devvm update&lt;/code&gt; reads the file (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/#security"&gt;devcontainer.json&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;ports&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/ports/"&gt;port forwarding&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A browser login&amp;rsquo;s port.&lt;/strong&gt; While &lt;code&gt;devvm agent login&lt;/code&gt; waits for Codex&amp;rsquo;s or opencode&amp;rsquo;s browser login to ChatGPT, devvm forwards this machine&amp;rsquo;s &lt;code&gt;localhost:1455&lt;/code&gt;, and &lt;code&gt;localhost:1457&lt;/code&gt; when it&amp;rsquo;s free, to the agent&amp;rsquo;s login server in the VM, so any program on this machine that connects in that window reaches the VM&amp;rsquo;s server and gets what it answers. The forward ends with the login, and &lt;code&gt;--device-code&lt;/code&gt; logs in without one (&lt;a href="https://next.devvm.dev/docs/internals/agents/#logging-in"&gt;logging in&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;VS Code&amp;rsquo;s and Cursor&amp;rsquo;s relays.&lt;/strong&gt; Over Remote-SSH, which &lt;code&gt;devvm code&lt;/code&gt; and &lt;code&gt;devvm cursor&lt;/code&gt; open, the editor forwards the ports that programs in the VM listen on, and it answers git&amp;rsquo;s prompts with your GitHub sign-in. devvm turns both off in the VM&amp;rsquo;s settings for each editor each time it sets the VM up, but the VM can turn them back on, and its settings take precedence over your own on this machine. The editor&amp;rsquo;s extensions also run in the VM, its AI features among them, and they may get the editor&amp;rsquo;s sign-ins there, such as Copilot&amp;rsquo;s GitHub token or your Cursor login. Recent Cursor runs its Agent in the VM with your sign-in in memory (&lt;a href="https://next.devvm.dev/docs/using/ssh/#cursors-agent"&gt;Cursor&amp;rsquo;s Agent&lt;/a&gt;). So don&amp;rsquo;t open a VM you don&amp;rsquo;t trust with &lt;code&gt;devvm code&lt;/code&gt; or &lt;code&gt;devvm cursor&lt;/code&gt;, or sign out of the editor&amp;rsquo;s AI features and its GitHub sign-in first (&lt;a href="https://next.devvm.dev/docs/using/ssh/#vs-code-and-cursor"&gt;VS Code and Cursor&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What a VM does through a link.&lt;/strong&gt; A &lt;a href="https://next.devvm.dev/docs/using/links/"&gt;link between VMs&lt;/a&gt; joins the two VMs&amp;rsquo; trust. Code in the client can often run code in the target through the service it reaches, such as Postgres&amp;rsquo;s &lt;code&gt;COPY … TO PROGRAM&lt;/code&gt;, and it then has the target&amp;rsquo;s network, the secrets it may use and its project folder. devvm limits a link to the ports the target publishes, on the target&amp;rsquo;s loopback, and a client to targets on its own tier or a stricter one, but it doesn&amp;rsquo;t limit what the service does. In a &lt;a href="https://next.devvm.dev/docs/using/links/#groups"&gt;group&lt;/a&gt;, every VM trusts every other in the same way, and a VM that joins later gets the same reach (&lt;a href="https://next.devvm.dev/docs/safety/network/#links-between-vms"&gt;links between VMs&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;History imported from a less strict tier.&lt;/strong&gt; An export of agents&amp;rsquo; history carries what the old VM&amp;rsquo;s agents read, so importing one from an open VM into a VM on the allowlist tier can bring in credentials and data that the new VM couldn&amp;rsquo;t reach itself, along with any instructions planted in them. devvm warns before such an import, and before importing an export whose tier it has no record of, but it imports all the same. Import history only from a VM you trusted as much as the new one (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-history"&gt;importing history&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What one VM learns of another through the shared Nix cache.&lt;/strong&gt; VMs with the nix layer share one cache of Nix&amp;rsquo;s packages on this machine. A VM can tell by how fast the cache answers whether some VM fetched a public package. The packages are public, and a project&amp;rsquo;s &lt;code&gt;flake.lock&lt;/code&gt; names the ones it needs, so this tells a VM only that another project on this machine uses a package. A VM that fetches many packages can also fill the cache up to its cap and push other VMs&amp;rsquo; packages out, so they download them again, but it can&amp;rsquo;t fill the disk past the cap or keep anything that cache.nixos.org didn&amp;rsquo;t sign (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;the shared Nix cache&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Through a company proxy.&lt;/strong&gt; The company proxy looks up the names it&amp;rsquo;s sent itself, and it may get another answer than this machine did, or a later one, so the VM&amp;rsquo;s proxy can&amp;rsquo;t check every address a name leads to there. Under a name that an allowlist names, a VM reaches whatever the company proxy reaches, such as your company&amp;rsquo;s internal hosts and the company proxy&amp;rsquo;s own host, which is this machine&amp;rsquo;s loopback when the company proxy runs on this machine, as a VPN client&amp;rsquo;s does. A name that the VM&amp;rsquo;s allowlist doesn&amp;rsquo;t allow never reaches the company proxy (&lt;a href="https://next.devvm.dev/docs/contributing/design/#a-company-proxy"&gt;the design note&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Which names resolve to internal addresses.&lt;/strong&gt; When the proxy refuses a name because this machine&amp;rsquo;s lookup gives it an internal address, its refusal says so, so a VM can learn which names this machine&amp;rsquo;s DNS resolves to internal addresses. The refusal never names the address, this machine&amp;rsquo;s DNS server or the company proxy, which stay in the proxy&amp;rsquo;s own log (&lt;a href="https://next.devvm.dev/docs/internals/network/#log-files"&gt;log files&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="this-machine"&gt;This machine&lt;span class="hx:absolute hx:-mt-20" id="this-machine"&gt;&lt;/span&gt;
&lt;a href="#this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A nested project replaced through its parent folder&amp;rsquo;s VM.&lt;/strong&gt; A project with a VM of its own inside a folder with another VM is in both VMs, so code in the parent folder&amp;rsquo;s VM can replace the nested project folder with a link, such as one to your home folder, which the nested VM would mount at its next start.
&lt;ul&gt;
&lt;li&gt;devvm warns each time it makes or opens such a nested VM, naming the parent folder&amp;rsquo;s VM. It checks the nested folder, by its path and by the folder itself, just before it starts the nested VM and again once the VM runs, and it refuses the start or stops the VM again when the folder was replaced.&lt;/li&gt;
&lt;li&gt;On macOS the VM mounts the folder itself rather than its path, so it never mounts what a link points to, even when the folder is put back before devvm checks again.&lt;/li&gt;
&lt;li&gt;On Linux the VM mounts the folder by its path, so code that replaces the folder for the moment the VM&amp;rsquo;s backend mounts it and puts it back before devvm checks again stays unseen, and the VM keeps what the link pointed to until its next start. Keep a nested project that you don&amp;rsquo;t want the parent folder&amp;rsquo;s VM to reach out of the parent folder (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-nested-project-replaced"&gt;a nested project replaced&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Set-id files on Linux hosts.&lt;/strong&gt; Root in a VM can set the set-user-id bit on a file in the project folder, and on Linux hosts that bit reaches the host, so the file runs as its owner for whoever runs it. devvm names such files when it makes a VM and once a VM is stopped, but not at a launch into a running VM, and &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#devvm-names-set-id-files"&gt;Troubleshooting&lt;/a&gt; says how to clear them. Don&amp;rsquo;t run programs from the project folder outside the VM (&lt;a href="https://next.devvm.dev/docs/internals/security/#set-id-files-on-linux-hosts"&gt;set-id files&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s CA keys.&lt;/strong&gt; Inside a VM, its CA vouches for any site, so someone with a copy of its key and a place on your network could impersonate sites to that VM. Each VM has CAs of its own, so a copy reaches one VM and no other. Only you can read the keys, they never leave this machine, and devvm keeps them out of Time Machine. Each CA lasts 30 days, so a copy goes stale, but the next CA&amp;rsquo;s key is on disk for up to 23 days before that CA starts, so a copy of it taken then works until that CA ends, up to 53 days later. Keep &lt;code&gt;~/.local/share/devvm/vms&lt;/code&gt; out of other backup and sync tools as well, and on Linux, which has no Time Machine, out of your backups (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;the VM&amp;rsquo;s CA&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your company proxy&amp;rsquo;s password.&lt;/strong&gt; No VM gets the company proxy&amp;rsquo;s settings: an open VM goes through its own proxy, which goes through the company proxy for it.
&lt;ul&gt;
&lt;li&gt;devvm keeps the password out of its run logs only where it can tell it&amp;rsquo;s a password, so one in an address with neither a scheme nor a port, one with a raw &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;?&lt;/code&gt;, &lt;code&gt;#&lt;/code&gt; or &lt;code&gt;@&lt;/code&gt; in it, or one in a run of more than 4 KiB without a space that a command writes in pieces can stay.&lt;/li&gt;
&lt;li&gt;Lima&amp;rsquo;s own log for the VM holds the password until the VM has started, when devvm replaces it with as many &lt;code&gt;*&lt;/code&gt;, so the log still shows its length. If devvm is killed before then, or you run &lt;code&gt;limactl start&lt;/code&gt; outside devvm, the log keeps it. Lima&amp;rsquo;s logs of the VM&amp;rsquo;s serial consoles hold the VM&amp;rsquo;s own proxy password in the same way, until the VM has started. A reboot inside the VM writes it to the console&amp;rsquo;s log again, and while the VM runs, its proxy replaces it within about a second of its line ending. So the log holds it for that second, or for as long as the proxy isn&amp;rsquo;t running (&lt;a href="https://next.devvm.dev/docs/internals/processes/#limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;/a&gt;). With &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s proxy, the mise that devvm runs on this machine gets the password in its environment, where programs that run as you can read it (&lt;a href="https://next.devvm.dev/docs/safety/network/#open-vms-and-builds"&gt;open VMs and builds&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;the run log&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="left-to-you"&gt;Left to you&lt;span class="hx:absolute hx:-mt-20" id="left-to-you"&gt;&lt;/span&gt;
&lt;a href="#left-to-you" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 data-hextra-search-id="files-the-vm-writes"&gt;Files the VM writes&lt;span class="hx:absolute hx:-mt-20" id="files-the-vm-writes"&gt;&lt;/span&gt;
&lt;a href="#files-the-vm-writes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The VM can write anything in the project folder, and devvm locks only &lt;code&gt;.git&lt;/code&gt;. Any other file there that a program on this machine runs, or reads as its config, is the VM&amp;rsquo;s to change. &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; keeps all of these away from this machine until you fetch the VM&amp;rsquo;s work and review it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hooks in the working tree.&lt;/strong&gt; Hooks kept in the project, such as husky&amp;rsquo;s &lt;code&gt;.husky/&lt;/code&gt; with &lt;code&gt;core.hooksPath&lt;/code&gt; pointing there, run on this machine, and so do an &lt;code&gt;include.path&lt;/code&gt; or a hook symlink that leads into the folder. devvm warns about them when it makes the VM (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#not-covered"&gt;not covered&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent config in the project.&lt;/strong&gt; Claude Code reads a project&amp;rsquo;s &lt;code&gt;.claude/settings.json&lt;/code&gt;, whose hooks run commands, and &lt;code&gt;.mcp.json&lt;/code&gt;, which starts MCP servers, and agents follow a project&amp;rsquo;s &lt;code&gt;CLAUDE.md&lt;/code&gt; and &lt;code&gt;AGENTS.md&lt;/code&gt;. pi reads a project&amp;rsquo;s &lt;code&gt;.pi&lt;/code&gt; folder, whose &lt;code&gt;extensions&lt;/code&gt; run as code when pi starts, whose &lt;code&gt;settings.json&lt;/code&gt; installs packages and sets &lt;code&gt;shellCommandPrefix&lt;/code&gt;, which comes before every command pi runs, and whose &lt;code&gt;mcp.json&lt;/code&gt; starts MCP servers. pi asks before it loads them, unless your &lt;code&gt;~/.pi/agent/trust.json&lt;/code&gt; on this machine already trusts the folder or your settings trust every folder. Running an agent on this machine in the folder after the VM has worked in it runs what the VM wrote, so run your agents in the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Editor and tool config.&lt;/strong&gt; VS Code runs &lt;code&gt;.vscode/tasks.json&lt;/code&gt; tasks set to &lt;code&gt;runOn: folderOpen&lt;/code&gt; and starts the interpreters and formatters that &lt;code&gt;.vscode/settings.json&lt;/code&gt; names. direnv loads &lt;code&gt;.envrc&lt;/code&gt;, and mise reads &lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s environment, hooks and tasks. Keep VS Code&amp;rsquo;s workspace trust on, and use direnv&amp;rsquo;s and mise&amp;rsquo;s own approval prompts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Project code and binaries.&lt;/strong&gt; &lt;code&gt;npm install&lt;/code&gt;, &lt;code&gt;make&lt;/code&gt;, a test run or &lt;code&gt;./bin/tool&lt;/code&gt; on this machine runs whatever the VM wrote. Run them in the VM instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Symlinks out of the folder.&lt;/strong&gt; The VM can create a link in the project folder that points at a file of yours, such as &lt;code&gt;~/.ssh/id_ed25519&lt;/code&gt;. A program on this machine that follows it, such as an upload, an archive or an agent reading files, reads your file instead. devvm itself never follows a link out of the folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Backdoors in code you merge.&lt;/strong&gt; Treat the VM&amp;rsquo;s commits as an untrusted contributor&amp;rsquo;s, and review them before you merge, deploy or publish them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secrets in the project folder.&lt;/strong&gt; A &lt;code&gt;.env&lt;/code&gt; file, a project &lt;code&gt;.npmrc&lt;/code&gt; or a cloud key in the folder is in the VM. On the allowlist tier it can reach only the hosts on the allowlist, on the internet tier any public host, and on the open tier anywhere. Keep secrets out of the project folder, or use &lt;code&gt;--clone&lt;/code&gt;, which copies no untracked files into the VM but those of a &lt;code&gt;git stash -u&lt;/code&gt; entry, though it copies your repo&amp;rsquo;s hooks as they are and a folder of repos&amp;rsquo; own files (&lt;a href="https://next.devvm.dev/docs/using/clone/#whats-copied"&gt;what&amp;rsquo;s copied&lt;/a&gt;). The same goes for your agents&amp;rsquo; config folders, which &lt;a href="#secrets-and-keys-the-vm-may-use"&gt;keys devvm can&amp;rsquo;t tell apart&lt;/a&gt; covers (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;mounts&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What you paste in.&lt;/strong&gt; An image, a PDF or a file you send with &lt;code&gt;devvm paste&lt;/code&gt; is a file in the VM, which anything in the VM can read, as it reads the project folder. devvm reads only an image, a PDF or a copied file&amp;rsquo;s reference from your clipboard, never text, asks before sending a copied file, showing its path, refuses a link anywhere in a copied file&amp;rsquo;s path but the system&amp;rsquo;s own, and lets nothing the VM says onto your clipboard, so paste nothing you wouldn&amp;rsquo;t put in the folder (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#pasting-images"&gt;pasting images&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="the-network"&gt;The network&lt;span class="hx:absolute hx:-mt-20" id="the-network"&gt;&lt;/span&gt;
&lt;a href="#the-network" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Allowed hosts.&lt;/strong&gt; Anything an allowed host accepts can carry data out. github.com accepts a push from anyone with an account, including an attacker with an account of their own, and the npm registry accepts packages the same way. Keep allowlists short, narrow a host to the methods and paths a VM needs (&lt;a href="https://next.devvm.dev/docs/safety/network/#rules-by-method-and-path"&gt;rules by method and path&lt;/a&gt;), and check what a VM reached with &lt;code&gt;devvm network log&lt;/code&gt;. A rule by method and path judges each request&amp;rsquo;s method and path, not its body or its other headers, so what an allowed request sends still reaches the host. A deny of &lt;code&gt;git-receive-pack&lt;/code&gt; on github.com, for example, blocks pushes over HTTPS alone: a push over ssh to &lt;code&gt;github.com:22&lt;/code&gt;, if a rule allows it, and the commits that GitHub&amp;rsquo;s Git Data API makes at &lt;code&gt;api.github.com&lt;/code&gt; with a GitHub token go on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What your secrets allow.&lt;/strong&gt; A VM can push with a GitHub token it may use and spend Claude quota. Use a fine-grained GitHub token, bind only the secrets a VM needs, and deny the methods a VM mustn&amp;rsquo;t use, such as &lt;code&gt;devvm network deny api.github.com --method POST,PUT,PATCH,DELETE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your claude.ai connectors.&lt;/strong&gt; With your Claude subscription&amp;rsquo;s login, a VM with Claude Code can use every connector you added in claude.ai, as Claude Code on this machine can, so code in the VM can read what they reach, such as your mail or documents, and act through them. Disconnect the connectors you don&amp;rsquo;t want VMs to use, or keep them from a VM with &lt;code&gt;devvm network deny mcp-proxy.anthropic.com&lt;/code&gt;, or from every VM with &lt;code&gt;-g&lt;/code&gt;, which works on every tier but open (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;Claude Code login&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open VMs.&lt;/strong&gt; An open VM, because you chose open or passed &lt;code&gt;--network open&lt;/code&gt;, reaches everything this machine can, including its services on &lt;code&gt;localhost&lt;/code&gt;, such as other VMs&amp;rsquo; ports, dev servers and databases, and your local network, directly and through its proxy, which applies no rules for it. Its proxy still puts its secrets in, so it can spend them on their hosts as any VM can, but it holds only their placeholders, as every VM does. A VM started outside devvm, such as with &lt;code&gt;limactl start&lt;/code&gt;, or one running since before &lt;code&gt;devvm network&lt;/code&gt; gave it a confined tier, runs unconfined in the same way until devvm restarts it confined (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your browser.&lt;/strong&gt; Programs in a VM can open URLs in this machine&amp;rsquo;s browser, and a page that a VM serves on a forwarded port runs in your browser like any other. From there it can reach the internet past the VM&amp;rsquo;s tier, and your services on &lt;code&gt;localhost&lt;/code&gt;. Browsers send a host&amp;rsquo;s cookies to every port on it, so a server in the VM on a forwarded &lt;code&gt;localhost&lt;/code&gt; port gets the cookies of the apps you use on &lt;code&gt;localhost&lt;/code&gt;, such as a local dashboard you&amp;rsquo;re signed in to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s ssh port in your browser.&lt;/strong&gt; Root in a VM can make its ssh port on this machine answer as a web server, so devvm puts every VM&amp;rsquo;s ssh on one of the ports that every browser refuses, and a VM that forwards no ports gets no page from your browser that way. A browser you&amp;rsquo;ve told to allow those ports, such as with Chrome&amp;rsquo;s &lt;code&gt;--explicitly-allowed-ports&lt;/code&gt; or Firefox&amp;rsquo;s &lt;code&gt;network.security.ports.banned.override&lt;/code&gt;, reaches it again. Another user on this machine can also take all 17 of those ports, so none of your VMs starts until they let one go (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#too-many-vms-at-once"&gt;too many VMs at once&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remote forwards you add.&lt;/strong&gt; A &lt;code&gt;RemoteForward&lt;/code&gt; in your ssh config, or an &lt;code&gt;ssh -R&lt;/code&gt; you type, makes this machine connect to whatever it names for the VM. devvm&amp;rsquo;s ssh entries can&amp;rsquo;t turn off a &lt;code&gt;RemoteForward&lt;/code&gt; of yours without also refusing an &lt;code&gt;ssh -R&lt;/code&gt; you type. The VM&amp;rsquo;s ssh server refuses a remote forward on any address outside &lt;code&gt;127.77.0.0/16&lt;/code&gt;, the range devvm keeps for links between VMs, so one on the VM&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, which &lt;code&gt;ssh -R&lt;/code&gt; asks for by default, is refused. Root in the VM can change that setting, though, and the server allows a forward on an address in &lt;code&gt;127.77.0.0/16&lt;/code&gt; for anyone it lets in. A forward you ask for by a host name that begins with &lt;code&gt;127.77.&lt;/code&gt; binds whatever address that name resolves to in the VM. So keep remote forwards out of &lt;code&gt;Host *&lt;/code&gt;, and don&amp;rsquo;t forward into a VM you don&amp;rsquo;t trust (&lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;ssh into VMs&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A company CA you add.&lt;/strong&gt; A &lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;company CA&lt;/a&gt; that you put in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt; can read the TLS traffic of every VM, whatever its tier, as it can this machine&amp;rsquo;s, and the proxy trusts it for its own connections. Only that folder adds CAs to the proxy, and nothing a VM sends can.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="the-platform"&gt;The platform&lt;span class="hx:absolute hx:-mt-20" id="the-platform"&gt;&lt;/span&gt;
&lt;a href="#the-platform" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;.git&lt;/code&gt; on Linux hosts.&lt;/strong&gt; devvm makes hooks and config read-only in the VM&amp;rsquo;s view, but a git command on this machine that replaces &lt;code&gt;.git/config&lt;/code&gt; while the VM runs leaves the new file the VM&amp;rsquo;s to change, replace or open for writing until devvm locks it again, which devvm names only when the VM stops (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#when-git-on-this-machine-replaces-a-locked-file"&gt;when git replaces a locked file&lt;/a&gt;). Where the kernel doesn&amp;rsquo;t let devvm use a user namespace, such as on Ubuntu 23.10 and newer, VMs have no &lt;code&gt;.git&lt;/code&gt; protection, and the VM can change hooks and config that run on the host, so use &lt;code&gt;--clone&lt;/code&gt; there (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#linux-hosts"&gt;Linux hosts&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What a build reaches.&lt;/strong&gt; A build, such as a &lt;a href="https://next.devvm.dev/docs/using/from/"&gt;&lt;code&gt;--from&lt;/code&gt;&lt;/a&gt; image&amp;rsquo;s or a layer&amp;rsquo;s, reaches the internet and your local network as well, this machine&amp;rsquo;s own address on it included, so a service of yours that listens on every address is in its reach. On macOS that&amp;rsquo;s all it reaches of this machine, because its loopback is out of reach, but on Linux the build reaches the services on this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; too, such as other VMs&amp;rsquo; proxies and dev servers. Build images only from container images and layers you trust (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Escaping the VM.&lt;/strong&gt; A bug in Lima, Apple&amp;rsquo;s Virtualization framework or QEMU could let code out of the VM. So could a bug in devvm&amp;rsquo;s own programs on this machine that read what a VM sends, which are the VM&amp;rsquo;s proxy, the port forwarder, the sessions of links between VMs, &lt;code&gt;devvm agent save&lt;/code&gt; and the export of agents&amp;rsquo; history that &lt;code&gt;devvm history export&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; save.
&lt;ul&gt;
&lt;li&gt;The part of the VM&amp;rsquo;s proxy that reads the VM&amp;rsquo;s network runs in a sandbox, which is macOS&amp;rsquo;s on macOS and Landlock with a seccomp filter on Linux. A bug there reaches the secrets bound to that VM, the company proxy&amp;rsquo;s password, the VM&amp;rsquo;s logs, the shared Nix cache and the public internet. It doesn&amp;rsquo;t reach your files, the Keychain, other VMs&amp;rsquo; secrets, or this machine&amp;rsquo;s unix sockets, such as ssh&amp;rsquo;s and Docker&amp;rsquo;s. Nor does it reach this machine&amp;rsquo;s services on &lt;code&gt;localhost&lt;/code&gt;, its own addresses or your LAN&amp;rsquo;s private addresses, unless a rule names the address or a company proxy reaches them. On Linux it can also learn whether a file of yours exists, and an older kernel confines it less (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;what it still reaches&lt;/a&gt;). devvm doctor warns when a VM&amp;rsquo;s proxy runs without its sandbox, or with only part of it (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Found a way out of a VM? See &lt;a href="https://github.com/devvmhq/devvm/blob/main/SECURITY.md" target="_blank" rel="noopener"&gt;SECURITY.md&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Everyday commands</title><link>https://next.devvm.dev/docs/getting-started/commands/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/getting-started/commands/</guid><description>
&lt;p&gt;This page lists devvm&amp;rsquo;s commands in the groups that &lt;code&gt;devvm --help&lt;/code&gt; shows them in, and each row links to the page with the details. &lt;code&gt;devvm COMMAND --help&lt;/code&gt; shows a command&amp;rsquo;s examples and flags, &lt;a href="https://next.devvm.dev/docs/using/command-line/"&gt;the command line&lt;/a&gt; covers what works the same in every command, and the &lt;a href="https://next.devvm.dev/docs/cli/"&gt;CLI reference&lt;/a&gt; has every command with all its flags.&lt;/p&gt;
&lt;h2 data-hextra-search-id="your-vm"&gt;Your VM&lt;span class="hx:absolute hx:-mt-20" id="your-vm"&gt;&lt;/span&gt;
&lt;a href="#your-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;open a shell in this folder&amp;rsquo;s VM, at the same path, making the VM first with the toolchains, agents and layers you choose, or that &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; name (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm restart&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stop this folder&amp;rsquo;s VM, start it again and open a shell in it, for changes that apply only when it starts (&lt;a href="https://next.devvm.dev/docs/using/vms/#restarting-and-stopping"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stop this folder&amp;rsquo;s VM (&lt;a href="https://next.devvm.dev/docs/using/vms/#restarting-and-stopping"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm update [--force] [--no-export] [--clean-home [--no-worktree-check]]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;move this folder&amp;rsquo;s VM to the newest shared tools, and when its image or its &lt;code&gt;devcontainer.json&lt;/code&gt; has changed, make it again from the image&amp;rsquo;s new build and the file as it is now, keeping its home folder and settings, after asking, then open a shell in it (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm rm [--force] [--no-export] [--no-clone-check] [--no-worktree-check]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;delete this folder&amp;rsquo;s VM after asking, exporting its agents&amp;rsquo; history first unless &lt;code&gt;--no-export&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/vms/#deleting-a-vm"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm rm VM [--force] [--no-export] [--no-clone-check] [--no-worktree-check]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;delete a VM whose folder is gone, by its name or ssh alias, after asking (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-vm-whose-folder-is-gone"&gt;details&lt;/a&gt;), or one whose folder is on a disk that isn&amp;rsquo;t connected, only after asking in a terminal (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-on-a-disk-that-isnt-connected"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm adopt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;use the VM made for an earlier folder at this path here (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-made-again"&gt;details&lt;/a&gt;), or the VM made for this folder before you moved or renamed it (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-moved-or-renamed-folder"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm adopt VM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;move a VM whose folder is gone to this folder, such as a copy of that folder on another disk, after asking (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-moved-or-renamed-folder"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;list the project VMs (&lt;a href="https://next.devvm.dev/docs/using/vms/#listing-vms"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;get this folder&amp;rsquo;s VM ready as &lt;code&gt;devvm host&lt;/code&gt; does, then open its folder in VS Code over Remote-SSH (&lt;a href="https://next.devvm.dev/docs/using/ssh/#vs-code-and-cursor"&gt;VS Code and Cursor&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm cursor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;get this folder&amp;rsquo;s VM ready as &lt;code&gt;devvm host&lt;/code&gt; does, then open its folder in Cursor over Remote-SSH (&lt;a href="https://next.devvm.dev/docs/using/ssh/#vs-code-and-cursor"&gt;VS Code and Cursor&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm desktop [--clipboard] [--no-open]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;serve this folder&amp;rsquo;s VM&amp;rsquo;s desktop on &lt;code&gt;127.0.0.1&lt;/code&gt; with its password until Ctrl+C, and open it in Screen Sharing on macOS (&lt;a href="https://next.devvm.dev/docs/using/desktop/"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm host&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;get this folder&amp;rsquo;s VM ready for ssh and editors, and show the host name they reach it by, such as &lt;code&gt;devvm-website&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/ssh/#devvm-host-devvm-code-and-devvm-cursor"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm history&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;list the exports of agents&amp;rsquo; history that devvm saved in &lt;code&gt;~/.local/share/devvm/exports&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm history export [FILE]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;save the history of this folder&amp;rsquo;s VM&amp;rsquo;s agents to FILE, or to a new &lt;code&gt;.tar.gz&lt;/code&gt; in &lt;code&gt;~/.local/share/devvm/exports&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm history import [FILE]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;put the agents&amp;rsquo; history in FILE, or in the newest export devvm saved for this folder, into this folder&amp;rsquo;s VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-history"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm paste [--json] [--send-file]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;send the image, the PDF, or the one copied file, after asking about a file, on this machine&amp;rsquo;s clipboard into this folder&amp;rsquo;s running VM&amp;rsquo;s paste folder, and copy its path there for your terminal&amp;rsquo;s paste shortcut (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#pasting-images"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm paste rm [--force]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;delete the files devvm paste left in this folder&amp;rsquo;s running VM, after asking (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#deleting-pasted-files"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In a folder without a VM of its own, each of these commands but &lt;code&gt;devvm adopt&lt;/code&gt; uses the VM of the nearest folder with one that it&amp;rsquo;s inside, and says which VM that is. &lt;code&gt;--here&lt;/code&gt; and &lt;code&gt;--parent&lt;/code&gt; choose which VM a command uses (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-subfolder"&gt;a subfolder&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;These options are for a new VM, so a VM that exists ignores them with a warning, and only &lt;code&gt;devvm&lt;/code&gt; takes them (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--tools LIST|none&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the toolchains the VM gets, such as &lt;code&gt;--tools node,python&lt;/code&gt;, in place of those the folder&amp;rsquo;s files call for (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--agents LIST|none&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the coding agents the VM gets, such as &lt;code&gt;--agents claude,codex&lt;/code&gt;, in place of those &lt;code&gt;devvm setup&lt;/code&gt; chose (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--layers LIST|none&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the layers the VM&amp;rsquo;s image gets, bottom first, such as &lt;code&gt;--layers docker&lt;/code&gt;, in place of those &lt;code&gt;devvm setup&lt;/code&gt; chose (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--network TIER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;create the VM on a &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt;: &lt;code&gt;open&lt;/code&gt; reaches anything this machine can, &lt;code&gt;internet&lt;/code&gt; any public host, &lt;code&gt;allowlist&lt;/code&gt;, the default, only the hosts you allow, and &lt;code&gt;none&lt;/code&gt; only its agents&amp;rsquo; and secrets&amp;rsquo; hosts and its links&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;create the VM with its own clone of the repo, or of each repo in a folder of repos, instead of mounting the folder (&lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--repos all|none|LIST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;--clone&lt;/code&gt; in a folder of repos, the repos the VM gets a clone of, such as &lt;code&gt;--repos frontend,backend&lt;/code&gt;, in place of the picker (&lt;a href="https://next.devvm.dev/docs/using/clone/#folders-of-repos"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--no-git-protect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;create the VM without &lt;code&gt;.git&lt;/code&gt; protection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--ssh-agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;create the VM forwarding your SSH agent, so while you&amp;rsquo;re connected, anything in it can use your keys (&lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--unsafe-folder&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;mount a folder that devvm refuses, such as one that is or holds your home folder (&lt;a href="https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--cpus N&lt;/code&gt;, &lt;code&gt;--memory GiB&lt;/code&gt;, &lt;code&gt;--disk GiB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s size (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--ports all|none|LIST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;which ports the VM forwards (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--from IMAGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;start its base from a container image, such as &lt;code&gt;node:24&lt;/code&gt;, instead of Ubuntu&amp;rsquo;s cloud image (&lt;a href="https://next.devvm.dev/docs/using/from/"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--no-devcontainer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;create the VM without reading the folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt;, which otherwise describes the VM as far as devvm supports it, with the options you give taking priority (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-hextra-search-id="working-on-a-clone"&gt;Working on a clone&lt;span class="hx:absolute hx:-mt-20" id="working-on-a-clone"&gt;&lt;/span&gt;
&lt;a href="#working-on-a-clone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm --clone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;make this folder&amp;rsquo;s VM with its own clone of the repo, copy your repo into it and open a shell in the clone (&lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm clone fetch [--json]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;on this machine, fetch the VM&amp;rsquo;s work as &lt;code&gt;devvm/&amp;lt;branch&amp;gt;&lt;/code&gt; into every repo it has a clone of, with its Git LFS objects, to review before you merge it, and list the new or moved branches, each with its repos (&lt;a href="https://next.devvm.dev/docs/using/clone/#fetching-the-vms-work"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm clone add PATH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;copy one more repo of a folder of repos into the VM, at the same path (&lt;a href="https://next.devvm.dev/docs/using/clone/#adding-a-repo"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm rm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;delete the VM, first offering to keep the work you haven&amp;rsquo;t fetched as &lt;code&gt;saved/devvm/&amp;lt;branch&amp;gt;&lt;/code&gt; branches (&lt;a href="https://next.devvm.dev/docs/using/clone/#deleting-the-vm"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm clone on|off&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;make an existing VM again with its own clone of the repo, or with the folder mounted once devvm has offered to keep the clone&amp;rsquo;s work as &lt;code&gt;devvm rm&lt;/code&gt; does (&lt;a href="https://next.devvm.dev/docs/using/clone/#switching-a-vm-that-exists"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="change-your-vm"&gt;Change your VM&lt;span class="hx:absolute hx:-mt-20" id="change-your-vm"&gt;&lt;/span&gt;
&lt;a href="#change-your-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in a terminal, choose this folder&amp;rsquo;s VM&amp;rsquo;s toolchains and agents in a list, then open a shell in it, and otherwise show its shared tools, each with its version and any newer one (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm tools add TOOL...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;add shared tools to this folder&amp;rsquo;s VM, such as &lt;code&gt;devvm tools add python claude&lt;/code&gt;, then open a shell in it (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm tools rm TOOL...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;take shared tools out of this folder&amp;rsquo;s VM, such as &lt;code&gt;devvm tools rm python claude&lt;/code&gt;, then open a shell in it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm tools update&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;move this folder&amp;rsquo;s VM to the newest shared tools, and only those, then open a shell in it (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm size [--cpus N] [--memory GiB] [--disk GiB]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show or change this folder&amp;rsquo;s VM&amp;rsquo;s CPUs, memory and disk (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm size -g ...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show or change the size new VMs get (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm mount-cache [none]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show how this folder&amp;rsquo;s VM caches its project folder on a Linux host, &lt;code&gt;none&lt;/code&gt;, which new VMs get, or Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt;, which can lose writes, or switch it to &lt;code&gt;none&lt;/code&gt; from the VM&amp;rsquo;s next start (&lt;a href="https://next.devvm.dev/docs/backends/lima/#the-project-folders-cache"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ports [all|none|LIST]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show or change which ports this folder&amp;rsquo;s VM forwards to this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, even while it runs (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ports add|rm LIST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;forward more ports, or stop forwarding some (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ports -g ...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show or change what new VMs forward (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network [open|internet|learn|allowlist|none]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show this folder&amp;rsquo;s VM&amp;rsquo;s tier, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;internet (learning)&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt; or &lt;code&gt;unenforced&lt;/code&gt;, and then its allowlist, file by file, or give it a tier: between the confined tiers at once, and into or out of open from its next start, offering to restart a running VM now, and with &lt;code&gt;learn&lt;/code&gt;, internet while it learns the hosts it needs (&lt;a href="https://next.devvm.dev/docs/safety/network/#choosing-a-tier"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network -g [open|internet|allowlist|none]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show or change new VMs&amp;rsquo; tier, which is &lt;code&gt;allowlist&lt;/code&gt; until you change it (&lt;a href="https://next.devvm.dev/docs/safety/network/#choosing-a-tier"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network lock [--all] [--none]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;choose which of the hosts this folder&amp;rsquo;s VM learned it keeps, add them to its own rules, and give it the allowlist tier (&lt;a href="https://next.devvm.dev/docs/safety/network/#locking-it"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network allow|deny|rm RULE... [-g]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;add allow or deny rules to this folder&amp;rsquo;s VM&amp;rsquo;s own, or remove them, at once, and with &lt;code&gt;-g&lt;/code&gt;, change yours for every VM (&lt;a href="https://next.devvm.dev/docs/safety/network/#changing-rules"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network allow|deny|rm RULE... --method METHODS --path PATH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;narrow those rules to some of a host&amp;rsquo;s requests, such as only &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;HEAD&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#rules-by-method-and-path"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network log [--follow] [-n N] [--blocked]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show what this folder&amp;rsquo;s VM connected to and what its proxy blocked (&lt;a href="https://next.devvm.dev/docs/safety/network/#logs"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network transparent [on|off]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show whether this folder&amp;rsquo;s VM sends tools that ignore the proxy settings to its proxy by the names they look up, and where that comes from, or give the VM its own setting, from its next launch (&lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ssh-agent [on|devvm|off]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show this folder&amp;rsquo;s VM&amp;rsquo;s SSH agent forwarding, which is &lt;code&gt;off&lt;/code&gt;, &lt;code&gt;on&lt;/code&gt; for yours or &lt;code&gt;devvm&lt;/code&gt; for devvm&amp;rsquo;s own, then the keys devvm&amp;rsquo;s own agent holds and those added to it, or change the forwarding from the VM&amp;rsquo;s next start (&lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ssh-agent add KEY_FILE [--confirm] [--lifetime DURATION]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;load a key into devvm&amp;rsquo;s own agent, and load it again whenever a VM needs it (&lt;a href="https://next.devvm.dev/docs/using/ssh/#devvms-own-agent"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ssh-agent rm KEY_FILE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;take a key out of devvm&amp;rsquo;s own agent, so devvm doesn&amp;rsquo;t load it again (&lt;a href="https://next.devvm.dev/docs/using/ssh/#devvms-own-agent"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm git-protect [on|off]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show or change this folder&amp;rsquo;s VM&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; protection, while it&amp;rsquo;s stopped (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#turning-it-on-or-off"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm clone [on|off] [--force] [--no-export] [--clean-home [--no-worktree-check]] [--no-clone-check] [--repos LIST]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show whether this folder&amp;rsquo;s VM has its own clone of the repo, or make it again with one, or with the folder mounted, keeping its home folder and settings, after asking, then open a shell in it (&lt;a href="https://next.devvm.dev/docs/using/clone/#switching-a-vm-that-exists"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret&lt;/code&gt;, &lt;code&gt;devvm secret rm NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;list the secrets, whether each is saved and the VMs using it, or delete a saved one (&lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret set claude|github [--stdin]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;save your Claude Code token or GitHub token on this machine, so that VMs get a placeholder and their proxy puts the secret in (&lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret set NAME --host HOST --env VARIABLE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;save a secret of your own, such as an API key, which VMs that use it send only to its hosts (&lt;a href="https://next.devvm.dev/docs/safety/network/#your-own-secrets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret use|unuse NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;let this folder&amp;rsquo;s VM use a secret, or stop it, though a VM with Claude Code always uses &lt;code&gt;claude&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm layer add LAYER... [--force] [--no-export] [--clean-home [--no-worktree-check]]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;make this folder&amp;rsquo;s VM again with more layers on top, keeping its home folder and settings, after asking, then open a shell in it (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm layer rm LAYER... [--force] [--no-export] [--clean-home [--no-worktree-check]]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;make this folder&amp;rsquo;s VM again without some of its layers, keeping its home folder and settings, after asking, then open a shell in it (&lt;a href="https://next.devvm.dev/docs/using/images/#taking-layers-out-of-a-vm"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="links-between-vms"&gt;Links between VMs&lt;span class="hx:absolute hx:-mt-20" id="links-between-vms"&gt;&lt;/span&gt;
&lt;a href="#links-between-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm link&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;list this folder&amp;rsquo;s VM&amp;rsquo;s links, each with its name, port, target VM and folder, the target&amp;rsquo;s status, and whether the link applies (&lt;a href="https://next.devvm.dev/docs/using/links/#listing-links"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm link add TARGET PORT [--as NAME]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;link this folder&amp;rsquo;s VM to PORT of the VM that TARGET names, so programs in it reach the port as &lt;code&gt;NAME:PORT&lt;/code&gt; and &lt;code&gt;NAME.devvm.internal:PORT&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/links/#adding-a-link"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm link rm TARGET PORT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;remove one of this folder&amp;rsquo;s VM&amp;rsquo;s links (&lt;a href="https://next.devvm.dev/docs/using/links/#removing-a-link"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm link publish [PORTS]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show the ports this folder&amp;rsquo;s VM publishes, or offer PORTS to links from any of your other VMs (&lt;a href="https://next.devvm.dev/docs/using/links/#publishing-a-port"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm link unpublish PORTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stop offering ports to links (&lt;a href="https://next.devvm.dev/docs/using/links/#publishing-a-port"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm group&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show the group this folder&amp;rsquo;s VM is in, with each of its VMs, the name the others reach it by, its folder and the ports it publishes (&lt;a href="https://next.devvm.dev/docs/using/links/#groups"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm group join NAME [--as NAME]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;put this folder&amp;rsquo;s VM in the group NAME, which its first VM makes, so each VM in the group reaches the ports the others publish (&lt;a href="https://next.devvm.dev/docs/using/links/#joining-a-group"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm group leave&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;take this folder&amp;rsquo;s VM out of its group, removing the links the group made (&lt;a href="https://next.devvm.dev/docs/using/links/#leaving-a-group"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="images"&gt;Images&lt;span class="hx:absolute hx:-mt-20" id="images"&gt;&lt;/span&gt;
&lt;a href="#images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm images&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;list the images, then the shared tool images (&lt;a href="https://next.devvm.dev/docs/using/images/#listing-images"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm images rm IMAGE|KEY...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;delete images, by name or by the key &lt;code&gt;devvm images&lt;/code&gt; shows (&lt;a href="https://next.devvm.dev/docs/using/images/#deleting-images"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm build IMAGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;build an image and the images under it, unless they&amp;rsquo;re built, such as &lt;code&gt;devvm build docker&lt;/code&gt; or &lt;code&gt;devvm build foo+bar&lt;/code&gt;, where IMAGE is base or layers and never a shared tool (&lt;a href="https://next.devvm.dev/docs/using/images/#layers"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm rebuild IMAGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;build an image of base or layers again from its parent as it is, and delete the stale images no VM uses, while shared tools follow the tools lock instead (&lt;a href="https://next.devvm.dev/docs/using/images/#rebuilding"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm layer new NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;start a layer of your own, &lt;code&gt;~/.config/devvm/layers/NAME.sh&lt;/code&gt;, with its allowlist, &lt;code&gt;NAME.policy&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/customizing/#your-own-layers"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;devvm build&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt; and &lt;code&gt;devvm images rm&lt;/code&gt; take &lt;code&gt;--from IMAGE&lt;/code&gt; to work on a base made from that container image (&lt;a href="https://next.devvm.dev/docs/using/from/"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="disk-space"&gt;Disk space&lt;span class="hx:absolute hx:-mt-20" id="disk-space"&gt;&lt;/span&gt;
&lt;a href="#disk-space" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm space&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show what devvm keeps on this machine, the disk each kind takes, and what frees it (&lt;a href="https://next.devvm.dev/docs/using/space/#devvm-space"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm gc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;delete the stale and unfinished images and the tool images no VM uses, after listing them, and never a VM (&lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm retention [KEY=VALUE...]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;show the retention settings, which say what devvm deletes on its own, or change them, with &lt;code&gt;KEY=off&lt;/code&gt; turning one off (&lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="this-machine"&gt;This machine&lt;span class="hx:absolute hx:-mt-20" id="this-machine"&gt;&lt;/span&gt;
&lt;a href="#this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm setup [--features LIST|none] [--agents LIST|none] [--layers LIST|none]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;choose base&amp;rsquo;s features and the coding agents and layers new VMs get, and in a terminal also new VMs&amp;rsquo; size and network tier (&lt;a href="https://next.devvm.dev/docs/using/settings/#devvm-setup"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm agent import [AGENT...]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;copy the agents&amp;rsquo; settings and logins from your home folder into devvm&amp;rsquo;s agent store, which every VM gets them from, never their history, asking before it replaces the store&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm agent login AGENT [--setup-token] [--device-code] [--api-key]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;log an agent in inside this folder&amp;rsquo;s VM, such as Claude Code to your Claude subscription, or get a Claude Code token with &lt;code&gt;--setup-token&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;details&lt;/a&gt;), or log an agent in to ChatGPT there, in a browser on this machine or with a code, or save an API key, and keep the login in devvm&amp;rsquo;s agent store for every VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#logging-in-with-devvm-agent-login"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm agent save [AGENT...]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;copy the agents&amp;rsquo; settings from this folder&amp;rsquo;s VM into devvm&amp;rsquo;s agent store, never their logins or history, after showing what changed and asking (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm doctor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;check what devvm needs on this machine and say how to get what&amp;rsquo;s missing (&lt;a href="https://next.devvm.dev/docs/getting-started/install/#checking-what-devvm-needs"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm upgrade [--check] [--to VERSION]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;install devvm&amp;rsquo;s newest release the way you installed devvm, after asking, or with &lt;code&gt;--check&lt;/code&gt; only say whether a newer one is out (&lt;a href="https://next.devvm.dev/docs/using/upgrading/#upgrading"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm completion SHELL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;print the shell completion script for &lt;code&gt;bash&lt;/code&gt;, &lt;code&gt;zsh&lt;/code&gt; or &lt;code&gt;fish&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/command-line/#shell-completion"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm limactl ARGS...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;run Lima&amp;rsquo;s &lt;code&gt;limactl&lt;/code&gt; on the VMs and images in devvm&amp;rsquo;s own Lima home, not &lt;code&gt;~/.lima&lt;/code&gt;, for debugging, which starts VMs unconfined, whatever their tier (&lt;a href="https://next.devvm.dev/docs/backends/lima/#running-limactl"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="devvm-itself"&gt;devvm itself&lt;span class="hx:absolute hx:-mt-20" id="devvm-itself"&gt;&lt;/span&gt;
&lt;a href="#devvm-itself" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm help [COMMAND]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;print the help for devvm or a command, as &lt;code&gt;--help&lt;/code&gt; and &lt;code&gt;-h&lt;/code&gt; do (&lt;a href="https://next.devvm.dev/docs/using/command-line/#help"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;print devvm&amp;rsquo;s version alone, as &lt;code&gt;devvm version&lt;/code&gt; also does&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The folders devvm keeps its state in and the environment variables it reads are in &lt;a href="https://next.devvm.dev/docs/using/settings/"&gt;Settings and files&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Images and caching</title><link>https://next.devvm.dev/docs/internals/images/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/images/</guid><description>
&lt;p&gt;This page explains how devvm builds images and shared tools, how it keys and caches them, and how it checks what they start from: Ubuntu&amp;rsquo;s cloud image, a container image from &lt;code&gt;--from&lt;/code&gt;, and each tool&amp;rsquo;s downloads. &lt;a href="https://next.devvm.dev/docs/using/images/"&gt;Images and tools&lt;/a&gt; covers choosing, rebuilding and cleaning up images, and &lt;a href="https://next.devvm.dev/docs/using/from/"&gt;Starting from a container image&lt;/a&gt; covers &lt;code&gt;--from&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="building"&gt;Building&lt;span class="hx:absolute hx:-mt-20" id="building"&gt;&lt;/span&gt;
&lt;a href="#building" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm builds each image in a VM of its own, and that VM then is the image:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;For base, devvm makes a new VM from &lt;a href="#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt; with &lt;code&gt;base.yaml&lt;/code&gt;&amp;rsquo;s settings, or, with &lt;code&gt;--from&lt;/code&gt;, from a container image &lt;a href="#how-its-converted"&gt;converted into a disk&lt;/a&gt;. A layer&amp;rsquo;s VM is a copy of its parent image.&lt;/li&gt;
&lt;li&gt;The VM starts confined, and it forwards no ports. What a build with the internet reaches of the host depends on the backend: on macOS, Lima keeps it out of the host&amp;rsquo;s loopback, and on Linux it reaches the host&amp;rsquo;s loopback too, as &lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;Lima&lt;/a&gt; describes.&lt;/li&gt;
&lt;li&gt;The script runs. For base, that&amp;rsquo;s base&amp;rsquo;s own script, &lt;code&gt;base.sh&lt;/code&gt;, and then the &lt;a href="https://next.devvm.dev/docs/using/customizing/"&gt;features&lt;/a&gt; you chose, and for a layer, it&amp;rsquo;s the layer&amp;rsquo;s script.&lt;/li&gt;
&lt;li&gt;The VM stops. devvm writes the image&amp;rsquo;s record last, &lt;code&gt;~/.local/share/devvm/images/&amp;lt;key&amp;gt;/record.json&lt;/code&gt;, with its name, its chain, what base started from and its digest, its C library, the glibc version of a &lt;code&gt;--from&lt;/code&gt; base with glibc, when the build finished and the version of the devvm that built it (&lt;code&gt;made_by&lt;/code&gt;). The record is JSON that only devvm writes, and devvm ignores fields it doesn&amp;rsquo;t know, so a newer devvm&amp;rsquo;s record still reads.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;While the VM is being built, it already has the image&amp;rsquo;s final name, so devvm holds a lock for each image it builds, &lt;code&gt;~/.local/share/devvm/images/locks/&amp;lt;key&amp;gt;&lt;/code&gt;, from before it looks for the image until the record is written. Another devvm that builds the same image waits for that lock under a status line (&lt;code&gt;image_build_waiting&lt;/code&gt;), and once it gets the lock, it finds the image built. An image without a record is unfinished only when its lock is free, so devvm then deletes it and builds it again (&lt;code&gt;image_leftover&lt;/code&gt;). While the lock is held, the image is &lt;code&gt;building&lt;/code&gt;, and &lt;code&gt;devvm gc&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt; and &lt;code&gt;devvm images rm&lt;/code&gt; leave it alone (&lt;code&gt;image_building&lt;/code&gt;). The lock is an OS lock on an open file, which the system releases when its devvm ends, however it ends, so a crash never leaves an image looking like it&amp;rsquo;s still being built. devvm deletes the lock file together with the image&amp;rsquo;s folder.&lt;/p&gt;
&lt;p&gt;Nothing from the host is mounted into a build, because layer scripts run third-party installers, which mustn&amp;rsquo;t see your files. Behind a company proxy, a build on Lima goes through a proxy of devvm&amp;rsquo;s on this machine for that build alone, which goes through the company proxy. The scripts&amp;rsquo; commands get only that proxy&amp;rsquo;s address, with a password devvm makes for the build, so neither the build nor its image ever has the company proxy&amp;rsquo;s password (&lt;a href="https://next.devvm.dev/docs/contributing/design/#a-company-proxy"&gt;a company proxy&lt;/a&gt;). A build gets base&amp;rsquo;s size fitted to the host, which the images built on base, and their VMs, keep (&lt;a href="#bases-size"&gt;base&amp;rsquo;s size&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A build&amp;rsquo;s downloads survive a network that cuts or stalls them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-fetch&lt;/code&gt;&lt;/strong&gt;, which base installs and every layer downloads through, gives up on a connection that takes more than 20 seconds to open or stays slower than 1 KB/s for 30 seconds, and tries again from where it stopped, five tries in all, waiting a little longer after each. A server that won&amp;rsquo;t resume (curl&amp;rsquo;s exits 33 and 36) starts the file again from nothing, and so does a file that doesn&amp;rsquo;t match its checksum, once, as a resume may have joined two versions of it. It follows a redirect only to https, and it keeps only a file whose checksum is the pinned one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;apt&lt;/strong&gt; tries a package&amp;rsquo;s download again three times once a source has answered (&lt;a href="#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;crane&lt;/strong&gt;, in a &lt;code&gt;--from&lt;/code&gt; conversion, is tried again five times, and &lt;strong&gt;oh-my-bash&lt;/strong&gt;&amp;rsquo;s clone, in the &lt;code&gt;omb&lt;/code&gt; feature, is tried five times in all, each failing on a connection that stays slower than 1 KB/s for 30 seconds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;mise&lt;/strong&gt;, in a tool image&amp;rsquo;s build and on this machine, tries each download again six times (&lt;code&gt;MISE_HTTP_RETRIES&lt;/code&gt;), as its own three end within a two-minute stall.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;tldr --update&lt;/code&gt;&lt;/strong&gt;, in the &lt;code&gt;cli-tools&lt;/code&gt; feature, gives up after a minute, as it has no timeout of its own, and the feature warns that you can run it in the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="keys-and-caching"&gt;Keys and caching&lt;span class="hx:absolute hx:-mt-20" id="keys-and-caching"&gt;&lt;/span&gt;
&lt;a href="#keys-and-caching" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm builds images in layers and caches them, as Docker does. &lt;code&gt;base&lt;/code&gt; comes first, and each layer is built on its parent, so &lt;code&gt;foo+bar&lt;/code&gt; is &lt;code&gt;bar&lt;/code&gt; on &lt;code&gt;foo&lt;/code&gt; on &lt;code&gt;base&lt;/code&gt;. A layer starts from its parent and runs its script inside it, and devvm stores it under a key, which is a hash of everything that goes into it. When an image with that key already exists, devvm uses it, and otherwise it builds one.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Image&lt;/th&gt;
&lt;th&gt;Its key hashes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;base&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the backend, base&amp;rsquo;s Lima template (&lt;code&gt;base.yaml&lt;/code&gt;), devvm&amp;rsquo;s prelude (&lt;code&gt;prelude.sh&lt;/code&gt;), the apt script (&lt;code&gt;apt.sh&lt;/code&gt;), base&amp;rsquo;s script (&lt;code&gt;base.sh&lt;/code&gt;), the chosen features that devvm has, in order (each name and its script), its rebuild counter, and with &lt;code&gt;--from&lt;/code&gt;, the image, its digest and the scripts that convert it; on Lima, the Ubuntu cloud image pinned on this machine (its release, file and SHA-256), base&amp;rsquo;s disk size, and the user that a &lt;code&gt;--from&lt;/code&gt; conversion puts in the image (its name, uid and home folder) with the converted disk&amp;rsquo;s size&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a built-in layer&lt;/td&gt;
&lt;td&gt;its parent&amp;rsquo;s key, its name, the prelude, the apt script, its own script, which devvm ships, and its rebuild counter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a custom layer&lt;/td&gt;
&lt;td&gt;its parent&amp;rsquo;s key, its name, the prelude, the apt script, its script (&lt;code&gt;~/.config/devvm/layers/&amp;lt;name&amp;gt;.sh&lt;/code&gt;) with the prelude before it, and its rebuild counter&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;devvm puts together each image&amp;rsquo;s recipe once, as the ordered list of steps its build runs. A step is a script with its name, its arguments and whether it runs as root. Each script in a recipe that runs with bash, devvm&amp;rsquo;s own and a custom layer&amp;rsquo;s alike, starts with devvm&amp;rsquo;s prelude, which &lt;a href="#the-scripts-prelude"&gt;the scripts&amp;rsquo; prelude&lt;/a&gt; describes, so the recipe holds the prelude and the script together. The recipe of &lt;code&gt;base&lt;/code&gt; starts with the backend&amp;rsquo;s own steps, which say what the backend makes &lt;code&gt;base&lt;/code&gt;&amp;rsquo;s disk from. On Lima, those are the Ubuntu cloud image pinned on this machine, base&amp;rsquo;s disk size and &lt;code&gt;base.yaml&lt;/code&gt;, and with &lt;code&gt;--from&lt;/code&gt;, the conversion&amp;rsquo;s scripts too, &lt;code&gt;build.sh&lt;/code&gt; with its arguments. Then come &lt;code&gt;apt.sh begin&lt;/code&gt;, &lt;code&gt;base.sh&lt;/code&gt;, the chosen features&amp;rsquo; scripts and &lt;code&gt;apt.sh end&lt;/code&gt;, while a layer&amp;rsquo;s recipe is &lt;code&gt;apt.sh lists&lt;/code&gt; and then its own script. The key hashes that recipe, and the backend is given the same recipe and runs it as it is, so nothing reaches a build that its key doesn&amp;rsquo;t hold, apart from base&amp;rsquo;s packages: those are the ones its key recorded at its first build, or the mirror to record them from, which &lt;a href="#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt; describes. A chosen feature without a script isn&amp;rsquo;t in the recipe, and devvm warns about it (&lt;code&gt;unknown_feature&lt;/code&gt;) when it builds &lt;code&gt;base&lt;/code&gt;. The user&amp;rsquo;s CAs and a company proxy&amp;rsquo;s variables are added to each step while it runs and taken out again, so they aren&amp;rsquo;t in the recipe, and the image keeps none of them. A build&amp;rsquo;s CPUs and memory aren&amp;rsquo;t in it either, because the host&amp;rsquo;s size doesn&amp;rsquo;t change what an image holds, but base&amp;rsquo;s disk size is, because the disk is part of the image (&lt;a href="#bases-size"&gt;base&amp;rsquo;s size&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A key is the first 12 hex digits of a SHA-256. Each input goes into the hash with its length, so different inputs never hash the same bytes. An image&amp;rsquo;s record keeps its chain, which is the key of each image it&amp;rsquo;s built on, from &lt;code&gt;base&lt;/code&gt; up.&lt;/p&gt;
&lt;p&gt;Each key hashes its parent&amp;rsquo;s, so a new key anywhere in the chain changes the key of every image above it:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 456px; --devvm-diagram-width: 513px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 513 456" width="513" height="456" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d6b5091369547aaca--title" aria-describedby="d6b5091369547aaca--desc"&gt;&lt;title id="d6b5091369547aaca--title"&gt;Image keys in a chain&lt;/title&gt;&lt;desc id="d6b5091369547aaca--desc"&gt;Each image's key hashes its parent's key, as in base, then foo, then foo+bar. After foo.sh is edited, or devvm rebuild foo, base keeps its key and is reused, and foo and foo+bar get new keys and are built again.&lt;/desc&gt;&lt;g class="pele-clusters"&gt;&lt;g class="pele-cluster" data-id="built"&gt;&lt;rect x="285.91" y="42.5" width="218.55" height="371" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="322.18" y="65.9" text-anchor="middle"&gt;built&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-cluster" data-id="next"&gt;&lt;rect x="8" y="8" width="232.91" height="440" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="124.45" y="29.9"&gt;after foo.sh is edited,&lt;/tspan&gt;&lt;tspan x="124.45" y="47.9"&gt;or devvm rebuild foo&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_b2_f2_0"&gt;&lt;path d="M124.45,138L124.45,198"/&gt;&lt;path class="pele-marker" d="M124.45,205L121.09,197L127.81,197Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_f2_fb2_0"&gt;&lt;path d="M124.45,283L124.45,343"/&gt;&lt;path class="pele-marker" d="M124.45,350L121.09,342L127.81,342Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_b1_f1_0"&gt;&lt;path d="M395.18,139.5L395.18,199.5"/&gt;&lt;path class="pele-marker" d="M395.18,206.5L391.82,198.5L398.54,198.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_f1_fb1_0"&gt;&lt;path d="M395.18,266.5L395.18,326.5"/&gt;&lt;path class="pele-marker" d="M395.18,333.5L391.82,325.5L398.54,325.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_b2_f2_0"&gt;&lt;rect x="89.27" y="162.5" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="124.45" y="175.7" text-anchor="middle"&gt;its key&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_f2_fb2_0"&gt;&lt;rect x="89.27" y="307.5" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="124.45" y="320.7" text-anchor="middle"&gt;its key&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_b1_f1_0"&gt;&lt;rect x="360" y="164" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="395.18" y="177.2" text-anchor="middle"&gt;its key&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_f1_fb1_0"&gt;&lt;rect x="360" y="291" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="395.18" y="304.2" text-anchor="middle"&gt;its key&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="b2" transform="translate(124.45,99)"&gt;&lt;rect x="-89.27" y="-39" width="178.55" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;base&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;key 1a2b3c4d5e6f&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;reused&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="f2" transform="translate(124.45,244)"&gt;&lt;rect x="-89.27" y="-39" width="178.55" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;foo&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;key 9a0b1c2d3e4f&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;built again&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="fb2" transform="translate(124.45,389)"&gt;&lt;rect x="-89.27" y="-39" width="178.55" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;foo+bar&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;key 5a6b7c8d9e0f&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;built again&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="b1" transform="translate(395.18,109.5)"&gt;&lt;rect x="-89.27" y="-30" width="178.55" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;base&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;key 1a2b3c4d5e6f&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="f1" transform="translate(395.18,236.5)"&gt;&lt;rect x="-89.27" y="-30" width="178.55" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;foo&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;key 7a8b9c0d1e2f&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="fb1" transform="translate(395.18,363.5)"&gt;&lt;rect x="-89.27" y="-30" width="178.55" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;foo+bar&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;key 3a4b5c6d7e8f&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;This means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When you edit a script, its layer and every layer above it rebuild the next time they&amp;rsquo;re used, and the layers below are reused.&lt;/li&gt;
&lt;li&gt;Each backend builds its own images and never uses another backend&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;--from&lt;/code&gt;, base&amp;rsquo;s key has the image&amp;rsquo;s &lt;a href="#digests"&gt;digest&lt;/a&gt;, so when the tag moves to a new image, base and everything on it rebuild.&lt;/li&gt;
&lt;li&gt;A layer whose script is gone hashes as missing, so its images don&amp;rsquo;t match any more.&lt;/li&gt;
&lt;li&gt;Nothing else counts. Features you haven&amp;rsquo;t chosen change no key, and neither do policy files (&lt;code&gt;*.policy&lt;/code&gt;), which the proxy reads at run time and which never go into an image.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An image whose key doesn&amp;rsquo;t match its inputs any more is stale. It stays until it&amp;rsquo;s deleted (&lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;cleaning up&lt;/a&gt;), and the next use builds a new one.&lt;/p&gt;
&lt;h2 data-hextra-search-id="rebuilding"&gt;Rebuilding&lt;span class="hx:absolute hx:-mt-20" id="rebuilding"&gt;&lt;/span&gt;
&lt;a href="#rebuilding" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm rebuild&lt;/code&gt; works through the rebuild counter, which each image&amp;rsquo;s key hashes. The counters are in &lt;code&gt;~/.local/share/devvm/images/rebuilds.json&lt;/code&gt;, one for each backend, each image that base starts from, as &lt;code&gt;--from&lt;/code&gt; gives it, and each image, so a rebuild on one backend leaves the other backends&amp;rsquo; images and their VMs as they are, and so does a rebuild from another container image. A rebuild writes a new value into its counter, made of the time and a random part, so the image gets a new key, and so does every image built on it. A rebuild of base on Lima also pins the newest &lt;a href="#ubuntus-cloud-image"&gt;Ubuntu cloud image&lt;/a&gt; first, while a rebuild of a &lt;code&gt;--from&lt;/code&gt; base looks up its container image&amp;rsquo;s digest again and keeps the cloud image pinned. The counters can&amp;rsquo;t be in an image&amp;rsquo;s folder, because a counter is an input to the key that names that folder. A devvm changing a counter holds a lock, &lt;code&gt;~/.local/share/devvm/images/locks/rebuilds&lt;/code&gt;, while it reads the file and writes it whole, so two rebuilds at once both keep their new values. devvm lists those images first (&lt;code&gt;rebuild_replaces&lt;/code&gt;). After the build, it deletes every stale image that no VM uses, which includes the old image and those built on it, and they&amp;rsquo;re built again, on the new image, the next time they&amp;rsquo;re needed. On Linux hosts, an image whose disk VMs are overlays of stays, and devvm says which VMs use it.&lt;/p&gt;
&lt;p&gt;A VM keeps the image it was made from, and its state keeps that image&amp;rsquo;s chain. When a key in the chain changes, after an edited script or a rebuild, devvm warns on each launch that the VM is outdated (&lt;code&gt;vm_outdated&lt;/code&gt;) and leaves the VM as it is (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;). &lt;code&gt;devvm update&lt;/code&gt; makes the same check, comparing each image&amp;rsquo;s key in the recorded chain with its key as it is now, and when one differs, it makes the VM again from the same image name (&lt;a href="https://next.devvm.dev/docs/internals/overview/#making-a-vm-again"&gt;making a VM again&lt;/a&gt;). Otherwise, when the VM also had the newest shared tools, it says the VM is current (&lt;code&gt;vm_current&lt;/code&gt;). Shared tool images have keys of their own, which &lt;a href="#building-tools"&gt;building tools&lt;/a&gt; describes, and they&amp;rsquo;re never in the chain, so newer shared tools alone don&amp;rsquo;t lead &lt;code&gt;devvm update&lt;/code&gt; to make the VM again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;span class="hx:absolute hx:-mt-20" id="ubuntus-cloud-image"&gt;&lt;/span&gt;
&lt;a href="#ubuntus-cloud-image" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On Lima, base starts from a dated release of Ubuntu 26.04&amp;rsquo;s cloud image (&lt;code&gt;release-YYYYMMDD&lt;/code&gt; on cloud-images.ubuntu.com), which devvm pins on this machine the first time it builds base. devvm&amp;rsquo;s own files hold only the release, 26.04, and Ubuntu&amp;rsquo;s cloud image key (fingerprint &lt;code&gt;D2EB44626FDDC30B513D5BB71A5D6C4C7DB87C81&lt;/code&gt;), so nothing in devvm needs moving when Ubuntu publishes a new image.&lt;/p&gt;
&lt;p&gt;To pin an image, devvm reads the list of dated releases at cloud-images.ubuntu.com and takes the newest one whose checksums list an image for the host:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; must carry a valid signature from Ubuntu&amp;rsquo;s cloud image key, in its &lt;code&gt;SHA256SUMS.gpg&lt;/code&gt;. No other key counts. devvm checks the signature itself, with the standard library&amp;rsquo;s RSA and SHA-2, so it needs no &lt;code&gt;gpgv&lt;/code&gt; or other program. When the signature is missing or doesn&amp;rsquo;t check out, devvm refuses the release (&lt;code&gt;ubuntu_bad_signature&lt;/code&gt;), and it never falls back to an older release for that reason.&lt;/li&gt;
&lt;li&gt;The host&amp;rsquo;s image, &lt;code&gt;ubuntu-26.04-server-cloudimg-arm64.img&lt;/code&gt; or &lt;code&gt;-amd64.img&lt;/code&gt;, must be listed with a SHA-256 of 64 hex digits. A release that lists none is passed over for the next older one, and when no release has one, devvm stops (&lt;code&gt;no_ubuntu_release&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;When devvm can&amp;rsquo;t read the list, it stops (&lt;code&gt;ubuntu_unreachable&lt;/code&gt;), and nothing is pinned. When a server&amp;rsquo;s certificate is what stops devvm reading the list, a release&amp;rsquo;s checksums or their signature, it says why, as it does for the download below (&lt;code&gt;ubuntu_untrusted&lt;/code&gt;, &lt;code&gt;ubuntu_bad_certificate&lt;/code&gt;, &lt;code&gt;ubuntu_certificate_invalid&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm records the pin in &lt;code&gt;~/.local/share/devvm/images/ubuntu.json&lt;/code&gt;: the release, the image&amp;rsquo;s file name, its SHA-256 and when it was pinned. One devvm pins at a time, holding &lt;code&gt;~/.local/share/devvm/images/locks/ubuntu&lt;/code&gt;, so two first builds pin the same image. Every later build of base on this machine uses the pinned image without looking anything up, so it needs no network for the image once devvm has it.&lt;/p&gt;
&lt;p&gt;devvm downloads the image itself, into &lt;code&gt;~/.local/share/devvm/images/ubuntu/&amp;lt;sha256&amp;gt;.img&lt;/code&gt;, and gives Lima that file, so Lima downloads nothing. The download goes through the company proxy, when there is one (&lt;a href="https://next.devvm.dev/docs/contributing/design/#a-company-proxy"&gt;a company proxy&lt;/a&gt;), and it trusts the CAs in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt; as well as this machine&amp;rsquo;s own, as the lookups of the dated releases do. A server whose certificate this machine doesn&amp;rsquo;t trust fails it at once (&lt;code&gt;ubuntu_untrusted&lt;/code&gt;), naming the folder of your CAs, and so does a certificate from a CA it trusts that&amp;rsquo;s for another host, out of date or not valid yet (&lt;code&gt;ubuntu_bad_certificate&lt;/code&gt;), which a wrong clock or another server answering for the host causes, so no CA mends it. Any other certificate that fails to verify, such as one signed with SHA-1 or by a CA whose name constraints leave the host out, fails it at once too, naming Go&amp;rsquo;s reason (&lt;code&gt;ubuntu_certificate_invalid&lt;/code&gt;). These are &lt;code&gt;fetch.Untrusted&lt;/code&gt;, &lt;code&gt;fetch.BadCertificate&lt;/code&gt; and &lt;code&gt;fetch.Unverified&lt;/code&gt;, which the lookups ask too, so each names the same cause, and devvm&amp;rsquo;s own mise asks &lt;code&gt;fetch.Untrusted&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;What came stays in &lt;code&gt;&amp;lt;sha256&amp;gt;.img.part&lt;/code&gt; across failures and runs, and the next try asks only for the rest, with an HTTP range and the file as it is, never compressed on the way. A try that reads nothing for 60 seconds ends, and five tries in a row that bring nothing fail the download (&lt;code&gt;ubuntu_download_failed&lt;/code&gt;), as do 100 tries in all, however much each brought. A failure that trying again in the same run won&amp;rsquo;t mend, such as a 403 or a company proxy that refuses, keeps the part for the next run too. Only a server that says the file is gone (404 or 410) and a file over 4 GiB take the part with them. A release that&amp;rsquo;s gone fails with &lt;code&gt;ubuntu_release_gone&lt;/code&gt;, which names &lt;code&gt;devvm rebuild base&lt;/code&gt;, as every try would get the same answer. A server that answers a range from another byte starts the part again, and a part that&amp;rsquo;s already the whole file, as a run killed before it kept the file leaves it, is kept without asking for more. A part that can&amp;rsquo;t be written, such as on a full disk, fails at once with that cause. devvm keeps the file only once its SHA-256 is the pin&amp;rsquo;s, and a file that doesn&amp;rsquo;t check out is downloaded again from nothing once before it fails (&lt;code&gt;ubuntu_image_checksum&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;One devvm downloads at a time, holding &lt;code&gt;~/.local/share/devvm/images/locks/ubuntu-image&lt;/code&gt;, and another waits for it under a status line (&lt;code&gt;ubuntu_image_waiting&lt;/code&gt;). Before it downloads, devvm takes the image from Lima&amp;rsquo;s own download cache when that holds it with the pin&amp;rsquo;s SHA-256, where a build of base by an earlier release of devvm, which had Lima download the image, left it, under the SHA-256 of the image&amp;rsquo;s address. devvm copies the file into a new file of its own, &lt;code&gt;&amp;lt;sha256&amp;gt;.img.import&lt;/code&gt;, which only you can read, hashes the bytes as it writes them and keeps the copy only once they&amp;rsquo;re the pin&amp;rsquo;s. It never links to Lima&amp;rsquo;s file or changes Lima&amp;rsquo;s cache. Lima 2.3 and newer check the file devvm gives it against the pin&amp;rsquo;s SHA-256 too, before they copy the file into the VM&amp;rsquo;s disk, and refuse one that doesn&amp;rsquo;t match. A &lt;code&gt;file://&lt;/code&gt; address, which only a test build&amp;rsquo;s &lt;code&gt;DEVVM_UBUNTU_URL&lt;/code&gt; can name, goes the same way, read from disk, and devvm refuses any other address that isn&amp;rsquo;t https.&lt;/p&gt;
&lt;p&gt;A pin for another architecture, such as in a data folder copied from another machine, counts as none, and the next build pins one for this host. A &lt;code&gt;--from&lt;/code&gt; base&amp;rsquo;s conversion boots the pinned image too, and pins one only when none is.&lt;/p&gt;
&lt;p&gt;An image devvm pinned in the same run that doesn&amp;rsquo;t boot, so that the backend fails to start base&amp;rsquo;s build VM, gets one second chance. devvm says so (&lt;code&gt;origin_no_boot&lt;/code&gt;), pins the newest release older than it, which it checks the same way, and builds base on that, so a broken new release of Ubuntu&amp;rsquo;s doesn&amp;rsquo;t stop new machines&amp;rsquo; first builds. The older release is what stays pinned. devvm tries this once a run, and never for an image that was pinned before the run, because that one booted then. The build VM that didn&amp;rsquo;t boot stays, stopped, as a &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-build-fails"&gt;failed build&lt;/a&gt; does.&lt;/p&gt;
&lt;p&gt;The pin is part of base&amp;rsquo;s recipe, so base&amp;rsquo;s key hashes the release, the file and its SHA-256, and a new pin makes a new base. base&amp;rsquo;s record keeps the address and SHA-256 of the image it was built from. Ubuntu removes its dated releases after a few months, so a base built from one that&amp;rsquo;s gone can still be used, but building it again needs devvm&amp;rsquo;s copy of the image, or Lima&amp;rsquo;s. &lt;code&gt;devvm gc --caches&lt;/code&gt; deletes devvm&amp;rsquo;s copies that no image&amp;rsquo;s record names and that aren&amp;rsquo;t pinned now, with a stopped download&amp;rsquo;s &lt;code&gt;.part&lt;/code&gt; and a stopped copy&amp;rsquo;s &lt;code&gt;.import&lt;/code&gt;, and those of any image once its &lt;code&gt;.img&lt;/code&gt; is there, unless one changed in the last hour. When devvm can&amp;rsquo;t read the pin, &lt;code&gt;devvm gc --caches&lt;/code&gt; fails rather than delete a copy the pin may name.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm gc --caches&lt;/code&gt; deletes an entry of Lima&amp;rsquo;s cache only when devvm&amp;rsquo;s own state shows that a build of devvm&amp;rsquo;s left it there and none needs it now: an image&amp;rsquo;s record names its address, as a build of base by an earlier release of devvm had Lima download it, devvm has its own copy of that image, which builds use instead, and it hasn&amp;rsquo;t changed in the last hour. An entry that no record names stays, because the user&amp;rsquo;s own Lima VMs share the cache and may have downloaded the same image. So does an entry for an image that the installed Lima&amp;rsquo;s own templates name, which devvm reads from the &lt;code&gt;share/lima/templates&lt;/code&gt; folder beside the &lt;code&gt;limactl&lt;/code&gt; on &lt;code&gt;PATH&lt;/code&gt;, as &lt;code&gt;limactl start&lt;/code&gt; with Lima&amp;rsquo;s templates starts from it, and devvm frees no entry of Lima&amp;rsquo;s when it can&amp;rsquo;t read them, with a line in the run log that names the folder and why.&lt;/p&gt;
&lt;h2 data-hextra-search-id="bases-settings-and-pins"&gt;Base&amp;rsquo;s settings and pins&lt;span class="hx:absolute hx:-mt-20" id="bases-settings-and-pins"&gt;&lt;/span&gt;
&lt;a href="#bases-settings-and-pins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Base&amp;rsquo;s size is 4 CPUs, 8 GiB of memory and a 100 GiB disk, which devvm sets in its own code, and it fits the CPUs and memory to the host (&lt;a href="#bases-size"&gt;base&amp;rsquo;s size&lt;/a&gt;). On Lima, base&amp;rsquo;s Lima template holds base&amp;rsquo;s other VM settings. Base&amp;rsquo;s script installs base, and the optional &lt;a href="https://next.devvm.dev/docs/using/customizing/"&gt;features&lt;/a&gt; you chose follow it.&lt;/p&gt;
&lt;p&gt;Each download in base&amp;rsquo;s script is pinned to a version and a SHA-256 at the top of the script, and the build fails if a checksum doesn&amp;rsquo;t match. Each feature pins its downloads in the same way, at the top of its script in the repo, which is built into devvm (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt; has where each script is). apt&amp;rsquo;s packages are pinned per image key, as &lt;a href="#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt; describes.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-scripts-prelude"&gt;The scripts&amp;rsquo; prelude&lt;span class="hx:absolute hx:-mt-20" id="the-scripts-prelude"&gt;&lt;/span&gt;
&lt;a href="#the-scripts-prelude" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm&amp;rsquo;s prelude, &lt;code&gt;prelude.sh&lt;/code&gt;, comes first in each script that a build runs with bash: &lt;code&gt;base.sh&lt;/code&gt; and &lt;code&gt;apt.sh&lt;/code&gt;, the built-in layers and features, your own layers, the shared tools&amp;rsquo; &lt;code&gt;build.sh&lt;/code&gt;, and a &lt;code&gt;--from&lt;/code&gt; conversion&amp;rsquo;s &lt;code&gt;build.sh&lt;/code&gt;. devvm puts it before the script on the script&amp;rsquo;s standard input, and for the conversion, in the copy of &lt;code&gt;build.sh&lt;/code&gt; that it writes into the conversion&amp;rsquo;s own temporary folder, so no copy of either is kept anywhere else. The prelude sets no shell options and runs only &lt;code&gt;uname&lt;/code&gt; and &lt;code&gt;command -v&lt;/code&gt;. It gives the script three things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$devvm_arch&lt;/code&gt; is the VM&amp;rsquo;s architecture as the pins name it, &lt;code&gt;arm64&lt;/code&gt; or &lt;code&gt;amd64&lt;/code&gt;. On any other architecture, the prelude stops the script.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$devvm_libc&lt;/code&gt; is the VM&amp;rsquo;s C library, &lt;code&gt;musl&lt;/code&gt; on Alpine, where &lt;code&gt;apk&lt;/code&gt; is, and &lt;code&gt;gnu&lt;/code&gt; everywhere else.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm_sha TOOL&lt;/code&gt; prints TOOL&amp;rsquo;s pinned SHA-256 for this VM, which is the script&amp;rsquo;s own &lt;code&gt;TOOL_sha256_&amp;lt;arch&amp;gt;_musl&lt;/code&gt; on musl when the script pins one, and its &lt;code&gt;TOOL_sha256_&amp;lt;arch&amp;gt;&lt;/code&gt; otherwise. A script that pins none for this VM gets an error that names the pin.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The prelude goes in as one line, &lt;code&gt;eval $'…'&lt;/code&gt;, which holds the whole file in bash&amp;rsquo;s ANSI-C quoting, and that line takes the place of the script&amp;rsquo;s &lt;code&gt;#!&lt;/code&gt; line. Each of the script&amp;rsquo;s lines then keeps its number in bash&amp;rsquo;s errors and in &lt;code&gt;$LINENO&lt;/code&gt;, and a script without a &lt;code&gt;#!&lt;/code&gt; line gets the prelude&amp;rsquo;s line before its first, so its lines are one further down. A build&amp;rsquo;s exports for a company proxy and for your CAs go on that same first line, before the &lt;code&gt;eval&lt;/code&gt;, so they don&amp;rsquo;t move the script&amp;rsquo;s lines either.&lt;/p&gt;
&lt;p&gt;Each of devvm&amp;rsquo;s scripts that uses the prelude checks that it came first, with &lt;code&gt;: &amp;quot;${devvm_arch:?}&amp;quot;&lt;/code&gt; for each variable it reads, so it stops at once when run without it. The key of each image and tool image whose build runs one of these scripts hashes the prelude with the script, so a change to the prelude rebuilds every image and every shared tool image. &lt;code&gt;bootify.sh&lt;/code&gt;, which runs with the container image&amp;rsquo;s own &lt;code&gt;sh&lt;/code&gt;, and &lt;code&gt;kernel.sh&lt;/code&gt; don&amp;rsquo;t get it.&lt;/p&gt;
&lt;p&gt;Your own layer gets the prelude in the same way, so it can pin its downloads as devvm&amp;rsquo;s scripts do and pick them with &lt;code&gt;devvm_sha&lt;/code&gt;, which &lt;a href="https://next.devvm.dev/docs/using/customizing/#example-mailpit"&gt;Customizing&amp;rsquo;s example&lt;/a&gt; shows. The prelude runs first, so a name your script sets or defines afterwards, &lt;code&gt;devvm_arch&lt;/code&gt; or &lt;code&gt;devvm_sha&lt;/code&gt; included, is your script&amp;rsquo;s from then on, and a script that never uses the prelude runs just as it would without it. Your layer&amp;rsquo;s step in its image&amp;rsquo;s recipe holds the prelude and your script together, so a change to either one rebuilds that image and the images above it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="bases-packages"&gt;Base&amp;rsquo;s packages&lt;span class="hx:absolute hx:-mt-20" id="bases-packages"&gt;&lt;/span&gt;
&lt;a href="#bases-packages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;base&amp;rsquo;s recipe runs &lt;code&gt;apt.sh begin&lt;/code&gt; as root before &lt;code&gt;base.sh&lt;/code&gt;, and &lt;code&gt;apt.sh end&lt;/code&gt; after the last feature. Both are steps of the recipe, so base&amp;rsquo;s key hashes the script. What the build gives the script in &lt;code&gt;/var/cache/devvm/packages/in&lt;/code&gt; decides where apt&amp;rsquo;s packages come from:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A first build of a key records them.&lt;/strong&gt; devvm sends &lt;code&gt;in/mirrors&lt;/code&gt;, which holds the mirror that &lt;a href="https://next.devvm.dev/docs/using/settings/#an-ubuntu-mirror"&gt;&lt;code&gt;ubuntu-mirror&lt;/code&gt;&lt;/a&gt; sets, or nothing. &lt;code&gt;apt.sh begin&lt;/code&gt; points each of the image&amp;rsquo;s sources at an apt &lt;code&gt;mirror+file:&lt;/code&gt; list of that mirror and then the source&amp;rsquo;s own archive (&lt;code&gt;archive.ubuntu.com&lt;/code&gt;, or &lt;code&gt;ports.ubuntu.com&lt;/code&gt; on arm64), so apt tries them in that order, and it keeps every package it downloads. apt also installs phased updates (&lt;code&gt;APT::Get::Always-Include-Phased-Updates&lt;/code&gt;), which Ubuntu otherwise rolls out to only some machines at first, so it always takes the newest version that the lists have. apt checks the archive&amp;rsquo;s signature with Ubuntu&amp;rsquo;s archive key, which the image has, whichever mirror answers. At the end, &lt;code&gt;apt.sh end&lt;/code&gt; moves each downloaded package to &lt;code&gt;out/&amp;lt;sha256&amp;gt;.deb&lt;/code&gt; and writes its entry from apt&amp;rsquo;s package lists, which apt checked against that signature, to &lt;code&gt;out/Packages&lt;/code&gt;. The script fails the build when the lists have no entry with the file&amp;rsquo;s SHA-256. It also copies each &lt;code&gt;InRelease&lt;/code&gt; file and package list that apt used to &lt;code&gt;out/&amp;lt;n&amp;gt;.InRelease&lt;/code&gt; or &lt;code&gt;out/&amp;lt;n&amp;gt;.Packages&lt;/code&gt;, so devvm can check them on this machine. apt keeps those lists uncompressed while base builds (&lt;code&gt;Acquire::GzipIndexes &amp;quot;false&amp;quot;&lt;/code&gt;), as they&amp;rsquo;re signed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every later build of the key replays them.&lt;/strong&gt; devvm sends the files the key recorded, from its cache, and &lt;code&gt;in/Packages&lt;/code&gt;, their entries, each naming its file. &lt;code&gt;apt.sh begin&lt;/code&gt; moves the image&amp;rsquo;s sources aside and gives apt only that folder, so &lt;code&gt;base.sh&lt;/code&gt; and the features install exactly what the first build did, with no network for them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;--from&lt;/code&gt; base gets neither.&lt;/strong&gt; Its packages come from the container image&amp;rsquo;s own sources as they are when it builds, and they aren&amp;rsquo;t pinned.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both ends put the image&amp;rsquo;s own sources back, remove devvm&amp;rsquo;s apt settings, empty apt&amp;rsquo;s cache and delete the package lists, so a first build and a replay make the same image. A VM made from it fetches lists when you run &lt;code&gt;sudo apt update&lt;/code&gt;, and each layer&amp;rsquo;s recipe starts with &lt;code&gt;apt.sh lists&lt;/code&gt;, as root, which fetches them from the image&amp;rsquo;s own sources when there are none, so a layer&amp;rsquo;s script installs as it would on any Ubuntu. &lt;code&gt;apt.sh&lt;/code&gt; makes a source that sends nothing for 30 seconds fail. While it fetches the package lists, it turns apt&amp;rsquo;s retries off, and when no source answers, it exits 75, which the backend reports as &lt;code&gt;build_sources_unreachable&lt;/code&gt;, not as a script that failed. Once a source has answered, apt tries a package&amp;rsquo;s failed download again three times, each after a longer wait. A build fetches only the lists apt installs from, with no translations, AppStream components or command-not-found metadata (&lt;code&gt;Acquire::Languages &amp;quot;none&amp;quot;&lt;/code&gt;, and the &lt;code&gt;DEP-11&lt;/code&gt; and &lt;code&gt;CNF&lt;/code&gt; targets off), which is about a third less than an update fetches, and the image keeps none of them.&lt;/p&gt;
&lt;p&gt;The backend sends the build&amp;rsquo;s input into the VM as a tar stream before the first step, and after the last step it hands devvm a tar stream of &lt;code&gt;out/&lt;/code&gt; and deletes the folder, which is the backend&amp;rsquo;s packages role (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;). On Lima, both run as root over &lt;code&gt;limactl shell&lt;/code&gt;. What comes back is the build VM&amp;rsquo;s, so devvm checks it before it keeps anything (&lt;code&gt;packages_refused&lt;/code&gt;). It takes only regular files named &lt;code&gt;Packages&lt;/code&gt;, &lt;code&gt;&amp;lt;64 hex digits&amp;gt;.deb&lt;/code&gt;, &lt;code&gt;&amp;lt;n&amp;gt;.InRelease&lt;/code&gt; or &lt;code&gt;&amp;lt;n&amp;gt;.Packages&lt;/code&gt;, each package&amp;rsquo;s content must hash to its name, and each entry must name a file that came back with the size and SHA-256 the entry gives, with no file left over. Each &lt;code&gt;InRelease&lt;/code&gt; file is at most 4 MiB and all of them 32 MiB, and each package list is at most 512 MiB, with lines of at most 1 MiB and entries of at most 4 MiB, and all the lists 2 GiB. A name that comes back twice is refused.&lt;/p&gt;
&lt;p&gt;devvm doesn&amp;rsquo;t take the build VM&amp;rsquo;s word for the entries, because anything with root in that VM could write them. It checks each &lt;code&gt;InRelease&lt;/code&gt; file&amp;rsquo;s clearsigned signature itself, in Go, against Ubuntu&amp;rsquo;s archive key, which devvm&amp;rsquo;s own files hold (fingerprint &lt;code&gt;F6ECB3762474EDA9D21B7022871920D1991BC93C&lt;/code&gt;), and refuses one that doesn&amp;rsquo;t check out or isn&amp;rsquo;t one of the suites an Ubuntu 26.04 image&amp;rsquo;s sources name: &lt;code&gt;resolute&lt;/code&gt;, &lt;code&gt;resolute-updates&lt;/code&gt;, &lt;code&gt;resolute-security&lt;/code&gt; and &lt;code&gt;resolute-backports&lt;/code&gt;, never &lt;code&gt;resolute-proposed&lt;/code&gt;. It tries at most 4 signatures in each file, because each one hashes the whole file. It also refuses an &lt;code&gt;InRelease&lt;/code&gt; whose &lt;code&gt;Date:&lt;/code&gt; is older than the archive state the pinned cloud image was built from, because Ubuntu&amp;rsquo;s &lt;code&gt;InRelease&lt;/code&gt; files carry no &lt;code&gt;Valid-Until&lt;/code&gt;, so a mirror that stopped updating still serves validly signed ones. The release pocket, &lt;code&gt;resolute&lt;/code&gt;, which Ubuntu stopped changing at release, must be dated no earlier than that day, 2026-04-23, which devvm&amp;rsquo;s code records. Every other pocket (&lt;code&gt;resolute-updates&lt;/code&gt;, &lt;code&gt;resolute-security&lt;/code&gt;, &lt;code&gt;resolute-backports&lt;/code&gt;) must be dated no more than a day before the pinned release&amp;rsquo;s date (&lt;code&gt;release-YYYYMMDD&lt;/code&gt;). devvm names the mirror that &lt;a href="https://next.devvm.dev/docs/using/settings/#an-ubuntu-mirror"&gt;&lt;code&gt;ubuntu-mirror&lt;/code&gt;&lt;/a&gt; sets (&lt;code&gt;packages_stale_mirror&lt;/code&gt;), or Ubuntu&amp;rsquo;s archive when none is set (&lt;code&gt;packages_stale&lt;/code&gt;). devvm compares the lists with the cloud image&amp;rsquo;s date, not with today&amp;rsquo;s, so a mirror that&amp;rsquo;s behind, or one that&amp;rsquo;s lying, can&amp;rsquo;t serve lists older than that, but a mirror that fell behind after that date can still give base packages older than Ubuntu&amp;rsquo;s, which is why &lt;a href="https://next.devvm.dev/docs/using/settings/#an-ubuntu-mirror"&gt;&lt;code&gt;ubuntu-mirror&lt;/code&gt;&lt;/a&gt; should name only a mirror you trust to keep up. Each package list must have the SHA-256 and size that a verified &lt;code&gt;InRelease&lt;/code&gt; gives for one of its &lt;code&gt;Packages&lt;/code&gt; lists, which devvm checks before it reads the list, and each package&amp;rsquo;s SHA-256 must be in one of those lists, as the same package, version, architecture and size that apt&amp;rsquo;s entry says. devvm then keeps the archive&amp;rsquo;s own entry for the package, not apt&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;devvm also checks that each package is the newest version that apt would install, because whatever has root in the build VM could hand back only the lists it chooses, such as the release pocket&amp;rsquo;s, and record an older version than &lt;code&gt;resolute-updates&lt;/code&gt; or &lt;code&gt;resolute-security&lt;/code&gt; has. A recording must give back the &lt;code&gt;InRelease&lt;/code&gt; files of &lt;code&gt;resolute-updates&lt;/code&gt; and &lt;code&gt;resolute-security&lt;/code&gt; with lists for the architectures whose lists have the recorded packages, such as &lt;code&gt;binary-arm64&lt;/code&gt;, so another archive&amp;rsquo;s &lt;code&gt;InRelease&lt;/code&gt;, such as &lt;code&gt;archive.ubuntu.com&lt;/code&gt;&amp;rsquo;s on arm64, where &lt;code&gt;ports.ubuntu.com&lt;/code&gt; has the lists, doesn&amp;rsquo;t count. For each &lt;code&gt;InRelease&lt;/code&gt; it gives back, it must also give back every package list that the file gives for those architectures, in every component (&lt;code&gt;main&lt;/code&gt;, &lt;code&gt;restricted&lt;/code&gt;, &lt;code&gt;universe&lt;/code&gt; and &lt;code&gt;multiverse&lt;/code&gt;). An empty list is the one exception, because it lists nothing. When one is missing, devvm names the suite and keeps nothing (&lt;code&gt;packages_lists_missing&lt;/code&gt;). devvm then refuses a recorded package when the release pocket&amp;rsquo;s list, &lt;code&gt;resolute-updates&lt;/code&gt;&amp;rsquo; or &lt;code&gt;resolute-security&lt;/code&gt;&amp;rsquo;s has a newer version of it for that architecture, and it names the package, both versions and the suite (&lt;code&gt;packages_not_newest&lt;/code&gt;). &lt;code&gt;resolute-backports&lt;/code&gt; doesn&amp;rsquo;t count, because apt installs its packages only when you ask for them (its &lt;code&gt;InRelease&lt;/code&gt; says &lt;code&gt;NotAutomatic&lt;/code&gt;). devvm orders versions as &lt;code&gt;dpkg --compare-versions&lt;/code&gt; does, in its own Go code: the epoch first, then the upstream version, then the Debian revision, with letters before other characters and &lt;code&gt;~&lt;/code&gt; before everything, even the end, so &lt;code&gt;1.0~rc1&lt;/code&gt; is older than &lt;code&gt;1.0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A recording that gives back no packages needs no lists. devvm writes the files into a folder of the build&amp;rsquo;s own in the cache while it checks them, and once the image is built, it moves each into the cache, &lt;code&gt;~/.local/share/devvm/packages/&amp;lt;sha256&amp;gt;.deb&lt;/code&gt;, and writes the key&amp;rsquo;s set, &lt;code&gt;~/.local/share/devvm/packages/sets/&amp;lt;key&amp;gt;.json&lt;/code&gt;: each package&amp;rsquo;s name, version, architecture, SHA-256, size and entry. A file the cache already has under that name is kept only when its checksum still matches it; devvm replaces a changed one with the build&amp;rsquo;s copy and notes that in the run log. That happens before the image&amp;rsquo;s record, under a lock, &lt;code&gt;~/.local/share/devvm/images/locks/packages&lt;/code&gt;, and a build that fails keeps nothing.&lt;/p&gt;
&lt;p&gt;A key&amp;rsquo;s set is written once, and the cache holds each file under its own SHA-256, so a build can&amp;rsquo;t change what another key installs. Before a replay, devvm reads each of the set&amp;rsquo;s files and checks its SHA-256 and size, and it refuses to build when one is gone or changed (&lt;code&gt;packages_missing&lt;/code&gt;), so it never records the key&amp;rsquo;s packages again. &lt;a href="#rebuilding"&gt;&lt;code&gt;devvm rebuild base&lt;/code&gt;&lt;/a&gt; gives base a new key, which records anew. &lt;code&gt;devvm gc&lt;/code&gt; deletes the sets of keys that are neither base&amp;rsquo;s key as it is now nor an image the backend has, and then, holding the lock, the package files that no set names then, so a set recorded meanwhile keeps its files. It also deletes a build&amp;rsquo;s own folder of what it gave back that&amp;rsquo;s over a day old, which a build that was killed leaves.&lt;/p&gt;
&lt;h2 data-hextra-search-id="bases-size"&gt;Base&amp;rsquo;s size&lt;span class="hx:absolute hx:-mt-20" id="bases-size"&gt;&lt;/span&gt;
&lt;a href="#bases-size" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm fits base&amp;rsquo;s CPUs and memory to the host with one rule that every backend uses. Base gets its 4 CPUs, or the host&amp;rsquo;s count when the host has fewer, because a Lima &lt;code&gt;vz&lt;/code&gt; VM given more CPUs than the Mac has can start so slowly that its ssh never comes up, as &lt;a href="https://github.com/lima-vm/lima/issues/1621" target="_blank" rel="noopener"&gt;Lima&amp;rsquo;s issue&lt;/a&gt; reports. Base gets its 8 GiB of memory, or half the host&amp;rsquo;s whole GiB when 8 GiB would leave the host less than 2 GiB, because a VM asking for all of the host&amp;rsquo;s memory doesn&amp;rsquo;t start.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima&lt;/strong&gt; passes the fitted size to &lt;code&gt;limactl create&lt;/code&gt; as &lt;code&gt;--cpus&lt;/code&gt; and &lt;code&gt;--memory&lt;/code&gt;, and base&amp;rsquo;s 100 GiB disk as &lt;code&gt;--disk&lt;/code&gt;, for base and for the VM that converts a &lt;code&gt;--from&lt;/code&gt; image. The images built on base are clones of it, so they and their VMs keep that size. A new VM&amp;rsquo;s disk is never smaller than base&amp;rsquo;s, because disks can&amp;rsquo;t shrink.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A size you set with &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; or &lt;code&gt;devvm size -g&lt;/code&gt; replaces the fitted one. devvm checks that size against the same rule, so it refuses more memory than the host&amp;rsquo;s whole GiB less 2, or half of them on a host of 4 GiB or less, and the fitted memory always passes (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;size&lt;/a&gt;). The fitted size isn&amp;rsquo;t in image keys, because the host&amp;rsquo;s size doesn&amp;rsquo;t change what an image holds.&lt;/p&gt;
&lt;p&gt;base also drops the server extras that Ubuntu&amp;rsquo;s cloud image comes with, which are snapd, multipath, ModemManager, udisks, firmware updates, crash reporting, tracing tools, kernel headers, and apt&amp;rsquo;s background updates and upgrades. That saves 0.9 GB of disk and 100 MB of memory per VM, and the everyday tools stay (&lt;a href="https://next.devvm.dev/docs/using/images/#base"&gt;base&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-desktop-layer"&gt;The desktop layer&lt;span class="hx:absolute hx:-mt-20" id="the-desktop-layer"&gt;&lt;/span&gt;
&lt;a href="#the-desktop-layer" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The built-in &lt;a href="https://next.devvm.dev/docs/using/images/#desktop"&gt;&lt;code&gt;desktop&lt;/code&gt; layer&lt;/a&gt;&amp;rsquo;s script is &lt;code&gt;desktop.sh&lt;/code&gt;, and its allowlist, &lt;code&gt;desktop.policy&lt;/code&gt;, has no rules, because the layer downloads nothing of its own and its packages come from the distribution&amp;rsquo;s archive, which base&amp;rsquo;s allowlist has. base&amp;rsquo;s image has no package lists, so the layer&amp;rsquo;s &lt;code&gt;apt.sh lists&lt;/code&gt; step fetches them first, and its packages are the archive&amp;rsquo;s as they are when the layer builds, which aren&amp;rsquo;t pinned. On &lt;code&gt;--from alpine&lt;/code&gt;, the script installs Alpine&amp;rsquo;s own packages, which aren&amp;rsquo;t pinned either. Besides Xfce and TigerVNC, the script writes &lt;code&gt;/usr/local/bin/devvm-desktop&lt;/code&gt;, which &lt;a href="https://next.devvm.dev/docs/internals/desktop/#in-the-vm"&gt;&lt;code&gt;devvm desktop&lt;/code&gt;&lt;/a&gt; runs in the VM. The layer needs no backend feature of its own, because it runs on any VM that can build an image and reach its ssh.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-docker-layer"&gt;The docker layer&lt;span class="hx:absolute hx:-mt-20" id="the-docker-layer"&gt;&lt;/span&gt;
&lt;a href="#the-docker-layer" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The built-in &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;&lt;code&gt;docker&lt;/code&gt; layer&lt;/a&gt;&amp;rsquo;s script is &lt;code&gt;docker.sh&lt;/code&gt;, embedded in devvm, and its &lt;a href="https://next.devvm.dev/docs/safety/network/#allowlists"&gt;allowlist&lt;/a&gt; is &lt;code&gt;docker.policy&lt;/code&gt;. The script pins the checksum of the signing key of Docker&amp;rsquo;s apt repository and each package&amp;rsquo;s version at the top. On &lt;code&gt;--from alpine&lt;/code&gt;, it installs Alpine&amp;rsquo;s own packages, which aren&amp;rsquo;t pinned. Running Docker&amp;rsquo;s engine in a VM is a backend feature of its own, &lt;code&gt;docker-layer&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-nix-layer"&gt;The nix layer&lt;span class="hx:absolute hx:-mt-20" id="the-nix-layer"&gt;&lt;/span&gt;
&lt;a href="#the-nix-layer" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The built-in &lt;a href="https://next.devvm.dev/docs/using/images/#nix"&gt;&lt;code&gt;nix&lt;/code&gt; layer&lt;/a&gt;&amp;rsquo;s script is &lt;code&gt;nix.sh&lt;/code&gt;, and its allowlist is &lt;code&gt;nix.policy&lt;/code&gt;. The script pins Nix&amp;rsquo;s release tarball, the direnv binary and nix-direnv&amp;rsquo;s &lt;code&gt;direnvrc&lt;/code&gt; at the top, each with its version and SHA-256, which are per architecture for Nix and direnv, and fetches them with &lt;code&gt;devvm-fetch&lt;/code&gt;. The repo&amp;rsquo;s bump script moves them (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#updating-pinned-versions"&gt;updating pinned versions&lt;/a&gt;). Nix&amp;rsquo;s version is the one nixos.org&amp;rsquo;s installer fetches, at least 2.35.3, which fixes the scripted installer&amp;rsquo;s store ownership (GHSA-hf6w-2rg9-v84g) and the daemon&amp;rsquo;s store corruption through &lt;code&gt;repair&lt;/code&gt; (CVE-2026-110450). Nix&amp;rsquo;s newer releases come with another installer, from artifacts.nixos.org, so the layer&amp;rsquo;s pins change shape when it moves to one of them.&lt;/p&gt;
&lt;p&gt;The script runs the tarball&amp;rsquo;s own installer as &lt;code&gt;install --daemon --yes --no-channel-add&lt;/code&gt;, which copies the tarball&amp;rsquo;s store into &lt;code&gt;/nix&lt;/code&gt;, downloading nothing, makes the &lt;code&gt;nixbld&lt;/code&gt; build users and, under systemd, starts &lt;code&gt;nix-daemon&lt;/code&gt;. On OpenRC, which a base &lt;code&gt;--from alpine&lt;/code&gt; runs, the script adds a service of devvm&amp;rsquo;s, &lt;code&gt;/etc/init.d/nix-daemon&lt;/code&gt;, to the default runlevel and starts it, and before the install it adds Alpine&amp;rsquo;s &lt;code&gt;xz&lt;/code&gt;, unpinned, which GNU tar needs for the tarball. Nix&amp;rsquo;s own binaries are static or linked against the C library in its store, so they run on musl. Its extra settings turn on flakes and the &lt;code&gt;nix&lt;/code&gt; command and keep &lt;code&gt;trusted-users = root&lt;/code&gt;, so only root can choose caches and signing keys. They also set &lt;code&gt;sandbox = true&lt;/code&gt; and &lt;code&gt;sandbox-fallback = false&lt;/code&gt;, so a build fails where the kernel can&amp;rsquo;t sandbox it, rather than run outside the sandbox without a word. The installer writes any proxy variables it finds into a systemd drop-in for the daemon, which would put a build&amp;rsquo;s proxy into the image, so the script runs it without them. It points Nix at the system&amp;rsquo;s CAs, which hold devvm&amp;rsquo;s and yours. After the install, the script checks that every path in the store is root&amp;rsquo;s, and it fails otherwise.&lt;/p&gt;
&lt;p&gt;It also adds Nix&amp;rsquo;s default profile to the end of sudo&amp;rsquo;s &lt;code&gt;secure_path&lt;/code&gt;, through &lt;code&gt;/etc/sudoers.d/devvm-nix&lt;/code&gt;, so &lt;code&gt;sudo nix&lt;/code&gt; works, and appends Nix&amp;rsquo;s profiles to the &lt;code&gt;PATH&lt;/code&gt; that &lt;code&gt;BASH_ENV&lt;/code&gt; gives shells that read no profile. direnv goes into &lt;code&gt;/usr/local/bin&lt;/code&gt; and nix-direnv into &lt;code&gt;/usr/local/share/nix-direnv&lt;/code&gt;. A file in &lt;code&gt;~/.config/direnv/lib&lt;/code&gt; loads nix-direnv and puts each project&amp;rsquo;s direnv layout under &lt;code&gt;~/.cache/direnv/layouts&lt;/code&gt;, named by a hash of the project&amp;rsquo;s path, so its cached dev shell and garbage collector roots stay in the VM&amp;rsquo;s home and out of the project folder. direnv&amp;rsquo;s shell hook is in &lt;code&gt;~/.bashrc.d/direnv.sh&lt;/code&gt;, which bash loads before &lt;code&gt;mise.sh&lt;/code&gt;, and since each hook puts itself first in &lt;code&gt;PROMPT_COMMAND&lt;/code&gt;, direnv&amp;rsquo;s runs after mise&amp;rsquo;s, and a dev shell&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt; comes before the shared tools'.&lt;/p&gt;
&lt;p&gt;The daemon doesn&amp;rsquo;t read &lt;code&gt;/etc/environment&lt;/code&gt;, so the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-setup"&gt;VM&amp;rsquo;s setup&lt;/a&gt; gives it the VM&amp;rsquo;s proxy on every tier, in a drop-in of its own under systemd, or else in &lt;code&gt;/etc/conf.d/nix-daemon&lt;/code&gt;, which OpenRC reads for the service. The setup also puts the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt; first in Nix&amp;rsquo;s substituters, in &lt;code&gt;/etc/nix/devvm-cache.conf&lt;/code&gt;. It removes both files from a VM whose environment names no proxy. Running the layer is a backend feature, &lt;code&gt;nix-layer&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt;), and building it also needs the feature, so a backend without it refuses &lt;code&gt;devvm build nix&lt;/code&gt;. With &lt;code&gt;sandbox-fallback = false&lt;/code&gt;, every Nix build fails in a VM that can&amp;rsquo;t make the kernel namespaces that Nix&amp;rsquo;s sandbox needs.&lt;/p&gt;
&lt;h2 data-hextra-search-id="how-its-converted"&gt;How it&amp;rsquo;s converted&lt;span class="hx:absolute hx:-mt-20" id="how-its-converted"&gt;&lt;/span&gt;
&lt;a href="#how-its-converted" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;With &lt;code&gt;--from&lt;/code&gt;, devvm turns the container image into a disk in a throwaway VM, &lt;code&gt;devvm-oci-build&lt;/code&gt;, which it makes from Ubuntu&amp;rsquo;s cloud image with &lt;code&gt;base.yaml&lt;/code&gt;&amp;rsquo;s settings and base&amp;rsquo;s size. No Docker is needed:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/google/go-containerregistry/tree/main/cmd/crane" target="_blank" rel="noopener"&gt;crane&lt;/a&gt; downloads exactly the &lt;a href="#digests"&gt;digest&lt;/a&gt; in &lt;code&gt;base&lt;/code&gt;&amp;rsquo;s key, for this machine&amp;rsquo;s architecture, and flattens its layers. crane is pinned like every download: its version and SHA-256 are at the top of the conversion&amp;rsquo;s &lt;code&gt;build.sh&lt;/code&gt;, checked with &lt;code&gt;sha256sum&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bootify.sh&lt;/code&gt;, in a chroot of the image, adds what a container lacks to boot as a VM: a kernel and initramfs, an init system (systemd, or OpenRC on Alpine), cloud-init, sshd and sudo, and your user in the VM. Your user has your uid, so &lt;code&gt;bootify.sh&lt;/code&gt; first removes a user of the image&amp;rsquo;s that has it, such as Ubuntu&amp;rsquo;s own &lt;code&gt;ubuntu&lt;/code&gt; (uid 1000, the uid a Linux host&amp;rsquo;s first user usually has).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mke2fs&lt;/code&gt; writes the image&amp;rsquo;s files into a raw ext4 disk, and &lt;code&gt;base&lt;/code&gt; grows it to base&amp;rsquo;s 100 GiB disk.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;build.sh&lt;/code&gt; also writes down the image&amp;rsquo;s C library, from its &lt;code&gt;/etc/os-release&lt;/code&gt;, and for a glibc image, its glibc version, which &lt;code&gt;getconf GNU_LIBC_VERSION&lt;/code&gt; prints in a chroot of the image. devvm checks both, keeps them in the record of &lt;code&gt;base&lt;/code&gt; and of every image on it (&lt;code&gt;libc&lt;/code&gt; and &lt;code&gt;glibc&lt;/code&gt;), and checks each shared tool against that glibc version (&lt;a href="#building-tools"&gt;building tools&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm then deletes the build VM and creates &lt;code&gt;base&lt;/code&gt; from the disk, booting its kernel and initrd directly. One conversion runs at a time, because each holds a lock, &lt;code&gt;~/.local/share/devvm/oci-build.lock&lt;/code&gt;, so another devvm&amp;rsquo;s conversion waits for it under a status line (&lt;code&gt;oci_waiting&lt;/code&gt;). The lock is an OS lock on an open file, which the system releases when its devvm ends, however it ends, so a devvm that crashed never keeps another from converting.&lt;/p&gt;
&lt;h2 data-hextra-search-id="digests"&gt;Digests&lt;span class="hx:absolute hx:-mt-20" id="digests"&gt;&lt;/span&gt;
&lt;a href="#digests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;base&lt;/code&gt; is keyed by the container image&amp;rsquo;s digest, not its tag. When devvm builds, it asks the image&amp;rsquo;s registry for the digest anonymously, with a &lt;code&gt;HEAD&lt;/code&gt; request for the image&amp;rsquo;s manifest, which doesn&amp;rsquo;t count against Docker Hub&amp;rsquo;s pull limit. When the registry asks for a token, devvm gets one from the registry&amp;rsquo;s token service, at an &lt;code&gt;https&lt;/code&gt; address only. The digest goes into &lt;code&gt;base&lt;/code&gt;&amp;rsquo;s key, and devvm records it for each container image in its cache, &lt;code&gt;~/.local/share/devvm/cache/from-digests.json&lt;/code&gt;, and in the record of each image it builds on that base. An existing VM&amp;rsquo;s state records what its base was made from (&lt;code&gt;from&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;For a VM made with &lt;code&gt;--from&lt;/code&gt;, devvm tells whether the VM is outdated from the container image&amp;rsquo;s digest that it last recorded, without looking anything up. When devvm makes the VM again, the build looks up the digest as every build does, so a tag that has moved since gives the VM the container image&amp;rsquo;s newer version too, and a pinned digest stays as it is (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The cache may be deleted at any time. Without it, devvm takes the digest from the record of the newest base built from the same container image, so every key stays as it was, and images stay current until a lookup finds that the tag has moved. The next lookup writes the cache again.&lt;/p&gt;
&lt;p&gt;devvm refuses a reference it can&amp;rsquo;t read (&lt;code&gt;bad_from&lt;/code&gt;). When it can&amp;rsquo;t reach the registry, it uses the digest it recorded last, with a warning (&lt;code&gt;from_cached_unreachable&lt;/code&gt;), and with none recorded, it fails (&lt;code&gt;from_unreachable&lt;/code&gt;). &lt;a href="https://next.devvm.dev/docs/using/from/#tags-and-digests"&gt;Tags and digests&lt;/a&gt; covers when a moved tag rebuilds base, how &lt;code&gt;@sha256:&lt;/code&gt; pins an image, and how devvm reads a reference.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-image-is-untrusted"&gt;The image is untrusted&lt;span class="hx:absolute hx:-mt-20" id="the-image-is-untrusted"&gt;&lt;/span&gt;
&lt;a href="#the-image-is-untrusted" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The container image&amp;rsquo;s own code runs as root in the build VM, so devvm treats what it writes as hostile:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The build VM is &lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confined&lt;/a&gt; like any build with the internet, which it needs for crane, so on macOS it can&amp;rsquo;t reach this machine&amp;rsquo;s loopback, though on Linux it can. It mounts three folders of the conversion&amp;rsquo;s own temporary folder, &lt;code&gt;devvm-oci.&amp;lt;random&amp;gt;&lt;/code&gt;, and nothing else. &lt;code&gt;oci/&lt;/code&gt; holds the conversion&amp;rsquo;s scripts, which devvm writes there from &lt;a href="https://next.devvm.dev/docs/internals/install/#devvms-own-files"&gt;its own files&lt;/a&gt; for this build alone, and the VM mounts it read-only. &lt;code&gt;guest/&lt;/code&gt;, also read-only, holds only &lt;code&gt;ca.sh&lt;/code&gt;, and devvm writes and mounts it only when there are &lt;a href="#a-companys-ca-in-builds"&gt;company CAs&lt;/a&gt;. &lt;code&gt;vm/&lt;/code&gt; is the one writable folder, and devvm writes nothing there itself except an &lt;a href="#images-only-docker-has"&gt;image only Docker has&lt;/a&gt;, before the VM starts. The scripts sit beside &lt;code&gt;vm/&lt;/code&gt;, never inside it, so what the image writes can&amp;rsquo;t replace them on this machine.&lt;/li&gt;
&lt;li&gt;devvm checks what comes out once the build VM is gone. Each file must be a regular file, because a link could point Lima at a file on this machine. The kernel command line can hold only letters, digits, spaces and &lt;code&gt;=,./:_-&lt;/code&gt;, because it goes into Lima&amp;rsquo;s config. The C library must be &lt;code&gt;gnu&lt;/code&gt; or &lt;code&gt;musl&lt;/code&gt;. The disk must be raw ext4 as &lt;code&gt;mke2fs&lt;/code&gt; writes it into a new file, its first 1024 bytes zero and an ext4 superblock after them, because another format, such as qcow2, can name a file on this machine as its backing file, and its header would sit in those first bytes. A &lt;code&gt;glibc&lt;/code&gt; file must be a regular file before devvm reads it, because a link could name a FIFO on this machine, and the read would wait. devvm refuses anything else (&lt;code&gt;convert_bad_output&lt;/code&gt;), and it doesn&amp;rsquo;t create &lt;code&gt;base&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;devvm deletes the build VM and the temporary folder, with the scripts it wrote there, however the run ends, Ctrl+C included.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="images-only-docker-has"&gt;Images only Docker has&lt;span class="hx:absolute hx:-mt-20" id="images-only-docker-has"&gt;&lt;/span&gt;
&lt;a href="#images-only-docker-has" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When the registry doesn&amp;rsquo;t give devvm the image (&lt;a href="https://next.devvm.dev/docs/using/from/#images-only-docker-has"&gt;images only Docker has&lt;/a&gt;), devvm keys &lt;code&gt;base&lt;/code&gt; by Docker&amp;rsquo;s image ID instead of a digest. devvm exports the image with &lt;code&gt;docker save&lt;/code&gt; into the build VM&amp;rsquo;s folder, where crane reads it, and it checks that the export is the image it looked up. The image is saved by name, so if the tag has moved since, for example after a rebuild, devvm stops and asks you to run it again. devvm only asks Docker about images, with &lt;code&gt;docker image inspect&lt;/code&gt;, &lt;code&gt;docker info&lt;/code&gt; and &lt;code&gt;docker save&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="versions"&gt;Versions&lt;span class="hx:absolute hx:-mt-20" id="versions"&gt;&lt;/span&gt;
&lt;a href="#versions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm doesn&amp;rsquo;t pin the shared tools&amp;rsquo; versions (&lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;shared tools&lt;/a&gt;). Instead, the shared tools&amp;rsquo; &lt;code&gt;mise.toml&lt;/code&gt;, which devvm ships, says which releases to follow, which is the latest of each tool, and Node 24. The first time a tool is needed, devvm resolves it to upstream&amp;rsquo;s newest release and writes that into the tools lock, &lt;code&gt;~/.local/share/devvm/mise.lock&lt;/code&gt;, with each download&amp;rsquo;s checksum for every platform that VMs run (Linux, with glibc and with musl). Builds install exactly the lock&amp;rsquo;s versions and check them against those checksums. Resolving needs this machine to be online once, and until it has been, devvm says so (&lt;code&gt;tools_need_resolve&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;mise&amp;rsquo;s registry decides where a tool comes from, and a mise release can change its choice, so that &lt;code&gt;mise.toml&lt;/code&gt; names the backend of every tool that isn&amp;rsquo;t one of mise&amp;rsquo;s own &lt;code&gt;core:&lt;/code&gt; tools in its &lt;code&gt;[tool_alias]&lt;/code&gt; table. Claude Code, Codex, pnpm and uv come from their GitHub releases through &lt;a href="https://aquaproj.github.io/" target="_blank" rel="noopener"&gt;aqua&lt;/a&gt;, and opencode comes from its GitHub releases directly (&lt;code&gt;github:anomalyco/opencode&lt;/code&gt;), because only that gives musl VMs opencode&amp;rsquo;s own musl build. pi comes from its GitHub releases directly too (&lt;code&gt;github:earendil-works/pi&lt;/code&gt;), one Bun-built program for each platform, which the build checks against the SHA-256 the lock records for it, as it checks every tool&amp;rsquo;s. Its releases have no musl build, so mise locks the glibc download for musl as well, and devvm refuses pi for a musl VM before any build (&lt;code&gt;tool_glibc_only&lt;/code&gt;), because the shared tools&amp;rsquo; registry marks it as glibc only. Without the alias, mise&amp;rsquo;s registry would take opencode 2 from npm, which has no download for each platform. The step back locks the older versions from the backend that the newest came from, and every project VM&amp;rsquo;s mise config gets the same &lt;code&gt;[tool_alias]&lt;/code&gt; table, so the VM&amp;rsquo;s mise finds each tool where its image came from.&lt;/p&gt;
&lt;p&gt;The resolving runs on this machine with a mise of devvm&amp;rsquo;s own. That mise is a pinned release, which devvm downloads once into &lt;code&gt;~/.local/share/devvm/cache/mise/&amp;lt;version&amp;gt;&lt;/code&gt; as its &lt;code&gt;.tar.gz&lt;/code&gt;, a third of the binary&amp;rsquo;s size, and checks against its SHA-256 before it takes the binary out and runs it (&lt;code&gt;mise_checksum&lt;/code&gt;). A download that gets no answer, loses it partway or gets a 408, 429 or server error is tried again up to three times, after one second and then twice as long each time, and any other answer fails it at once (&lt;code&gt;mise_download_failed&lt;/code&gt;). One devvm downloads it at a time, holding &lt;code&gt;~/.local/share/devvm/cache/mise/download.lock&lt;/code&gt;, and another waits for it under a status line (&lt;code&gt;mise_waiting&lt;/code&gt;) and then takes what it kept. The download goes into a folder of its own, which the next download takes away when a killed run left it, and devvm hashes the archive again through the file it then unpacks, so the binary comes from the bytes it checked. devvm never uses the mise you have installed, and nothing it does reaches your own mise config. Each run of that mise gets temporary folders for its data, cache, state and config, which devvm deletes afterwards, so &lt;code&gt;cache/mise/&amp;lt;version&amp;gt;&lt;/code&gt; holds only the binary. &lt;code&gt;devvm gc&lt;/code&gt; deletes the folders of other versions, unless one changed in the last hour.&lt;/p&gt;
&lt;p&gt;A new VM&amp;rsquo;s tools resolve while its image builds, as neither needs the other. The resolve starts once an image starts to build, after the build&amp;rsquo;s questions, and when every image is built already, devvm resolves them before the tool images build, with its status lines as usual. The resolve says nothing while the build runs, because the build has the terminal. devvm holds back what the resolve says until the build ends, shows no status line for it, refuses any question it would ask, and starts its commands&amp;rsquo; lines in the run log with &lt;code&gt;[resolve]&lt;/code&gt;. When the build ends with the resolve still running, devvm shows what the resolve does from then on, and waits for it under a status line of its own (&lt;code&gt;resolving_tools&lt;/code&gt;). When the resolve fails, devvm says so once, after the build, and the launch fails, and when the build fails, devvm stops the resolve.&lt;/p&gt;
&lt;p&gt;Sometimes a tool&amp;rsquo;s newest version isn&amp;rsquo;t published for every platform yet, for example when a release is still uploading, when a tag has no release, or for a few days after a Node release until its musl builds appear. A version counts as published only where its lock entry has a download with a checksum, since mise checks the download against it. mise downloads some files as it locks them, and when one of them isn&amp;rsquo;t there (a 404), mise fails the whole lock and writes nothing. devvm then locks each tool on its own, and it locks a tool that still fails one platform at a time, so that tool has no download for the platform that&amp;rsquo;s missing it. A tool whose newest version has no download on any platform gets no entry, and resolving fails (&lt;code&gt;tools_resolve_failed&lt;/code&gt;). For a tool without every download, devvm takes the newest of the next five older versions that is published everywhere, and says so (&lt;code&gt;tool_stepped_back&lt;/code&gt;), locking those versions one at a time when one of them is missing a download too. When none of them is published everywhere, devvm says that too (&lt;code&gt;tool_no_download&lt;/code&gt;). The next check tries the newest version again.&lt;/p&gt;
&lt;p&gt;A new VM gets the lock&amp;rsquo;s versions, and devvm checks the lock again first when the last check was more than a day ago. When a check fails, devvm uses the versions it found last (&lt;code&gt;tools_check_failed&lt;/code&gt;). When the shared tools&amp;rsquo; &lt;code&gt;mise.toml&lt;/code&gt; changes, as it can in a devvm upgrade, devvm resolves the tools again. A VM lists its tool images in its state, so a newer version never changes a VM that has an older one. Older versions that no VM has are unused, and &lt;code&gt;devvm gc&lt;/code&gt; deletes them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="building-tools"&gt;Building tools&lt;span class="hx:absolute hx:-mt-20" id="building-tools"&gt;&lt;/span&gt;
&lt;a href="#building-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm builds the tool images that a VM&amp;rsquo;s shared tools need when it makes the VM, after its image, and when &lt;code&gt;devvm tools add&lt;/code&gt;, &lt;code&gt;devvm tools update&lt;/code&gt; or &lt;code&gt;devvm update&lt;/code&gt; gives a VM new ones, unless the share already has them. &lt;code&gt;devvm build&lt;/code&gt; builds images alone, never tool images. Each tool image builds in a throwaway VM of its own, which devvm makes from a base image and confines like an image build. Up to four build side by side, as many as this machine&amp;rsquo;s memory and CPUs give a build VM of 2 GiB and 2 CPUs each after keeping 6 GiB and 2 CPUs for itself and the memory devvm&amp;rsquo;s running VMs have, and as many as the backend&amp;rsquo;s disks have room for, each build VM counted as a whole copy of base (&lt;a href="#free-space"&gt;free space&lt;/a&gt;). When the backend can&amp;rsquo;t list its VMs, they build one at a time. Each build VM running at once has a name of its own on Lima, &lt;code&gt;devvm-tools-build&lt;/code&gt; and then &lt;code&gt;devvm-tools-build-2&lt;/code&gt; to &lt;code&gt;devvm-tools-build-4&lt;/code&gt;, and the first one&amp;rsquo;s build deletes what a killed run left in the others that this run doesn&amp;rsquo;t use. A build that runs alone gets base&amp;rsquo;s size.&lt;/p&gt;
&lt;p&gt;Side by side, one status line covers the builds (&lt;code&gt;building_tools_together&lt;/code&gt;), and each line of a build&amp;rsquo;s commands in the run log starts with its tool&amp;rsquo;s name, such as &lt;code&gt;[node]&lt;/code&gt;. The first failure stops the others, which are cancelled, and is what devvm reports, with the end of that tool&amp;rsquo;s own lines in the run log rather than the others&amp;rsquo; that came after. Every write of a build&amp;rsquo;s commands to the run log starts with its tool&amp;rsquo;s name, a line that a progress bar&amp;rsquo;s &lt;code&gt;\r&lt;/code&gt; ends included, so no build can pass a line off as another&amp;rsquo;s. A failed build&amp;rsquo;s VM is deleted once devvm has shown that end, when devvm takes the share&amp;rsquo;s lock again for it. While another devvm holds that lock, whether for a build, &lt;code&gt;devvm gc&lt;/code&gt; or the daily refresh of the tools lock, the VM stays, and the next tools build deletes what it finds in the slots first, as &lt;code&gt;devvm gc&lt;/code&gt; does once it holds the share&amp;rsquo;s lock, without asking but naming each one (&lt;code&gt;tools_build_vms_deleted&lt;/code&gt;), because a build VM holds nothing of yours. That lock is the data folder&amp;rsquo;s, so two devvms with data folders of their own and one Lima home (&lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;) don&amp;rsquo;t keep out each other&amp;rsquo;s builds: a tools build or &lt;code&gt;devvm gc&lt;/code&gt; in one can delete a build VM that the other is still using, and that build fails until it&amp;rsquo;s run again. Don&amp;rsquo;t build tools or run &lt;code&gt;devvm gc&lt;/code&gt; in both at once. Which base it makes the VM from depends on the C library the images are for, because any VM whose tools need an image&amp;rsquo;s key mounts it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;glibc:&lt;/strong&gt; devvm&amp;rsquo;s own base from Ubuntu&amp;rsquo;s cloud image, on the VM&amp;rsquo;s backend, whatever base the VM has. A VM on a &lt;code&gt;--from&lt;/code&gt; Debian or Ubuntu image gets images built there too, so the container image&amp;rsquo;s code never runs in the build of images that other VMs mount. When that base isn&amp;rsquo;t built yet, devvm says so (&lt;code&gt;tools_need_own_base&lt;/code&gt;) and builds it first, pinning the cloud image on its first build as usual (&lt;a href="#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;musl:&lt;/strong&gt; the VM&amp;rsquo;s own &lt;code&gt;--from&lt;/code&gt; base, as it is now, because musl builds need Alpine. Its key hashes that base&amp;rsquo;s digest, so the images are only ever another VM&amp;rsquo;s on the same container image. &lt;code&gt;devvm tools add&lt;/code&gt;, &lt;code&gt;devvm tools update&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; build that base first, looking up its digest, so the keys they work out are those of the base that the images build in.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before a build, devvm reads the record of the base it&amp;rsquo;s about to clone and refuses to build in it unless it&amp;rsquo;s the base the images are for (&lt;code&gt;tools_wrong_base&lt;/code&gt;): &lt;code&gt;base&lt;/code&gt; from Ubuntu&amp;rsquo;s cloud image for glibc, and for musl a &lt;code&gt;--from&lt;/code&gt; base with the digest that the images&amp;rsquo; keys hash. A tool&amp;rsquo;s installer can run anything in its VM, as root too, so a VM and a folder for each tool are what keep one tool from writing into another tool&amp;rsquo;s image, whose key doesn&amp;rsquo;t hash it. A build VM gets its one tool and version, and it never sees the share. It writes into a folder of its own, &lt;code&gt;~/.local/share/devvm/tools-build.&amp;lt;random&amp;gt;&lt;/code&gt;, which devvm deletes once that tool is done. Lima mounts that folder at boot and goes on when the mount fails, so the build script waits up to 60 seconds for the tools lock that devvm put in the folder, mounting the folder again while it isn&amp;rsquo;t mounted. If the lock never appears, the build fails, naming the folder and the mount&amp;rsquo;s last error. devvm then checks that each image is a plain file and not a link (&lt;code&gt;tool_bad_output&lt;/code&gt;), moves it into the share and writes its record beside it, never through a name the VM could have planted.&lt;/p&gt;
&lt;p&gt;A glibc build also measures the newest glibc version that each tool needs, because each upstream download is built against a glibc of its own and doesn&amp;rsquo;t run on an older one. After installing the tool, the build script reads the version needs of every ELF program and library in it with &lt;code&gt;readelf&lt;/code&gt;, which base&amp;rsquo;s &lt;code&gt;build-essential&lt;/code&gt; installs, and writes the newest &lt;code&gt;GLIBC_&lt;/code&gt; version they name into &lt;code&gt;&amp;lt;image&amp;gt;.glibc&lt;/code&gt;, or nothing when none needs one. It leaves out folders named &lt;code&gt;testdata&lt;/code&gt;, because Go&amp;rsquo;s has ELF files from other systems that nothing runs. devvm takes that file only as a plain file holding one version (&lt;code&gt;tool_bad_output&lt;/code&gt;) and keeps the version in the image&amp;rsquo;s record (&lt;code&gt;glibc&lt;/code&gt;). Before it gives a VM its tools, devvm compares each image&amp;rsquo;s version with the glibc of the VM&amp;rsquo;s &lt;code&gt;--from&lt;/code&gt; base, and an older base refuses the tool, naming it and both versions (&lt;code&gt;tool_needs_glibc&lt;/code&gt;). It checks the same way when &lt;code&gt;devvm tools add&lt;/code&gt;, &lt;code&gt;devvm tools update&lt;/code&gt; or &lt;code&gt;devvm update&lt;/code&gt; gives an existing VM tools, against the glibc its state recorded when it was made. A base from Ubuntu&amp;rsquo;s cloud image has no glibc version in its record, so its tools aren&amp;rsquo;t checked, and a musl base gets musl builds, which need no glibc. Only one build at a time writes to the share, because each holds the share&amp;rsquo;s lock, &lt;code&gt;~/.local/share/devvm/tools.lock&lt;/code&gt;, outside the share that VMs mount. Another devvm waits for it under a status line (&lt;code&gt;share_waiting&lt;/code&gt;) until the build ends or you press Ctrl+C. The lock is an OS lock on an open file, so the system releases it when its devvm ends, however it ends, and a devvm that crashed or that you killed never leaves another one waiting.&lt;/p&gt;
&lt;p&gt;Each tool image is named &lt;code&gt;&amp;lt;tool&amp;gt;-&amp;lt;version&amp;gt;-&amp;lt;key&amp;gt;.erofs&lt;/code&gt;. Its key hashes the tool&amp;rsquo;s entry in the tools lock (its version, its downloads and their checksums), the shared tools&amp;rsquo; &lt;code&gt;build.sh&lt;/code&gt; with &lt;a href="#the-scripts-prelude"&gt;the prelude&lt;/a&gt; before it, the &lt;code&gt;[settings]&lt;/code&gt; table of their &lt;code&gt;mise.toml&lt;/code&gt;, the version of mise that &lt;code&gt;base.sh&lt;/code&gt; pins, the C library the image is built for, the base it builds in (devvm&amp;rsquo;s own for glibc, and for musl the digest of the &lt;code&gt;--from&lt;/code&gt; base), and the backend&amp;rsquo;s format. The build VM is made from base, so base&amp;rsquo;s mise is the one that installs the tool, and a new mise builds every tool image it installs again. A tool that &lt;code&gt;build.sh&lt;/code&gt; installs itself, without mise, doesn&amp;rsquo;t have mise&amp;rsquo;s version in its key, because mise doesn&amp;rsquo;t install it: rustup installs rust, and dotnet comes from Microsoft&amp;rsquo;s own archive (&lt;a href="#dotnets-download"&gt;dotnet&amp;rsquo;s download&lt;/a&gt;). The tests check that &lt;code&gt;base.sh&lt;/code&gt; pins the same mise as the one devvm runs on the host, with the same Linux checksums. devvm reads the lock as TOML and hashes what the tool&amp;rsquo;s entry says, the entry of the version the image installs, so a mise that writes the same lock in another order, with other spacing or quoting, leaves every key as it is. The settings are in the key because they change what mise installs, such as &lt;code&gt;python.compile&lt;/code&gt;, and the key reads what they say in the same way, so a comment or another way of writing the same settings leaves it as it is. Lima&amp;rsquo;s format is &lt;code&gt;build.sh&lt;/code&gt;&amp;rsquo;s own, compressed EROFS, which adds nothing to the key. A new version, a new download, an edited build script or a changed setting builds the image again, and a base with a different C library, such as Alpine&amp;rsquo;s musl, gets an image of its own, and so would a VM on another backend. Every glibc image&amp;rsquo;s key names devvm&amp;rsquo;s own base, because glibc images build only there, so a VM on Ubuntu&amp;rsquo;s base and one on a &lt;code&gt;--from&lt;/code&gt; Debian image share them. A musl image&amp;rsquo;s key has its base&amp;rsquo;s digest, so when the container image&amp;rsquo;s tag moves to a new image, its VMs&amp;rsquo; next tools build again in the new base. When the lock has no download of a tool for the VM&amp;rsquo;s platform, devvm doesn&amp;rsquo;t build it and says to try again later (&lt;code&gt;tool_unbuilt&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;An image is base and its layers alone, and a VM&amp;rsquo;s shared tools are a list in its state (the &lt;code&gt;tools&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;names&lt;/code&gt;) beside its image. devvm&amp;rsquo;s check of an image name refuses a shared tool&amp;rsquo;s name in it (&lt;code&gt;tool_not_layer&lt;/code&gt;), so &lt;code&gt;devvm build&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt; and &lt;code&gt;devvm images rm&lt;/code&gt; refuse one, because shared tools aren&amp;rsquo;t images and their versions come from the lock.&lt;/p&gt;
&lt;h3 data-hextra-search-id="dotnets-download"&gt;dotnet&amp;rsquo;s download&lt;span class="hx:absolute hx:-mt-20" id="dotnets-download"&gt;&lt;/span&gt;
&lt;a href="#dotnets-download" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;mise resolves dotnet&amp;rsquo;s version like any tool&amp;rsquo;s, but it locks the version alone, without a download, because its installer runs Microsoft&amp;rsquo;s install script, which nothing pins. So devvm adds each platform&amp;rsquo;s SDK archive to the lock itself (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt; names the code). For each dotnet entry that lacks a platform&amp;rsquo;s download, it fetches the channel&amp;rsquo;s list of releases, &lt;code&gt;https://builds.dotnet.microsoft.com/dotnet/release-metadata/&amp;lt;channel&amp;gt;/releases.json&lt;/code&gt;, over HTTPS and capped at 32 MB, and it records that platform&amp;rsquo;s &lt;code&gt;dotnet-sdk-&amp;lt;rid&amp;gt;.tar.gz&lt;/code&gt; with its SHA-512. It keeps a file only when its URL is under &lt;code&gt;https://builds.dotnet.microsoft.com/dotnet/&lt;/code&gt; and its hash is 128 hex digits, and a version that Microsoft doesn&amp;rsquo;t list gets no download, so devvm doesn&amp;rsquo;t build it. The image&amp;rsquo;s key hashes that lock entry, its URLs and checksums included, as it does every tool&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;build.sh&lt;/code&gt; gets the URL and the SHA-512 from devvm and downloads the archive with &lt;code&gt;devvm-fetch&lt;/code&gt;, which checks a 128-character checksum as a SHA-512 and any other as a SHA-256, and which deletes the file and fails when the sum differs. The script unpacks the archive and checks that &lt;code&gt;dotnet --list-sdks&lt;/code&gt; names the locked version. The SDK&amp;rsquo;s folder is read-only in VMs, so the script puts a &lt;code&gt;userlocal&lt;/code&gt; marker in its &lt;code&gt;metadata/workloads/&amp;lt;band&amp;gt;&lt;/code&gt; folder, for its feature band (10.0.400 for 10.0.403), which makes &lt;code&gt;dotnet workload install&lt;/code&gt; install into &lt;code&gt;~/.dotnet&lt;/code&gt; in the VM. In the VM, &lt;code&gt;sync.sh&lt;/code&gt; writes the shared SDK&amp;rsquo;s folder into &lt;code&gt;/etc/dotnet/install_location&lt;/code&gt;, where .NET&amp;rsquo;s programs look for an installed runtime, so global tools find it in every shell and not only those that mise activates, and it sets mise&amp;rsquo;s &lt;code&gt;dotnet.isolated&lt;/code&gt;, which gives each SDK a folder of its own, so the shared one runs from its image.&lt;/p&gt;
&lt;p&gt;The trust root is Microsoft&amp;rsquo;s &lt;code&gt;releases.json&lt;/code&gt;, read over HTTPS, which is the same model as the upstream checksums that mise locks for the other tools. An SDK that a project&amp;rsquo;s &lt;code&gt;global.json&lt;/code&gt; asks for is different: mise installs it in the VM with Microsoft&amp;rsquo;s install script, which checks only HTTPS and the download&amp;rsquo;s size, and it stays in that VM&amp;rsquo;s home, so no image or other VM gets it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-companys-ca-in-builds"&gt;A company&amp;rsquo;s CA in builds&lt;span class="hx:absolute hx:-mt-20" id="a-companys-ca-in-builds"&gt;&lt;/span&gt;
&lt;a href="#a-companys-ca-in-builds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Build VMs trust the CA certificates in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt;) while they build, and images never keep them. &lt;a href="https://next.devvm.dev/docs/internals/network/#a-companys-ca"&gt;Network tiers&lt;/a&gt; describes how devvm reads them and how the guest&amp;rsquo;s &lt;code&gt;ca.sh&lt;/code&gt; installs them.&lt;/p&gt;
&lt;p&gt;A build carries two scripts made from &lt;code&gt;ca.sh&lt;/code&gt;, which run as root: one to add the CAs, which writes the certificates from heredocs to a temporary folder and installs them, and one to remove them, which is &lt;code&gt;ca.sh&lt;/code&gt; without a folder. Each script of the build, &lt;code&gt;build.sh&lt;/code&gt; of a tools build too, also gets an environment at its start that exports the CAs&amp;rsquo; variables, so its tools find the CAs, and nothing of that is written in the VM. The backend puts it there, as it does the build&amp;rsquo;s proxy variables (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt; names the types). Each backend runs the add script before anything in the build VM downloads, and the remove script once the scripts are done, before the VM stops:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima:&lt;/strong&gt; the add script runs right after the start, through &lt;code&gt;sudo sh&lt;/code&gt;, then base&amp;rsquo;s or the layer&amp;rsquo;s scripts, then the remove script, before the final &lt;code&gt;sync&lt;/code&gt; and the stop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lima with &lt;code&gt;--from&lt;/code&gt;:&lt;/strong&gt; the conversion&amp;rsquo;s build VM, which is deleted afterwards, also runs the add script. &lt;code&gt;oci/build.sh&lt;/code&gt; gets &lt;code&gt;ca.sh&lt;/code&gt;, from devvm&amp;rsquo;s &lt;code&gt;guest/&lt;/code&gt; folder mounted read-only, and runs it in the image&amp;rsquo;s chroot with the CAs before &lt;code&gt;bootify.sh&lt;/code&gt; and without them after it, so that Alpine&amp;rsquo;s &lt;code&gt;apk&lt;/code&gt; reaches its HTTPS mirrors. The converted base then builds as Lima&amp;rsquo;s does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared tools:&lt;/strong&gt; the add script runs before &lt;code&gt;build.sh&lt;/code&gt;. devvm deletes the build VM and keeps only its output folder, so it needs no remove script.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An image is therefore the same with or without CAs, which is why its key holds none of them, and a tool image&amp;rsquo;s key stays its lock entry, &lt;code&gt;build.sh&lt;/code&gt;, mise&amp;rsquo;s settings, the C library and the base it builds in. When there are CAs, the build&amp;rsquo;s numbered steps include the two scripts. A layer script that copies the system&amp;rsquo;s bundle elsewhere keeps that copy.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (the &lt;code&gt;images&lt;/code&gt; section, &lt;a href="https://next.devvm.dev/docs/contributing/tests/#the-tests-behind-how-it-works"&gt;the tests behind it&lt;/a&gt;): a layer built with a test CA in the folder trusts it while its script runs, keeps its key once the folder is emptied, and a copy of its image booted without devvm has none of devvm&amp;rsquo;s CA files.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-share"&gt;The share&lt;span class="hx:absolute hx:-mt-20" id="the-share"&gt;&lt;/span&gt;
&lt;a href="#the-share" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm builds each tool version once for each backend and C library into a read-only image (EROFS) in &lt;code&gt;~/.local/share/devvm/tools&lt;/code&gt;, with its record next to it in &lt;code&gt;&amp;lt;image&amp;gt;.json&lt;/code&gt;. The record is JSON that only devvm writes, with the image&amp;rsquo;s SHA-256 (&lt;code&gt;sha256&lt;/code&gt;), its C library (&lt;code&gt;libc&lt;/code&gt;), for glibc the newest glibc version it needs (&lt;code&gt;glibc&lt;/code&gt;), for musl the digest of the base it was built in (&lt;code&gt;base&lt;/code&gt;), its backend&amp;rsquo;s format (&lt;code&gt;format&lt;/code&gt;), the backend that built it (&lt;code&gt;backend&lt;/code&gt;), when it was moved in (&lt;code&gt;built&lt;/code&gt;), the version of the devvm that built it (&lt;code&gt;made_by&lt;/code&gt;) and, once retention finds that no VM has it, since when (&lt;code&gt;idle_since&lt;/code&gt;). The share holds only the images and their records, and Lima&amp;rsquo;s images are compressed. That folder is mounted read-only in every VM at &lt;code&gt;/mnt/devvm-tools&lt;/code&gt;, and each VM mounts the images its tools need at &lt;code&gt;/opt/devvm/tools/&amp;lt;tool&amp;gt;/&amp;lt;version&amp;gt;&lt;/code&gt;, at boot and on every launch. A VM can&amp;rsquo;t change the shared images, even as root.&lt;/p&gt;
&lt;p&gt;A tool that doesn&amp;rsquo;t mount fails the launch (&lt;code&gt;tools_unmounted&lt;/code&gt;). mise&amp;rsquo;s &lt;code&gt;auto_install&lt;/code&gt; stays on for a project&amp;rsquo;s own version files, so without this check a tool that isn&amp;rsquo;t mounted would download into the VM on first use without a word. The VM&amp;rsquo;s mount script, &lt;code&gt;devvm-tools&lt;/code&gt;, tries every image in the VM&amp;rsquo;s list. It leaves out the empty mount point of one that fails, lists each failed image in &lt;code&gt;/run/devvm/tools-unmounted&lt;/code&gt; and exits non-zero, which fails the launch&amp;rsquo;s setup. The setup removes that list before anything else it runs, so a list left from the VM&amp;rsquo;s boot isn&amp;rsquo;t read after a failure that has nothing to do with the tools. devvm then reads the first 16 KiB of that list from the VM, and it gives up after 10 seconds, because root in the VM could make the read hang. It counts only a whole line that is one of the VM&amp;rsquo;s own tool images from its state, so the error shows devvm&amp;rsquo;s own names, never the VM&amp;rsquo;s text. devvm reads the list with a command of its own because the setup&amp;rsquo;s output goes straight to the run log, and a pipe for reading it would keep devvm waiting on any process that the setup left running.&lt;/p&gt;
&lt;p&gt;At boot the same failure fails only the &lt;code&gt;devvm-tools&lt;/code&gt; service, and the boot goes on. Either way, the launch&amp;rsquo;s setup runs the mount script again and stops on the failure.&lt;/p&gt;
&lt;h2 data-hextra-search-id="listing-and-cleaning-up"&gt;Listing and cleaning up&lt;span class="hx:absolute hx:-mt-20" id="listing-and-cleaning-up"&gt;&lt;/span&gt;
&lt;a href="#listing-and-cleaning-up" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/using/images/#listing-images"&gt;Listing images&lt;/a&gt; describes the columns of &lt;code&gt;devvm images&lt;/code&gt;. An &lt;code&gt;unfinished&lt;/code&gt; image is a build that didn&amp;rsquo;t finish, so it has no record, and a &lt;code&gt;building&lt;/code&gt; image has no record yet because another devvm holds its &lt;a href="#building"&gt;lock&lt;/a&gt;. A tool image&amp;rsquo;s &lt;code&gt;STATE&lt;/code&gt; compares it with the tools lock and with the VMs&amp;rsquo; state:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;current&lt;/code&gt; is the tools lock&amp;rsquo;s version, for the C library of the base that new VMs get, which &lt;code&gt;--from&lt;/code&gt; changes, and for musl, for that base&amp;rsquo;s digest.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;in use&lt;/code&gt; is another version, which a VM has in its state.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unused&lt;/code&gt; is neither.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;not built&lt;/code&gt; is the lock&amp;rsquo;s version of a tool that the share has other versions of.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;not installed&lt;/code&gt; means the share has nothing of that name&amp;rsquo;s.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Listing never resolves the tools lock. Before there is a lock, no tool image is current, and the tool images that no VM has show no state.&lt;/p&gt;
&lt;p&gt;A tool image&amp;rsquo;s name doesn&amp;rsquo;t say which backend and C library it&amp;rsquo;s built for, so &lt;code&gt;LIBC&lt;/code&gt; comes from its record, which also names the backend that built it, as &lt;code&gt;devvm images --json&lt;/code&gt; shows in &lt;code&gt;backend&lt;/code&gt;. An image without a record shows &lt;code&gt;-&lt;/code&gt;, and has no &lt;code&gt;backend&lt;/code&gt; or &lt;code&gt;libc&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm images rm&lt;/code&gt; deletes images with their records. &lt;code&gt;devvm gc&lt;/code&gt; deletes stale and unfinished images with their records, and unused tool images with theirs. With &lt;code&gt;--tool-images&lt;/code&gt;, it also deletes the current tool images that no VM&amp;rsquo;s state lists and that have a record, however recently they were built.&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s launch builds its tools before it records them in its state, and a new VM can also pick a tool that was built long before and that no VM has, so deleting current tools needs a reliable sign that no VM is being made. That sign is the making lock, &lt;code&gt;~/.local/share/devvm/making.lock&lt;/code&gt;. Each devvm that makes a VM holds it shared from before it picks the VM&amp;rsquo;s tools, and &lt;code&gt;devvm tools add&lt;/code&gt;, &lt;code&gt;devvm tools update&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; hold it until the VM&amp;rsquo;s state lists the new tools. A new VM&amp;rsquo;s devvm keeps it until just before the VM&amp;rsquo;s first shell. Any number of devvms hold it at once, on every backend, because it&amp;rsquo;s taken before the backend does anything. &lt;code&gt;devvm gc --tool-images&lt;/code&gt; and retention&amp;rsquo;s &lt;code&gt;tools.unused-age&lt;/code&gt; take it exclusively without waiting (&lt;code&gt;flock&lt;/code&gt; with &lt;code&gt;LOCK_NB&lt;/code&gt;), after the share&amp;rsquo;s lock, and hold it until they&amp;rsquo;re done, so no VM picks its tools between their list and their deletions. A devvm that starts to make a VM meanwhile waits under a status line (&lt;code&gt;making_waiting&lt;/code&gt;). In a terminal, gc holds it while it asks. Every tool image build runs for one of those devvms, under the making lock, and holds the share&amp;rsquo;s lock while it builds and moves the images in, so gc, which takes the share&amp;rsquo;s lock first, waits for a build in progress and then finds the making lock held until the VM&amp;rsquo;s state lists what it built.&lt;/p&gt;
&lt;p&gt;When a VM is being made, &lt;code&gt;devvm gc --tool-images&lt;/code&gt; keeps every current tool image that no VM&amp;rsquo;s state lists and names them (&lt;code&gt;gc_tools_making&lt;/code&gt;), after the same filters, and deletes the rest of its list. Retention deletes no tool images in that run and leaves their records&amp;rsquo; &lt;code&gt;idle_since&lt;/code&gt; as it is, then applies its other settings. The lock is an OS lock on an open file, which the system releases when the last descriptor closes, so a devvm that crashes or is killed lets go of it. Its descriptor is close-on-exec, so neither the processes devvm starts (a Lima host agent, a proxy) nor the shell that takes devvm&amp;rsquo;s place inherit it. gc and retention never wait for it, so they can&amp;rsquo;t block, and the order the two locks are taken in can&amp;rsquo;t deadlock: a devvm making a VM takes the making lock and then the share&amp;rsquo;s, and gc and retention take the share&amp;rsquo;s and only try the making lock. Retention at a command&amp;rsquo;s start doesn&amp;rsquo;t wait for the share&amp;rsquo;s lock either: while another devvm holds it, as a tool build does, that run deletes no tool images, and they wait for the next day&amp;rsquo;s run.&lt;/p&gt;
&lt;p&gt;When a tool image that a new VM&amp;rsquo;s state lists is gone by the VM&amp;rsquo;s setup, &lt;code&gt;devvm-tools&lt;/code&gt; can&amp;rsquo;t mount it, the setup fails with &lt;code&gt;tools_unmounted&lt;/code&gt;, and the VM and its state stay, because only an interrupt undoes a new VM. Every launch of the VM fails the same way until &lt;code&gt;devvm tools update&lt;/code&gt; builds the missing images, as a launch builds whatever the share lacks.&lt;/p&gt;
&lt;p&gt;gc holds the share&amp;rsquo;s lock throughout, so no tool build or &lt;code&gt;devvm tools update&lt;/code&gt; changes the share meanwhile. A tool image is unused only when compared with the tools lock, so before there is a lock, gc deletes none. Because &lt;code&gt;current&lt;/code&gt; is for the C library of the base that new VMs get, the musl tool images of an Alpine VM are unused once it&amp;rsquo;s gone, unless you give gc that &lt;code&gt;--from&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;gc also trims the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt; to its cap, deleting its least recently used files under the lock that the VMs&amp;rsquo; proxies take, and with &lt;code&gt;--nix-cache&lt;/code&gt;, it deletes all of the cache&amp;rsquo;s files. &lt;code&gt;devvm images&lt;/code&gt; ends with what the cache takes of its cap when it holds anything.&lt;/p&gt;
&lt;h2 data-hextra-search-id="free-space"&gt;Free space&lt;span class="hx:absolute hx:-mt-20" id="free-space"&gt;&lt;/span&gt;
&lt;a href="#free-space" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before each build and each new VM, devvm checks the free space on the disk that will hold it, and &lt;a href="https://next.devvm.dev/docs/using/ports-size/#free-space"&gt;free space&lt;/a&gt; lists what each step needs. devvm checks the disk that holds the images and VMs, which is the disk of devvm&amp;rsquo;s Lima home. Shared tool images come out into devvm&amp;rsquo;s data folder, so a tools build also checks that folder&amp;rsquo;s disk, which needs 0.5 GiB and 0.25 GiB for each tool, rounded up: 1 GiB for one tool and 3 GiB for all ten. When devvm&amp;rsquo;s data folder is on a small temporary disk, such as a tmpfs &lt;code&gt;/tmp&lt;/code&gt; on Linux, devvm checks that disk.&lt;/p&gt;
&lt;p&gt;The numbers leave a margin over what each step took when devvm&amp;rsquo;s tests measured the free space before, during and after it. Most of a step&amp;rsquo;s space is only needed while it runs. On Lima on macOS, base took about 1 GiB with Ubuntu&amp;rsquo;s cloud image already downloaded, and downloading the image takes up to another 0.9 GiB, which devvm keeps in its data folder (&lt;a href="#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;). A tools build counts its build VMs&amp;rsquo; floor once for each that runs at once, as on a disk with no copy on write, such as ext4, each is a full copy of base. base&amp;rsquo;s features add up to 2.5 GiB. A build of all ten shared tools took 6 GiB at its peak and kept 1.5 GiB of images. On macOS, an image built on another and a new VM take only what they write. On Linux hosts, an image and the VM that builds shared tools start as a full copy of their parent&amp;rsquo;s disk, but a new VM&amp;rsquo;s disk holds only its own changes. A VM then grows as you work in it, and its disk never shrinks.&lt;/p&gt;</description></item><item><title>Setting up GitHub for releases</title><link>https://next.devvm.dev/docs/contributing/github-setup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/github-setup/</guid><description>
&lt;p&gt;Releases go through CI and the co-signer only once GitHub is set up for them, and until then &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; publishes them from the maintainer&amp;rsquo;s machine, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; says. This page is the setup, in the order to do it. Each step gives the clicks in GitHub&amp;rsquo;s settings and, where GitHub&amp;rsquo;s API can do it, the &lt;code&gt;gh api&lt;/code&gt; command that does the same. Read each command before you run it, check it against GitHub&amp;rsquo;s documentation, and replace each &lt;code&gt;&amp;lt;…&amp;gt;&lt;/code&gt; with its value. The commands assume the repos are &lt;code&gt;devvmhq/devvm&lt;/code&gt; and &lt;code&gt;devvmhq/homebrew-tap&lt;/code&gt;, under the organization &lt;code&gt;devvmhq&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Step 4 needs your user ID, which &lt;code&gt;gh api user --jq .id&lt;/code&gt; prints, and step 7 the App ID from step 2.&lt;/p&gt;
&lt;h2 data-hextra-search-id="1-the-release-keys"&gt;1. The release keys&lt;span class="hx:absolute hx:-mt-20" id="1-the-release-keys"&gt;&lt;/span&gt;
&lt;a href="#1-the-release-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm checks a release with three release keys once they&amp;rsquo;re built into it (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#release-keys"&gt;Release keys&lt;/a&gt;). Until you make them, &lt;code&gt;packaging/keys&lt;/code&gt; has none and &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s three key lines are empty, so devvm and the install script check each release with the old release key alone, and &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; publishes it signed with that key, as before. CI&amp;rsquo;s Release workflow, &lt;code&gt;scripts/publish.sh&lt;/code&gt; without &lt;code&gt;--local&lt;/code&gt;, &lt;code&gt;--sign-legacy&lt;/code&gt; and the co-signer refuse to run without the keys, and each refusal points here. Make each key where its holder keeps it, and never two on one machine:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;minisign -G -W -p packaging/keys/release-ci.pub -s ci.key &lt;span class="c1"&gt;# CI&amp;#39;s, with no password: step 4 puts it in GitHub&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo minisign -G -W -p release-cosign.pub -s /etc/devvm-cosign/release.key &lt;span class="c1"&gt;# on the co-signer&amp;#39;s machine (step 3)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;minisign -G -p release-recovery.pub -s /path/on/an/offline/drive/recovery.key &lt;span class="c1"&gt;# the recovery key, with a password, kept offline&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Commit the three &lt;code&gt;.pub&lt;/code&gt; files to &lt;code&gt;packaging/keys/&lt;/code&gt; as &lt;code&gt;release-ci.pub&lt;/code&gt;, &lt;code&gt;release-cosign.pub&lt;/code&gt; and &lt;code&gt;release-recovery.pub&lt;/code&gt;, and copy each key into &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;release_ci_key&lt;/code&gt;, &lt;code&gt;release_cosign_key&lt;/code&gt; and &lt;code&gt;release_recovery_key&lt;/code&gt; lines, all in one commit, because a devvm with one or two of the keys can&amp;rsquo;t upgrade. &lt;code&gt;TestReleaseKeys&lt;/code&gt; checks that the keys are all three, each a different minisign key and none of them the old release key, and &lt;code&gt;TestInstallScriptKeys&lt;/code&gt; checks that &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s lines match them. &lt;code&gt;scripts/release.sh --check-tag&lt;/code&gt; refuses a tag with one or two of the keys, a key marked &lt;code&gt;PLACEHOLDER&lt;/code&gt; in its comment, or lines in &lt;code&gt;install.sh&lt;/code&gt; that differ. The first release built with the keys still carries the old key&amp;rsquo;s signature, so every devvm before it, which has no release keys, upgrades to it. Keep &lt;code&gt;ci.key&lt;/code&gt; only until step 4, then delete it, because a lost CI key is replaced by a release that the other two keys sign.&lt;/p&gt;
&lt;h2 data-hextra-search-id="2-the-github-app"&gt;2. The GitHub App&lt;span class="hx:absolute hx:-mt-20" id="2-the-github-app"&gt;&lt;/span&gt;
&lt;a href="#2-the-github-app" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The co-signer calls GitHub as an app of its own, never with your GitHub token, and the app can read the repo, write releases and the tap, and read workflow runs&amp;rsquo; artifacts, and nothing else (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#the-github-app"&gt;The GitHub App&lt;/a&gt;).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;https://github.com/organizations/devvmhq/settings/apps/new&lt;/code&gt; (for a user account, Settings, then Developer settings, then GitHub Apps, then New GitHub App).&lt;/li&gt;
&lt;li&gt;Name it, such as &lt;code&gt;devvm-cosign&lt;/code&gt;, with &lt;code&gt;https://devvm.dev&lt;/code&gt; as its homepage, and clear &lt;strong&gt;Webhook: Active&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Repository permissions&lt;/strong&gt;, set &lt;strong&gt;Contents&lt;/strong&gt; to Read and write and &lt;strong&gt;Actions&lt;/strong&gt; to Read-only. GitHub adds &lt;strong&gt;Metadata&lt;/strong&gt;, Read-only. Leave every other permission, and every organization and account permission, at No access.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Where can this GitHub App be installed?&lt;/strong&gt;, choose &lt;strong&gt;Only on this account&lt;/strong&gt;, then &lt;strong&gt;Create GitHub App&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Note the &lt;strong&gt;App ID&lt;/strong&gt; and the &lt;strong&gt;Client ID&lt;/strong&gt; at the top of its page: the config&amp;rsquo;s &lt;code&gt;[app] id&lt;/code&gt; takes either, and step 7 needs the App ID.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Private keys&lt;/strong&gt;, choose &lt;strong&gt;Generate a private key&lt;/strong&gt;, and copy the &lt;code&gt;.pem&lt;/code&gt; file to the co-signer&amp;rsquo;s machine as &lt;code&gt;/etc/devvm-cosign/app.pem&lt;/code&gt;, root&amp;rsquo;s, mode 0600. Delete the downloaded copy.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Install App&lt;/strong&gt;, then the &lt;code&gt;devvmhq&lt;/code&gt; account, then &lt;strong&gt;Only select repositories&lt;/strong&gt;, and select &lt;code&gt;devvm&lt;/code&gt; and &lt;code&gt;homebrew-tap&lt;/code&gt; alone. The installation&amp;rsquo;s ID is the number at the end of the page&amp;rsquo;s URL afterwards, &lt;code&gt;…/installations/&amp;lt;ID&amp;gt;&lt;/code&gt;, which is the config&amp;rsquo;s &lt;code&gt;[app] installation&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Check it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api orgs/devvmhq/installations --jq &lt;span class="s1"&gt;&amp;#39;.installations[] | {id, app_slug, repository_selection, permissions}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api orgs/devvmhq/installations/&amp;lt;installation ID&amp;gt;/repositories --jq &lt;span class="s1"&gt;&amp;#39;.repositories[].full_name&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;# devvm and homebrew-tap alone&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="3-the-co-signers-machine"&gt;3. The co-signer&amp;rsquo;s machine&lt;span class="hx:absolute hx:-mt-20" id="3-the-co-signers-machine"&gt;&lt;/span&gt;
&lt;a href="#3-the-co-signers-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Set it up as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#setting-it-up"&gt;Setting it up&lt;/a&gt; says, with the release key from step 1 and the app&amp;rsquo;s key from step 2, then step 7 below for its notify command. Its &lt;code&gt;init&lt;/code&gt; records what GitHub has published, so run &lt;code&gt;devvm-cosign@init&lt;/code&gt; once the setup on this page is done and before the first release goes through it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="4-the-release-environment"&gt;4. The release environment&lt;span class="hx:absolute hx:-mt-20" id="4-the-release-environment"&gt;&lt;/span&gt;
&lt;a href="#4-the-release-environment" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;CI&amp;rsquo;s Release workflow runs in the environment &lt;code&gt;release&lt;/code&gt;, which waits for your approval on each run and holds CI&amp;rsquo;s release key and the tag signers (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#cis-release-workflow"&gt;CI&amp;rsquo;s release workflow&lt;/a&gt;). Only runs for &lt;code&gt;v*&lt;/code&gt; tags may use it, and administrators can&amp;rsquo;t skip the approval.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, open &lt;strong&gt;Environments&lt;/strong&gt;, then &lt;strong&gt;New environment&lt;/strong&gt;, and name it &lt;code&gt;release&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Tick &lt;strong&gt;Required reviewers&lt;/strong&gt; and add yourself. Leave &lt;strong&gt;Prevent self-review&lt;/strong&gt; clear, because you push the tags you approve. Approve only a run for a tag you just pushed: the run is that tag&amp;rsquo;s own workflow, so approving it gives CI&amp;rsquo;s release key to the tag&amp;rsquo;s code, and the tag&amp;rsquo;s signature check runs inside it.&lt;/li&gt;
&lt;li&gt;Clear &lt;strong&gt;Allow administrators to bypass configured protection rules&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Deployment branches and tags&lt;/strong&gt;, choose &lt;strong&gt;Selected branches and tags&lt;/strong&gt;, then &lt;strong&gt;Add deployment branch or tag rule&lt;/strong&gt;, choose &lt;strong&gt;Tag&lt;/strong&gt;, and enter &lt;code&gt;v*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Environment secrets&lt;/strong&gt;, add &lt;code&gt;RELEASE_CI_KEY&lt;/code&gt;, the whole of &lt;code&gt;ci.key&lt;/code&gt; from step 1, both lines, then delete &lt;code&gt;ci.key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Environment variables&lt;/strong&gt;, add &lt;code&gt;RELEASE_TAG_SIGNERS&lt;/code&gt;: the SSH public keys that sign release tags, one per line, each after a name, as git&amp;rsquo;s allowed signers file has them, such as &lt;code&gt;cj ssh-ed25519 AAAA…&lt;/code&gt;. The key is the one &lt;code&gt;packaging/release-signer&lt;/code&gt; pins the fingerprint of, and &lt;code&gt;git config user.signingkey&lt;/code&gt; names.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The same with &lt;code&gt;gh&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method PUT repos/devvmhq/devvm/environments/release --input - &lt;span class="s"&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;wait_timer&amp;#34;: 0,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;prevent_self_review&amp;#34;: false,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;can_admins_bypass&amp;#34;: false,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;reviewers&amp;#34;: [{ &amp;#34;type&amp;#34;: &amp;#34;User&amp;#34;, &amp;#34;id&amp;#34;: &amp;lt;your user ID&amp;gt; }],
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;deployment_branch_policy&amp;#34;: { &amp;#34;protected_branches&amp;#34;: false, &amp;#34;custom_branch_policies&amp;#34;: true }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method POST repos/devvmhq/devvm/environments/release/deployment-branch-policies -f &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;v*&amp;#39;&lt;/span&gt; -f &lt;span class="nv"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tag
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh secret &lt;span class="nb"&gt;set&lt;/span&gt; RELEASE_CI_KEY --env release --repo devvmhq/devvm &amp;lt; ci.key
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;cj %s\n&amp;#39;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;cat ~/.ssh/&amp;lt;your signing key&amp;gt;.pub&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; gh variable &lt;span class="nb"&gt;set&lt;/span&gt; RELEASE_TAG_SIGNERS --env release --repo devvmhq/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Check it with &lt;code&gt;gh api repos/devvmhq/devvm/environments/release&lt;/code&gt;: &lt;code&gt;can_admins_bypass&lt;/code&gt; is false, &lt;code&gt;protection_rules&lt;/code&gt; lists you as the reviewer, and &lt;code&gt;gh api repos/devvmhq/devvm/environments/release/deployment-branch-policies&lt;/code&gt; lists &lt;code&gt;v*&lt;/code&gt; as a tag.&lt;/p&gt;
&lt;h2 data-hextra-search-id="5-the-tag-ruleset"&gt;5. The tag ruleset&lt;span class="hx:absolute hx:-mt-20" id="5-the-tag-ruleset"&gt;&lt;/span&gt;
&lt;a href="#5-the-tag-ruleset" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Only you can create, move or delete a &lt;code&gt;v*&lt;/code&gt; tag, so nobody else can start a release build, or retag a release. GitHub&amp;rsquo;s rulesets take roles, teams and apps as bypasses, not a single user, so the bypass is the repository&amp;rsquo;s admin role, which is you while you&amp;rsquo;re the only admin. Check that first, &lt;code&gt;gh api repos/devvmhq/devvm/collaborators --jq '.[] | select(.permissions.admin) | .login'&lt;/code&gt;, which lists organization owners too, and check &lt;code&gt;gh api repos/devvmhq/devvm/rulesets&lt;/code&gt; for a tag ruleset there already, to edit rather than add.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, open &lt;strong&gt;Rules&lt;/strong&gt;, then &lt;strong&gt;Rulesets&lt;/strong&gt;, then &lt;strong&gt;New ruleset&lt;/strong&gt;, then &lt;strong&gt;New tag ruleset&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Name it &lt;code&gt;Release tags&lt;/code&gt;, and set &lt;strong&gt;Enforcement status&lt;/strong&gt; to Active.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Bypass list&lt;/strong&gt;, add &lt;strong&gt;Repository admin&lt;/strong&gt;, with &lt;strong&gt;Always allow&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Target tags&lt;/strong&gt;, add the pattern &lt;code&gt;v*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Tag rules&lt;/strong&gt;, tick &lt;strong&gt;Restrict creations&lt;/strong&gt;, &lt;strong&gt;Restrict updates&lt;/strong&gt;, &lt;strong&gt;Restrict deletions&lt;/strong&gt; and &lt;strong&gt;Block force pushes&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The same with &lt;code&gt;gh&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method POST repos/devvmhq/devvm/rulesets --input - &lt;span class="s"&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;name&amp;#34;: &amp;#34;Release tags&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;target&amp;#34;: &amp;#34;tag&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;enforcement&amp;#34;: &amp;#34;active&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;conditions&amp;#34;: { &amp;#34;ref_name&amp;#34;: { &amp;#34;include&amp;#34;: [&amp;#34;refs/tags/v*&amp;#34;], &amp;#34;exclude&amp;#34;: [] } },
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;rules&amp;#34;: [{ &amp;#34;type&amp;#34;: &amp;#34;creation&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;update&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;deletion&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;non_fast_forward&amp;#34; }],
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;bypass_actors&amp;#34;: [{ &amp;#34;actor_id&amp;#34;: 5, &amp;#34;actor_type&amp;#34;: &amp;#34;RepositoryRole&amp;#34;, &amp;#34;bypass_mode&amp;#34;: &amp;#34;always&amp;#34; }]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;actor_id&lt;/code&gt; 5 is the repository admin role.&lt;/p&gt;
&lt;h2 data-hextra-search-id="6-immutable-releases"&gt;6. Immutable releases&lt;span class="hx:absolute hx:-mt-20" id="6-immutable-releases"&gt;&lt;/span&gt;
&lt;a href="#6-immutable-releases" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Once a release is published, nobody can change its files or move its tag, so the files the co-signer checked are the ones users download. A draft can still change, which is how the co-signer and &lt;code&gt;--sign-legacy&lt;/code&gt; add their files before it&amp;rsquo;s published.&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, under &lt;strong&gt;General&lt;/strong&gt;, then &lt;strong&gt;Releases&lt;/strong&gt;, tick &lt;strong&gt;Enable release immutability&lt;/strong&gt;. With &lt;code&gt;gh&lt;/code&gt;, &lt;code&gt;gh api --method PUT repos/devvmhq/devvm/immutable-releases&lt;/code&gt;, and &lt;code&gt;gh api repos/devvmhq/devvm/immutable-releases&lt;/code&gt; checks it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="7-the-taps-ruleset"&gt;7. The tap&amp;rsquo;s ruleset&lt;span class="hx:absolute hx:-mt-20" id="7-the-taps-ruleset"&gt;&lt;/span&gt;
&lt;a href="#7-the-taps-ruleset" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Only the co-signer&amp;rsquo;s app writes the tap&amp;rsquo;s &lt;code&gt;main&lt;/code&gt;, so nobody else can point Homebrew at other archives.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;homebrew-tap&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, open &lt;strong&gt;Rules&lt;/strong&gt;, then &lt;strong&gt;Rulesets&lt;/strong&gt;, then &lt;strong&gt;New ruleset&lt;/strong&gt;, then &lt;strong&gt;New branch ruleset&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Name it &lt;code&gt;main&lt;/code&gt;, and set &lt;strong&gt;Enforcement status&lt;/strong&gt; to Active.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Bypass list&lt;/strong&gt;, add the app from step 2, with &lt;strong&gt;Always allow&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Target branches&lt;/strong&gt;, choose &lt;strong&gt;Include default branch&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Branch rules&lt;/strong&gt;, tick &lt;strong&gt;Restrict updates&lt;/strong&gt;, &lt;strong&gt;Restrict deletions&lt;/strong&gt; and &lt;strong&gt;Block force pushes&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The same with &lt;code&gt;gh&lt;/code&gt;, with the App ID from step 2:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method POST repos/devvmhq/homebrew-tap/rulesets --input - &lt;span class="s"&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;name&amp;#34;: &amp;#34;main&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;target&amp;#34;: &amp;#34;branch&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;enforcement&amp;#34;: &amp;#34;active&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;conditions&amp;#34;: { &amp;#34;ref_name&amp;#34;: { &amp;#34;include&amp;#34;: [&amp;#34;~DEFAULT_BRANCH&amp;#34;], &amp;#34;exclude&amp;#34;: [] } },
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;rules&amp;#34;: [{ &amp;#34;type&amp;#34;: &amp;#34;update&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;deletion&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;non_fast_forward&amp;#34; }],
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;bypass_actors&amp;#34;: [{ &amp;#34;actor_id&amp;#34;: &amp;lt;App ID&amp;gt;, &amp;#34;actor_type&amp;#34;: &amp;#34;Integration&amp;#34;, &amp;#34;bypass_mode&amp;#34;: &amp;#34;always&amp;#34; }]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To fix the tap by hand, turn the ruleset&amp;rsquo;s enforcement off, make the change, and turn it on again, which admins can do. The co-signer raises an alert for a tap formula it didn&amp;rsquo;t write.&lt;/p&gt;
&lt;h2 data-hextra-search-id="8-where-the-co-signer-tells-you"&gt;8. Where the co-signer tells you&lt;span class="hx:absolute hx:-mt-20" id="8-where-the-co-signer-tells-you"&gt;&lt;/span&gt;
&lt;a href="#8-where-the-co-signer-tells-you" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A run that fails, a refusal and an alert reach you through the config&amp;rsquo;s &lt;code&gt;notify&lt;/code&gt; command (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#refusals-and-alerts"&gt;Refusals and alerts&lt;/a&gt;). A script that posts over HTTPS works under the co-signer&amp;rsquo;s units, such as this one to ntfy, saved as &lt;code&gt;/usr/local/bin/devvm-cosign-notify&lt;/code&gt;, root&amp;rsquo;s, mode 0755, with &lt;code&gt;notify = [&amp;quot;/usr/local/bin/devvm-cosign-notify&amp;quot;]&lt;/code&gt; in the config:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# What failed comes on standard input.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;exec&lt;/span&gt; curl -fsS --max-time &lt;span class="m"&gt;30&lt;/span&gt; -H &lt;span class="s1"&gt;&amp;#39;Title: devvm co-signer&amp;#39;&lt;/span&gt; --data-binary @- https://ntfy.sh/&amp;lt;a long random topic&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;An ntfy.sh topic is readable by anyone who knows its name, so use a long random one, or a server of your own with an ntfy access token. GitHub tells you the rest: it emails you when the Release workflow waits for your approval, and when a run fails.&lt;/p&gt;
&lt;h2 data-hextra-search-id="9-the-first-release-through-ci"&gt;9. The first release through CI&lt;span class="hx:absolute hx:-mt-20" id="9-the-first-release-through-ci"&gt;&lt;/span&gt;
&lt;a href="#9-the-first-release-through-ci" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Make it a release candidate, so a mistake costs little:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git tag -s v&amp;lt;version&amp;gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; scripts/publish.sh &lt;span class="c1"&gt;# push main and the tag&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh run watch --repo devvmhq/devvm &lt;span class="c1"&gt;# approve the run in the Actions tab first&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/publish.sh --sign-legacy &lt;span class="c1"&gt;# once the co-signer&amp;#39;s draft is there&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh release view v&amp;lt;version&amp;gt; --repo devvmhq/devvm &lt;span class="c1"&gt;# published, with SHA256SUMS and its three signatures&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The three signatures are CI&amp;rsquo;s, the co-signer&amp;rsquo;s and the old key&amp;rsquo;s, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;, &lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt; and &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; isn&amp;rsquo;t needed any more, and a release it published would be one the co-signer alerts on.&lt;/p&gt;</description></item><item><title>SSH and editors</title><link>https://next.devvm.dev/docs/using/ssh/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/ssh/</guid><description>
&lt;p&gt;You can reach each running VM by name from ssh and from editors such as VS Code and Cursor, and you choose for each VM whether it can use your SSH keys. &lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;ssh into VMs&lt;/a&gt; explains how devvm&amp;rsquo;s ssh entries keep a VM away from the rest of this machine.&lt;/p&gt;
&lt;h2 data-hextra-search-id="ssh-access-by-name"&gt;SSH access by name&lt;span class="hx:absolute hx:-mt-20" id="ssh-access-by-name"&gt;&lt;/span&gt;
&lt;a href="#ssh-access-by-name" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each running project VM can be reached as &lt;code&gt;devvm-&amp;lt;folder&amp;gt;&lt;/code&gt;, as in &lt;code&gt;ssh devvm-website&lt;/code&gt; or VS Code&amp;rsquo;s &lt;em&gt;Remote-SSH: Connect to Host&lt;/em&gt;. devvm chooses this alias once, when it makes the VM, and records it, so it never changes. A VM gets &lt;code&gt;devvm-&amp;lt;folder&amp;gt;&lt;/code&gt; unless another VM already has that alias, and then its alias is its full name. So when two folders share a name, the first VM made keeps &lt;code&gt;devvm-website&lt;/code&gt;, and the second one&amp;rsquo;s alias is its full name, whichever of them you delete first. The VM&amp;rsquo;s full name (&lt;code&gt;devvm-website-&amp;lt;hash&amp;gt;&lt;/code&gt;) always works as well.&lt;/p&gt;
&lt;p&gt;devvm writes these entries to &lt;code&gt;~/.local/share/devvm/ssh_config&lt;/code&gt; each time it launches or stops a VM, because a VM&amp;rsquo;s SSH port can change each time it starts. To use them, add this line to the top of &lt;code&gt;~/.ssh/config&lt;/code&gt;, before any &lt;code&gt;Host&lt;/code&gt; block:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Include ~/.local/share/devvm/ssh_config&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can also point ssh at the file, as in &lt;code&gt;ssh -F ~/.local/share/devvm/ssh_config devvm-website&lt;/code&gt;. &lt;code&gt;devvm host&lt;/code&gt;, &lt;code&gt;devvm code&lt;/code&gt;, &lt;code&gt;devvm cursor&lt;/code&gt; and a new &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; VM offer to add the line in a terminal, and without one, they show it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Only running VMs are listed.&lt;/strong&gt; A stopped VM&amp;rsquo;s port is free for any program on this machine to take, so an entry for it could hand your connection, and your agent, to that program. Start the VM with &lt;code&gt;devvm host&lt;/code&gt; or &lt;code&gt;devvm&lt;/code&gt; before you connect from an editor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each entry checks the VM&amp;rsquo;s own host keys,&lt;/strong&gt; which devvm reads from the VM once each time it starts and keeps in the VM&amp;rsquo;s folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/known_hosts&lt;/code&gt;. ssh refuses a host key that doesn&amp;rsquo;t match, and a VM whose keys devvm can&amp;rsquo;t read gets no entry.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each entry reaches the VM on this machine&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;,&lt;/strong&gt; as the VM&amp;rsquo;s user with the VM&amp;rsquo;s own key. A VM whose backend names any other address, or no user or key, gets no entry, so ssh never takes your connection somewhere else.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The entries need OpenSSH 8.7 or newer&lt;/strong&gt; (&lt;code&gt;ssh -V&lt;/code&gt;), and an older ssh refuses them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ssh sends your terminal&amp;rsquo;s &lt;code&gt;COLORTERM&lt;/code&gt;,&lt;/strong&gt; so programs in the VM show 24-bit color when your terminal does. It&amp;rsquo;s the only variable the entries send beyond the ones your own ssh config sends, and a VM made with &lt;code&gt;--from&lt;/code&gt; gets it only when its image&amp;rsquo;s sshd accepts it, as devvm&amp;rsquo;s base does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep remote forwards out of &lt;code&gt;Host *&lt;/code&gt;.&lt;/strong&gt; The entries turn off what else your ssh config could share with a VM, but they can&amp;rsquo;t turn off a &lt;code&gt;RemoteForward&lt;/code&gt; of yours.&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- markdownlint-disable-next-line MD033 -- the section's anchor before its rename, which released versions' messages link to --&gt;
&lt;p&gt;&lt;a id="devvm-host-and-devvm-code"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-host-devvm-code-and-devvm-cursor"&gt;devvm host, devvm code and devvm cursor&lt;span class="hx:absolute hx:-mt-20" id="devvm-host-devvm-code-and-devvm-cursor"&gt;&lt;/span&gt;
&lt;a href="#devvm-host-devvm-code-and-devvm-cursor" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm host &lt;span class="c1"&gt;# get this folder&amp;#39;s VM ready, and show the name ssh and editors reach it by&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm code &lt;span class="c1"&gt;# the same, then open its folder in VS Code over Remote-SSH&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm cursor &lt;span class="c1"&gt;# the same, then open its folder in Cursor over Remote-SSH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm host&lt;/code&gt; gets this folder&amp;rsquo;s VM ready for ssh and editors, then shows its host name (&lt;code&gt;devvm-website&lt;/code&gt;) and its folder in the VM. It does what &lt;a href="https://next.devvm.dev/docs/internals/overview/#an-existing-vm"&gt;a launch of an existing VM&lt;/a&gt; does, without opening a shell. It checks &lt;code&gt;.git&lt;/code&gt;, applies the size, ports and agent forwarding that a stopped VM&amp;rsquo;s state asks for, starts the VM if it&amp;rsquo;s stopped, runs the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;self-check&lt;/a&gt;, sets the VM up and writes the ssh config. A VM whose tier isn&amp;rsquo;t enforced is stopped, and it gets no name. The editors&amp;rsquo; commands start the same way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm code&lt;/code&gt; does the same, then opens the folder in VS Code over Remote-SSH with VS Code&amp;rsquo;s &lt;code&gt;code&lt;/code&gt; command, as in &lt;code&gt;code --remote ssh-remote+devvm-website ~/website&lt;/code&gt;. VS Code gets the SSH agent that devvm was started with, not the one that devvm&amp;rsquo;s own connections to the VM carry. Without &lt;code&gt;code&lt;/code&gt; on &lt;code&gt;PATH&lt;/code&gt;, devvm names the host to connect to with &lt;em&gt;Remote-SSH: Connect to Host&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm cursor&lt;/code&gt; does the same in Cursor, the editor, with its &lt;code&gt;cursor&lt;/code&gt; command, as in &lt;code&gt;cursor --remote ssh-remote+devvm-website ~/website&lt;/code&gt;. Cursor gets the SSH agent that devvm was started with too, and without &lt;code&gt;cursor&lt;/code&gt; on &lt;code&gt;PATH&lt;/code&gt;, devvm names the host to connect to from Cursor. Cursor installs its &lt;code&gt;cursor&lt;/code&gt; command from its command palette, as VS Code does its &lt;code&gt;code&lt;/code&gt;. Cursor&amp;rsquo;s CLI agent, which runs in the VM, is another program, with commands of its own (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#cursor-cli-login"&gt;Cursor CLI login&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- markdownlint-disable-next-line MD033 -- the section's anchor before its rename, which released versions' help links to --&gt;
&lt;p&gt;&lt;a id="vs-code"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 data-hextra-search-id="vs-code-and-cursor"&gt;VS Code and Cursor&lt;span class="hx:absolute hx:-mt-20" id="vs-code-and-cursor"&gt;&lt;/span&gt;
&lt;a href="#vs-code-and-cursor" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Over Remote-SSH, VS Code and Cursor reach further than ssh:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ports.&lt;/strong&gt; They forward the ports that programs they start in the VM listen on to this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, whatever &lt;code&gt;devvm ports&lt;/code&gt; says. Those programs include their terminals, their tasks and an agent.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Git sign-in.&lt;/strong&gt; They answer git&amp;rsquo;s credential prompts in the VM with your GitHub sign-in in the editor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your editor&amp;rsquo;s own sign-ins.&lt;/strong&gt; The editor&amp;rsquo;s extensions run in the VM, its AI features among them, such as GitHub Copilot in VS Code and Cursor&amp;rsquo;s own AI and codebase indexing. They may get the editor&amp;rsquo;s sign-ins to work there, such as Copilot&amp;rsquo;s GitHub token or your Cursor login, and devvm&amp;rsquo;s proxy doesn&amp;rsquo;t hold those back. devvm hasn&amp;rsquo;t checked what reaches the VM, so take it that a program in the VM could read them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm turns the first two off in each editor&amp;rsquo;s settings for the VM, which are &lt;code&gt;~/.vscode-server/data/Machine/settings.json&lt;/code&gt; in the VM for VS Code and &lt;code&gt;~/.cursor-server/data/Machine/settings.json&lt;/code&gt; for Cursor. Each time devvm sets the VM up, it sets &lt;code&gt;remote.autoForwardPorts&lt;/code&gt;, &lt;code&gt;git.terminalAuthentication&lt;/code&gt; and &lt;code&gt;github.gitAuthentication&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in both files and keeps their other settings. A file with comments isn&amp;rsquo;t plain JSON, so devvm leaves it as it is and says so in the run log. A file or folder that devvm can&amp;rsquo;t write is said in the run log too, and the rest of the setup goes on.&lt;/p&gt;
&lt;p&gt;Those settings only cover ordinary use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The VM can turn the three back on, and setting them in your own settings on this machine doesn&amp;rsquo;t stop it: in VS Code, the settings on the remote machine and the opened folder&amp;rsquo;s &lt;code&gt;.vscode/settings.json&lt;/code&gt;, both of which the VM can write, take precedence over yours for all three. Only a policy that an administrator sets takes precedence over the VM&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;Even with port forwarding off, an extension or a URL that the editor opens can still forward a port.&lt;/li&gt;
&lt;li&gt;Cursor is built on VS Code, so it most likely works the same way, though devvm hasn&amp;rsquo;t checked it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So don&amp;rsquo;t open a VM you don&amp;rsquo;t trust with &lt;code&gt;devvm code&lt;/code&gt; or &lt;code&gt;devvm cursor&lt;/code&gt;, and use &lt;code&gt;ssh&lt;/code&gt; or devvm&amp;rsquo;s shell instead, or sign out of the editor&amp;rsquo;s AI features and its GitHub sign-in first. Programs in the VM can also open URLs in this machine&amp;rsquo;s browser (&lt;code&gt;$BROWSER&lt;/code&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="cursors-agent"&gt;Cursor&amp;rsquo;s Agent&lt;span class="hx:absolute hx:-mt-20" id="cursors-agent"&gt;&lt;/span&gt;
&lt;a href="#cursors-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Recent releases of Cursor run its Agent in the editor&amp;rsquo;s server in the VM, not in the Cursor app on this machine. That server holds your Cursor sign-in in memory and uses it to talk to Cursor, so code in the VM could use your sign-in while the window is open.&lt;/p&gt;
&lt;p&gt;The safest way to use &lt;code&gt;devvm cursor&lt;/code&gt; is a VM on the allowlist or none tier without Cursor&amp;rsquo;s CLI:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --network allowlist --agents claude &lt;span class="c1"&gt;# any agents but cursor&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm cursor&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The VM can&amp;rsquo;t reach Cursor&amp;rsquo;s hosts, so its server can&amp;rsquo;t use your sign-in.&lt;/li&gt;
&lt;li&gt;Agent and Tab still work: Cursor sends their requests through the app on this machine when the VM can&amp;rsquo;t reach Cursor.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm network log&lt;/code&gt; shows the VM&amp;rsquo;s server trying &lt;code&gt;api2.cursor.sh&lt;/code&gt; and &lt;code&gt;downloads.cursor.com&lt;/code&gt;, blocked. The second is the server trying to download itself into the VM; Cursor then downloads it on this machine and copies it in.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A VM with Cursor&amp;rsquo;s CLI has Cursor&amp;rsquo;s hosts on its allowlist, so there the editor&amp;rsquo;s server can use your sign-in. To send Agent&amp;rsquo;s own requests through the app either way, add this line to your Cursor user settings, &lt;code&gt;~/Library/Application Support/Cursor/User/settings.json&lt;/code&gt; on macOS or &lt;code&gt;Cursor/User/settings.json&lt;/code&gt; in &lt;code&gt;$XDG_CONFIG_HOME&lt;/code&gt;, by default &lt;code&gt;~/.config&lt;/code&gt;, on Linux:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;cursorAgentHost.remoteInferenceRoute&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;always&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Once it finds Cursor&amp;rsquo;s &lt;code&gt;cursor&lt;/code&gt; command, &lt;code&gt;devvm cursor&lt;/code&gt; reads that file, without changing it, and warns before it opens Cursor when the line isn&amp;rsquo;t there, or when it can&amp;rsquo;t read the file. Cursor reads the setting only from your user settings, never from the VM&amp;rsquo;s. The setting doesn&amp;rsquo;t take your sign-in out of the VM, though: the editor&amp;rsquo;s server still signs in to Cursor where it can reach it, so open only VMs you trust with &lt;code&gt;devvm cursor&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="agent-forwarding"&gt;Agent forwarding&lt;span class="hx:absolute hx:-mt-20" id="agent-forwarding"&gt;&lt;/span&gt;
&lt;a href="#agent-forwarding" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;SSH agent forwarding is off by default. While it&amp;rsquo;s on and you&amp;rsquo;re connected, anything in the VM, coding agents included, can &lt;em&gt;use&lt;/em&gt; the agent&amp;rsquo;s keys, for example to push, to log in to servers or to sign any data, as &lt;code&gt;ssh-keygen -Y sign&lt;/code&gt; does. It can&amp;rsquo;t copy or remove them, lock the agent or add keys to it (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;). Turn forwarding on for one VM when you need git over SSH there.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --ssh-agent &lt;span class="c1"&gt;# a new VM that forwards your SSH agent&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ssh-agent &lt;span class="c1"&gt;# show this folder&amp;#39;s VM&amp;#39;s choice and devvm&amp;#39;s agent&amp;#39;s keys&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ssh-agent on &lt;span class="c1"&gt;# forward your SSH agent to this folder&amp;#39;s VM from its next start&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ssh-agent add ~/.ssh/deploy_key &lt;span class="c1"&gt;# or load one key into devvm&amp;#39;s own agent&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ssh-agent devvm &lt;span class="c1"&gt;# and forward that agent instead of yours&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ssh-agent off &lt;span class="c1"&gt;# stop forwarding from the VM&amp;#39;s next start&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 220px; --devvm-diagram-width: 687px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 687 220" width="687" height="220" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="df00e32c0a2b4116b--title" aria-describedby="df00e32c0a2b4116b--desc"&gt;&lt;title id="df00e32c0a2b4116b--title"&gt;The SSH agent a VM gets&lt;/title&gt;&lt;desc id="df00e32c0a2b4116b--desc"&gt;With devvm ssh-agent off, the default, the VM has no agent, so git over SSH fails. With on, it has your agent while you're connected, and with devvm, it has devvm's own agent, with only the keys you added.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_choice_off_0"&gt;&lt;path d="M304.27,53L304.27,59Q304.27,71 292.27,71L118.18,71Q106.18,71 106.18,83L106.18,126.5"/&gt;&lt;path class="pele-marker" d="M106.18,133.5L102.82,125.5L109.54,125.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_choice_on_0"&gt;&lt;path d="M343.09,53L343.09,126.5"/&gt;&lt;path class="pele-marker" d="M343.09,133.5L339.73,125.5L346.45,125.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_choice_own_0"&gt;&lt;path d="M381.91,53L381.91,59Q381.91,71 393.91,71L568,71Q580,71 580,83L580,126.5"/&gt;&lt;path class="pele-marker" d="M580,133.5L576.64,125.5L583.36,125.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_choice_off_0"&gt;&lt;rect x="30.91" y="91" width="150.55" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="106.18" y="104.2" text-anchor="middle"&gt;off, the default&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_choice_on_0"&gt;&lt;rect x="330.18" y="91" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="343.09" y="104.2" text-anchor="middle"&gt;on&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_choice_own_0"&gt;&lt;rect x="553.73" y="91" width="52.55" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="580" y="104.2" text-anchor="middle"&gt;devvm&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-hex" data-id="choice" transform="translate(343.09,30.5)"&gt;&lt;polygon points="-84.82,-22.5 84.82,-22.5 96.07,0 84.82,22.5 -84.82,22.5 -96.07,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;devvm ssh-agent&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="off" transform="translate(106.18,163.5)"&gt;&lt;rect x="-98.18" y="-30" width="196.36" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;no agent:&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;git over SSH fails&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="on" transform="translate(343.09,163.5)"&gt;&lt;rect x="-93.73" y="-30" width="187.45" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;your agent, while&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;you're connected&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="own" transform="translate(580,172.5)"&gt;&lt;rect x="-98.18" y="-39" width="196.36" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;devvm's own agent,&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;with only the keys&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;you added&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm --ssh-agent&lt;/code&gt; creates the VM forwarding your agent. &lt;code&gt;devvm ssh-agent on&lt;/code&gt;, &lt;code&gt;devvm&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt; changes it for an existing VM from its next start, and &lt;code&gt;devvm ssh-agent&lt;/code&gt; shows it. For a running VM, devvm asks in a terminal whether to restart it now, as &lt;code&gt;devvm restart&lt;/code&gt; does, and otherwise, or without a terminal or with &lt;code&gt;--no-input&lt;/code&gt;, the change waits for &lt;code&gt;devvm restart&lt;/code&gt; or the VM&amp;rsquo;s next start. Until then, each time devvm opens the running VM it asks in a terminal whether to restart it with the change, with no as the default unless an agent&amp;rsquo;s new folders wait too (&lt;a href="https://next.devvm.dev/docs/using/vms/#restarting-and-stopping"&gt;restarting&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;The choice applies to devvm&amp;rsquo;s shells and to the ssh entries alike, both as the VM&amp;rsquo;s current start was made with, so a change reaches neither until the VM next starts, whichever folder devvm runs from. When forwarding is on, an entry names the VM&amp;rsquo;s own agent socket, &lt;code&gt;~/.local/share/devvm/run/agent-&amp;lt;hash&amp;gt;.sock&lt;/code&gt;, as the agent, so an editor forwards the agent the VM started with however the editor was started. When forwarding is off, an entry says &lt;code&gt;ForwardAgent no&lt;/code&gt;, whatever your own &lt;code&gt;Host *&lt;/code&gt; settings say, and none of devvm&amp;rsquo;s own connections to the VM carry your agent.&lt;/li&gt;
&lt;li&gt;A VM started outside devvm, such as with &lt;code&gt;devvm limactl start&lt;/code&gt;, gets no agent in its ssh entry, because nothing says which agent that start forwards. devvm&amp;rsquo;s shells get its proxy&amp;rsquo;s relay of the agent that devvm last started it with, if any, until devvm starts it again.&lt;/li&gt;
&lt;li&gt;A VM that has run since before you upgraded devvm to this release can still remove the agent&amp;rsquo;s keys, lock the agent and add keys to it until its next start. devvm warns of such a VM each time it opens it or changes its links, and &lt;code&gt;devvm restart&lt;/code&gt; in its folder gives it the relay at once.&lt;/li&gt;
&lt;li&gt;With forwarding off, git over SSH in the VM fails. devvm says so when it creates a VM for a repo whose &lt;code&gt;origin&lt;/code&gt; is an SSH URL. Use an HTTPS remote with a GitHub token instead, or turn forwarding on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No keys loaded.&lt;/strong&gt; When a VM forwards your agent, the agent has no keys and &lt;code&gt;~/.ssh&lt;/code&gt; has one, devvm offers to load it (&lt;code&gt;ssh-add --apple-use-keychain&lt;/code&gt; on macOS). To keep it loaded across reboots, add &lt;code&gt;AddKeysToAgent yes&lt;/code&gt;, and &lt;code&gt;UseKeychain yes&lt;/code&gt; on macOS, under &lt;code&gt;Host *&lt;/code&gt; in &lt;code&gt;~/.ssh/config&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You can also use an agent that asks you to approve each use, such as 1Password&amp;rsquo;s or Secretive.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;GitHub&amp;rsquo;s host keys are preinstalled in every VM, so a first connection to GitHub doesn&amp;rsquo;t prompt.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvms-own-agent"&gt;devvm&amp;rsquo;s own agent&lt;span class="hx:absolute hx:-mt-20" id="devvms-own-agent"&gt;&lt;/span&gt;
&lt;a href="#devvms-own-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm&amp;rsquo;s own agent keeps your other keys out of reach, because it holds only the keys you add to it, such as a deploy key or a key with access to fewer repos.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm ssh-agent add ~/.ssh/deploy_key&lt;/code&gt; starts the agent and loads the key. The agent&amp;rsquo;s socket is &lt;code&gt;~/.local/share/devvm/agent.sock&lt;/code&gt;. &lt;code&gt;devvm ssh-agent devvm&lt;/code&gt; makes this folder&amp;rsquo;s VM forward that agent instead of yours, in devvm&amp;rsquo;s shells and in the ssh entries alike. VMs share the agent, but none of them can remove its keys or lock it for the others.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ssh-agent&lt;/code&gt; shows this folder&amp;rsquo;s VM&amp;rsquo;s choice, and once you&amp;rsquo;ve added a key, it then lists the keys devvm&amp;rsquo;s agent holds, as &lt;code&gt;ssh-add -l&lt;/code&gt; does, and each key you added, with its file, its fingerprint and how it&amp;rsquo;s loaded. It loads the keys the agent lacks before it lists them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ssh-agent rm ~/.ssh/deploy_key&lt;/code&gt; takes the key out of devvm&amp;rsquo;s agent and out of &lt;code&gt;~/.local/share/devvm/agent-keys.json&lt;/code&gt;, so devvm doesn&amp;rsquo;t load it again. devvm finds the key in the agent by the fingerprint it recorded, so the key file can have changed or be gone, and devvm leaves the file itself as it is. devvm refuses a key you didn&amp;rsquo;t add, and &lt;code&gt;devvm ssh-agent&lt;/code&gt; lists the ones you did.&lt;/li&gt;
&lt;li&gt;devvm loads a key again when a VM that uses the agent launches without it, such as after a reboot or once the key&amp;rsquo;s lifetime ran out, and it asks for the key&amp;rsquo;s passphrase if it has one. It does so only while the file holds the key you added. &lt;code&gt;add&lt;/code&gt; records the key&amp;rsquo;s fingerprint, so devvm doesn&amp;rsquo;t load a file that was replaced since, or a link that was swapped to another key. A key you replaced in place needs &lt;code&gt;devvm ssh-agent add&lt;/code&gt; again.&lt;/li&gt;
&lt;li&gt;devvm refuses a key inside a folder a VM mounts, and doesn&amp;rsquo;t load it, because that VM could read it. That&amp;rsquo;s every folder that a VM&amp;rsquo;s state says it mounts, whether the VM is running or stopped: its project folder, its agents&amp;rsquo; config folders and the shared tools. Keep the keys for devvm&amp;rsquo;s agent outside project folders.&lt;/li&gt;
&lt;li&gt;An encrypted key in the old PEM format needs converting first, with &lt;code&gt;ssh-keygen -p -f KEY&lt;/code&gt;, because devvm can&amp;rsquo;t read its fingerprint without the passphrase.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The agent drops each key 12 hours after it loads it, so a VM can&amp;rsquo;t keep using the key indefinitely. &lt;code&gt;--lifetime 30m&lt;/code&gt; changes that for one key, and it takes a &lt;a href="https://next.devvm.dev/docs/using/command-line/#flags-and-values"&gt;duration&lt;/a&gt; in minutes, hours, days or weeks, such as &lt;code&gt;30m&lt;/code&gt;, &lt;code&gt;8h&lt;/code&gt; or &lt;code&gt;1d&lt;/code&gt;, or &lt;code&gt;forever&lt;/code&gt;. &lt;code&gt;--confirm&lt;/code&gt; makes the agent ask you before each use, such as each push or each login, through an &lt;code&gt;ssh-askpass&lt;/code&gt; program. macOS doesn&amp;rsquo;t include one, so install one and put it on your &lt;code&gt;PATH&lt;/code&gt;, or set &lt;code&gt;SSH_ASKPASS&lt;/code&gt; to it. devvm keeps the keys and their options in &lt;code&gt;~/.local/share/devvm/agent-keys.json&lt;/code&gt;, and running &lt;code&gt;devvm ssh-agent add&lt;/code&gt; on the same key again replaces its options.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-ssh-agent-json"&gt;devvm ssh-agent &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-ssh-agent-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-ssh-agent-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm ssh-agent --json&lt;/code&gt; prints what &lt;code&gt;devvm ssh-agent&lt;/code&gt; shows as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. &lt;code&gt;mode&lt;/code&gt; is this folder&amp;rsquo;s VM&amp;rsquo;s choice, &lt;code&gt;off&lt;/code&gt;, &lt;code&gt;on&lt;/code&gt; or &lt;code&gt;devvm&lt;/code&gt;. Each of the &lt;code&gt;keys&lt;/code&gt; is a key you added to devvm&amp;rsquo;s agent, with its &lt;code&gt;file&lt;/code&gt;, the &lt;code&gt;fingerprint&lt;/code&gt; devvm recorded, &lt;code&gt;confirm&lt;/code&gt;, its &lt;code&gt;lifetime&lt;/code&gt; and &lt;code&gt;loaded&lt;/code&gt;, which says whether the agent holds it. As without &lt;code&gt;--json&lt;/code&gt;, devvm loads the keys the agent lacks first, and with no key added, &lt;code&gt;keys&lt;/code&gt; is &lt;code&gt;[]&lt;/code&gt; and devvm doesn&amp;rsquo;t start its agent. With &lt;code&gt;--json&lt;/code&gt; the command only shows, so devvm refuses &lt;code&gt;on&lt;/code&gt;, &lt;code&gt;devvm&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt; with it.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;mode&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;keys&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;file&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/.ssh/deploy_key&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;fingerprint&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SHA256:mVPwvezndPv/ARoIadVY98vAC0g+P/5633yTC4d/wXE&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;confirm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;lifetime&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;12h&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;loaded&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>The co-signer</title><link>https://next.devvm.dev/docs/contributing/cosigner/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/cosigner/</guid><description>
&lt;p&gt;The co-signer, &lt;code&gt;devvm-cosign&lt;/code&gt;, is the second of the two builders that sign each devvm release and each published base. It runs on a Linux machine of the maintainer&amp;rsquo;s, and a systemd timer starts it every hour. CI builds each release and hands its files and its signature over as a workflow artifact, because CI&amp;rsquo;s token can only read the repo. Each run, the co-signer downloads what CI handed over, rebuilds it with its own copy of devvm, and signs the manifest only when its build matches CI&amp;rsquo;s byte for byte. Then it makes the GitHub release itself, uploads CI&amp;rsquo;s files and both signatures, and publishes the release once two of the three keys signed it, then updates the Homebrew tap. CI can&amp;rsquo;t make or publish a release, so only the co-signer, and the maintainer by hand, can, and the co-signer raises an alert for any release published since its state began that it didn&amp;rsquo;t make, whatever its tag. Its code is &lt;code&gt;cmd/devvm-cosign&lt;/code&gt; and &lt;code&gt;internal/cosign&lt;/code&gt;, and its systemd units and install script are in &lt;code&gt;packaging/cosign&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Releases go through CI and the co-signer once GitHub is set up for them, as &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/"&gt;Setting up GitHub for releases&lt;/a&gt; lists, and until then &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; publishes them from the maintainer&amp;rsquo;s machine, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; describes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-ci-hands-over"&gt;What CI hands over&lt;span class="hx:absolute hx:-mt-20" id="what-ci-hands-over"&gt;&lt;/span&gt;
&lt;a href="#what-ci-hands-over" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;CI&amp;rsquo;s release workflow, &lt;code&gt;.github/workflows/release.yml&lt;/code&gt; by default (&lt;code&gt;release_workflow&lt;/code&gt; in the config), runs for each pushed release tag, and uploads one artifact named &lt;code&gt;release&lt;/code&gt;. The artifact holds &lt;code&gt;SHA256SUMS&lt;/code&gt;, CI&amp;rsquo;s signature of it, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;, and every file &lt;code&gt;SHA256SUMS&lt;/code&gt; lists, and nothing else, side by side, with no folders. The base workflow, &lt;code&gt;.github/workflows/base.yml&lt;/code&gt; by default, uploads one artifact named &lt;code&gt;base&lt;/code&gt; in the same way, with &lt;code&gt;base-index.json&lt;/code&gt;, &lt;code&gt;base-index.json.ci.minisig&lt;/code&gt; and the files the index lists.&lt;/p&gt;
&lt;p&gt;The co-signer reads the workflow&amp;rsquo;s successful runs of this repo&amp;rsquo;s own, never a fork&amp;rsquo;s, through the Actions API. For a release, it takes each tag&amp;rsquo;s newest run that the tag&amp;rsquo;s push started, and for a base, the newest run on &lt;code&gt;main&lt;/code&gt;. What a run hands over isn&amp;rsquo;t trusted for being CI&amp;rsquo;s: CI&amp;rsquo;s key has to have signed the manifest, and the co-signer&amp;rsquo;s own build has to match it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-a-run-does"&gt;What a run does&lt;span class="hx:absolute hx:-mt-20" id="what-a-run-does"&gt;&lt;/span&gt;
&lt;a href="#what-a-run-does" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For each release CI handed over that the co-signer hasn&amp;rsquo;t published, oldest version first, though a run builds only one release or base, and the next waits for the next run:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Its version is newer&lt;/strong&gt; than every release the co-signer has signed, or it&amp;rsquo;s one it signed already, with the same &lt;code&gt;SHA256SUMS&lt;/code&gt;, because the run that signed it stopped before publishing. An older version, or a second &lt;code&gt;SHA256SUMS&lt;/code&gt; for a version it signed, is refused, because that&amp;rsquo;s an old or another release replayed, and an older version is an alert until you ack it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CI&amp;rsquo;s artifact checks out.&lt;/strong&gt; The co-signer downloads the artifact into &lt;code&gt;/var/lib/devvm-cosign/stage/&lt;/code&gt;, which no build can write, checked against GitHub&amp;rsquo;s digest of it, and unzips it there, taking only plain files with names a manifest can list, each written new and hashed as it&amp;rsquo;s written, within the artifact&amp;rsquo;s limits. It checks &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt; with CI&amp;rsquo;s release key and the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, exactly, through &lt;code&gt;internal/minisign&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Keys.CheckRole&lt;/code&gt;. The artifact has to hold exactly the files &lt;code&gt;SHA256SUMS&lt;/code&gt; lists, each with its SHA-256, and nothing else. Before the build, the co-signer deletes those files from the stage and keeps only &lt;code&gt;SHA256SUMS&lt;/code&gt; and CI&amp;rsquo;s signature, so none of CI&amp;rsquo;s files is on disk while its own build runs, and nothing can have the build copy CI&amp;rsquo;s bytes in place of its own unless it has them from CI itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its tag checks out.&lt;/strong&gt; The co-signer clones its own devvm checkout, which is at the commit its config pins, into &lt;code&gt;/var/lib/devvm-cosign/src/&lt;/code&gt;, where no build&amp;rsquo;s container can reach it, fetches the tag and &lt;code&gt;main&lt;/code&gt; from GitHub, and checks the tag&amp;rsquo;s SSH signature against the tag signers its config pins, never a list read from GitHub or from the tag&amp;rsquo;s commit. The tag&amp;rsquo;s commit has to be on &lt;code&gt;main&lt;/code&gt;, and it has to be the commit CI&amp;rsquo;s run built, and the co-signer records the tag object&amp;rsquo;s ID. Before anything of the tag&amp;rsquo;s runs, the co-signer reads two files from the tag&amp;rsquo;s commit: the Homebrew formulas&amp;rsquo; template, &lt;code&gt;packaging/homebrew/devvm.rb&lt;/code&gt;, and &lt;code&gt;CHANGELOG.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its own build matches.&lt;/strong&gt; The co-signer runs its clone&amp;rsquo;s &lt;code&gt;scripts/release.sh --tag &amp;lt;tag&amp;gt;&lt;/code&gt;, with its temporary files in &lt;code&gt;/var/lib/devvm-cosign-build/work/&lt;/code&gt;, the one folder its containers write, and its finished files copied to a folder of &lt;code&gt;src/&lt;/code&gt;, where the co-signer reads them, which checks the tag again with git and the same signers, and builds the release in its pinned container. No code of the tag&amp;rsquo;s runs outside that container, though the tag does choose the container&amp;rsquo;s image and its Go and GoReleaser downloads, each pinned by its hash, so a tag that a pinned signer signed is what the co-signer trusts (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#reproducible-releases"&gt;Reproducible releases&lt;/a&gt;). git and &lt;code&gt;release.sh&lt;/code&gt; run with an environment of their own, the machine&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;HOME&lt;/code&gt;, locale and container runtime&amp;rsquo;s variables alone, and no git config but the command line&amp;rsquo;s, so a repository&amp;rsquo;s own config runs no hook or fsmonitor, and git reaches files and HTTPS alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On a match, it signs.&lt;/strong&gt; Every file that &lt;code&gt;SHA256SUMS&lt;/code&gt; lists has to have the same SHA-256 in both builds, and the two &lt;code&gt;SHA256SUMS&lt;/code&gt; have to be the same bytes. The co-signer renders the tap&amp;rsquo;s formulas itself, from the tag&amp;rsquo;s template and the signed &lt;code&gt;SHA256SUMS&lt;/code&gt;, as &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;formula&lt;/code&gt; function does, and its build&amp;rsquo;s formulas have to be the same bytes, so neither builder&amp;rsquo;s container decides what Homebrew installs. It keeps the formulas and the release notes, the tag&amp;rsquo;s &lt;code&gt;CHANGELOG.md&lt;/code&gt; entry for the version, in &lt;code&gt;kept/&amp;lt;version&amp;gt;/&lt;/code&gt;, and records their SHA-256s and the version as signed in its state. Then it signs &lt;code&gt;SHA256SUMS&lt;/code&gt; with its own key and the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On a mismatch, it signs nothing.&lt;/strong&gt; It writes a report to &lt;code&gt;/var/lib/devvm-cosign/reports/&amp;lt;tag&amp;gt;-&amp;lt;time&amp;gt;.txt&lt;/code&gt;, with each file that differs and both builds&amp;rsquo; SHA-256s, files nothing publicly, and records the &lt;code&gt;SHA256SUMS&lt;/code&gt; as refused, so it isn&amp;rsquo;t built or downloaded again. Every run fails until you clear it, as &lt;a href="#refusals-and-alerts"&gt;Refusals and alerts&lt;/a&gt; says. A build that fails rather than differs, such as one cut short by a full disk or a download that failed, is built again at the next run, but the third failure in a row refuses it in the same way, with a report that holds the last failure. A build that keeps failing would otherwise take every run&amp;rsquo;s one build, and hold up each newer release and base behind it. A build stopped with its run, at its time limit or by &lt;code&gt;systemctl stop&lt;/code&gt;, isn&amp;rsquo;t counted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It makes the release.&lt;/strong&gt; The co-signer downloads CI&amp;rsquo;s artifact again, checked as before, with the same &lt;code&gt;SHA256SUMS&lt;/code&gt;. It makes a draft release of the tag, titled &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, with the notes it kept, as a prerelease for a version such as &lt;code&gt;0.3.0-rc.1&lt;/code&gt;. It uploads &lt;code&gt;SHA256SUMS&lt;/code&gt;, both signatures and CI&amp;rsquo;s files from the stage, hashing each file as it&amp;rsquo;s sent, so a file that changed on disk after its check is deleted again rather than published. An asset it didn&amp;rsquo;t upload, such as a half-finished upload&amp;rsquo;s, is deleted, and one with the bytes it should have, by size and GitHub&amp;rsquo;s digest, is kept, so a run that stops can run again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It checks the draft, then publishes.&lt;/strong&gt; The draft&amp;rsquo;s signatures have to pass &lt;code&gt;Keys.Check&lt;/code&gt;, so two of CI&amp;rsquo;s, its own and the recovery key&amp;rsquo;s. While releases bridge from the old release key, it waits until you upload &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; to the draft, with &lt;code&gt;scripts/publish.sh --sign-legacy&lt;/code&gt;, and checks it with that key and the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, because devvm 0.1 and 0.2 check only that key, so while the bridge lasts, that key alone still signs a release for them. Each run fails while it waits, so you hear that the draft is waiting for you. Then it reads the draft again: its tag, title and notes have to be the ones it wrote, and its assets exactly the ones it uploaded, by GitHub&amp;rsquo;s ID, size and digest, with nothing added. The tag has to name the same tag object its rebuild checked, so a tag deleted or pushed again while the draft waited isn&amp;rsquo;t published. Only then does it publish the release, as GitHub&amp;rsquo;s latest release unless it&amp;rsquo;s a prerelease or older than a release it published, which happens when the old key signs a newer release&amp;rsquo;s draft first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It checks the release again.&lt;/strong&gt; When the published release differs from what it checked, the co-signer raises an alert and stops there, without updating the tap. devvm and the install script refuse a file that doesn&amp;rsquo;t match &lt;code&gt;SHA256SUMS&lt;/code&gt;, and Homebrew one that doesn&amp;rsquo;t match its formula, but compare the files by hand. With immutable releases on, the fix is a newer release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Then the tap.&lt;/strong&gt; It commits the formulas it kept, each checked against the SHA-256 its state recorded, to the tap&amp;rsquo;s &lt;code&gt;Formula/devvm.rb&lt;/code&gt; and &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, with GitHub&amp;rsquo;s contents API, as &lt;code&gt;scripts/publish.sh&lt;/code&gt; does: &lt;code&gt;devvm.rb&lt;/code&gt; only for a release, not a prerelease, and each only when the tap&amp;rsquo;s formula is for an older version. A tap formula for a version newer than any the co-signer signed isn&amp;rsquo;t one it wrote, so that&amp;rsquo;s an alert. A run that stopped after publishing finishes the tap on the next run, without building again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Before any of that, the co-signer looks at each published release it hasn&amp;rsquo;t finished. Its own draft, published without it seeing the answer, such as when GitHub&amp;rsquo;s answer to the publish was lost, is checked as a published release: its &lt;code&gt;SHA256SUMS&lt;/code&gt; has to be the one it signed, both signatures and every file have to check out, downloaded, and its title and notes have to be its own. Only then does the co-signer finish the tap, and otherwise it raises an alert. &lt;code&gt;init&lt;/code&gt; records the highest release ID GitHub showed, and the drafts there were then, and GitHub&amp;rsquo;s IDs only go up, so any other release published since, whatever its tag or version, is an alert too. Each run also reads GitHub&amp;rsquo;s latest release, the one &lt;code&gt;/releases/latest/download/&lt;/code&gt; serves to the install script, wherever the list puts it. &lt;code&gt;init&lt;/code&gt; records which release that was, and the latest has to stay that one or become one the co-signer published: an older release made the latest again, such as one with a known flaw, is an alert, by &lt;code&gt;latest:&amp;lt;tag&amp;gt;#&amp;lt;ID&amp;gt;&lt;/code&gt;, and so is the one &lt;code&gt;init&lt;/code&gt; saw, or one of the co-signer&amp;rsquo;s own, once it&amp;rsquo;s older than a release the co-signer published.&lt;/p&gt;
&lt;p&gt;Each step that fails is logged, and the run goes on to the next release, then exits 1. A run that stops at any step can run again safely, and since an Ed25519 signature of the same bytes and comment is always the same, a signature made again is the one the first run would have made.&lt;/p&gt;
&lt;h3 data-hextra-search-id="refusals-and-alerts"&gt;Refusals and alerts&lt;span class="hx:absolute hx:-mt-20" id="refusals-and-alerts"&gt;&lt;/span&gt;
&lt;a href="#refusals-and-alerts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A refused build and an alert each fail every run, exit 1, until you deal with them, so the journal and the notify command keep saying so:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;journalctl -u &lt;span class="s1"&gt;&amp;#39;devvm-cosign@*&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;# what each run did, and why it failed&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo -u devvm-cosign devvm-cosign retry v0.3.0 &lt;span class="c1"&gt;# build CI&amp;#39;s v0.3.0 again, though it didn&amp;#39;t match before&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo -u devvm-cosign devvm-cosign ack v0.3.0 &lt;span class="c1"&gt;# clear v0.3.0&amp;#39;s alert, once you&amp;#39;ve dealt with it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A refusal&lt;/strong&gt; is a rebuild that didn&amp;rsquo;t match CI&amp;rsquo;s, or one that failed three times in a row. Read its report, and find out why, such as a full disk or a download cut short on the co-signer, or a build that isn&amp;rsquo;t reproducible. A new CI build of the same tag gives the same &lt;code&gt;SHA256SUMS&lt;/code&gt;, because builds are reproducible, so it stays refused. Once the cause is fixed, &lt;code&gt;devvm-cosign retry &amp;lt;tag&amp;gt;&lt;/code&gt; lets the next run rebuild it once more. The co-signer never retries a refusal on its own. Once a newer release is signed, a refused older one can&amp;rsquo;t be signed any more, because versions only go up, so a retry of it raises the older-version alert, and its fix is a newer release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An alert&lt;/strong&gt; is something wrong that the co-signer can&amp;rsquo;t fix: a release someone else published, one of its own whose published files differ from what it checked, an older version CI handed over, a tap formula it didn&amp;rsquo;t write, or an older release made GitHub&amp;rsquo;s latest. Find out what happened and fix it by hand, such as by deleting a release that isn&amp;rsquo;t CI&amp;rsquo;s and the co-signer&amp;rsquo;s build, then ack it with what the alert names: the tag for its own release or base, &lt;code&gt;&amp;lt;tag&amp;gt;#&amp;lt;ID&amp;gt;&lt;/code&gt; for a release someone else published, so another release of that tag is alerted on again, &lt;code&gt;tap:&amp;lt;formula&amp;gt;@&amp;lt;version&amp;gt;&lt;/code&gt; for a tap formula, and &lt;code&gt;latest:&amp;lt;tag&amp;gt;#&amp;lt;ID&amp;gt;&lt;/code&gt; for the latest release. After an ack, the next run checks its own release again, and raises the alert again if it still differs, and it leaves the rest alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A draft the co-signer didn&amp;rsquo;t make&lt;/strong&gt;, for a tag CI handed over, stops that release every run. A run that stopped between making a draft and recording it leaves one too. Delete it by hand, and the next run makes its own.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both commands take the state&amp;rsquo;s lock and fail at once when a run holds it, so run one again then. Neither reads a key file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The notify command&lt;/strong&gt;, &lt;code&gt;notify&lt;/code&gt; in the config, is how you hear of a run that failed: a program and its arguments. Every unit of the co-signer&amp;rsquo;s that fails, a run killed at its time limit or one whose config won&amp;rsquo;t load included, starts &lt;code&gt;devvm-cosign-failed.service&lt;/code&gt; (&lt;code&gt;OnFailure=&lt;/code&gt;), which runs &lt;code&gt;devvm-cosign failed&lt;/code&gt;. That runs the notify command with a line saying a run failed and the last run&amp;rsquo;s record, which says when it started and what failed, or that it never finished, on its standard input, at most 64 KiB, with an environment of its own, &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;LANG&lt;/code&gt; and &lt;code&gt;DEVVM_COSIGN_EVENT=failed&lt;/code&gt; alone, in &lt;code&gt;/&lt;/code&gt;, for a minute at most, so it gets none of the co-signer&amp;rsquo;s credentials. Use a script that posts over HTTPS, such as &lt;code&gt;curl&lt;/code&gt; to ntfy: a local mail server&amp;rsquo;s &lt;code&gt;sendmail&lt;/code&gt; doesn&amp;rsquo;t work under the units&amp;rsquo; &lt;code&gt;NoNewPrivileges&lt;/code&gt;. A co-signer that&amp;rsquo;s down sends nothing, so a release tag that&amp;rsquo;s still not published a day on is the sign to look at it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="bases"&gt;Bases&lt;span class="hx:absolute hx:-mt-20" id="bases"&gt;&lt;/span&gt;
&lt;a href="#bases" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A base is a release of its own, &lt;code&gt;base-&amp;lt;serial&amp;gt;&lt;/code&gt;, whose manifest is &lt;code&gt;base-index.json&lt;/code&gt; and whose trusted comment is &lt;code&gt;devvm-base &amp;lt;format&amp;gt; &amp;lt;serial&amp;gt; &amp;lt;expiry&amp;gt;&lt;/code&gt;, with each of those the same as the index&amp;rsquo;s fields. The co-signer checks a base CI handed over as it checks a release, with the base keys, and with these differences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Only CI&amp;rsquo;s newest base counts,&lt;/strong&gt; as each base replaces the last. A run that the co-signer has published is never downloaded again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The serial only goes up,&lt;/strong&gt; and the index has to be in date. Its expiry is the last day devvm takes it, in UTC, and it may be at most 31 days ahead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The snapshot can&amp;rsquo;t be old.&lt;/strong&gt; An index whose Ubuntu snapshot is more than 60 days old (&lt;code&gt;max_snapshot_days&lt;/code&gt; in &lt;code&gt;[base]&lt;/code&gt;) is refused, whether or not it needs a rebuild. The expiry alone can&amp;rsquo;t keep users off an old base, because the co-signer re-signs an unchanged base with a new serial and expiry, so whoever holds CI&amp;rsquo;s base key could otherwise keep users on one snapshot, missing every update since, for as long as they sign. Ubuntu&amp;rsquo;s archive changes every day, so a base that&amp;rsquo;s two months old has missed security updates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An unchanged base is signed without a rebuild.&lt;/strong&gt; The co-signer records the SHA-256 of every base file that a rebuild of its own matched, and the last index it signed. A base that&amp;rsquo;s that index again, with a new serial and expiry, and whose files are all ones it has checked, is re-signed at once, which keeps the published base inside its 30 days while nothing changes. Any other index is rebuilt, so an older base&amp;rsquo;s files can&amp;rsquo;t come back with a new serial.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its release&lt;/strong&gt; is made at the index&amp;rsquo;s commit, titled &lt;code&gt;devvm's base &amp;lt;serial&amp;gt;&lt;/code&gt;, with notes the co-signer writes from the index, and it&amp;rsquo;s never GitHub&amp;rsquo;s latest release, which stays devvm&amp;rsquo;s newest release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No rebuild yet.&lt;/strong&gt; Bases are built from the signing design&amp;rsquo;s fifth phase on, and until then a base with a file the co-signer hasn&amp;rsquo;t checked isn&amp;rsquo;t signed, and its log says why. &lt;code&gt;BaseBuilder&lt;/code&gt; is the seam for that build.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without base keys in the config, the co-signer leaves bases alone.&lt;/p&gt;
&lt;h2 data-hextra-search-id="its-files"&gt;Its files&lt;span class="hx:absolute hx:-mt-20" id="its-files"&gt;&lt;/span&gt;
&lt;a href="#its-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/usr/local/bin/devvm-cosign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the program, built from a release tag the maintainer checked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/etc/devvm-cosign/config.toml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;everything it trusts and signs with, root&amp;rsquo;s, readable by its group, &lt;code&gt;devvm-cosign&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/etc/devvm-cosign/*.key&lt;/code&gt;, &lt;code&gt;app.pem&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its minisign secret keys and the GitHub App&amp;rsquo;s private key, root&amp;rsquo;s, mode 0600, which reach the service as systemd&amp;rsquo;s credentials&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/state.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what it signed, made, published, refused and alerted on&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/kept/&amp;lt;version&amp;gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each signed release&amp;rsquo;s formulas and notes, which it renders and checks before publishing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/reports/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the reports of rebuilds that didn&amp;rsquo;t match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/stage/&lt;/code&gt;, &lt;code&gt;src/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;CI&amp;rsquo;s artifacts, unzipped, and each build&amp;rsquo;s clone of the checkout, which &lt;code&gt;release.sh&lt;/code&gt; runs from, and its finished files, both emptied at the start of each run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/cache/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s downloads, which only it, on the host, reads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/last-failure.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the last run&amp;rsquo;s record for the notify command: when it started, and what failed or that it never finished; removed when a run succeeds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign-build/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the build folder, the one the builds&amp;rsquo; containers write: &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s temporary files in &lt;code&gt;work/&lt;/code&gt;, and rootless podman&amp;rsquo;s config, images and containers, all deleted each time the podman service starts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The config:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;repo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvmhq/devvm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;tap&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvmhq/homebrew-tap&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The SSH public keys whose signed tags it builds, as their .pub files have them.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;tag_signers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ssh-ed25519 AAAA… cj@mini&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# podman or docker, for release.sh; podman by default.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;runtime&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;podman&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Run after each run that failed, with what failed on its stdin; none by default.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;notify&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/usr/local/bin/devvm-cosign-notify&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# devvm&amp;#39;s checkout that the release.sh it builds with is from: a release tag you checked.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;devvm&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/opt/devvm-cosign/devvm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;commit&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;the tag&amp;#39;s commit, all 40 characters&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;secret_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/etc/devvm-cosign/release.key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;keys&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cosign&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;recovery&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# While releases bridge from the old release key: packaging/minisign.pub&amp;#39;s key.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;legacy_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Optional, until bases are published.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;secret_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/etc/devvm-cosign/base.key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;keys&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cosign&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;recovery&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;the app&amp;#39;s client ID or app ID&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;installation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12345678&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;private_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/etc/devvm-cosign/app.pem&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The keys&lt;/strong&gt; are each kind&amp;rsquo;s three public keys, the same as &lt;code&gt;packaging/keys&lt;/code&gt;&amp;rsquo; &lt;code&gt;&amp;lt;kind&amp;gt;-&amp;lt;role&amp;gt;.pub&lt;/code&gt;, and the secret key&amp;rsquo;s public half has to be the &lt;code&gt;cosign&lt;/code&gt; key, or the config is refused. A config with a key it doesn&amp;rsquo;t know is refused too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The key files&lt;/strong&gt; are read from systemd&amp;rsquo;s credentials folder, &lt;code&gt;$CREDENTIALS_DIRECTORY&lt;/code&gt;, when the service runs, by the name each path in the config ends with, so those names have to be the units&amp;rsquo; credential names: &lt;code&gt;release.key&lt;/code&gt;, &lt;code&gt;app.pem&lt;/code&gt; and &lt;code&gt;base.key&lt;/code&gt;. Run by hand, outside the units, they&amp;rsquo;re read from where the config says. Each has to be a regular file that only its owner can read, mode 0600 or 0400, or the config is refused, but for a credential, which systemd makes root&amp;rsquo;s, mode 0440, with an ACL for the service&amp;rsquo;s user, in a folder only that service sees, and which only has to be unreadable by others.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;git_url&lt;/code&gt;, &lt;code&gt;api_url&lt;/code&gt; and &lt;code&gt;uploads_url&lt;/code&gt;&lt;/strong&gt; default to &lt;code&gt;https://github.com/&amp;lt;repo&amp;gt;.git&lt;/code&gt;, &lt;code&gt;https://api.github.com&lt;/code&gt; and &lt;code&gt;https://uploads.github.com&lt;/code&gt;, and each has to be HTTPS. &lt;strong&gt;&lt;code&gt;state_dir&lt;/code&gt;&lt;/strong&gt; defaults to &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; and &lt;strong&gt;&lt;code&gt;build_dir&lt;/code&gt;&lt;/strong&gt; to &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt;, and neither may be in the other, so the podman service&amp;rsquo;s unit can hide the state folder whole. The units name both folders, so change them only with the units changed to match.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;release_workflow&lt;/code&gt;&lt;/strong&gt; and &lt;code&gt;[base]&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;&lt;code&gt;workflow&lt;/code&gt;&lt;/strong&gt; are the workflow files&amp;rsquo; names, &lt;code&gt;release.yml&lt;/code&gt; and &lt;code&gt;base.yml&lt;/code&gt; by default, and &lt;code&gt;[base]&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;&lt;code&gt;max_snapshot_days&lt;/code&gt;&lt;/strong&gt; is from 1 to 365, 60 by default.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The tap&lt;/strong&gt; has to be under the same owner as the repo, as the app&amp;rsquo;s one installation covers both.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;state.json&lt;/code&gt; records, for releases and for bases, the newest version or serial it signed, the SHA-256 of each manifest it signed and of each it refused with how often it was retried, how many of a manifest&amp;rsquo;s builds in a row failed, the draft releases it made, what it published, each alert and how often it was acked, the CI runs it signed, the SHA-256 of each file it kept, each release&amp;rsquo;s tag object, and each base file a rebuild matched, and the highest release ID GitHub showed and its latest release when &lt;code&gt;init&lt;/code&gt; wrote it. It&amp;rsquo;s written whole, through a temp file that&amp;rsquo;s synced and renamed, and the folder is synced after, and a write that would record less than the file on disk, such as an older version or a dropped draft, is refused. At the start of each run the co-signer also compares it with GitHub: when a release or base, a draft or published, has a signature that checks out with the co-signer&amp;rsquo;s key and is newer than the state&amp;rsquo;s newest, which a state it wrote never is, the state was restored from an old backup or replaced, and the run stops before signing anything, so restore the newest backup. Only one run runs at a time, through a lock in the state folder.&lt;/p&gt;
&lt;p&gt;GitHub lists releases and runs newest first, so the co-signer reads them a page at a time until a page holds only ones it&amp;rsquo;s finished with: published, and either from before its state began, its own and finished, or someone else&amp;rsquo;s that it has alerted on. Years of releases and bases never make it read more. Ten pages it hasn&amp;rsquo;t finished with are an error, never a list cut short.&lt;/p&gt;
&lt;h2 data-hextra-search-id="setting-it-up"&gt;Setting it up&lt;span class="hx:absolute hx:-mt-20" id="setting-it-up"&gt;&lt;/span&gt;
&lt;a href="#setting-it-up" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The co-signer runs on any Linux machine with systemd, about 4 cores and 20 GB free, podman (or Docker), git, bash, curl and &lt;code&gt;ssh-keygen&lt;/code&gt;. Nothing reaches it from outside: it calls GitHub&amp;rsquo;s API, fetches from GitHub, and its builds download Go, GoReleaser and Go&amp;rsquo;s modules.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install what it runs,&lt;/strong&gt; such as &lt;code&gt;sudo dnf install podman git curl openssh-clients&lt;/code&gt; on Fedora or &lt;code&gt;sudo apt install podman git curl openssh-client&lt;/code&gt; on Debian or Ubuntu, and &lt;a href="https://mise.jdx.dev" target="_blank" rel="noopener"&gt;mise&lt;/a&gt;, for the Go the tag pins.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Register qemu-user with binfmt,&lt;/strong&gt; once, on an x86_64 machine, so it can rebuild arm64&amp;rsquo;s base: &lt;code&gt;sudo dnf install qemu-user-static&lt;/code&gt; on Fedora, or &lt;code&gt;sudo apt install qemu-user-static binfmt-support&lt;/code&gt; on Debian or Ubuntu, then check that &lt;code&gt;/proc/sys/fs/binfmt_misc/qemu-aarch64&lt;/code&gt; exists. Releases don&amp;rsquo;t need it, because Go cross-compiles them, and an arm64 machine doesn&amp;rsquo;t need it at all.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check out devvm at a release tag&lt;/strong&gt; and build the co-signer from it, with the Go that the tag&amp;rsquo;s &lt;code&gt;mise.lock&lt;/code&gt; pins:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone https://github.com/devvmhq/devvm.git ~/devvm-cosign &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/devvm-cosign
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git tag -v v&amp;lt;version&amp;gt; &lt;span class="c1"&gt;# signed by your key: compare its fingerprint&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git checkout v&amp;lt;version&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise trust &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise install go &lt;span class="c1"&gt;# the Go the tag&amp;#39;s mise.lock pins&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;CGO_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; mise &lt;span class="nb"&gt;exec&lt;/span&gt; -- go build -trimpath -o /tmp/devvm-cosign ./cmd/devvm-cosign &lt;span class="c1"&gt;# outside the checkout, which must stay clean&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo packaging/cosign/install.sh /tmp/devvm-cosign
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mkdir -p /opt/devvm-cosign &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo mv ~/devvm-cosign /opt/devvm-cosign/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo chown -R root:root /opt/devvm-cosign/devvm &lt;span class="c1"&gt;# the checkout config.toml names, root&amp;#39;s&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;install.sh&lt;/code&gt; installs the program and the systemd units, makes the user &lt;code&gt;devvm-cosign&lt;/code&gt; with 65536 subordinate IDs for rootless podman, above every other user&amp;rsquo;s range so no two users&amp;rsquo; containers share an ID, and makes &lt;code&gt;/etc/devvm-cosign&lt;/code&gt;, &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; and &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt; with the folders the units need. It installs no package and starts nothing, and it warns when there&amp;rsquo;s no &lt;code&gt;qemu-aarch64&lt;/code&gt; handler.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Write the config and copy the keys&lt;/strong&gt; into &lt;code&gt;/etc/devvm-cosign&lt;/code&gt;: the config root&amp;rsquo;s, readable by the co-signer&amp;rsquo;s group, and each key file root&amp;rsquo;s alone, &lt;code&gt;sudo chown root:devvm-cosign /etc/devvm-cosign/config.toml &amp;amp;&amp;amp; sudo chmod 640 /etc/devvm-cosign/config.toml &amp;amp;&amp;amp; sudo chown root:root /etc/devvm-cosign/*.key /etc/devvm-cosign/app.pem &amp;amp;&amp;amp; sudo chmod 600 /etc/devvm-cosign/*.key /etc/devvm-cosign/app.pem&lt;/code&gt;. With a base key, run &lt;code&gt;install.sh&lt;/code&gt; again, which then installs the drop-in that loads it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check it, write its first state and start the timer:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl start devvm-cosign@check &lt;span class="c1"&gt;# the config, the keys and the checkout, offline&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl start devvm-cosign@init &lt;span class="c1"&gt;# state.json, from the newest release and base published&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;journalctl -u devvm-cosign@check -u devvm-cosign@init
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; --now devvm-cosign.timer&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;init&lt;/code&gt; writes the first &lt;code&gt;state.json&lt;/code&gt; from what GitHub has published, so the co-signer signs only newer releases and bases and alerts on any release published after it, and it refuses to replace a state there is.&lt;/p&gt;
&lt;p&gt;The units:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;[email protected]&lt;/code&gt;&lt;/strong&gt; runs &lt;code&gt;devvm-cosign &amp;lt;instance&amp;gt;&lt;/code&gt; as &lt;code&gt;devvm-cosign&lt;/code&gt;, once per start: &lt;code&gt;devvm-cosign@run&lt;/code&gt; for the timer, and &lt;code&gt;@check&lt;/code&gt; and &lt;code&gt;@init&lt;/code&gt; for setting up. It loads the release key and the app&amp;rsquo;s key as systemd&amp;rsquo;s credentials (&lt;code&gt;LoadCredential=&lt;/code&gt;), and the base key through the drop-in &lt;code&gt;devvm-cosign-base.conf&lt;/code&gt;, because a credential that isn&amp;rsquo;t there fails the service. It runs with &lt;code&gt;NoNewPrivileges&lt;/code&gt;, &lt;code&gt;ProtectSystem=strict&lt;/code&gt;, &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; and &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt; its only writable folders, &lt;code&gt;ProtectHome&lt;/code&gt;, a private &lt;code&gt;/tmp&lt;/code&gt;, a PID namespace of its own, no capabilities, and a 3-hour limit, and when it fails it starts &lt;code&gt;devvm-cosign-failed.service&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-cosign.timer&lt;/code&gt;&lt;/strong&gt; starts &lt;code&gt;devvm-cosign@run&lt;/code&gt; hourly, and at boot for a run the machine was off for.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-cosign-podman.service&lt;/code&gt;&lt;/strong&gt; is the rootless podman service, as the same user, that the builds&amp;rsquo; containers run in, through &lt;code&gt;CONTAINER_HOST&lt;/code&gt;. podman can&amp;rsquo;t map a user namespace for its containers under &lt;code&gt;NoNewPrivileges&lt;/code&gt;, because &lt;code&gt;newuidmap&lt;/code&gt; gets its privilege from a file capability, so the containers run in this service, which has no &lt;code&gt;NoNewPrivileges&lt;/code&gt; and whose cgroup is delegated to the user, so &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s process and memory limits apply. Its &lt;code&gt;HOME&lt;/code&gt; is the build folder, where podman keeps its config and storage. Each time it starts, it deletes the user&amp;rsquo;s &lt;code&gt;libpod*&lt;/code&gt; files in &lt;code&gt;/dev/shm&lt;/code&gt;, podman&amp;rsquo;s locks, which outlive the service, then everything in the build folder, its images and containers with &lt;code&gt;podman system reset&lt;/code&gt;, so each run pulls its build&amp;rsquo;s image again, and a start that fails starts &lt;code&gt;devvm-cosign-failed.service&lt;/code&gt;. A start fails when a build left files the co-signer&amp;rsquo;s user can&amp;rsquo;t delete, and until root deletes them, &lt;code&gt;sudo rm -rf /var/lib/devvm-cosign-build/*&lt;/code&gt;, no run starts. It runs only while a run needs it (&lt;code&gt;StopWhenUnneeded=&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-cosign-failed.service&lt;/code&gt;&lt;/strong&gt; runs &lt;code&gt;devvm-cosign failed&lt;/code&gt;, which runs the notify command, and reads no key.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="what-a-builds-container-can-reach"&gt;What a build&amp;rsquo;s container can reach&lt;span class="hx:absolute hx:-mt-20" id="what-a-builds-container-can-reach"&gt;&lt;/span&gt;
&lt;a href="#what-a-builds-container-can-reach" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The builds&amp;rsquo; containers run as the same user as the co-signer, because rootless podman maps a container&amp;rsquo;s root to it, and they have no capabilities and no network, but for the one that downloads Go&amp;rsquo;s modules, and run only code from a tag a pinned signer signed. A process that escapes a container lands in the podman service, and the units keep these from it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The keys and the config.&lt;/strong&gt; The keys are root&amp;rsquo;s, and the co-signer gets them only as credentials, in a folder of its own service&amp;rsquo;s while it runs. The podman service sees neither &lt;code&gt;/etc/devvm-cosign&lt;/code&gt; nor any service&amp;rsquo;s credentials (&lt;code&gt;InaccessiblePaths=&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The co-signer&amp;rsquo;s processes.&lt;/strong&gt; The podman service and the run&amp;rsquo;s service each have a PID namespace of their own (&lt;code&gt;PrivatePIDs=&lt;/code&gt;), so an escaped process can&amp;rsquo;t see the co-signer, &lt;code&gt;release.sh&lt;/code&gt; or git, nor reach their files through &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/root&lt;/code&gt;. &lt;code&gt;devvm-cosign&lt;/code&gt; also makes itself non-dumpable when it starts, so no other process of its user can read its memory, where the keys and the GitHub token are, or trace it, though the programs it starts are dumpable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The state and what the co-signer runs.&lt;/strong&gt; The podman service can&amp;rsquo;t see &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; at all: the state, the kept formulas, CI&amp;rsquo;s staged files, the download cache, the clone whose &lt;code&gt;release.sh&lt;/code&gt; and git config the co-signer runs, and the folder &lt;code&gt;release.sh&lt;/code&gt; copies the finished build to, which the co-signer reads. It writes only the build folder. The co-signer runs nothing from there, and the one thing &lt;code&gt;release.sh&lt;/code&gt; reads from it once a container has run is the build&amp;rsquo;s output, which it copies to that private folder: a link there can only change what the co-signer compares, and none of CI&amp;rsquo;s files is on disk then, so a build it changed differs from CI&amp;rsquo;s and is refused. That holds unless CI is compromised too: whoever controls CI knows its files&amp;rsquo; bytes, so an escape that downloads them into the build counts as the co-signer&amp;rsquo;s compromise, and both builders are then compromised, which two of three keys can&amp;rsquo;t stop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Later builds.&lt;/strong&gt; Each run builds once, and the podman service runs only while the run does, so a process that escaped a build is gone before the next build&amp;rsquo;s &lt;code&gt;release.sh&lt;/code&gt; and git run. Each start of the service deletes the user&amp;rsquo;s podman files in &lt;code&gt;/dev/shm&lt;/code&gt; and the whole build folder, podman&amp;rsquo;s config and images with it, so nothing a build left behind, such as a lock, a link or a config pointing podman at another runtime, reaches the next.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What&amp;rsquo;s still shared is the user and the machine. An escaped process can slow the build it&amp;rsquo;s in, or change it, which then doesn&amp;rsquo;t match CI&amp;rsquo;s, and use the machine&amp;rsquo;s network while that run lasts. An escape through the kernel, rather than podman or crun, gets past all of it, so keep the machine for the co-signer alone. Running podman as a build user of its own would take away the shared user, though that isn&amp;rsquo;t set up yet.&lt;/p&gt;
&lt;p&gt;With Docker instead, set &lt;code&gt;runtime = &amp;quot;docker&amp;quot;&lt;/code&gt;, drop &lt;code&gt;CONTAINER_HOST&lt;/code&gt; and the podman unit from the service, and add &lt;code&gt;devvm-cosign&lt;/code&gt; to the &lt;code&gt;docker&lt;/code&gt; group. Membership of that group is as good as root on the machine, so podman is the better choice.&lt;/p&gt;
&lt;h3 data-hextra-search-id="making-its-keys"&gt;Making its keys&lt;span class="hx:absolute hx:-mt-20" id="making-its-keys"&gt;&lt;/span&gt;
&lt;a href="#making-its-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The co-signer&amp;rsquo;s keys are minisign keys with no password, because nobody is there to type one, so the machine&amp;rsquo;s disk is what protects them:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo minisign -G -W -p release-cosign.pub -s /etc/devvm-cosign/release.key
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo minisign -G -W -p base-cosign.pub -s /etc/devvm-cosign/base.key&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Commit each public key to &lt;code&gt;packaging/keys/&amp;lt;kind&amp;gt;-cosign.pub&lt;/code&gt;, and copy the release key into &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;release_cosign_key&lt;/code&gt; line (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#release-keys"&gt;Release keys&lt;/a&gt;). Keep an encrypted copy of each secret key offline, such as on a USB drive kept apart, and never on a machine you develop on, because that machine and CI would then hold two of the three keys.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-github-app"&gt;The GitHub App&lt;span class="hx:absolute hx:-mt-20" id="the-github-app"&gt;&lt;/span&gt;
&lt;a href="#the-github-app" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The co-signer calls GitHub with a GitHub App&amp;rsquo;s installation token, never a personal token. Each run signs a JSON Web Token with the app&amp;rsquo;s private key (RS256, issued a minute in the past and valid for nine minutes), trades it for an installation token, which lasts an hour, and asks for that token to reach only &lt;code&gt;devvm&lt;/code&gt; and the tap, with Contents read and write and Actions read, and nothing else. The app&amp;rsquo;s actor isn&amp;rsquo;t the maintainer, so it has none of the maintainer&amp;rsquo;s bypasses of rulesets.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#2-the-github-app"&gt;Setting up GitHub for releases&lt;/a&gt; has the clicks and the commands that check them.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create the app under the account that owns devvm, with no webhook, and the repository permissions Contents: read and write, Actions: read, and Metadata: read, which GitHub adds.&lt;/li&gt;
&lt;li&gt;Install it on &lt;code&gt;devvm&lt;/code&gt; and &lt;code&gt;homebrew-tap&lt;/code&gt; alone, and note the installation&amp;rsquo;s ID, the number at the end of its settings page&amp;rsquo;s URL.&lt;/li&gt;
&lt;li&gt;Generate a private key, and copy the &lt;code&gt;.pem&lt;/code&gt; file to &lt;code&gt;/etc/devvm-cosign/app.pem&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Let the app through the tap&amp;rsquo;s ruleset, as a bypass for its &lt;code&gt;main&lt;/code&gt;, or the co-signer can&amp;rsquo;t update the formulas, and every run fails.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Every GitHub call goes through &lt;code&gt;Client&lt;/code&gt; in &lt;code&gt;internal/cosign/github.go&lt;/code&gt; and &lt;code&gt;actions.go&lt;/code&gt;: listing releases, reading one, making a draft, uploading, deleting and downloading an asset, publishing, reading and writing the tap&amp;rsquo;s files, and listing a workflow&amp;rsquo;s runs and a run&amp;rsquo;s artifacts and downloading one. A download redirects to GitHub&amp;rsquo;s storage, and the token is never sent to a host other than the one it called.&lt;/p&gt;
&lt;h2 data-hextra-search-id="moving-it-to-another-machine"&gt;Moving it to another machine&lt;span class="hx:absolute hx:-mt-20" id="moving-it-to-another-machine"&gt;&lt;/span&gt;
&lt;a href="#moving-it-to-another-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Set up the new machine as above, with the same config and keys, then stop the old one&amp;rsquo;s timer (&lt;code&gt;sudo systemctl disable --now devvm-cosign.timer&lt;/code&gt;) and copy its &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; whole, but for &lt;code&gt;stage/&lt;/code&gt;, &lt;code&gt;src/&lt;/code&gt; and &lt;code&gt;cache/&lt;/code&gt;, which the new machine makes again, as it does the build folder, &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt;, which isn&amp;rsquo;t copied. &lt;code&gt;state.json&lt;/code&gt; alone isn&amp;rsquo;t enough, because a release signed on the old machine and not yet in the tap needs its &lt;code&gt;kept/&lt;/code&gt; files. Two machines with the same keys must never run at once, because each would publish.&lt;/p&gt;
&lt;p&gt;A lost machine, or a co-signer key you no longer trust, needs new keys instead: make them on the new machine, then publish a release that embeds the new public key, signed by CI and the recovery key, which are two of three without the old key. From that release on, devvm checks the new key.&lt;/p&gt;
&lt;h2 data-hextra-search-id="its-tests"&gt;Its tests&lt;span class="hx:absolute hx:-mt-20" id="its-tests"&gt;&lt;/span&gt;
&lt;a href="#its-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;internal/cosign&lt;/code&gt;&amp;rsquo;s tests run the co-signer against a fake GitHub in memory (&lt;code&gt;fakegithub_test.go&lt;/code&gt;), which checks each call&amp;rsquo;s token and the app&amp;rsquo;s JWT, serves workflow runs and their artifacts, makes drafts, serves downloads from a storage server of its own, and can fail a call, leave a half-finished upload, lose a publish&amp;rsquo;s answer, or swap an asset. The rebuild is a stub in most tests, and &lt;code&gt;build_test.go&lt;/code&gt; runs &lt;code&gt;ReleaseBuild&lt;/code&gt; with real git repositories and a stub &lt;code&gt;release.sh&lt;/code&gt;. The cases include a rebuild that doesn&amp;rsquo;t match and its retry, a build that keeps failing, an older release made the latest, a formula of the build&amp;rsquo;s own, a bad CI signature, an artifact with a file too many or too few, a zip with a link, a folder or a size that lies, a tag signed by an unpinned key, an older version replayed, a file swapped before or as it&amp;rsquo;s published, a release someone else published, a failure mid-upload and its retry, the release list past ten pages, a base on an old snapshot, and a state that would go backwards, and the parsers of outside input have fuzz tests.&lt;/p&gt;</description></item><item><title>The structure test and owners</title><link>https://next.devvm.dev/docs/contributing/structure/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/structure/</guid><description>
&lt;h2 data-hextra-search-id="the-structure-test"&gt;The structure test&lt;span class="hx:absolute hx:-mt-20" id="the-structure-test"&gt;&lt;/span&gt;
&lt;a href="#the-structure-test" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;internal/structure&lt;/code&gt; parses every Go file in the repo, tests and every platform&amp;rsquo;s included, generated files left out, and checks what linters don&amp;rsquo;t. &lt;code&gt;mise run test&lt;/code&gt; runs it. Each failure starts with its rule and the file and line:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;th&gt;Checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;max-methods&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;no type has more than 24 methods, value and pointer receivers together, and no interface declares more than 24, not counting the interfaces it embeds; a larger one splits by what its methods do&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;no-init&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;no &lt;code&gt;func init()&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;package-vars&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a package-level &lt;code&gt;var&lt;/code&gt; is a blank interface check, an &lt;code&gt;Err*&lt;/code&gt;/&lt;code&gt;err*&lt;/code&gt; sentinel from &lt;code&gt;errors.New&lt;/code&gt; or &lt;code&gt;fmt.Errorf&lt;/code&gt;, a &lt;code&gt;regexp.MustCompile&lt;/code&gt;, &lt;code&gt;template.Must&lt;/code&gt; or &lt;code&gt;sync.Once*&lt;/code&gt; result, a &lt;code&gt;//go:embed&lt;/code&gt; file, or listed in &lt;code&gt;allowedVars&lt;/code&gt;; anything else becomes a field, a const or a local&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;layers&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;which packages import which, in non-test files (tests may wire packages together)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;owners&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, only its owner runs a host command that &lt;code&gt;commands&lt;/code&gt; lists, only the files &lt;code&gt;execSites&lt;/code&gt; lists make a host command, only &lt;code&gt;guardOwner&lt;/code&gt; asserts a backend package&amp;rsquo;s type, only &lt;code&gt;envOwner&lt;/code&gt; reads a &lt;code&gt;DEVVM_&lt;/code&gt; variable, but the settings &lt;code&gt;envSettings&lt;/code&gt; lists, only its file in &lt;code&gt;envOwners&lt;/code&gt; reads &lt;code&gt;HOME&lt;/code&gt;, only its owner&amp;rsquo;s string literals hold a text that &lt;code&gt;literals&lt;/code&gt; lists, only its owner&amp;rsquo;s string literals are, whole, a name that &lt;code&gt;names&lt;/code&gt; lists, only its owner&amp;rsquo;s calls to package &lt;code&gt;strings&lt;/code&gt; split or join on a separator that &lt;code&gt;separators&lt;/code&gt; lists, only &lt;code&gt;pathsOwner&lt;/code&gt; builds a path in devvm&amp;rsquo;s data or config folder, and only its file in &lt;code&gt;callers&lt;/code&gt; calls a function that &lt;code&gt;callers&lt;/code&gt; lists (&lt;a href="#the-checks-on-owners"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;goroutines&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, a function that starts a goroutine, with a &lt;code&gt;go&lt;/code&gt; statement, a wait group&amp;rsquo;s &lt;code&gt;Go&lt;/code&gt; or &lt;code&gt;time&lt;/code&gt;&amp;rsquo;s or &lt;code&gt;context&lt;/code&gt;&amp;rsquo;s &lt;code&gt;AfterFunc&lt;/code&gt;, is in &lt;code&gt;goroutineSites&lt;/code&gt;, with what waits for its goroutines to end, or &lt;code&gt;detached:&lt;/code&gt; and why nothing does, and a package that starts one calls &lt;code&gt;leaktest.Main&lt;/code&gt; in its tests&amp;rsquo; &lt;code&gt;TestMain&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dropped-errors&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, no function assigns a &lt;code&gt;Wait&lt;/code&gt;&amp;rsquo;s error, or a &lt;code&gt;strconv&lt;/code&gt; parse&amp;rsquo;s, to &lt;code&gt;_&lt;/code&gt;, such as &lt;code&gt;_ = cmd.Wait()&lt;/code&gt; or &lt;code&gt;n, _ := strconv.Atoi(s)&lt;/code&gt;, unless &lt;code&gt;droppedErrors&lt;/code&gt; lists it with why, because a failed wait would read as a clean exit and text that isn&amp;rsquo;t a number as 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;read-limits&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, every &lt;code&gt;io.ReadAll&lt;/code&gt; reads through an &lt;code&gt;io.LimitReader&lt;/code&gt; made in its call, such as &lt;code&gt;io.ReadAll(io.LimitReader(r, limit+1))&lt;/code&gt;, unless &lt;code&gt;unboundedReads&lt;/code&gt; lists its function with why, so a peer or a file that never ends can&amp;rsquo;t fill the memory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;folder-ids&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files outside &lt;code&gt;internal/platform&lt;/code&gt;, no function compares a folder&amp;rsquo;s identity or its volume with &lt;code&gt;==&lt;/code&gt; or &lt;code&gt;!=&lt;/code&gt;, except with &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;, switches on one, passes one to &lt;code&gt;strings.EqualFold&lt;/code&gt;, &lt;code&gt;strings.Compare&lt;/code&gt;, &lt;code&gt;slices.Contains&lt;/code&gt; or &lt;code&gt;slices.Index&lt;/code&gt;, or keys a map by one, whether indexed or in a map&amp;rsquo;s literal, with its type written out or as a named map type of the module&amp;rsquo;s. A folder&amp;rsquo;s identity is a field named &lt;code&gt;Folder&lt;/code&gt; or &lt;code&gt;GitID&lt;/code&gt;, a call of a state&amp;rsquo;s &lt;code&gt;Folder&lt;/code&gt; or &lt;code&gt;FolderVolume&lt;/code&gt;, a call of &lt;code&gt;FolderID&lt;/code&gt;, &lt;code&gt;folderID&lt;/code&gt; or &lt;code&gt;FolderDevice&lt;/code&gt;, or a name in the same function that one of those, or such a name, was assigned to. A function passes when &lt;code&gt;exactFolderIDs&lt;/code&gt; lists it with why. The rule is there because a boot can number an unchanged folder&amp;rsquo;s device anew, which only &lt;code&gt;platform.SameFolder&lt;/code&gt; and &lt;code&gt;platform.SameOpenFolder&lt;/code&gt; allow for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;status-lines&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files outside the folders &lt;code&gt;statusFree&lt;/code&gt; lists, a function that does slow work shows a status line itself, with a Reporter&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt;, a &lt;code&gt;LoggedCmd&lt;/code&gt; step or its &lt;code&gt;Runner&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Run&lt;/code&gt;, unless &lt;code&gt;statusSites&lt;/code&gt; lists it with why, so the user sees what devvm waits for (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#status-lines"&gt;status lines&lt;/a&gt;). Slow work is making a host command with &lt;code&gt;exec.Command&lt;/code&gt; or &lt;code&gt;exec.CommandContext&lt;/code&gt;, running host git through &lt;code&gt;internal/hostgit&lt;/code&gt;, walking a folder with &lt;code&gt;fs.WalkDir&lt;/code&gt;, &lt;code&gt;filepath.Walk&lt;/code&gt;, &lt;code&gt;filepath.WalkDir&lt;/code&gt;, &lt;code&gt;hostsafety.Walk&lt;/code&gt; or &lt;code&gt;safefile.Walk&lt;/code&gt;, looking up a volume with &lt;code&gt;platform.VolumeUUID&lt;/code&gt;, making a request with &lt;code&gt;internal/fetch&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Open&lt;/code&gt;, &lt;code&gt;Resolve&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt; or &lt;code&gt;Download&lt;/code&gt;, a &lt;code&gt;fetch.Resumable{…}.Download&lt;/code&gt; or &lt;code&gt;ubuntu.Download&lt;/code&gt;, waiting for a lock with &lt;code&gt;platform.LockFile&lt;/code&gt;, &lt;code&gt;LockFileShared&lt;/code&gt; or &lt;code&gt;LockDir&lt;/code&gt; whose waiting is &lt;code&gt;nil&lt;/code&gt; or &lt;code&gt;platform.NoWait&lt;/code&gt;, or running a backend&amp;rsquo;s command outside a step with its &lt;code&gt;Runner&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Output&lt;/code&gt; or &lt;code&gt;Attach&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The layers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Only &lt;code&gt;cmd/devvm&lt;/code&gt; and &lt;code&gt;internal/cli&lt;/code&gt; import &lt;code&gt;internal/ui&lt;/code&gt;; only &lt;code&gt;internal/cli&lt;/code&gt; imports &lt;code&gt;internal/vm&lt;/code&gt;; only &lt;code&gt;cmd/devvm&lt;/code&gt; imports &lt;code&gt;internal/cli&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;internal/backend/...&lt;/code&gt; imports none of &lt;code&gt;internal/vm&lt;/code&gt;, &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;tools&lt;/code&gt;, &lt;code&gt;netpolicy&lt;/code&gt;, &lt;code&gt;secrets&lt;/code&gt;, &lt;code&gt;project&lt;/code&gt;, &lt;code&gt;gitprotect&lt;/code&gt;, &lt;code&gt;sshconfig&lt;/code&gt;, &lt;code&gt;sshagent&lt;/code&gt;, &lt;code&gt;trust&lt;/code&gt; or &lt;code&gt;vmssh&lt;/code&gt;, so the port forwarder and the link sessions stay devvm&amp;rsquo;s on every backend.&lt;/li&gt;
&lt;li&gt;Only &lt;code&gt;internal/backend/registry&lt;/code&gt; and &lt;code&gt;internal/cli&lt;/code&gt; import a backend (&lt;code&gt;lima&lt;/code&gt;); only tests import &lt;code&gt;backendtest&lt;/code&gt;, &lt;code&gt;internal/leaktest&lt;/code&gt;, &lt;code&gt;internal/memnet&lt;/code&gt;, and &lt;code&gt;internal/stubtest&lt;/code&gt; and the packages below it, which import only &lt;code&gt;internal/msg&lt;/code&gt; and each other. The stubs&amp;rsquo; binary, &lt;code&gt;internal/stubtest/stub&lt;/code&gt;, and its state, &lt;code&gt;internal/stubtest/stubstate&lt;/code&gt;, import nothing else of devvm&amp;rsquo;s, because the binary stands in for the tools devvm runs and is built apart from it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;internal/proxy&lt;/code&gt; imports no other devvm package except &lt;code&gt;internal/daemon&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets&lt;/code&gt;, &lt;code&gt;locales&lt;/code&gt;, &lt;code&gt;internal/platform&lt;/code&gt;, &lt;code&gt;internal/msg/gen&lt;/code&gt;, &lt;code&gt;internal/testbuild&lt;/code&gt;, &lt;code&gt;internal/hostgit&lt;/code&gt;, &lt;code&gt;internal/shell&lt;/code&gt;, &lt;code&gt;internal/vmname&lt;/code&gt;, &lt;code&gt;internal/daemon&lt;/code&gt;, &lt;code&gt;internal/fetch&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt;, &lt;code&gt;internal/leaktest&lt;/code&gt; and &lt;code&gt;internal/memnet&lt;/code&gt; import no devvm package; &lt;code&gt;internal/agentlogin&lt;/code&gt; only &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/fetch&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/platform&lt;/code&gt;, &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt; and &lt;code&gt;internal/state&lt;/code&gt;, because it holds agents&amp;rsquo; logins; &lt;code&gt;internal/msg&lt;/code&gt; only &lt;code&gt;locales&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;; &lt;code&gt;internal/paths&lt;/code&gt; only &lt;code&gt;internal/msg&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;; &lt;code&gt;internal/state&lt;/code&gt; only &lt;code&gt;internal/msg&lt;/code&gt;, &lt;code&gt;internal/paths&lt;/code&gt;, &lt;code&gt;internal/platform&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;; &lt;code&gt;internal/image&lt;/code&gt; only &lt;code&gt;assets&lt;/code&gt;, &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/msg&lt;/code&gt;, &lt;code&gt;internal/paths&lt;/code&gt; and &lt;code&gt;internal/shell&lt;/code&gt;; &lt;code&gt;internal/devcontainer&lt;/code&gt; only &lt;code&gt;internal/image&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/msg&lt;/code&gt; and &lt;code&gt;internal/shell&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Everything it holds the code to is in &lt;code&gt;devvm()&lt;/code&gt; in &lt;code&gt;internal/structure/structure_test.go&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;largeTypes&lt;/code&gt;&lt;/strong&gt; lists the types allowed more methods, which are &lt;code&gt;paths.Dirs&lt;/code&gt; and &lt;code&gt;ui.UI&lt;/code&gt;, each with its count as its maximum and why. A backend isn&amp;rsquo;t one of them, because its methods are split by &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s roles (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;). One that grows fails; one that shrinks fails until its maximum is lowered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;allowedVars&lt;/code&gt;&lt;/strong&gt; lists the other package-level vars, by package folder and name, each with why: values set by &lt;code&gt;-ldflags&lt;/code&gt;, fixed tables, test fixtures. An entry whose var is gone fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;layers&lt;/code&gt;&lt;/strong&gt; is the layering table: a layer&amp;rsquo;s packages (&lt;code&gt;from&lt;/code&gt;, but not &lt;code&gt;exceptFrom&lt;/code&gt;) import none of &lt;code&gt;to&lt;/code&gt; (but &lt;code&gt;exceptTo&lt;/code&gt;); &lt;code&gt;x/...&lt;/code&gt; is &lt;code&gt;x&lt;/code&gt; and the packages below it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;commands&lt;/code&gt;&lt;/strong&gt; maps a host command to the one package that runs it. &lt;strong&gt;&lt;code&gt;execSites&lt;/code&gt;&lt;/strong&gt; lists the files that make a host command with &lt;code&gt;exec.Command&lt;/code&gt; or &lt;code&gt;exec.CommandContext&lt;/code&gt;, each with why, and a listed file that no longer makes one fails. &lt;strong&gt;&lt;code&gt;guardOwner&lt;/code&gt;&lt;/strong&gt; names &lt;code&gt;internal/backend/guard.go&lt;/code&gt;, the one file that asserts a backend&amp;rsquo;s type. &lt;strong&gt;&lt;code&gt;envOwner&lt;/code&gt;&lt;/strong&gt; names the one file that reads devvm&amp;rsquo;s &lt;code&gt;DEVVM_&lt;/code&gt; variables. &lt;strong&gt;&lt;code&gt;envSettings&lt;/code&gt;&lt;/strong&gt; lists the variables read elsewhere, each with the files that read it and why. A listed file that no longer reads its variable fails. &lt;strong&gt;&lt;code&gt;envOwners&lt;/code&gt;&lt;/strong&gt; maps another variable to the one file that reads it, which for &lt;code&gt;HOME&lt;/code&gt; is &lt;code&gt;internal/paths/dirs.go&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;literals&lt;/code&gt;&lt;/strong&gt; maps a text that only one package&amp;rsquo;s string literals may hold to that package and what the others use instead. &lt;strong&gt;&lt;code&gt;names&lt;/code&gt;&lt;/strong&gt; maps a name that only one package&amp;rsquo;s string literals may be, whole, to that package and what the others use, and &lt;strong&gt;&lt;code&gt;namesFree&lt;/code&gt;&lt;/strong&gt; lists the folders whose literals may be one anyway: &lt;code&gt;internal/stubtest&lt;/code&gt;, whose stubs are named after the commands they stand in for.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;goroutineSites&lt;/code&gt;&lt;/strong&gt; lists every function outside tests that starts a goroutine, as its file and its name (&lt;code&gt;internal/proxy/splice.go: splice&lt;/code&gt;, or &lt;code&gt;Type.Method&lt;/code&gt; for a method). A function literal&amp;rsquo;s goroutine counts in the function it&amp;rsquo;s in, or in the package-level var whose value it is. A goroutine starts with a &lt;code&gt;go&lt;/code&gt; statement, a wait group&amp;rsquo;s &lt;code&gt;Go&lt;/code&gt;, or &lt;code&gt;time&lt;/code&gt;&amp;rsquo;s or &lt;code&gt;context&lt;/code&gt;&amp;rsquo;s &lt;code&gt;AfterFunc&lt;/code&gt;, whose function runs in a goroutine of its own. Goroutines that the standard library starts otherwise, such as an HTTP server&amp;rsquo;s for each connection, are for the leak checks to find, not the registry. Each entry says what waits for the goroutines to end, such as &lt;code&gt;scanAll's wg.Wait&lt;/code&gt;, or starts with &lt;code&gt;detached:&lt;/code&gt; and says why nothing does and what ends them anyway, such as a look at a folder whose disk may hang, which &lt;code&gt;folderWithin&lt;/code&gt; leaves to finish on its own. A new goroutine fails until its function is listed, and a listed function that no longer starts one fails, so the list stays current. A package that starts a goroutine also fails until a test file of its calls &lt;code&gt;leaktest.Main&lt;/code&gt;. The tests&amp;rsquo; own goroutines are the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#goroutine-leaks"&gt;leak checks&amp;rsquo;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;droppedErrors&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests that assign a &lt;code&gt;Wait&lt;/code&gt;&amp;rsquo;s or a &lt;code&gt;strconv&lt;/code&gt; parse&amp;rsquo;s error to &lt;code&gt;_&lt;/code&gt;, each named as in &lt;code&gt;goroutineSites&lt;/code&gt; and with why, and none does today. The check reads no types, so a call of any method named &lt;code&gt;Wait&lt;/code&gt; counts, and the parses are &lt;code&gt;Atoi&lt;/code&gt;, the &lt;code&gt;Parse&lt;/code&gt; functions, &lt;code&gt;Unquote&lt;/code&gt;, &lt;code&gt;UnquoteChar&lt;/code&gt; and &lt;code&gt;QuotedPrefix&lt;/code&gt;. A listed function that no longer drops one fails, so the list stays current.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;unboundedReads&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests whose &lt;code&gt;io.ReadAll&lt;/code&gt; reads with no limit, in the same way, each with why its reader ends: the status line&amp;rsquo;s look at the end of the run&amp;rsquo;s own log, which only that run writes, and the test stubs&amp;rsquo; reads of the standard input that devvm under test writes and closes. A reader limited before the call, held in a variable, counts as unlimited, so the limit goes in the call itself. A listed function that no longer reads with no limit fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;exactFolderIDs&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests and &lt;code&gt;internal/platform&lt;/code&gt; that compare a field named &lt;code&gt;Folder&lt;/code&gt; or &lt;code&gt;GitID&lt;/code&gt; with &lt;code&gt;==&lt;/code&gt; or &lt;code&gt;!=&lt;/code&gt;, in the same way, each with why: the agents&amp;rsquo; and exports&amp;rsquo; fields of that name, which are paths, &lt;code&gt;recordMove&lt;/code&gt;&amp;rsquo;s check that the state is as it was read, and &lt;code&gt;folderChanged&lt;/code&gt;, which runs after a start recorded the folder&amp;rsquo;s identity as it is now. The check reads no types, so any field by those names counts. A listed function that no longer compares one fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;statusSites&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests that do slow work and show no status line of their own, in the same way, each with why: the status line of the caller it runs under, named by its message, such as &lt;code&gt;checking_vm&lt;/code&gt; for a launch&amp;rsquo;s checks of the project folder, work that takes the terminal, such as &lt;code&gt;ssh-add&lt;/code&gt; asking for a passphrase, a process with no UI, such as a forwarder or a link session, or a command made for its caller to run. &lt;strong&gt;&lt;code&gt;statusFree&lt;/code&gt;&lt;/strong&gt; lists the folders whose code shows none, each with why: &lt;code&gt;internal/ui&lt;/code&gt;, which draws the status line, the proxy&amp;rsquo;s and devvm&amp;rsquo;s background processes, &lt;code&gt;internal/hostgit&lt;/code&gt; and &lt;code&gt;internal/fetch&lt;/code&gt;, whose callers&amp;rsquo; functions are the sites, and the tests&amp;rsquo; stubs. The check reads no types, so it doesn&amp;rsquo;t see a backend&amp;rsquo;s methods, such as &lt;code&gt;Exec&lt;/code&gt;, which &lt;code&gt;TestLaunchStatusLines&lt;/code&gt; checks for a launch, and a caller&amp;rsquo;s status line is only named, so a reviewer checks that it covers the call. A listed function that no longer does slow work without one fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;callers&lt;/code&gt;&lt;/strong&gt; maps a function to the one file outside its package that calls it, and a listed file that no longer calls it fails. A method is listed as &lt;code&gt;pkg.Type.Name&lt;/code&gt;, such as &lt;code&gt;internal/paths.Dirs.AgentSettings&lt;/code&gt;, and any call of a method by that name outside its package counts, because the check reads no types, so a listed method&amp;rsquo;s name is its type&amp;rsquo;s alone.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;TestRulesFail&lt;/code&gt; breaks each rule, and each layer, on small sources and checks the failure names it.&lt;/p&gt;
&lt;p&gt;Shell scripts that live in Go strings get shellcheck too, since lint&amp;rsquo;s shellcheck only finds files with a shebang. &lt;code&gt;TestEmbeddedScripts&lt;/code&gt; in &lt;code&gt;internal/structure&lt;/code&gt; finds every call site that runs a script as &lt;code&gt;sh -c&lt;/code&gt;, &lt;code&gt;/bin/sh -c&lt;/code&gt; or &lt;code&gt;bash -c&lt;/code&gt; (or &lt;code&gt;-lc&lt;/code&gt;), in a &lt;code&gt;[]string&lt;/code&gt; literal or a call&amp;rsquo;s arguments, outside tests and the stubs. When the script is a constant, a literal, or a sum of them, such as &lt;code&gt;seedApply&lt;/code&gt; with &lt;code&gt;seedMarker&lt;/code&gt; in it, the test writes it to a file and runs &lt;code&gt;shellcheck -s sh&lt;/code&gt; or &lt;code&gt;-s bash&lt;/code&gt;, as its shell reads it, at &lt;code&gt;-S warning&lt;/code&gt;, skipping when shellcheck isn&amp;rsquo;t installed. A script built at run time can&amp;rsquo;t be read there, so the test fails on one until &lt;code&gt;dynamicScripts&lt;/code&gt; lists its file and expression with why: a fixed command around quoted paths, a devcontainer&amp;rsquo;s own command, or a builder that a test of its package checks, as &lt;code&gt;internal/vm&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TestBuiltScriptsShellcheck&lt;/code&gt; does for the scripts built from the agents&amp;rsquo; registry. A listed site that&amp;rsquo;s gone fails too, so the list stays current. A shell given any other flag, such as &lt;code&gt;sh -ec&lt;/code&gt; or &lt;code&gt;sh -e -c&lt;/code&gt;, fails as well, because the test would miss its script: put options such as &lt;code&gt;set -e&lt;/code&gt; in the script instead. &lt;code&gt;-s&lt;/code&gt;, for a script on standard input, is fine.&lt;/p&gt;
&lt;h2 data-hextra-search-id="one-owner-for-each-concern"&gt;One owner for each concern&lt;span class="hx:absolute hx:-mt-20" id="one-owner-for-each-concern"&gt;&lt;/span&gt;
&lt;a href="#one-owner-for-each-concern" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each concern in devvm has one owner, the package or function that does it, such as &lt;code&gt;internal/hostgit&lt;/code&gt; for every git command devvm runs on the host, &lt;code&gt;internal/paths&lt;/code&gt; for every folder and file devvm uses, &lt;code&gt;internal/settings&lt;/code&gt; for every default (&lt;code&gt;settings.Read&lt;/code&gt; and &lt;code&gt;settings.Save&lt;/code&gt;, over &lt;code&gt;config.toml&lt;/code&gt; and &lt;code&gt;settings.json&lt;/code&gt;, with each value&amp;rsquo;s parser), and &lt;code&gt;locales/en.toml&lt;/code&gt; for every message. Before you add a helper, a parser, a path, a file reader, a message or a table, find its owner and extend it. A second copy drifts from the first, and then one of them is wrong. Code with no owner yet can have a second copy, because a copy can be cheaper than the wrong shared helper, so extract an owner at the third copy. A judge, such as &lt;code&gt;proxy.Public&lt;/code&gt; or &lt;code&gt;NormHost&lt;/code&gt;, gets its owner at once, because its two copies would disagree on what&amp;rsquo;s allowed. &lt;a href="#the-packages"&gt;The packages&lt;/a&gt; says what each package owns, and the failures of the checks below name the owners too.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-packages"&gt;The packages&lt;span class="hx:absolute hx:-mt-20" id="the-packages"&gt;&lt;/span&gt;
&lt;a href="#the-packages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each package owns these concerns, and a package&amp;rsquo;s &lt;code&gt;doc.go&lt;/code&gt;, where it has one, maps the package itself. &lt;code&gt;internal/fetch&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/shell&lt;/code&gt;, &lt;code&gt;internal/vmname&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt; and &lt;code&gt;internal/daemon&lt;/code&gt; use the standard library alone, and &lt;code&gt;internal/proxy&lt;/code&gt; uses it with &lt;code&gt;internal/daemon&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt; and nothing else. &lt;code&gt;internal/devcontainer&lt;/code&gt; imports no module from outside devvm, but it uses &lt;code&gt;internal/image&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/msg&lt;/code&gt; and &lt;code&gt;internal/shell&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Owns&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cmd/devvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the entry point: &lt;code&gt;ui.Main&lt;/code&gt; makes the run&amp;rsquo;s UI and runs the root command with it, and it&amp;rsquo;s the only &lt;code&gt;os.Exit&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/cli&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the command line. Each Cobra command has a file of its own, and its &lt;code&gt;about&lt;/code&gt; holds its docs page, its help group and the reason it has no &lt;code&gt;--json&lt;/code&gt;. The package also holds the run&amp;rsquo;s services (&lt;code&gt;app.go&lt;/code&gt;), the argument and flag checks, whose failures are usage errors, help, &lt;code&gt;--json&lt;/code&gt;, the CLI tests, &lt;code&gt;docgen/&lt;/code&gt;, which writes the CLI reference, and doctor&amp;rsquo;s check of Linux&amp;rsquo;s pins (&lt;code&gt;pins.go&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what each command does to a folder&amp;rsquo;s VM, below the command line: &lt;code&gt;Env&lt;/code&gt; and its parts, the one start, the finder, the inventory, &lt;code&gt;Launch&lt;/code&gt;, the agents&amp;rsquo; store, logins and saves, &lt;code&gt;Lifecycle&lt;/code&gt; and the one remake, &lt;code&gt;Housekeeping&lt;/code&gt;, &lt;code&gt;Settings&lt;/code&gt;, &lt;code&gt;Net&lt;/code&gt; and &lt;code&gt;Links&lt;/code&gt;, which its &lt;code&gt;doc.go&lt;/code&gt; maps with their owners. A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s copy is &lt;code&gt;cloneseed.go&lt;/code&gt;&amp;rsquo;s: its in-VM scripts &lt;code&gt;initRepos&lt;/code&gt;, &lt;code&gt;seedStage&lt;/code&gt; and &lt;code&gt;seedApply&lt;/code&gt;, sent through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt;, with the shallow file read through &lt;code&gt;internal/safefile&lt;/code&gt; and the pack made by &lt;code&gt;internal/hostgit&lt;/code&gt;&amp;rsquo;s git. Its uncommitted changes are &lt;code&gt;cloneworktree.go&lt;/code&gt;&amp;rsquo;s &lt;code&gt;seedTree&lt;/code&gt;: the index read through &lt;code&gt;internal/safefile&lt;/code&gt; and normalised by &lt;code&gt;internal/hostgit&lt;/code&gt;&amp;rsquo;s git, &lt;code&gt;hostgit.DiffFiles&lt;/code&gt; for what differs, and each working copy read through a &lt;code&gt;safefile.Root&lt;/code&gt;, opening each folder from its parent with &lt;code&gt;OpenDir&lt;/code&gt;, so no link on the way is followed, then the record of what went, which &lt;code&gt;clonecheck.go&lt;/code&gt; reads back. An operation in progress, the &lt;code&gt;info&lt;/code&gt; files and the stash are &lt;code&gt;clonestate.go&lt;/code&gt;&amp;rsquo;s &lt;code&gt;seedState&lt;/code&gt;, each file read through &lt;code&gt;internal/safefile&lt;/code&gt;, and only the files its &lt;code&gt;stateIDs&lt;/code&gt; lists are read for object ids. The settings and hooks are &lt;code&gt;cloneconfig.go&lt;/code&gt;&amp;rsquo;s &lt;code&gt;seedConfig&lt;/code&gt;, an allowlist of config keys whose URLs &lt;code&gt;cleanURL&lt;/code&gt; takes the credentials out of, and a VM&amp;rsquo;s stash entry is saved by &lt;code&gt;clonesave.go&lt;/code&gt;, without its untracked files. &lt;code&gt;Tools.update&lt;/code&gt; is the step devvm tools update takes, which devvm update takes first, and &lt;code&gt;filePorts&lt;/code&gt; works out a VM&amp;rsquo;s ports again from its &lt;code&gt;devcontainer.json&lt;/code&gt;&amp;rsquo;s, with the rules of devvm ports add and devvm ports rm (&lt;a href="https://next.devvm.dev/docs/internals/overview/#reading-the-devcontainerjson-again"&gt;reading the devcontainer.json again&lt;/a&gt;). &lt;code&gt;vm.AgentImport&lt;/code&gt; reads each agent&amp;rsquo;s folder through that folder as an &lt;code&gt;os.Root&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#links-out-of-an-agents-folder"&gt;links out of an agent&amp;rsquo;s folder&lt;/a&gt;). &lt;code&gt;Launch.buildTools&lt;/code&gt; builds the tool images that a VM&amp;rsquo;s shared tools need and the share lacks, and &lt;code&gt;retainTools&lt;/code&gt; is retention&amp;rsquo;s &lt;code&gt;tools.unused-age&lt;/code&gt;. &lt;code&gt;Inventory.GitKeeper&lt;/code&gt; names the VM that keeps a path locked, and &lt;code&gt;cloneState&lt;/code&gt; is the script that reads a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s state back, its stash entries included. A Git LFS object file is opened beneath the common dir through an &lt;code&gt;os.Root&lt;/code&gt;, each folder on the way checked first, because an &lt;code&gt;os.Root&lt;/code&gt; still follows a link that stays inside it. &lt;code&gt;confinementFor&lt;/code&gt; chooses a start&amp;rsquo;s confinement from the tier, &lt;code&gt;starter.start&lt;/code&gt; registers the interrupt&amp;rsquo;s cleanup around the backend&amp;rsquo;s &lt;code&gt;Start&lt;/code&gt;, &lt;code&gt;vm.Env.Terminal&lt;/code&gt; gives an agent&amp;rsquo;s login the terminal&amp;rsquo;s files (&lt;code&gt;ui.Terminal&lt;/code&gt;), and &lt;code&gt;AgentLogin.endLogin&lt;/code&gt; ends the login in the VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/shell&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;quoting for a POSIX shell (&lt;code&gt;Quote&lt;/code&gt;, &lt;code&gt;QuoteJoin&lt;/code&gt;), a word on one line for bash (&lt;code&gt;QuoteLine&lt;/code&gt;, ANSI-C quoting) and a shell variable&amp;rsquo;s names (&lt;code&gt;EnvName&lt;/code&gt;), with the standard library alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vmname&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the name of every machine devvm runs on a backend, &lt;code&gt;VM&lt;/code&gt;, which a field or a parameter holds instead of a string, and the parsers that make one where it&amp;rsquo;s read. &lt;code&gt;Parse&lt;/code&gt; reads a project VM&amp;rsquo;s name from an argument or a file name, and it also reads &lt;code&gt;vm.json&lt;/code&gt;&amp;rsquo;s name and runs in &lt;code&gt;project.Nth&lt;/code&gt;. &lt;code&gt;ParseListed&lt;/code&gt; reads one that a backend lists. &lt;code&gt;VM&lt;/code&gt;&amp;rsquo;s &lt;code&gt;UnmarshalText&lt;/code&gt; reads one in a JSON file, which may be any machine&amp;rsquo;s, so a field that must hold a project VM&amp;rsquo;s is still checked with &lt;code&gt;IsProject&lt;/code&gt;. &lt;code&gt;Image&lt;/code&gt; names an image&amp;rsquo;s machine, and &lt;code&gt;VM.Aside&lt;/code&gt; a remake&amp;rsquo;s old one. &lt;code&gt;msg.M.VM&lt;/code&gt; reads back the VM a message&amp;rsquo;s function took. It also holds a project VM&amp;rsquo;s name grammar (&lt;code&gt;Prefix&lt;/code&gt;, &lt;code&gt;HashLen&lt;/code&gt;, &lt;code&gt;IsVM&lt;/code&gt;, and &lt;code&gt;VM&lt;/code&gt;&amp;rsquo;s &lt;code&gt;IsProject&lt;/code&gt;, &lt;code&gt;Hash&lt;/code&gt;, &lt;code&gt;Slug&lt;/code&gt;, &lt;code&gt;Short&lt;/code&gt;, &lt;code&gt;ImageKey&lt;/code&gt; and a remake&amp;rsquo;s &lt;code&gt;Aside&lt;/code&gt;), with the standard library alone, so the proxy uses it too (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/project&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a project folder: its VM&amp;rsquo;s name, the hash that names its VM&amp;rsquo;s state folder (&lt;code&gt;project.Hash&lt;/code&gt;), its link targets, the folders that aren&amp;rsquo;t safe to use and its parents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/gitprotect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.git&lt;/code&gt; protection: one &lt;code&gt;scan&lt;/code&gt; for each check, a &lt;code&gt;Locker&lt;/code&gt; for each host, which is &lt;code&gt;Flags&lt;/code&gt; on macOS, &lt;code&gt;Binds&lt;/code&gt; on Linux, whose pins the start sets, or else &lt;code&gt;Watch&lt;/code&gt;, and the table of its reports. A nested repo is left to another only when that repo&amp;rsquo;s scan locks its git folder whole (&lt;code&gt;snapshot.covered&lt;/code&gt;). &lt;code&gt;gitprotect.Protector.Check&lt;/code&gt; is the check of a stopped VM, and for a VM that devvm 0.1.0 or 0.1.1-rc.1 made strict, the &lt;code&gt;converter&lt;/code&gt;&amp;rsquo;s &lt;code&gt;unstrict&lt;/code&gt; then takes &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; out of its repos&amp;rsquo; configs, on a context that an interrupt doesn&amp;rsquo;t cancel (&lt;code&gt;context.WithoutCancel&lt;/code&gt;), and &lt;code&gt;strictLeft&lt;/code&gt; does the same for &lt;code&gt;devvm git-protect on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt;, without the warning. &lt;code&gt;gitprotect.Keeps&lt;/code&gt; says whether another VM&amp;rsquo;s protection still covers a path. The configs it reads, the watch&amp;rsquo;s hashed files and git&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt;, &lt;code&gt;commondir&lt;/code&gt; and &lt;code&gt;gitdir&lt;/code&gt; files all go through &lt;code&gt;internal/safefile&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/"&gt;.git protection&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/hostsafety&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder&amp;rsquo;s other checks on the host: one &lt;code&gt;Walk&lt;/code&gt; once the VM is stopped, which skips &lt;code&gt;.git&lt;/code&gt; and finds set-id files and nested repos (&lt;code&gt;hostsafety.Walk&lt;/code&gt;, which only &lt;code&gt;starter.walk&lt;/code&gt; calls), git&amp;rsquo;s own test for a bare repo&amp;rsquo;s shape (&lt;code&gt;hostsafety.IsGitDir&lt;/code&gt;), doctor&amp;rsquo;s read of &lt;code&gt;safe.bareRepository&lt;/code&gt; (&lt;code&gt;hostsafety.BareExplicit&lt;/code&gt;), and an SSH origin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/hostgit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every git command devvm runs on the host, with no fsmonitor, hooks, filters or signing programs, ssh only, none of the environment&amp;rsquo;s &lt;code&gt;GIT_*&lt;/code&gt; variables and no prompts, and with &lt;code&gt;GIT_NO_REPLACE_OBJECTS=1&lt;/code&gt; and &lt;code&gt;GIT_GRAFT_FILE=/dev/null&lt;/code&gt;, so it sees a repo&amp;rsquo;s real history. &lt;code&gt;hostgit.UserConfig&lt;/code&gt; reads one key of git&amp;rsquo;s global and system config by the files&amp;rsquo; names, the files that &lt;code&gt;GIT_CONFIG_GLOBAL&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_SYSTEM&lt;/code&gt; name included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/sshconfig&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the ssh config that reaches running VMs by name, and its Include line in &lt;code&gt;~/.ssh/config&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/sshagent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each VM&amp;rsquo;s choice of SSH agent, devvm&amp;rsquo;s own agent and its keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/build&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;building and rebuilding images, and their records. &lt;code&gt;build.Names&lt;/code&gt; checks an image name&amp;rsquo;s layers and refuses a shared tool&amp;rsquo;s name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;image keys and names, with no side effects, and the shared tools&amp;rsquo; registry, &lt;code&gt;SharedTools&lt;/code&gt;: one entry for each toolchain, with its members, its detection, its installer, its guest environment, its &lt;code&gt;PATH&lt;/code&gt; folders and its version files (the structure test&amp;rsquo;s &lt;code&gt;names&lt;/code&gt;), and whether it&amp;rsquo;s built for glibc alone (&lt;code&gt;image.ToolDef.GlibcOnly&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/fetch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every HTTP client, with the standard library alone: &lt;code&gt;NewClient&lt;/code&gt;, with a timeout and &lt;code&gt;HTTPSOnly&lt;/code&gt; or &lt;code&gt;SameScheme&lt;/code&gt;, &lt;code&gt;Retry&lt;/code&gt; and &lt;code&gt;Transient&lt;/code&gt;, the failures callers tell apart (&lt;code&gt;Gone&lt;/code&gt;, &lt;code&gt;Untrusted&lt;/code&gt;, &lt;code&gt;BadCertificate&lt;/code&gt; and &lt;code&gt;Unverified&lt;/code&gt;), &lt;code&gt;ReadCapped&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt;, &lt;code&gt;Resolve&lt;/code&gt;, which finds where a HEAD&amp;rsquo;s redirects end, &lt;code&gt;Download&lt;/code&gt;, which checks the SHA-256 and caps the size, and &lt;code&gt;Resumable&lt;/code&gt;, a large download that goes on from where a cut or a stall stopped it, in this run or the next. &lt;code&gt;fetch.Client.Trust&lt;/code&gt; adds your CAs to a client&amp;rsquo;s roots, for the download of devvm&amp;rsquo;s own mise and an agent&amp;rsquo;s OAuth refresh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm upgrade: how this devvm was installed (&lt;code&gt;Detect&lt;/code&gt;), the releases (&lt;code&gt;Source&lt;/code&gt;, with the newest, &lt;code&gt;Check&lt;/code&gt; for a notice, and &lt;code&gt;Fetch&lt;/code&gt;, which checks &lt;code&gt;SHA256SUMS&lt;/code&gt; with &lt;code&gt;checkSums&lt;/code&gt;, two of the three built-in release keys&amp;rsquo; signatures through &lt;code&gt;internal/minisign&lt;/code&gt;, or while releases bridge from it, the old release key&amp;rsquo;s in &lt;code&gt;legacy.go&lt;/code&gt;, then the SHA-256), the unpack, the link&amp;rsquo;s switch and its rollback, and Homebrew. &lt;code&gt;upgradetest/&lt;/code&gt;, for tests only, has a TLS release server and the release&amp;rsquo;s signers (&lt;code&gt;Signers&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every check of a signature of devvm&amp;rsquo;s own, with the standard library and &lt;code&gt;x/crypto&lt;/code&gt;&amp;rsquo;s &lt;code&gt;blake2b&lt;/code&gt; alone (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;): minisign&amp;rsquo;s keys and signatures (&lt;code&gt;ParsePublicKey&lt;/code&gt;, and &lt;code&gt;PublicKey.Check&lt;/code&gt;, which takes only the prehashed &lt;code&gt;ED&lt;/code&gt; signature and compares its trusted comment exactly), a key&amp;rsquo;s &lt;code&gt;Role&lt;/code&gt; (&lt;code&gt;CI&lt;/code&gt;, &lt;code&gt;Cosign&lt;/code&gt;, &lt;code&gt;Recovery&lt;/code&gt;) and the &lt;code&gt;Kind&lt;/code&gt; it signs (&lt;code&gt;Release&lt;/code&gt;, &lt;code&gt;Base&lt;/code&gt;), the names of each role&amp;rsquo;s signature and key files (&lt;code&gt;SigName&lt;/code&gt;, &lt;code&gt;KeyFile&lt;/code&gt;) and a kind&amp;rsquo;s trusted comment (&lt;code&gt;Kind.Comment&lt;/code&gt;), and &lt;code&gt;Keys&lt;/code&gt;, a kind&amp;rsquo;s three different keys, whose &lt;code&gt;Check&lt;/code&gt; accepts a manifest that two of them signed and whose &lt;code&gt;CheckRole&lt;/code&gt; checks one role&amp;rsquo;s signature. It also signs, for the co-signer: &lt;code&gt;SecretKey&lt;/code&gt;, a minisign secret key made with no password (&lt;code&gt;ParseSecretKey&lt;/code&gt;), whose &lt;code&gt;Sign&lt;/code&gt; writes the signature file minisign would. &lt;code&gt;minisigntest/&lt;/code&gt;, for tests only, signs as minisign does&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/cosign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the co-signer, &lt;code&gt;devvm-cosign&lt;/code&gt;, a program of its own (&lt;code&gt;cmd/devvm-cosign&lt;/code&gt;), which imports the standard library, BurntSushi/toml and &lt;code&gt;internal/minisign&lt;/code&gt; alone, and which nothing of devvm&amp;rsquo;s imports (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/"&gt;The co-signer&lt;/a&gt;): its config (&lt;code&gt;LoadConfig&lt;/code&gt;, and &lt;code&gt;ReadConfig&lt;/code&gt; without the keys), a run (&lt;code&gt;Cosigner.Run&lt;/code&gt;) and the maintainer&amp;rsquo;s &lt;code&gt;retry&lt;/code&gt; and &lt;code&gt;ack&lt;/code&gt; (&lt;code&gt;Cosigner.Clear&lt;/code&gt;), CI&amp;rsquo;s artifacts, unzipped into its stage (&lt;code&gt;unzip&lt;/code&gt;), the rebuild (&lt;code&gt;ReleaseBuild&lt;/code&gt;, and &lt;code&gt;BaseBuilder&lt;/code&gt; for bases), the tap&amp;rsquo;s formulas, rendered from the signed &lt;code&gt;SHA256SUMS&lt;/code&gt; (&lt;code&gt;renderFormula&lt;/code&gt;), the SSH tag check (&lt;code&gt;VerifyTag&lt;/code&gt;), &lt;code&gt;state.json&lt;/code&gt; (&lt;code&gt;Store&lt;/code&gt;), the GitHub client (&lt;code&gt;Client&lt;/code&gt;, with the Actions API&amp;rsquo;s runs and artifacts) and the app&amp;rsquo;s token (&lt;code&gt;AppToken&lt;/code&gt;); &lt;code&gt;doc.go&lt;/code&gt; maps its files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/from&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--from&lt;/code&gt;: references, registry digests with an anonymous token, Docker&amp;rsquo;s IDs and the recorded digests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/redact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;passwords out of logs, with the standard library alone, and &lt;code&gt;Secret&lt;/code&gt;, the type of the values that let whoever holds them act as you or as a VM (&lt;a href="#secrets-in-the-code"&gt;Secrets in the code&lt;/a&gt;). &lt;code&gt;String&lt;/code&gt; redacts the run log&amp;rsquo;s lines, taking out proxy keys and URL passwords. &lt;code&gt;In&lt;/code&gt; redacts another program&amp;rsquo;s log as it grows, in place and keeping its length. It reads a line not yet ended again from its start when the line is within &lt;code&gt;MatchMax&lt;/code&gt; of what an earlier look read, and otherwise from &lt;code&gt;MatchMax&lt;/code&gt; back, starring what runs on to an &lt;code&gt;@&lt;/code&gt; there, and &lt;code&gt;Look.Cut&lt;/code&gt; does the same after a rotation&amp;rsquo;s cut. &lt;code&gt;Unended&lt;/code&gt; redacts a copy&amp;rsquo;s cut end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vmlog&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every log a VM can drive, except the proxy&amp;rsquo;s own. &lt;code&gt;Limit&lt;/code&gt; is the rate and length of what a VM makes devvm&amp;rsquo;s background processes write. The port forwarder and the link session write through it, and the link session&amp;rsquo;s warnings take their turns from its &lt;code&gt;Allow&lt;/code&gt;. &lt;code&gt;Capped&lt;/code&gt; is a background process&amp;rsquo;s log, held to its cap as it appends, with &lt;code&gt;Trim&lt;/code&gt; at its next start. &lt;code&gt;KeepVM&lt;/code&gt; is what the VM&amp;rsquo;s proxy (through &lt;code&gt;proxy.IO.KeepLogs&lt;/code&gt;) and a build run on the logs the backend writes as the VM runs (&lt;code&gt;backend.Run.Logs&lt;/code&gt;), the serial consoles&amp;rsquo; among them. It watches each log in a goroutine of its own, redacts what each one gained every second (&lt;code&gt;redact.In&lt;/code&gt;), so a reboot in place can&amp;rsquo;t leave the proxy&amp;rsquo;s password there, and skips a log that hasn&amp;rsquo;t grown. &lt;code&gt;Redact&lt;/code&gt; is Lima&amp;rsquo;s redaction at the end of a start. Each rotation copies the log&amp;rsquo;s end to its &lt;code&gt;.1&lt;/code&gt; file, redacting only what the last look didn&amp;rsquo;t reach and masking a secret cut at its end, and empties it with &lt;code&gt;f.Truncate&lt;/code&gt;, counting a log by what it holds past the hole its writer left, as Lima&amp;rsquo;s programs write at their own offset. Every log is opened through &lt;code&gt;safefile&lt;/code&gt; (&lt;code&gt;Opts.Write&lt;/code&gt;), never through a link or waiting on a FIFO. The proxy, which imports only the standard library and a few of devvm&amp;rsquo;s leaves, rotates its own logs itself (&lt;code&gt;proxy.rotating&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/safefile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every read of a file a VM can write or swap, with the standard library alone, so the proxy uses it too (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;). It refuses a file that isn&amp;rsquo;t regular with &lt;code&gt;safefile.ErrNotRegular&lt;/code&gt; and one past its cap with &lt;code&gt;safefile.ErrTooLong&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/landlock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the proxy&amp;rsquo;s child&amp;rsquo;s confinement on Linux, with the standard library alone, behind its own build tags: &lt;code&gt;Self&lt;/code&gt;, which confines every thread of the process to its folders with &lt;code&gt;no_new_privs&lt;/code&gt;, Landlock and the hand-written seccomp filter (&lt;code&gt;filter&lt;/code&gt;), checks that it holds, and returns what it got (&lt;code&gt;Result&lt;/code&gt;), which the proxy&amp;rsquo;s &lt;code&gt;confineSelf&lt;/code&gt; turns into its line in &lt;code&gt;run/proxy.confined&lt;/code&gt; (&lt;code&gt;proxy.Confinement&lt;/code&gt;) (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;). It makes each call on every thread through &lt;code&gt;syscall.AllThreadsSyscall&lt;/code&gt;, which works only without cgo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/devcontainer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a project&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt;, with no side effects: finding it, mapping it to a new VM&amp;rsquo;s plan, its refusals, and what devvm update&amp;rsquo;s second reading replaces (&lt;code&gt;Reread&lt;/code&gt;): &lt;code&gt;devcontainer.Reread&lt;/code&gt; drops the parts the file gave that it no longer calls for and adds the ones it now calls for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/jsonc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;JSON with comments (&lt;code&gt;jsonc.Strip&lt;/code&gt;), with the standard library alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the shared tools: the lock, mise on the host, the daily check, the tool images&amp;rsquo; builds and the share. &lt;code&gt;Share.Build&lt;/code&gt; builds a VM&amp;rsquo;s tool images under the making lock, which &lt;code&gt;tools.Making&lt;/code&gt; holds, and &lt;code&gt;tools.HasBuilds&lt;/code&gt; refuses a glibc-only tool, such as pi, for a musl VM. &lt;code&gt;ShareBusy&lt;/code&gt; says whether another devvm holds the share&amp;rsquo;s lock, so retention skips the tool images that day. &lt;code&gt;Share.NoVM&lt;/code&gt; lists the current tool images that no VM&amp;rsquo;s state lists, and &lt;code&gt;Versions.StaleMise&lt;/code&gt; the folders of mise&amp;rsquo;s other versions, which gc deletes. &lt;code&gt;withSDKDownloads&lt;/code&gt; in &lt;code&gt;internal/tools/dotnet.go&lt;/code&gt; adds each platform&amp;rsquo;s dotnet SDK archive to the lock (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/netpolicy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;network policy: the choice of tier, learning the hosts a VM reached, &lt;code&gt;RiskOf&lt;/code&gt;, the VM&amp;rsquo;s proxy and the self-check. &lt;code&gt;netpolicy.Policies&lt;/code&gt; lists a VM&amp;rsquo;s policies for its tier, the built-in ones and yours, and &lt;code&gt;netpolicy.PolicyWarnings&lt;/code&gt; warns of the lines that aren&amp;rsquo;t rules. &lt;code&gt;netpolicy.Proxy.Prepare&lt;/code&gt; readies a VM&amp;rsquo;s proxy at each launch, its policy warnings and the CA bundle included, &lt;code&gt;netpolicy.Proxy.PrepareRunning&lt;/code&gt; checks what could refuse a running VM&amp;rsquo;s new proxy before the old one stops, and &lt;code&gt;netpolicy.Proxy.Refusal&lt;/code&gt; runs the company proxy&amp;rsquo;s check with the check of your CAs. The event log&amp;rsquo;s readers are &lt;code&gt;netpolicy.Log.Blocks&lt;/code&gt;, which gives a quiet block no &lt;code&gt;Allow&lt;/code&gt;, &lt;code&gt;netpolicy.Log.Learned&lt;/code&gt;, with &lt;code&gt;Learned.NoProxy&lt;/code&gt; for the hosts that only transparent mode reached and &lt;code&gt;agentWord&lt;/code&gt; for a &lt;code&gt;User-Agent&lt;/code&gt;&amp;rsquo;s first word, &lt;code&gt;Log.Countable&lt;/code&gt; and &lt;code&gt;netpolicy.Log.MarkLearning&lt;/code&gt;. &lt;code&gt;netpolicy.Judge.Quiet&lt;/code&gt; keeps quiet hosts out of what devvm network lock offers, &lt;code&gt;netpolicy.Tickable&lt;/code&gt;, with its list &lt;code&gt;tickable&lt;/code&gt;, and &lt;code&gt;netpolicy.RiskOf&lt;/code&gt; mark the hosts it offers, and &lt;code&gt;quietMark&lt;/code&gt; and &lt;code&gt;RuleFile.Quiet&lt;/code&gt; show the quiet lines in devvm network (&lt;a href="https://next.devvm.dev/docs/internals/network/"&gt;network policy&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/secrets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;tokens on the host and the VM&amp;rsquo;s bindings to them, and your own secrets (&lt;code&gt;custom.go&lt;/code&gt;, with their checks, &lt;code&gt;Yours&lt;/code&gt; and &lt;code&gt;custom-secrets.json&lt;/code&gt;). &lt;code&gt;secrets.BoundSecret&lt;/code&gt; records in a VM&amp;rsquo;s state the definition and hosts a secret of yours was bound with, and the store&amp;rsquo;s lookup (&lt;code&gt;Store.Get&lt;/code&gt;, &lt;code&gt;secrets.Store.Get&lt;/code&gt;) checks every binding against that record. &lt;code&gt;secrets.Store.Save&lt;/code&gt; saves a secret, &lt;code&gt;secrets.ClaudeOf(store).Login&lt;/code&gt; picks the one Claude Code login devvm keeps, and &lt;code&gt;secrets.ClaudeOf(store).Sums&lt;/code&gt; gives that login&amp;rsquo;s checksums&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/trust&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your CAs in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt;, read and checked, sent to VMs, the build VMs&amp;rsquo; &lt;code&gt;Trust&lt;/code&gt; scripts and the guest environment, and each VM&amp;rsquo;s own CA and its next one (&lt;code&gt;InitCA&lt;/code&gt;, in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/ca/&lt;/code&gt;). &lt;code&gt;trust.Env&lt;/code&gt; holds the CAs&amp;rsquo; variables that a build&amp;rsquo;s scripts and every project VM start with. &lt;code&gt;trust.Read&lt;/code&gt; reads your CA folder, looking at each file with &lt;code&gt;os.Lstat&lt;/code&gt; and following no link, &lt;code&gt;trust.CAs.Host&lt;/code&gt; writes the bundle for the host&amp;rsquo;s mise on Linux, and &lt;code&gt;trust.InitCA&lt;/code&gt; readies each VM&amp;rsquo;s CA and its next one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/agents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the coding agents&amp;rsquo; registry, with the standard library alone: one &lt;code&gt;Def&lt;/code&gt; for each agent, with its shared tool, settings, logins, history, guest environment, ways to log in and &lt;code&gt;[pass-keys]&lt;/code&gt;, which every list of the agents comes from. Code about one agent names it by its constant (the structure test&amp;rsquo;s &lt;code&gt;names&lt;/code&gt;). &lt;code&gt;agents.Def&lt;/code&gt;&amp;rsquo;s &lt;code&gt;PassKeys&lt;/code&gt; says whether an agent&amp;rsquo;s keys are withheld by default, and &lt;code&gt;agents.Providers&lt;/code&gt; lists the providers whose keys the proxy puts in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;agents&amp;rsquo; login and settings files on the host: the VM&amp;rsquo;s copies with placeholders, the bindings, the values and the OAuth refresh (&lt;code&gt;File&lt;/code&gt;, with a &lt;code&gt;format&lt;/code&gt; for each kind of login), the shape of every placeholder (&lt;code&gt;Placeholder&lt;/code&gt;), &lt;code&gt;Redact&lt;/code&gt;, and &lt;code&gt;Restore&lt;/code&gt;, which puts the store&amp;rsquo;s values back for a VM&amp;rsquo;s placeholders. The package &lt;code&gt;agentlogin&lt;/code&gt; saves a captured login (&lt;code&gt;agentlogin.File.Capture&lt;/code&gt;), refreshes and reads one (&lt;code&gt;agentlogin.File.Get&lt;/code&gt;) and makes the VM&amp;rsquo;s copy (&lt;code&gt;agentlogin.File.VMCopy&lt;/code&gt;), whose &lt;code&gt;VMFile&lt;/code&gt; reports &lt;code&gt;PassBound&lt;/code&gt;, the bound providers that &lt;code&gt;[pass-keys]&lt;/code&gt; lists. &lt;code&gt;agentlogin.Pick&lt;/code&gt; tells whose login a request is by its &lt;code&gt;User-Agent&lt;/code&gt;, &lt;code&gt;agentlogin.Endpoints&lt;/code&gt; lists every format&amp;rsquo;s endpoints, &lt;code&gt;agentlogin.SetupToken&lt;/code&gt; recognises claude setup-token&amp;rsquo;s request, &lt;code&gt;agentlogin.ClaudeOAuthBindings&lt;/code&gt; makes the Claude login&amp;rsquo;s bindings, &lt;code&gt;agentlogin.OpencodeImport&lt;/code&gt; makes opencode&amp;rsquo;s import entries, and &lt;code&gt;agentlogin.PiSettings&lt;/code&gt; drops the pi settings that would undo devvm&amp;rsquo;s. The formats&amp;rsquo; field lists are &lt;code&gt;codexKeep&lt;/code&gt;, &lt;code&gt;claudeAccountKeep&lt;/code&gt; and &lt;code&gt;cursorFormat&lt;/code&gt;, &lt;code&gt;internal/agentlogin/logins.go&lt;/code&gt; holds &lt;code&gt;opencodeVM&lt;/code&gt; and &lt;code&gt;withheldEntry&lt;/code&gt;, and &lt;code&gt;internal/agentlogin/pi.go&lt;/code&gt; holds pi&amp;rsquo;s format (&lt;a href="https://next.devvm.dev/docs/internals/network/#agents-logins-and-settings"&gt;agents&amp;rsquo; logins and settings&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the proxy, as its &lt;code&gt;README.md&lt;/code&gt; describes. It runs as two processes, its broker, &lt;code&gt;devvm _proxy&lt;/code&gt; (&lt;code&gt;broker.go&lt;/code&gt;, &lt;code&gt;process.go&lt;/code&gt;), and its child, &lt;code&gt;devvm _proxy-child&lt;/code&gt; (&lt;code&gt;child.go&lt;/code&gt;), which talk over a socketpair in the broker&amp;rsquo;s protocol (&lt;code&gt;wire.go&lt;/code&gt;). The package also holds the relay of a VM&amp;rsquo;s SSH agent on &lt;code&gt;paths.Dirs.AgentRelay&lt;/code&gt; (&lt;code&gt;Config.Agent&lt;/code&gt;, &lt;code&gt;agent.go&lt;/code&gt;), which is the only socket of an agent that a VM&amp;rsquo;s backend forwards. And it holds the one form of a host that every package judges and compares hosts in (&lt;code&gt;Host&lt;/code&gt;, &lt;code&gt;NormHost&lt;/code&gt;, &lt;code&gt;HostOK&lt;/code&gt;), which the structure test holds every package to (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;). The desktop&amp;rsquo;s local proxy listens in the VM at &lt;code&gt;proxy.LocalProxyAddr&lt;/code&gt; and &lt;code&gt;proxy.LocalProxyPort&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#the-local-proxy"&gt;the local proxy&lt;/a&gt;). The package &lt;code&gt;proxy&lt;/code&gt; reads policies in &lt;code&gt;policy.go&lt;/code&gt;: &lt;code&gt;proxy.ParsePolicy&lt;/code&gt; is the one parser of every policy file, which returns each line with its number and whether it&amp;rsquo;s a rule, &lt;code&gt;proxy.ValidRule&lt;/code&gt; decides what&amp;rsquo;s a rule, &lt;code&gt;proxy.BrokenDeny&lt;/code&gt; marks a broken &lt;code&gt;!&lt;/code&gt; line, and &lt;code&gt;proxy.ReadPolicy&lt;/code&gt; reads a file through &lt;code&gt;internal/safefile&lt;/code&gt;. &lt;code&gt;readBuiltins&lt;/code&gt; keeps a built-in policy&amp;rsquo;s &lt;code&gt;quiet&lt;/code&gt; lines (&lt;code&gt;PolicyLine.Quiet&lt;/code&gt;), and &lt;code&gt;loadPolicy&lt;/code&gt; drops any other file&amp;rsquo;s. &lt;code&gt;proxy.NarrowRule&lt;/code&gt; writes a rule by method and path in its canonical form, in &lt;code&gt;proxy.Methods&lt;/code&gt;&amp;rsquo; order, and &lt;code&gt;proxy.ExactRule&lt;/code&gt; the exact rule for one host and port. &lt;code&gt;proxy.ReadAllowlist&lt;/code&gt; reads the allowlist tier&amp;rsquo;s policies, whose &lt;code&gt;Allowlist.Allows&lt;/code&gt;, &lt;code&gt;Allowlist.Denies&lt;/code&gt; and &lt;code&gt;Allowlist.Quiet&lt;/code&gt; are the proxy&amp;rsquo;s own decisions. A decision reads the rules that cover a host and port in one read (&lt;code&gt;policy.rulesFor&lt;/code&gt;, a &lt;code&gt;hostRules&lt;/code&gt;), &lt;code&gt;policy.all&lt;/code&gt; leaves the quiet rules out and &lt;code&gt;policy.quiet&lt;/code&gt; matches them. &lt;code&gt;hostRules.byRequest&lt;/code&gt; says when requests are judged one by one, by &lt;code&gt;policy.judge&lt;/code&gt;, and &lt;code&gt;hostRules.unjudgeable&lt;/code&gt; covers a request that names a method outside &lt;code&gt;proxy.Methods&lt;/code&gt;. &lt;code&gt;request.go&lt;/code&gt; judges each request in an intercepted tunnel (&lt;code&gt;server.judgeRequest&lt;/code&gt;) with the one matcher of rules and bindings, &lt;code&gt;proxy.match&lt;/code&gt;, which uses &lt;code&gt;plainPath&lt;/code&gt;, &lt;code&gt;proxy.PathOK&lt;/code&gt; and &lt;code&gt;matchPath&lt;/code&gt; for paths and patterns, &lt;code&gt;overrides&lt;/code&gt; and &lt;code&gt;overrideLike&lt;/code&gt; for the methods a request names, and &lt;code&gt;match.allows&lt;/code&gt;, &lt;code&gt;match.denies&lt;/code&gt; and &lt;code&gt;trimDots&lt;/code&gt;, and Go&amp;rsquo;s &lt;code&gt;url.ParseQuery&lt;/code&gt;, whose &lt;code&gt;ParseQuery&lt;/code&gt; reads a query differently from some servers (&lt;a href="https://next.devvm.dev/docs/internals/network/#requests-by-method-and-path"&gt;requests by method and path&lt;/a&gt;). In &lt;code&gt;proxy.go&lt;/code&gt;, &lt;code&gt;server.blocked&lt;/code&gt; marks a block&amp;rsquo;s event &lt;code&gt;Quiet&lt;/code&gt; only for the reason &lt;code&gt;notAllowed&lt;/code&gt;, &lt;code&gt;blockPage&lt;/code&gt; writes the block page, and &lt;code&gt;proxy.Public&lt;/code&gt; is the one judge of a public address. &lt;code&gt;secrets.go&lt;/code&gt; holds the bindings file (&lt;code&gt;proxy.BindingList.Encode&lt;/code&gt;), how a &lt;code&gt;secret&lt;/code&gt; binding&amp;rsquo;s value goes in (&lt;code&gt;Binding.secretValue&lt;/code&gt;) and a &lt;code&gt;login&lt;/code&gt; binding&amp;rsquo;s (&lt;code&gt;Binding.takes&lt;/code&gt;), and the refusals &lt;code&gt;githubMinting&lt;/code&gt; and &lt;code&gt;cursorMints&lt;/code&gt;. &lt;code&gt;cursor.go&lt;/code&gt; holds Cursor&amp;rsquo;s routes and refusals (&lt;code&gt;cursorRoutes&lt;/code&gt;, &lt;code&gt;cursorPersists&lt;/code&gt;, &lt;code&gt;cursorStore&lt;/code&gt;, &lt;code&gt;cursorChanges&lt;/code&gt;) and the reply scanners (&lt;code&gt;frameScanner&lt;/code&gt;, &lt;code&gt;jwtScanner&lt;/code&gt;). &lt;code&gt;upstream.go&lt;/code&gt; holds the route to a company proxy (&lt;code&gt;proxy.Upstream.WithPassword&lt;/code&gt;, &lt;code&gt;proxy.Upstream.Route&lt;/code&gt;), which a lookup&amp;rsquo;s context carries with &lt;code&gt;proxy.WithRoute&lt;/code&gt; and gives back with &lt;code&gt;proxy.RouteOf&lt;/code&gt;, and the CAs a lookup trusts (&lt;code&gt;proxy.WithRoots&lt;/code&gt;, &lt;code&gt;proxy.RootsOf&lt;/code&gt;). The config is &lt;code&gt;proxy.Config&lt;/code&gt;, and &lt;code&gt;proxy.Config.Sum&lt;/code&gt; tells devvm whether a running proxy must start again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/seatbelt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;macOS&amp;rsquo;s sandbox as devvm uses it: &lt;code&gt;sandbox-exec&lt;/code&gt;&amp;rsquo;s path (&lt;code&gt;Exec&lt;/code&gt;), a Seatbelt string and a real path in a profile (&lt;code&gt;String&lt;/code&gt;, &lt;code&gt;Path&lt;/code&gt;), the links a sandboxed lookup goes through (&lt;code&gt;Links&lt;/code&gt;), and the profile of a VM&amp;rsquo;s proxy&amp;rsquo;s child (&lt;code&gt;ChildProfile&lt;/code&gt;), which &lt;code&gt;Sandbox.ProxyChild&lt;/code&gt; gives the broker through &lt;code&gt;proxy.IO.Seatbelt&lt;/code&gt;, because the proxy imports the standard library alone. Lima&amp;rsquo;s profile for its hostagent (&lt;code&gt;lima/seatbelt.go&lt;/code&gt;) is written with the same strings and paths. How the child is confined, its report in &lt;code&gt;run/proxy.confined&lt;/code&gt; (&lt;code&gt;proxy.Confinement&lt;/code&gt;), the check that it holds (&lt;code&gt;checkConfined&lt;/code&gt;) and the hook where a platform confines the child in the process (&lt;code&gt;confineSelf&lt;/code&gt;) are &lt;code&gt;internal/proxy&lt;/code&gt;&amp;rsquo;s &lt;code&gt;confine.go&lt;/code&gt;, which every platform&amp;rsquo;s confinement shares&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/daemon&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s background processes, with the standard library alone: detached starts in a session of their own (&lt;code&gt;daemon.Detach&lt;/code&gt;), pid files checked against the process&amp;rsquo;s arguments before any signal (&lt;code&gt;daemon.Proc&lt;/code&gt;), stopping with TERM and then KILL, each sent to the process&amp;rsquo;s group (&lt;code&gt;daemon.SignalGroup&lt;/code&gt;), readiness by a status file, the lifeline, and an accept loop&amp;rsquo;s wait after an error that leaves its listener open (&lt;code&gt;AcceptRetry&lt;/code&gt;), which the port forwarder, the link session, a login&amp;rsquo;s forward, the proxy&amp;rsquo;s SSH agent relay and the desktop relay share. It&amp;rsquo;s the only place that signals a process by its pid. &lt;a href="https://next.devvm.dev/docs/internals/processes/"&gt;Processes&lt;/a&gt; has what each of those processes holds, reads, writes and is confined by&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm desktop&amp;rsquo;s relay on the host, which checks VNC&amp;rsquo;s password, then opens an ssh channel to the VM&amp;rsquo;s socket and drops the viewer&amp;rsquo;s clipboard, and the desktop&amp;rsquo;s passwords&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/backend&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Backend&lt;/code&gt; and its roles, &lt;code&gt;Caps&lt;/code&gt;, &lt;code&gt;Require&lt;/code&gt;, &lt;code&gt;Check&lt;/code&gt;, the registry and its guard (&lt;code&gt;As&lt;/code&gt;), as &lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt; describes. Below it are &lt;code&gt;backendtest/&lt;/code&gt;, the fake, &lt;code&gt;registry/&lt;/code&gt;, which holds every backend, and &lt;code&gt;lima/&lt;/code&gt;, whose &lt;code&gt;pins.go&lt;/code&gt; has QEMU&amp;rsquo;s user and mount namespace on Linux, its pins, their events and the probe, while &lt;code&gt;platform&lt;/code&gt;&amp;rsquo;s &lt;code&gt;pinrun_linux.go&lt;/code&gt; is the namespace&amp;rsquo;s side. A build&amp;rsquo;s &lt;code&gt;ImageSpec.Trust&lt;/code&gt;, a &lt;code&gt;Trust&lt;/code&gt;, holds the &lt;code&gt;Add&lt;/code&gt; and &lt;code&gt;Remove&lt;/code&gt; scripts made from &lt;code&gt;ca.sh&lt;/code&gt; and the &lt;code&gt;Env&lt;/code&gt; each script gets, and a tools build runs &lt;code&gt;ToolsSpec.Trust.Add&lt;/code&gt; alone. A backend runs &lt;code&gt;Add&lt;/code&gt; before anything downloads and &lt;code&gt;Remove&lt;/code&gt; once the scripts are done: Lima runs &lt;code&gt;Add&lt;/code&gt; right after the start and &lt;code&gt;Remove&lt;/code&gt; before the final sync, and a tools build needs no &lt;code&gt;Remove&lt;/code&gt;. &lt;code&gt;backend.NetProxy&lt;/code&gt; confines a VM to its proxy and &lt;code&gt;backend.NetDirect&lt;/code&gt; puts it on its backend&amp;rsquo;s own network, &lt;code&gt;Confinement.GuestProxy&lt;/code&gt; says whether the guest&amp;rsquo;s proxy settings name devvm&amp;rsquo;s proxy, and Lima&amp;rsquo;s clone sets the VM&amp;rsquo;s environment from &lt;code&gt;VMSpec.Env&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/images/#a-companys-ca-in-builds"&gt;a company&amp;rsquo;s CA in builds&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s own use of a VM&amp;rsquo;s ssh, on every backend. &lt;code&gt;Checked&lt;/code&gt; is the one way to a VM&amp;rsquo;s ssh (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;), and &lt;code&gt;Forwards&lt;/code&gt; is the port forwarder&amp;rsquo;s one owner, which locks, stops and starts it with its ports from &lt;code&gt;vm.json&lt;/code&gt;. The package also holds a login&amp;rsquo;s forward of this machine&amp;rsquo;s loopback ports, in devvm&amp;rsquo;s own process (&lt;code&gt;ForwardLoopback&lt;/code&gt;), the links&amp;rsquo; sessions, and each VM&amp;rsquo;s one record of its host keys for each start (&lt;code&gt;PinHostKeys&lt;/code&gt;, in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/known_hosts&lt;/code&gt;), which every ssh of devvm&amp;rsquo;s checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the only package that prints: &lt;code&gt;ui.UI&lt;/code&gt;, with messages, prompts, the status line, the run log and the cleanups, and &lt;code&gt;ui.Main&lt;/code&gt;, which handles signals. It has no package state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/msg&lt;/code&gt;, &lt;code&gt;locales&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;messages: &lt;code&gt;en.toml&lt;/code&gt;, the generated functions, the doc links (&lt;code&gt;docs.go&lt;/code&gt;), the generator (&lt;code&gt;gen/&lt;/code&gt;), &lt;code&gt;Reporter&lt;/code&gt; and &lt;code&gt;Question&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#messages"&gt;messages&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s ports section, with the forwards asked for and the host ports chosen, and the one allocator of host ports, under the claims lock, which puts VMs&amp;rsquo; ssh only on the ports browsers refuse (&lt;code&gt;SSHPorts&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/paths&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every folder and file devvm uses, a VM&amp;rsquo;s in its folder (&lt;code&gt;Dirs.VM&lt;/code&gt;, and a project VM&amp;rsquo;s folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, from &lt;code&gt;Dirs.VMDir&lt;/code&gt;), and host paths resolved and compared (&lt;code&gt;Physical&lt;/code&gt;, &lt;code&gt;PhysicalParent&lt;/code&gt;, &lt;code&gt;Within&lt;/code&gt;, &lt;code&gt;Below&lt;/code&gt;, &lt;code&gt;In&lt;/code&gt; and &lt;code&gt;Under&lt;/code&gt;, where &lt;code&gt;resolve.go&lt;/code&gt; says which one is for what). Among the locks, &lt;code&gt;paths.Dirs.GitLock&lt;/code&gt; is the host&amp;rsquo;s lock of &lt;code&gt;.git&lt;/code&gt; protection, taken before any VM&amp;rsquo;s own, and &lt;code&gt;Dirs.MakingLock&lt;/code&gt; is the tool images&amp;rsquo; making lock&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s state, &lt;code&gt;vm.json&lt;/code&gt;, with its core fields and one section for each package, which changes only in &lt;code&gt;VM.Update&lt;/code&gt; under the VM&amp;rsquo;s lock. It also owns the layout version (&lt;code&gt;CheckLayout&lt;/code&gt; and &lt;code&gt;migrations&lt;/code&gt;, while &lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; lists every file), every file written whole (&lt;code&gt;WriteFile&lt;/code&gt;, &lt;code&gt;WriteFileMode&lt;/code&gt;) and private folders (&lt;code&gt;PrivateDir&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/settings&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the defaults (&lt;code&gt;Defaults&lt;/code&gt;, &lt;code&gt;Read&lt;/code&gt;, &lt;code&gt;Save&lt;/code&gt;), with your &lt;code&gt;config.toml&lt;/code&gt;, read strictly, over devvm&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt;, and each value&amp;rsquo;s check (&lt;code&gt;ParsePorts&lt;/code&gt;, &lt;code&gt;ParseCPUs&lt;/code&gt;, &lt;code&gt;ParseGiB&lt;/code&gt; and the retention settings). &lt;code&gt;settings.CompanyProxy.Upstream&lt;/code&gt; checks the company proxy&amp;rsquo;s settings and its password, &lt;code&gt;settings.CompanyProxy.Route&lt;/code&gt; is the route devvm&amp;rsquo;s own clients take through it, and &lt;code&gt;settings.PassKeys&lt;/code&gt; is &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/platform&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the code for each system, behind build tags, such as &lt;code&gt;platform.SameFolder&lt;/code&gt;, which tells whether a project folder whose device number changed after a restart is still the VM&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/internals/overview/#an-existing-vm"&gt;an existing VM&lt;/a&gt;), and &lt;code&gt;platform.FoldsCase&lt;/code&gt;, whether the system&amp;rsquo;s file systems fold case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/ubuntu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;finding Ubuntu&amp;rsquo;s cloud image and verifying it, and its download (&lt;code&gt;ubuntu.Download&lt;/code&gt;, a &lt;code&gt;fetch.Resumable&lt;/code&gt;), which the backend calls, the release pocket&amp;rsquo;s date (&lt;code&gt;ubuntu.Released&lt;/code&gt;), and versions ordered as &lt;code&gt;dpkg --compare-versions&lt;/code&gt; orders them (&lt;code&gt;ubuntu.CompareVersions&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/testbuild&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether this is a test build, which ldflags set: only a test build reads the test overrides (&lt;code&gt;cli&lt;/code&gt;&amp;rsquo;s &lt;code&gt;readOverrides&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;assets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the files devvm ships, embedded as &lt;code&gt;assets.FS&lt;/code&gt;, which &lt;code&gt;cli&lt;/code&gt; passes to constructors. &lt;code&gt;base.yaml&lt;/code&gt; is base&amp;rsquo;s Lima template, and &lt;code&gt;prelude.sh&lt;/code&gt;, with &lt;code&gt;$devvm_arch&lt;/code&gt;, &lt;code&gt;$devvm_libc&lt;/code&gt; and &lt;code&gt;devvm_sha&lt;/code&gt;, comes first in each build script run with bash, the user&amp;rsquo;s layers included, and is put in place of a script&amp;rsquo;s &lt;code&gt;#!&lt;/code&gt; line, as one &lt;code&gt;eval&lt;/code&gt; line quoted by &lt;code&gt;shell.QuoteLine&lt;/code&gt;, by &lt;code&gt;image.WithPrelude&lt;/code&gt;, which &lt;code&gt;image.OwnScript&lt;/code&gt; calls for devvm&amp;rsquo;s own. &lt;code&gt;layers/&lt;/code&gt; holds base&amp;rsquo;s scripts, its policy and Ubuntu&amp;rsquo;s signing keys, and the built-in layers, &lt;code&gt;desktop&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;nix&lt;/code&gt;, each with its policy. &lt;code&gt;network/&lt;/code&gt; holds the network tiers&amp;rsquo; own policies, &lt;code&gt;features/&lt;/code&gt; base&amp;rsquo;s optional features, and &lt;code&gt;shared-tools/&lt;/code&gt; its &lt;code&gt;mise.toml&lt;/code&gt;, &lt;code&gt;build.sh&lt;/code&gt; and &lt;code&gt;*.policy&lt;/code&gt; files. &lt;code&gt;guest/&lt;/code&gt; holds the scripts in the VM that every launch sends, and the port forwarder&amp;rsquo;s &lt;code&gt;ports.sh&lt;/code&gt;, and &lt;code&gt;oci/&lt;/code&gt; is &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion, as its &lt;code&gt;README.md&lt;/code&gt; describes. So the How it works pages&amp;rsquo; scripts are, in the repo, &lt;code&gt;assets/base.yaml&lt;/code&gt;, &lt;code&gt;assets/prelude.sh&lt;/code&gt;, &lt;code&gt;assets/layers/apt.sh&lt;/code&gt;, whose first step is &lt;code&gt;assets/layers/apt.sh begin&lt;/code&gt;, &lt;code&gt;assets/layers/base.sh&lt;/code&gt;, &lt;code&gt;assets/layers/&amp;lt;name&amp;gt;.sh&lt;/code&gt; for each built-in layer, which are &lt;code&gt;assets/layers/desktop.sh&lt;/code&gt;, &lt;code&gt;assets/layers/docker.sh&lt;/code&gt; and &lt;code&gt;assets/layers/nix.sh&lt;/code&gt;, with &lt;code&gt;assets/layers/desktop.policy&lt;/code&gt;, &lt;code&gt;assets/layers/docker.policy&lt;/code&gt; and &lt;code&gt;assets/layers/nix.policy&lt;/code&gt;, Ubuntu&amp;rsquo;s keys, &lt;code&gt;assets/layers/ubuntu-cloud.gpg&lt;/code&gt; and &lt;code&gt;assets/layers/ubuntu-archive.gpg&lt;/code&gt;, base&amp;rsquo;s features, &lt;code&gt;assets/features/&amp;lt;name&amp;gt;.sh&lt;/code&gt;, the shared tools&amp;rsquo; &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; and &lt;code&gt;assets/shared-tools/build.sh&lt;/code&gt;, the conversion&amp;rsquo;s &lt;code&gt;assets/oci/build.sh&lt;/code&gt; and &lt;code&gt;assets/oci/bootify.sh&lt;/code&gt;, and the CA script, &lt;code&gt;assets/guest/ca.sh&lt;/code&gt;, which &lt;code&gt;assets/guest/ca.sh DIR&lt;/code&gt; runs to install the CAs in a VM. The built-in policies are paths in &lt;code&gt;assets/&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/images/"&gt;images&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/structure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="#the-structure-test"&gt;structure test&lt;/a&gt;, for tests only, and &lt;code&gt;owners_doc_test.go&lt;/code&gt;, which writes &lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/stubtest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the test &lt;a href="https://next.devvm.dev/docs/contributing/tests/#stubs"&gt;stubs&lt;/a&gt;, for tests only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/leaktest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#goroutine-leaks"&gt;goroutine leak checks&lt;/a&gt;, &lt;code&gt;Main&lt;/code&gt; for a package&amp;rsquo;s &lt;code&gt;TestMain&lt;/code&gt; and &lt;code&gt;Check&lt;/code&gt; for one test, for tests only, and the standard library only, so the proxy&amp;rsquo;s tests use it too&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/memnet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the network in memory for &lt;a href="https://next.devvm.dev/docs/contributing/tests/#time-and-lifecycles"&gt;tests in a synctest bubble&lt;/a&gt;: connections (&lt;code&gt;Pipe&lt;/code&gt;) that close their writing side alone, hold a buffer&amp;rsquo;s worth and have deadlines, and listeners by address (&lt;code&gt;Network&lt;/code&gt;), for tests only, and the standard library only, so the proxy&amp;rsquo;s tests use it too&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;testdata&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the CLI tests (&lt;code&gt;script/*.txtar&lt;/code&gt;), the &lt;a href="https://next.devvm.dev/docs/contributing/testing/#golden-fixtures"&gt;golden fixtures&lt;/a&gt; (&lt;code&gt;golden/&amp;lt;os&amp;gt;/&lt;/code&gt;), a lock to test with (&lt;code&gt;mise.lock&lt;/code&gt;), each package&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/contributing/tests/#coverage"&gt;coverage baseline&lt;/a&gt; on each system (&lt;code&gt;coverage/&amp;lt;os&amp;gt;.txt&lt;/code&gt;), each release&amp;rsquo;s &lt;a href="#released-state"&gt;state fixture&lt;/a&gt; (&lt;code&gt;v&amp;lt;release&amp;gt;/&amp;lt;os&amp;gt;/&lt;/code&gt;), and the lines that break each forbidigo rule (&lt;code&gt;lint/&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/contributing/#go-lint-rules"&gt;Go lint rules&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt; on real VMs, in Go with the tag &lt;code&gt;e2e&lt;/code&gt; and a file for each section. &lt;code&gt;TestE2E&lt;/code&gt; is the run, &lt;code&gt;sandbox_test.go&lt;/code&gt; has the sandbox, its slot&amp;rsquo;s paths and lock and &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, and &lt;code&gt;slots_test.go&lt;/code&gt; runs the slots. The lock file holds the shared tools&amp;rsquo; versions that every section but &lt;code&gt;tools&lt;/code&gt; uses (&lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;scripts&lt;/code&gt;, &lt;code&gt;packaging&lt;/code&gt;, &lt;code&gt;.goreleaser.yaml&lt;/code&gt;, &lt;code&gt;VERSION&lt;/code&gt;, &lt;code&gt;CHANGELOG.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;bump.sh&lt;/code&gt; updates the pins. &lt;code&gt;release.sh&lt;/code&gt; runs the signed tag&amp;rsquo;s checks, then GoReleaser in its pinned container, then minisign, and CI&amp;rsquo;s build and signature (&lt;code&gt;--ci&lt;/code&gt;, &lt;code&gt;--ci-sign&lt;/code&gt;), &lt;code&gt;repro-check.sh&lt;/code&gt; builds a release twice and compares the bytes, and &lt;code&gt;publish.sh&lt;/code&gt; checks the tag and pushes it for CI and the co-signer, signs their draft with the old key while the bridge lasts (&lt;code&gt;--sign-legacy&lt;/code&gt;), or makes the release itself (&lt;code&gt;--local&lt;/code&gt;), with its checks, &lt;code&gt;release.sh&lt;/code&gt;, one yes, then the pushes, &lt;code&gt;gh release&lt;/code&gt; and the tap. The &lt;code&gt;test&lt;/code&gt; and &lt;code&gt;coverage&lt;/code&gt; tasks run &lt;code&gt;test.sh&lt;/code&gt;, which runs &lt;code&gt;coverage.sh&lt;/code&gt; to check each package&amp;rsquo;s coverage against its baseline. &lt;code&gt;packaging/&lt;/code&gt; holds the Homebrew formula and &lt;code&gt;key.go&lt;/code&gt;, which embeds its folder, so devvm upgrade&amp;rsquo;s release keys are those in &lt;code&gt;keys/&lt;/code&gt; (&lt;code&gt;release-ci.pub&lt;/code&gt;, &lt;code&gt;release-cosign.pub&lt;/code&gt; and &lt;code&gt;release-recovery.pub&lt;/code&gt;) and its old release key is &lt;code&gt;minisign.pub&lt;/code&gt;&amp;rsquo;s, and a build without a file has no such key (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#release-keys"&gt;release keys&lt;/a&gt;). Only the scripts read &lt;code&gt;VERSION&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;releasing&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;install.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;curl | bash&lt;/code&gt;: it installs the host&amp;rsquo;s archive, with the binary, the README, the changelog and the license, checked, into &lt;code&gt;~/.local/lib/devvm/&amp;lt;version&amp;gt;&lt;/code&gt;, then runs doctor&amp;rsquo;s fixes, asking first. Tests source it (&lt;code&gt;DEVVM_INSTALL_TEST&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-hextra-search-id="the-checks-on-owners"&gt;The checks on owners&lt;span class="hx:absolute hx:-mt-20" id="the-checks-on-owners"&gt;&lt;/span&gt;
&lt;a href="#the-checks-on-owners" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;An owner gets a check only when a second copy would be a bug or a security hole, and only when the check is exact, so that it never fails on code that&amp;rsquo;s right. Each check&amp;rsquo;s failure names the owner. The table is written from &lt;code&gt;ownerDocs&lt;/code&gt; in &lt;code&gt;internal/structure/owners_doc_test.go&lt;/code&gt;, which &lt;code&gt;TestOwnersDoc&lt;/code&gt; checks it against and &lt;code&gt;TestOwnersAgree&lt;/code&gt; checks against the structure test&amp;rsquo;s own tables, so a change to a check changes its row there, and &lt;code&gt;go test ./internal/structure -run TestOwnersDoc -update&lt;/code&gt; writes the table again:&lt;/p&gt;
&lt;!-- The table is generated from ownerDocs in internal/structure/owners_doc_test.go: go test ./internal/structure -run TestOwnersDoc -update --&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Owner&lt;/th&gt;
&lt;th&gt;Allowed elsewhere&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;testbuild.On&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/cli&lt;/code&gt;, whose &lt;code&gt;readOverrides&lt;/code&gt; is the only code that asks whether this is a test build&lt;/td&gt;
&lt;td&gt;nowhere: other packages take the overrides as fields&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.FindProcess&lt;/code&gt;, &lt;code&gt;syscall.Kill&lt;/code&gt;, &lt;code&gt;unix.Kill&lt;/code&gt; and &lt;code&gt;os.Process&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Kill&lt;/code&gt; and &lt;code&gt;Signal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/daemon&lt;/code&gt;, which signals a background process only while its pid file and its arguments say it&amp;rsquo;s still that process (&lt;code&gt;Proc&lt;/code&gt;), or through the process it started (&lt;code&gt;Handle&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/platform&lt;/code&gt;; tests, which signal the children they started; and a child that hasn&amp;rsquo;t been waited for yet, whose pid is still its own, with a &lt;code&gt;nolint&lt;/code&gt; saying so&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;unicode.IsGraphic&lt;/code&gt;, &lt;code&gt;IsPrint&lt;/code&gt;, &lt;code&gt;IsControl&lt;/code&gt; and &lt;code&gt;Bidi_Control&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;msg.Safe&lt;/code&gt; in &lt;code&gt;internal/msg/safe.go&lt;/code&gt;, the one rule for which characters reach the terminal, which &lt;code&gt;msg.Printable&lt;/code&gt;, &lt;code&gt;msg.OneLine&lt;/code&gt;, the UI&amp;rsquo;s renderers and devvm agent save&amp;rsquo;s diff follow, so a second rule can&amp;rsquo;t let through what this one refuses (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#colors"&gt;Colors&lt;/a&gt; says what it refuses)&lt;/td&gt;
&lt;td&gt;a check that isn&amp;rsquo;t about the terminal, such as a path one line long, with a &lt;code&gt;//nolint:forbidigo&lt;/code&gt; saying so&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, HTTP clients&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/fetch&lt;/code&gt;, whose &lt;code&gt;NewClient&lt;/code&gt; sets each client&amp;rsquo;s timeout and redirect policy (&lt;code&gt;HTTPSOnly&lt;/code&gt; or &lt;code&gt;SameScheme&lt;/code&gt;), and whose &lt;code&gt;Retry&lt;/code&gt;, &lt;code&gt;Transient&lt;/code&gt;, &lt;code&gt;ReadCapped&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt;, &lt;code&gt;Resolve&lt;/code&gt; and &lt;code&gt;Download&lt;/code&gt; try again after the failures that may pass, cap what a body or a download may hold, follow a HEAD&amp;rsquo;s redirects to where they end and check a download&amp;rsquo;s SHA-256 before anything uses it. &lt;code&gt;fetch.Client&lt;/code&gt; is its own type, so a client that &lt;code&gt;NewClient&lt;/code&gt; didn&amp;rsquo;t make, such as &lt;code&gt;&amp;amp;fetch.Client{}&lt;/code&gt;, fails every request, and a caller changes a client&amp;rsquo;s transport through its &lt;code&gt;Transport&lt;/code&gt; method&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;, which is the standard library only, and tests, which make their own servers&amp;rsquo; clients&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;x509&lt;/code&gt;&amp;rsquo;s &lt;code&gt;UnknownAuthorityError&lt;/code&gt;, &lt;code&gt;HostnameError&lt;/code&gt; and &lt;code&gt;CertificateInvalidError&lt;/code&gt; and &lt;code&gt;tls.CertificateVerificationError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fetch.Untrusted&lt;/code&gt;, &lt;code&gt;fetch.BadCertificate&lt;/code&gt; and &lt;code&gt;fetch.Unverified&lt;/code&gt; in &lt;code&gt;internal/fetch/fetch.go&lt;/code&gt;, beside &lt;code&gt;fetch.Gone&lt;/code&gt;: a server&amp;rsquo;s certificate that no CA this machine trusts signed, which the user&amp;rsquo;s CA mends, one a trusted CA signed that&amp;rsquo;s for another host, out of date or not valid yet, which no CA mends, and any failure to verify one, with its reason. &lt;code&gt;Transient&lt;/code&gt; asks &lt;code&gt;Unverified&lt;/code&gt;, so none is tried again. Ubuntu&amp;rsquo;s lookups and the cloud image&amp;rsquo;s download ask all three, so each names the same cause, and host mise&amp;rsquo;s asks &lt;code&gt;Untrusted&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;tests, which make those errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;netip.Addr&lt;/code&gt;&amp;rsquo;s &lt;code&gt;IsPrivate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;proxy.Public&lt;/code&gt; in &lt;code&gt;internal/proxy/proxy.go&lt;/code&gt;, the one judge of whether an address is on the internet: netip&amp;rsquo;s classes, the table of the other ranges that aren&amp;rsquo;t (&lt;code&gt;notPublic&lt;/code&gt;), and the IPv4 address in a NAT64 or 6to4 address. The proxy&amp;rsquo;s floor, &lt;code&gt;devvm network lock&lt;/code&gt;, a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s partial-clone remotes and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registries all ask it, so a range added to it holds for each&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;redact.Secret&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Reveal&lt;/code&gt;; the structure test, a struct that embeds &lt;code&gt;redact.Secret&lt;/code&gt; and an interface that declares &lt;code&gt;Reveal() string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;redact.Secret&lt;/code&gt; in &lt;code&gt;internal/redact/secret.go&lt;/code&gt;, the type of the values that let whoever holds them act as the user or a VM, but for those &lt;a href="#secrets-in-the-code"&gt;Secrets in the code&lt;/a&gt; names: a VM&amp;rsquo;s proxy password, a secret&amp;rsquo;s value, a login&amp;rsquo;s keys and tokens once they leave its file, and the company proxy&amp;rsquo;s password and its &lt;code&gt;Proxy-Authorization&lt;/code&gt;. Every way of printing one shows &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; or, in an unexported field, an address, and encoding one as JSON or text is an error, never a stand-in, so a file that holds the real value writes it through its own wire type, and a value can&amp;rsquo;t be lost by going somewhere it isn&amp;rsquo;t meant to&lt;/td&gt;
&lt;td&gt;where the value is used, each call to &lt;code&gt;Reveal&lt;/code&gt; with a &lt;code&gt;//nolint:forbidigo&lt;/code&gt; that says why: the proxy&amp;rsquo;s password check, its config file, the headers it puts values in, the company proxy&amp;rsquo;s credentials, the VM&amp;rsquo;s CA key as it signs and the broker&amp;rsquo;s frames to its child; the store&amp;rsquo;s file and Keychain; the VM&amp;rsquo;s proxy URL and its key in &lt;code&gt;vm.json&lt;/code&gt;; a login&amp;rsquo;s file, its refresh and its claims; and tests. No struct embeds &lt;code&gt;redact.Secret&lt;/code&gt; and no interface declares &lt;code&gt;Reveal() string&lt;/code&gt; outside &lt;code&gt;internal/redact&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.WriteFile&lt;/code&gt;, &lt;code&gt;os.Create&lt;/code&gt; and &lt;code&gt;os.O_TRUNC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;, whose &lt;code&gt;WriteFile&lt;/code&gt; and &lt;code&gt;WriteFileMode&lt;/code&gt; write a file whole through a temporary file in its folder, renamed over it, so a reader never sees half of it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;, which imports only the standard library and has its own writer, &lt;code&gt;writeAtomic&lt;/code&gt;; &lt;code&gt;internal/msg/gen&lt;/code&gt;, which imports no devvm package; &lt;code&gt;internal/stubtest&lt;/code&gt;; tests; and, with a &lt;code&gt;nolint&lt;/code&gt; saying why, a file written another way: a log that a process writes as it runs, a download that streams into its file, and &lt;code&gt;internal/daemon&lt;/code&gt;&amp;rsquo;s pid and status files, each written in one write that a reader takes as missing until its line ends&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.Open&lt;/code&gt;, &lt;code&gt;os.OpenFile&lt;/code&gt;, &lt;code&gt;os.ReadFile&lt;/code&gt;, &lt;code&gt;os.OpenRoot&lt;/code&gt;, &lt;code&gt;os.OpenInRoot&lt;/code&gt;, &lt;code&gt;os.DirFS&lt;/code&gt; and &lt;code&gt;os.Root&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Open&lt;/code&gt;, &lt;code&gt;OpenFile&lt;/code&gt;, &lt;code&gt;ReadFile&lt;/code&gt; and &lt;code&gt;FS&lt;/code&gt;, in the code that reads files a VM can write or swap: &lt;code&gt;internal/gitprotect&lt;/code&gt;, &lt;code&gt;internal/agentlogin&lt;/code&gt;, &lt;code&gt;internal/vm&lt;/code&gt;&amp;rsquo;s &lt;code&gt;devcontainer.go&lt;/code&gt;, &lt;code&gt;detect.go&lt;/code&gt;, &lt;code&gt;paste.go&lt;/code&gt; and &lt;code&gt;agentsave*.go&lt;/code&gt;, &lt;code&gt;internal/netpolicy/rules.go&lt;/code&gt;, &lt;code&gt;internal/vmlog&lt;/code&gt;, and &lt;code&gt;internal/proxy&lt;/code&gt;&amp;rsquo;s &lt;code&gt;config.go&lt;/code&gt;, &lt;code&gt;policy.go&lt;/code&gt;, &lt;code&gt;rotate.go&lt;/code&gt; and &lt;code&gt;nixcache.go&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/safefile&lt;/code&gt;, which imports only the standard library, so the proxy reads with it too. Its &lt;code&gt;Read&lt;/code&gt; and &lt;code&gt;Open&lt;/code&gt; open a file without blocking and, unless the caller passes &lt;code&gt;Follow&lt;/code&gt;, without following a symbolic link at the path&amp;rsquo;s end. They then check the file they opened, not its name, so a FIFO, a device or a folder is refused with &lt;code&gt;ErrNotRegular&lt;/code&gt;, a file past its cap with &lt;code&gt;ErrTooLong&lt;/code&gt;, and, with &lt;code&gt;OneLink&lt;/code&gt;, a file with another hard link with &lt;code&gt;ErrLinked&lt;/code&gt;. A FIFO that the VM swaps in after a check can&amp;rsquo;t hold devvm, and a link to &lt;code&gt;/dev/zero&lt;/code&gt; can&amp;rsquo;t flood it. &lt;code&gt;Checked&lt;/code&gt; checks a file its caller opened another way in the same way, such as devvm paste&amp;rsquo;s copied file, which &lt;code&gt;platform.OpenNoLinks&lt;/code&gt; opens following no link but the system&amp;rsquo;s, through &lt;code&gt;openat&lt;/code&gt;, which the standard library doesn&amp;rsquo;t have on macOS. &lt;code&gt;OpenRoot&lt;/code&gt; opens beneath a folder through &lt;code&gt;os.Root&lt;/code&gt;, never through a link out of it, and its &lt;code&gt;FS&lt;/code&gt; lists and stats what&amp;rsquo;s there but opens only regular files and, never through a link at the name&amp;rsquo;s end, folders to list. &lt;code&gt;Walk&lt;/code&gt; walks a folder that a VM can fill, reading each folder in batches and stopping at its bound on the entries it reads, as &lt;code&gt;devvm agent import&lt;/code&gt; walks an agent&amp;rsquo;s folder&lt;/td&gt;
&lt;td&gt;every other file, which is devvm&amp;rsquo;s own or the user&amp;rsquo;s; tests, which make their own fixtures; and, with a &lt;code&gt;nolint&lt;/code&gt; saying why, what opens a file to write it or a folder to lock it, such as the proxy&amp;rsquo;s logs and the Nix cache&amp;rsquo;s lock, each opened never through a link or waiting on a FIFO and checked once open&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.Chmod&lt;/code&gt;, &lt;code&gt;os.Chtimes&lt;/code&gt;, &lt;code&gt;os.Chown&lt;/code&gt;, &lt;code&gt;os.Lchown&lt;/code&gt; and &lt;code&gt;os.Truncate&lt;/code&gt;, in the code that changes files a VM can write or swap: &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;internal/vmlog&lt;/code&gt; and &lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the file&amp;rsquo;s own descriptor, from &lt;code&gt;internal/safefile&lt;/code&gt;, an &lt;code&gt;os.Root&lt;/code&gt; or the proxy&amp;rsquo;s &lt;code&gt;OpenLog&lt;/code&gt;: &lt;code&gt;os.File&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Chmod&lt;/code&gt;, &lt;code&gt;Chown&lt;/code&gt; and &lt;code&gt;Truncate&lt;/code&gt;, an &lt;code&gt;os.Root&lt;/code&gt;&amp;rsquo;s methods, and the proxy&amp;rsquo;s &lt;code&gt;touchFile&lt;/code&gt; (&lt;code&gt;futimes&lt;/code&gt;, or &lt;code&gt;utimensat&lt;/code&gt; with no path), because a VM can swap a name for a link between the open and the change, which would then reach a file of yours&lt;/td&gt;
&lt;td&gt;every other package, whose files are devvm&amp;rsquo;s own or the user&amp;rsquo;s; tests, which make their own fixtures; and, with a &lt;code&gt;nolint&lt;/code&gt; saying why, a unix socket devvm has just made in its own folder (the proxy&amp;rsquo;s SSH agent relay and the link session&amp;rsquo;s sockets), whose mode only its path can set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.Setenv&lt;/code&gt;, &lt;code&gt;os.Unsetenv&lt;/code&gt;, &lt;code&gt;os.Clearenv&lt;/code&gt; and &lt;code&gt;syscall&lt;/code&gt;&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;each command&amp;rsquo;s own environment, its &lt;code&gt;exec.Cmd&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Env&lt;/code&gt;, because every command and background process devvm starts inherits devvm&amp;rsquo;s. A VM&amp;rsquo;s SSH agent is one: the finder&amp;rsquo;s &lt;code&gt;target&lt;/code&gt; carries its socket, its proxy&amp;rsquo;s relay (&lt;code&gt;netpolicy.Proxy.Prepare&lt;/code&gt;), which goes to the backend in &lt;code&gt;backend.ExecOpts.Agent&lt;/code&gt;, &lt;code&gt;backend.ShellOpts.Agent&lt;/code&gt; and &lt;code&gt;Confinement.AgentSocket&lt;/code&gt;, and Lima sets &lt;code&gt;SSH_AUTH_SOCK&lt;/code&gt; on that VM&amp;rsquo;s &lt;code&gt;limactl&lt;/code&gt; commands alone, so a run that reaches several VMs never gives one another&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;&lt;code&gt;daemon.Ready&lt;/code&gt; in &lt;code&gt;internal/daemon/status.go&lt;/code&gt;, which takes the status file&amp;rsquo;s name out of a background process&amp;rsquo;s own environment; &lt;code&gt;stubtest.NoGitRepo&lt;/code&gt;, which takes git&amp;rsquo;s variables that pick a repo out of a test&amp;rsquo;s environment until the test ends; and tests, which use &lt;code&gt;t.Setenv&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, host commands&lt;/td&gt;
&lt;td&gt;the runners: the UI&amp;rsquo;s &lt;code&gt;LoggedCmd&lt;/code&gt;, which a package takes as a field and which runs a command into the run log, a backend&amp;rsquo;s &lt;code&gt;Runner&lt;/code&gt;, and &lt;code&gt;internal/hostgit&lt;/code&gt;. A host command that one of them doesn&amp;rsquo;t run is made only in the files &lt;code&gt;execSites&lt;/code&gt; lists: those that make the command a runner then runs, such as Lima&amp;rsquo;s &lt;code&gt;limactl&lt;/code&gt; and mise&amp;rsquo;s, and those whose command can&amp;rsquo;t go into the run log, because it streams for as long as a link, the port forwarder or the desktop&amp;rsquo;s relay lasts, asks on the terminal, outlives the run, or carries a secret&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, a backend&amp;rsquo;s other interfaces&lt;/td&gt;
&lt;td&gt;&lt;code&gt;backend.As&lt;/code&gt; in &lt;code&gt;internal/backend/guard.go&lt;/code&gt;, because the registry&amp;rsquo;s backends are behind its guard, whose type has only &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s methods, so a type assertion to &lt;code&gt;backend.Forgetter&lt;/code&gt; or &lt;code&gt;*lima.Lima&lt;/code&gt; on one is always false&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, git&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/hostgit&lt;/code&gt;, which runs git without the repo&amp;rsquo;s fsmonitor, hooks, filters or signing programs, over ssh only, without the environment&amp;rsquo;s &lt;code&gt;GIT_*&lt;/code&gt; variables, prompts, replace refs or grafts. It&amp;rsquo;s also the only package whose string literals may be &lt;code&gt;&amp;quot;push&amp;quot;&lt;/code&gt;, whole (&lt;code&gt;names&lt;/code&gt;), and none is: a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s copy goes through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; (&lt;code&gt;internal/vm/cloneseed.go&lt;/code&gt;), never git&amp;rsquo;s transport, whose receive-pack refuses shallow and SHA-256 repos. Nor may any other package&amp;rsquo;s be &lt;code&gt;&amp;quot;diff-files&amp;quot;&lt;/code&gt;, which enters each submodule, where that repo&amp;rsquo;s own config can name a filter: &lt;code&gt;hostgit.DiffFiles&lt;/code&gt; doesn&amp;rsquo;t. In tests, which run plain git to make their repos, it&amp;rsquo;s &lt;code&gt;internal/stubtest&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Git&lt;/code&gt;, which leaves out git&amp;rsquo;s variables that pick a repo, its files or its config (&lt;code&gt;GitEnv&lt;/code&gt;), so a git that runs the tests, such as a hook&amp;rsquo;s or &lt;code&gt;git rebase --exec&lt;/code&gt;&amp;rsquo;s, never sends a test&amp;rsquo;s git to the checkout itself&lt;/td&gt;
&lt;td&gt;the files &lt;code&gt;commandsFree&lt;/code&gt; lists for git, which may run no other guarded command: the co-signer&amp;rsquo;s &lt;code&gt;internal/cosign/build.go&lt;/code&gt;, a program of its own that imports none of devvm&amp;rsquo;s packages but &lt;code&gt;internal/minisign&lt;/code&gt;, whose git fetches a release&amp;rsquo;s tag over HTTPS into repositories it makes, with no config but its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.UserHomeDir&lt;/code&gt;, and the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;paths.FromEnv&lt;/code&gt; in &lt;code&gt;internal/paths/dirs.go&lt;/code&gt;, which reads &lt;code&gt;HOME&lt;/code&gt; once into &lt;code&gt;paths.Dirs.Home&lt;/code&gt;, so a test or an e2e run that sets its own &lt;code&gt;HOME&lt;/code&gt; moves every path devvm takes from it&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;DEVVM_&lt;/code&gt; variables&lt;/td&gt;
&lt;td&gt;&lt;code&gt;readOverrides&lt;/code&gt; in &lt;code&gt;internal/cli/overrides.go&lt;/code&gt;, which reads a test build&amp;rsquo;s stand-ins, while a release reads none&lt;/td&gt;
&lt;td&gt;the settings in &lt;code&gt;envSettings&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, signatures&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;, whose &lt;code&gt;PublicKey.Check&lt;/code&gt; checks a minisign signature and its trusted comment, exactly, and whose &lt;code&gt;Keys.Check&lt;/code&gt; checks a manifest, such as a release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt;, against any two of a kind&amp;rsquo;s three keys, by role, each signer counted once. A call of &lt;code&gt;ed25519&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Verify&lt;/code&gt; or &lt;code&gt;VerifyWithOptions&lt;/code&gt;, &lt;code&gt;rsa&lt;/code&gt;&amp;rsquo;s &lt;code&gt;VerifyPKCS1v15&lt;/code&gt; or &lt;code&gt;VerifyPSS&lt;/code&gt;, or &lt;code&gt;ecdsa&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Verify&lt;/code&gt; or &lt;code&gt;VerifyASN1&lt;/code&gt;, an import of one of those packages with a dot, a call of a method named &lt;code&gt;CheckSignature&lt;/code&gt;, &lt;code&gt;CheckSignatureFrom&lt;/code&gt; or &lt;code&gt;CheckCRLSignature&lt;/code&gt;, as &lt;code&gt;crypto/x509&lt;/code&gt;&amp;rsquo;s are, and an import of &lt;code&gt;golang.org/x/crypto/blake2b&lt;/code&gt;, fail, so devvm&amp;rsquo;s own signatures are checked in one place, with the key&amp;rsquo;s role and kind&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign/minisigntest&lt;/code&gt;, which signs for tests; the files in &lt;code&gt;signatureFree&lt;/code&gt;, which check other projects&amp;rsquo; formats, Ubuntu&amp;rsquo;s OpenPGP signatures (&lt;code&gt;internal/ubuntu/pgp.go&lt;/code&gt;), cache.nixos.org&amp;rsquo;s (&lt;code&gt;internal/proxy/nixcache.go&lt;/code&gt;) and git&amp;rsquo;s SSH signatures on release tags, which the co-signer checks against its pinned signers (&lt;code&gt;internal/cosign/sshsig.go&lt;/code&gt;); and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, shell quoting&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/shell&lt;/code&gt;, whose &lt;code&gt;Quote&lt;/code&gt; and &lt;code&gt;QuoteJoin&lt;/code&gt; quote words for a POSIX shell, so a value never runs as a command, and &lt;code&gt;QuoteLine&lt;/code&gt; a word on one line for bash&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, the VM-name grammar&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmname&lt;/code&gt;, whose &lt;code&gt;IsVM&lt;/code&gt; tells a project VM&amp;rsquo;s name from an image&amp;rsquo;s, so gc never takes a project VM for an image&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, VM names&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmname&lt;/code&gt;, whose &lt;code&gt;VM&lt;/code&gt; is the name of every machine devvm runs on a backend: a project VM, an image&amp;rsquo;s machine, a build VM, or a VM&amp;rsquo;s old machine while a remake makes the new one. A name is made a &lt;code&gt;VM&lt;/code&gt; only where it&amp;rsquo;s read: &lt;code&gt;Parse&lt;/code&gt; takes a project VM&amp;rsquo;s name from an argument or a file name, and also reads &lt;code&gt;vm.json&lt;/code&gt;&amp;rsquo;s name and runs in &lt;code&gt;project.Nth&lt;/code&gt;, &lt;code&gt;ParseListed&lt;/code&gt; one a backend lists, &lt;code&gt;VM.UnmarshalText&lt;/code&gt; one in a JSON file (one path element that doesn&amp;rsquo;t start with &lt;code&gt;-&lt;/code&gt;, or none, and any machine&amp;rsquo;s, so a field that must hold a project VM&amp;rsquo;s is still checked with &lt;code&gt;IsProject&lt;/code&gt;), &lt;code&gt;Image&lt;/code&gt; names an image&amp;rsquo;s machine and &lt;code&gt;VM.Aside&lt;/code&gt; a remake&amp;rsquo;s old one, and a backend&amp;rsquo;s build VMs are typed constants. A struct field, a parameter or a result named for a VM (&lt;code&gt;vm&lt;/code&gt;, &lt;code&gt;vms&lt;/code&gt;, &lt;code&gt;otherVM&lt;/code&gt;, &lt;code&gt;vmName&lt;/code&gt;) whose type is a string, a pointer to one, a list of them or a map keyed on them fails, and so do a conversion of anything but a literal to &lt;code&gt;vmname.VM&lt;/code&gt; and a type alias of it, so a path, an alias or a folder&amp;rsquo;s name is never passed for a VM&amp;rsquo;s name. The check goes by names, so it doesn&amp;rsquo;t see a VM&amp;rsquo;s name in a string named otherwise (&lt;code&gt;target&lt;/code&gt;, &lt;code&gt;client&lt;/code&gt;, &lt;code&gt;parent&lt;/code&gt;, &lt;code&gt;to&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;), &lt;code&gt;vmname&lt;/code&gt; imported with a dot or reached through a type parameter, or a VM joined to a string constant, whose type is still &lt;code&gt;vmname.VM&lt;/code&gt; (&lt;code&gt;l.VM+lineNoLinks&lt;/code&gt; in &lt;code&gt;internal/vmssh/links.go&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;msg.M.VM&lt;/code&gt; in &lt;code&gt;internal/msg/msg.go&lt;/code&gt;, which reads back the VM a message&amp;rsquo;s function took; &lt;code&gt;internal/stubtest&lt;/code&gt;, whose stubs stand in for &lt;code&gt;limactl&lt;/code&gt; and &lt;code&gt;ssh&lt;/code&gt;, whose arguments are strings; the names &lt;code&gt;notNames&lt;/code&gt; lists that aren&amp;rsquo;t a VM&amp;rsquo;s, such as &lt;code&gt;backend.Registry.NewVMs&lt;/code&gt;, a backend&amp;rsquo;s name; and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, hosts&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy/host.go&lt;/code&gt;, whose &lt;code&gt;NormHost&lt;/code&gt; reads a host as the proxy judges it, the one form every judge of a host compares: a host of printable ASCII lowercased, in ASCII alone, and its one trailing dot dropped unless it&amp;rsquo;s an address, whose dot can only be its IPv6 zone&amp;rsquo;s, and any other host left as it is, which &lt;code&gt;HostOK&lt;/code&gt; refuses, so no Unicode fold makes another name match. An address is bare, or an IPv6 address in one pair of brackets, never one with a stray bracket. Its &lt;code&gt;Host&lt;/code&gt; is what a matcher takes, such as a rule&amp;rsquo;s &lt;code&gt;matchHost&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt;&amp;rsquo;s. A call to package &lt;code&gt;strings&lt;/code&gt; that drops a dot (&lt;code&gt;Trim&lt;/code&gt;, &lt;code&gt;TrimLeft&lt;/code&gt; or &lt;code&gt;TrimRight&lt;/code&gt; with a cutset that holds &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;TrimSuffix&lt;/code&gt; or &lt;code&gt;CutSuffix&lt;/code&gt; with &lt;code&gt;&amp;quot;.&amp;quot;&lt;/code&gt;), or that folds or trims an argument named for a host (&lt;code&gt;ToLower&lt;/code&gt;, &lt;code&gt;ToUpper&lt;/code&gt;, &lt;code&gt;EqualFold&lt;/code&gt;, &lt;code&gt;TrimFunc&lt;/code&gt;, &lt;code&gt;TrimLeftFunc&lt;/code&gt; or &lt;code&gt;TrimRightFunc&lt;/code&gt; of &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;sni&lt;/code&gt; or &lt;code&gt;u.Hostname()&lt;/code&gt;), fails, and so does a conversion to &lt;code&gt;proxy.Host&lt;/code&gt; of anything but a literal. The check goes by names and calls, so it doesn&amp;rsquo;t see a host&amp;rsquo;s case folded in a variable named otherwise, a dot dropped by slicing, or a host mapped rune by rune (&lt;code&gt;strings.Map&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;the functions &lt;code&gt;free&lt;/code&gt; lists by file and name, each with why: &lt;code&gt;trimDots&lt;/code&gt; in &lt;code&gt;internal/proxy/request.go&lt;/code&gt;, which drops a path&amp;rsquo;s segments&amp;rsquo; trailing dots; &lt;code&gt;urlHost&lt;/code&gt; in &lt;code&gt;internal/vm/cloneseed.go&lt;/code&gt;, which reads a remote&amp;rsquo;s ssh host as ssh does, to find a VM&amp;rsquo;s alias, its case folded and its trailing dot kept; &lt;code&gt;safeIndexPath&lt;/code&gt; in &lt;code&gt;internal/vm/cloneworktree.go&lt;/code&gt;, which drops a path segment&amp;rsquo;s trailing dots and spaces as Windows does; and &lt;code&gt;machines.fillPassword&lt;/code&gt; in &lt;code&gt;internal/backend/lima/start.go&lt;/code&gt; and &lt;code&gt;transportHelper&lt;/code&gt; in &lt;code&gt;internal/vm/cloneconfig.go&lt;/code&gt;, which check that a string has only the characters of a set that holds &lt;code&gt;.&lt;/code&gt;; and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, the coding agents&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agents&lt;/code&gt;, whose &lt;code&gt;Defs&lt;/code&gt; hold every fact devvm keeps of each agent, so no copy of an agent&amp;rsquo;s list or paths goes stale when one is added. A string literal that is an agent&amp;rsquo;s name or a login file&amp;rsquo;s kind, whole, or that holds an agent&amp;rsquo;s folder below the home folder, fails, and code of one agent&amp;rsquo;s own names the agent by its constant there. Comparing with that constant, or with one named after it such as &lt;code&gt;secrets.ClaudeToken&lt;/code&gt;, a &lt;code&gt;case&lt;/code&gt; for it, looking for it with &lt;code&gt;slices.Contains&lt;/code&gt; or &lt;code&gt;slices.Index&lt;/code&gt;, looking it up in a map, a map literal keyed on it and &lt;code&gt;strings.HasPrefix&lt;/code&gt;, &lt;code&gt;HasSuffix&lt;/code&gt;, &lt;code&gt;EqualFold&lt;/code&gt; or &lt;code&gt;Contains&lt;/code&gt; with it fail too, outside the files named for the agent, such as &lt;code&gt;claude.go&lt;/code&gt;, so the rest of devvm asks the agent&amp;rsquo;s &lt;code&gt;Def&lt;/code&gt; and a new agent changes none of it. A list that holds every agent&amp;rsquo;s name, tests included, fails as a copy of &lt;code&gt;agents.Names()&lt;/code&gt;, and so does a CLI test script&amp;rsquo;s line that lists agents as a message does, for which the runner gives &lt;code&gt;$AGENT_CHOICES&lt;/code&gt;, &lt;code&gt;$LOGIN_AGENTS&lt;/code&gt; and &lt;code&gt;$KEY_AGENTS&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-coding-agent"&gt;adding a coding agent&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/stubtest&lt;/code&gt;, whose stubs are named after the commands they stand in for, and tests; for a name, the value of a constant that &lt;code&gt;devvmNameFree&lt;/code&gt; lists with its reason and the only files that may use it: &lt;code&gt;vm.CursorCommand&lt;/code&gt;, the Cursor editor&amp;rsquo;s &lt;code&gt;cursor&lt;/code&gt; command, which &lt;code&gt;devvm cursor&lt;/code&gt; runs and isn&amp;rsquo;t the agent&amp;rsquo;s, used in &lt;code&gt;internal/vm/ssh.go&lt;/code&gt; and &lt;code&gt;internal/cli/cursor.go&lt;/code&gt; alone and compared with as an agent&amp;rsquo;s constant is; for the comparisons, the files whose names hold the agent&amp;rsquo;s name as a word, and the constants &lt;code&gt;devvmSwitchFree&lt;/code&gt; lists in one file each with its reason: the claude secret&amp;rsquo;s own checks, which are a secret&amp;rsquo;s, and Codex&amp;rsquo;s binding name in &lt;code&gt;logins.go&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, the toolchains&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/image&lt;/code&gt;, whose &lt;code&gt;SharedTools&lt;/code&gt; holds every fact devvm keeps of each toolchain: its members, the files that call for it, its installer, its guest environment, its &lt;code&gt;PATH&lt;/code&gt; folders and its version files. A string literal that is a toolchain&amp;rsquo;s name or a member&amp;rsquo;s, whole, fails, so code elsewhere asks the table, and a new toolchain is an entry there (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-toolchain"&gt;adding a toolchain&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/stubtest&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, image names&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/image&lt;/code&gt;, whose &lt;code&gt;Name&lt;/code&gt; is an image&amp;rsquo;s name and splits it into its layers (&lt;code&gt;Layers&lt;/code&gt;, &lt;code&gt;Parent&lt;/code&gt;, &lt;code&gt;Has&lt;/code&gt;), whose &lt;code&gt;NameOf&lt;/code&gt; joins layers into one, and whose &lt;code&gt;ParseName&lt;/code&gt; reads the name the user gives, which &lt;code&gt;build.Names&lt;/code&gt;&amp;rsquo; &lt;code&gt;Parse&lt;/code&gt; checks against the layers there are. &lt;code&gt;devvm build&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt; and &lt;code&gt;devvm images rm&lt;/code&gt; read their names there once, and the rest of devvm passes the &lt;code&gt;image.Name&lt;/code&gt; on&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;state.ReadHash&lt;/code&gt; and &lt;code&gt;project.Parents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the finder in &lt;code&gt;internal/vm/finder.go&lt;/code&gt;, whose &lt;code&gt;target&lt;/code&gt; finds the VM every command acts on: the folder&amp;rsquo;s own, the nearest parent folder&amp;rsquo;s under &lt;code&gt;--here&lt;/code&gt; and &lt;code&gt;--parent&lt;/code&gt; (&lt;code&gt;resolveFolder&lt;/code&gt;), or one named (&lt;code&gt;devvm rm VM&lt;/code&gt;). It finds a folder&amp;rsquo;s VM by the state that records the folder (&lt;code&gt;finder.state&lt;/code&gt;, by the path&amp;rsquo;s hash first, then &lt;code&gt;recorded&lt;/code&gt;), offers to move a VM whose folder moved there (&lt;code&gt;moveHere&lt;/code&gt; in &lt;code&gt;internal/vm/move.go&lt;/code&gt;, the match &lt;code&gt;here.movedFrom&lt;/code&gt;), and names a new VM by the first of the folder&amp;rsquo;s names whose VM folder is free (&lt;code&gt;newName&lt;/code&gt;, &lt;code&gt;project.Nth&lt;/code&gt;). Its &lt;code&gt;need&lt;/code&gt; says what the command needs of the VM, and &lt;code&gt;need.check&lt;/code&gt; is the one place that refuses one that isn&amp;rsquo;t there, one made for an earlier folder at its path, one whose remake didn&amp;rsquo;t finish and one whose creation didn&amp;rsquo;t, the last with &lt;code&gt;refuseUnfinished&lt;/code&gt;, which every start (&lt;code&gt;starter.bringUp&lt;/code&gt; in &lt;code&gt;internal/vm/start.go&lt;/code&gt;) makes too. It reads the folder devvm runs in only then, so the commands that act on no folder&amp;rsquo;s VM run in a folder that&amp;rsquo;s gone. The VM it finds is a &lt;code&gt;target&lt;/code&gt; (&lt;code&gt;internal/vm/target.go&lt;/code&gt;). It holds what the VM&amp;rsquo;s backend told the finder, which each start and stop of the VM then updates, and it runs what a command does with that VM: &lt;code&gt;exec&lt;/code&gt;, &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;stop&lt;/code&gt;, &lt;code&gt;running&lt;/code&gt;, &lt;code&gt;ownSSH&lt;/code&gt; and the name of its ssh config entry&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;hostsafety.Walk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the start in &lt;code&gt;internal/vm/start.go&lt;/code&gt;, whose &lt;code&gt;starter.walk&lt;/code&gt; walks a VM&amp;rsquo;s project folder once for each check of the folder on the host, for the git repos nested in it, which &lt;code&gt;.git&lt;/code&gt; protection goes by (&lt;code&gt;gitprotect.Protector.Nested&lt;/code&gt;), and on Linux hosts its set-id files, so a check never walks the folder twice. It walks when a VM is made and when a check finds it stopped, at a launch or at &lt;code&gt;devvm stop&lt;/code&gt; (&lt;code&gt;starter.hostChecks&lt;/code&gt;), and at &lt;code&gt;devvm git-protect&lt;/code&gt; on a stopped VM, never at a launch into a running VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/hostsafety&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;state.ReadAll&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the inventory in &lt;code&gt;internal/vm/inventory.go&lt;/code&gt;, which reads every VM&amp;rsquo;s state (&lt;code&gt;ReadStates&lt;/code&gt;), and with &lt;code&gt;ReadInventory&lt;/code&gt; the backends&amp;rsquo; lists too, each within its wait, for every listing of VMs: &lt;code&gt;devvm ls&lt;/code&gt;, &lt;code&gt;devvm space&lt;/code&gt;, &lt;code&gt;devvm images&lt;/code&gt; and &lt;code&gt;devvm gc&lt;/code&gt;, the ssh config, &lt;code&gt;devvm gc --orphans&lt;/code&gt;, the links, &lt;code&gt;devvm secret&lt;/code&gt;&amp;rsquo;s list, finding a VM by its name and the mounts that devvm&amp;rsquo;s SSH agent checks a key against. Its one failure policy is that a backend that can&amp;rsquo;t list fails a listing (&lt;code&gt;Inventory.Err&lt;/code&gt;) only when some VM&amp;rsquo;s state names it, and that a state that can&amp;rsquo;t be read is a row of its own, which the readers leave out and &lt;code&gt;ToolsInUse&lt;/code&gt; and &lt;code&gt;Mounts&lt;/code&gt; fail on. &lt;code&gt;state.VMNames&lt;/code&gt;, which fails on such a state, stays for the readers below &lt;code&gt;internal/vm&lt;/code&gt; that must count every VM: &lt;code&gt;netpolicy&lt;/code&gt;&amp;rsquo;s secrets, &lt;code&gt;ports&lt;/code&gt; and &lt;code&gt;sshconfig.ChooseAlias&lt;/code&gt;; &lt;code&gt;state.ReadableVMs&lt;/code&gt;, which leaves such a state out, is for those that only warn: &lt;code&gt;netpolicy&lt;/code&gt;&amp;rsquo;s warnings of every VM and doctor&amp;rsquo;s policy warnings&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;paths.Dirs.AgentSettings&lt;/code&gt; and &lt;code&gt;paths.Dirs.AgentLogins&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s agent store: &lt;code&gt;agentStore&lt;/code&gt; in &lt;code&gt;internal/vm/agents.go&lt;/code&gt; for the agents&amp;rsquo; settings, which the mounts, the setup&amp;rsquo;s copies, a remake&amp;rsquo;s home and &lt;code&gt;devvm agent import&lt;/code&gt; take, and &lt;code&gt;secrets.LoginFile&lt;/code&gt; in &lt;code&gt;internal/secrets/secrets.go&lt;/code&gt; for their logins, which the setup&amp;rsquo;s copies and the proxy read, so nothing reads an agent&amp;rsquo;s files from the home folder but &lt;code&gt;vm.AgentImport&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/paths&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, paths in devvm&amp;rsquo;s folders&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/paths&lt;/code&gt;, whose &lt;code&gt;Dirs&lt;/code&gt; and &lt;code&gt;VM&lt;/code&gt; name every file and folder devvm keeps, so the layout, its golden listing in &lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; and a VM&amp;rsquo;s teardown miss none. A &lt;code&gt;filepath.Join&lt;/code&gt; onto a &lt;code&gt;Data&lt;/code&gt; or &lt;code&gt;Config&lt;/code&gt; field fails, and so does an &lt;code&gt;os.MkdirTemp&lt;/code&gt; or &lt;code&gt;os.CreateTemp&lt;/code&gt; there whose name is a literal; a name from &lt;code&gt;paths&lt;/code&gt;, such as &lt;code&gt;paths.ToolsBuildPrefix&lt;/code&gt;, passes&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;!-- end of the generated table --&gt;
&lt;p&gt;forbidigo matches only the function a call names, so the checks that look at a call&amp;rsquo;s arguments are in the &lt;a href="#the-structure-test"&gt;structure test&lt;/a&gt;. It finds a host command in an &lt;code&gt;exec.Command&lt;/code&gt; or &lt;code&gt;exec.CommandContext&lt;/code&gt; call that names it, as a literal or as a constant, whatever name the file imports &lt;code&gt;os/exec&lt;/code&gt; under. It finds a &lt;code&gt;DEVVM_&lt;/code&gt; variable in a call to any function or field named &lt;code&gt;Getenv&lt;/code&gt; or &lt;code&gt;LookupEnv&lt;/code&gt;, in any case, so &lt;code&gt;t.Getenv&lt;/code&gt; and a &lt;code&gt;getenv&lt;/code&gt; parameter count as well as &lt;code&gt;os.Getenv&lt;/code&gt;, and it finds &lt;code&gt;HOME&lt;/code&gt; the same way. The settings &lt;code&gt;envSettings&lt;/code&gt; lists are the ones users set, &lt;code&gt;DEVVM_NO_TOOL_CHECK&lt;/code&gt;, &lt;code&gt;DEVVM_NO_RELEASE_CHECK&lt;/code&gt;, &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt; and &lt;code&gt;DEVVM_FROM&lt;/code&gt;; names mode, &lt;code&gt;DEVVM_MESSAGES&lt;/code&gt;, which any build has; and the variables devvm sets for its own processes, &lt;code&gt;DEVVM_GUESTFWD&lt;/code&gt; for &lt;code&gt;devvm _qemu&lt;/code&gt; and &lt;code&gt;DEVVM_DAEMON_STATUS&lt;/code&gt; for each background process &lt;code&gt;internal/daemon&lt;/code&gt; starts.&lt;/p&gt;
&lt;p&gt;The structure test also finds a copy of an owner&amp;rsquo;s code by its text, in &lt;code&gt;literals&lt;/code&gt;. A string literal outside tests that holds &lt;code&gt;'\''&lt;/code&gt;, the escaped quote a shell quoter writes, belongs in &lt;code&gt;internal/shell&lt;/code&gt;, and one that holds &lt;code&gt;[0-9a-f]{14}&lt;/code&gt;, the hash at the end of a project VM&amp;rsquo;s name, belongs in &lt;code&gt;internal/vmname&lt;/code&gt;. A quote written as a rune, such as &lt;code&gt;'\''&lt;/code&gt; in Go, isn&amp;rsquo;t a string literal, so it doesn&amp;rsquo;t count. One that holds a coding agent&amp;rsquo;s folder below the home folder, such as &lt;code&gt;.codex/&lt;/code&gt; or &lt;code&gt;.pi/agent&lt;/code&gt;, belongs in &lt;code&gt;internal/agents&lt;/code&gt;, and so does one that is an agent&amp;rsquo;s name or a login file&amp;rsquo;s kind, whole, such as &lt;code&gt;&amp;quot;opencode&amp;quot;&lt;/code&gt; (&lt;code&gt;names&lt;/code&gt;), so code of one agent&amp;rsquo;s own names it by its constant there, such as &lt;code&gt;agents.Opencode&lt;/code&gt;, and a longer text that mentions an agent, such as a command&amp;rsquo;s example, doesn&amp;rsquo;t count. A literal that is a toolchain&amp;rsquo;s name or one of its members&amp;rsquo;, whole, such as &lt;code&gt;&amp;quot;dotnet&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;pnpm&amp;quot;&lt;/code&gt;, belongs in &lt;code&gt;internal/image&lt;/code&gt; in the same way, so code elsewhere finds a toolchain&amp;rsquo;s facts in its &lt;code&gt;image.SharedTools&lt;/code&gt; entry. A literal that is &lt;code&gt;&amp;quot;push&amp;quot;&lt;/code&gt;, whole, belongs only in &lt;code&gt;internal/hostgit&lt;/code&gt;, which holds none, so no package passes &lt;code&gt;push&lt;/code&gt; to git: a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s copy goes through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; instead (&lt;code&gt;internal/vm/cloneseed.go&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-copy-into-a-clone-vm"&gt;the copy into a clone VM&lt;/a&gt;), because git&amp;rsquo;s receive-pack refuses shallow and SHA-256 repos, and a second transport would drift. A literal that is &lt;code&gt;&amp;quot;diff-files&amp;quot;&lt;/code&gt;, whole, belongs only in &lt;code&gt;internal/hostgit&lt;/code&gt; too, whose &lt;code&gt;DiffFiles&lt;/code&gt; adds &lt;code&gt;--ignore-submodules=all&lt;/code&gt;, because git diff-files otherwise runs git status in each submodule or embedded repo, where that repo&amp;rsquo;s own config can name a filter that devvm&amp;rsquo;s git doesn&amp;rsquo;t turn off. In the same way, &lt;code&gt;separators&lt;/code&gt; finds a copy of a parser by what it splits on: a call to any function of package &lt;code&gt;strings&lt;/code&gt; with &lt;code&gt;+&lt;/code&gt; as an argument, as a literal or as a constant, splits or joins an image&amp;rsquo;s layers, so it belongs in &lt;code&gt;internal/image&lt;/code&gt;. A call with another argument that holds a &lt;code&gt;+&lt;/code&gt;, such as &lt;code&gt;strings.ContainsAny(arg, &amp;quot;+,&amp;quot;)&lt;/code&gt;, doesn&amp;rsquo;t count.&lt;/p&gt;
&lt;p&gt;The shared tools have one owner too, the table &lt;code&gt;image.SharedTools&lt;/code&gt; in &lt;code&gt;internal/image/tool.go&lt;/code&gt;, whose agents&amp;rsquo; entries it makes from the coding agents&amp;rsquo; registry, &lt;code&gt;agents.Defs&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-coding-agent"&gt;adding a coding agent&lt;/a&gt;). Each entry, an &lt;code&gt;image.ToolDef&lt;/code&gt;, holds a tool&amp;rsquo;s name, its kind (a toolchain or an agent), its members (the tools in the lock that its name stands for, such as pnpm and bun for node), the files in a project folder that call for it, and its installer, which is mise for every tool but rust, which rustup installs, and dotnet, which &lt;code&gt;assets/shared-tools/build.sh&lt;/code&gt; unpacks from Microsoft&amp;rsquo;s SDK archive. A toolchain&amp;rsquo;s entry also holds the environment that every VM&amp;rsquo;s shells get for it, such as &lt;code&gt;NPM_CONFIG_PREFIX&lt;/code&gt; and .NET&amp;rsquo;s telemetry switch (&lt;code&gt;Env&lt;/code&gt;), the folders of the VM&amp;rsquo;s home that go on every VM&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, where its global installs go (&lt;code&gt;PathDirs&lt;/code&gt;), and the members whose version files mise reads in a project (&lt;code&gt;VersionFiles&lt;/code&gt;). mise locks dotnet&amp;rsquo;s version without a download, because its own installer runs Microsoft&amp;rsquo;s install script, which checks nothing, so devvm adds each platform&amp;rsquo;s archive and its SHA-512 from Microsoft&amp;rsquo;s release metadata to the lock (&lt;code&gt;withSDKDownloads&lt;/code&gt; in &lt;code&gt;internal/tools/dotnet.go&lt;/code&gt;), and &lt;code&gt;Share.Build&lt;/code&gt; passes them to build.sh (&lt;code&gt;image.OwnDownload&lt;/code&gt;), which checks the archive with &lt;code&gt;devvm-fetch&lt;/code&gt;. &lt;code&gt;image.Toolchains&lt;/code&gt;, &lt;code&gt;image.Agents&lt;/code&gt;, &lt;code&gt;image.GroupTools&lt;/code&gt;, the files that make devvm choose a toolchain for a new VM, the lock&amp;rsquo;s check for downloads (&lt;code&gt;image.NoDownload&lt;/code&gt;) and the &lt;code&gt;devcontainer.json&lt;/code&gt; features that devvm maps to a toolchain all come from it. So do the files that every launch&amp;rsquo;s setup writes for the toolchains: &lt;code&gt;/etc/devvm/toolchains.sh&lt;/code&gt;, with every toolchain&amp;rsquo;s environment and &lt;code&gt;PATH&lt;/code&gt; folders (&lt;code&gt;image.GuestEnv&lt;/code&gt; and &lt;code&gt;image.GuestPath&lt;/code&gt;), which base&amp;rsquo;s &lt;code&gt;/etc/profile.d/devvm-tools.sh&lt;/code&gt; reads in every shell, as it reads the agents&amp;rsquo; &lt;code&gt;/etc/devvm/agents.sh&lt;/code&gt;, and the VM&amp;rsquo;s mise setting that names the tools whose version files it reads (&lt;code&gt;image.VersionFileTools&lt;/code&gt;). The image builds read none of them, so a toolchain&amp;rsquo;s environment changes no image. The structure test fails on a string literal outside &lt;code&gt;internal/image&lt;/code&gt; that is a toolchain&amp;rsquo;s name or a member&amp;rsquo;s, whole, so code elsewhere asks the table, through &lt;code&gt;image.Def&lt;/code&gt;, an entry&amp;rsquo;s &lt;code&gt;Installer&lt;/code&gt; or its other fields, rather than naming a toolchain. &lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-toolchain"&gt;Adding a toolchain&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-coding-agent"&gt;adding a coding agent&lt;/a&gt; list the files a new shared tool needs, and the &lt;a href="#agreement-tests"&gt;agreement tests&lt;/a&gt; fail until the table and those files match.&lt;/p&gt;
&lt;p&gt;The scripts that devvm&amp;rsquo;s builds run with bash have one owner for the machine they run on, &lt;code&gt;assets/prelude.sh&lt;/code&gt;, whose &lt;code&gt;$devvm_arch&lt;/code&gt;, &lt;code&gt;$devvm_libc&lt;/code&gt; and &lt;code&gt;devvm_sha&lt;/code&gt; give each script its architecture, its C library and its pinned checksum for each download (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-scripts-prelude"&gt;the scripts&amp;rsquo; prelude&lt;/a&gt;). A script reads them rather than run &lt;code&gt;uname -m&lt;/code&gt; or look for &lt;code&gt;apk&lt;/code&gt; itself, and checks that the prelude came first with &lt;code&gt;: &amp;quot;${devvm_arch:?}&amp;quot;&lt;/code&gt; for each variable it reads, which also tells shellcheck that the variable is set. Go reads each of those scripts through &lt;code&gt;image.OwnScript&lt;/code&gt;, which puts the prelude before it, so a recipe, a tool image&amp;rsquo;s key and the conversion&amp;rsquo;s copy of &lt;code&gt;oci/build.sh&lt;/code&gt; all hold the two together. &lt;code&gt;TestPreludeUsers&lt;/code&gt; in &lt;code&gt;internal/image&lt;/code&gt; fails when a script that doesn&amp;rsquo;t get the prelude, such as &lt;code&gt;assets/oci/bootify.sh&lt;/code&gt; or &lt;code&gt;assets/guest/&lt;/code&gt;&amp;rsquo;s, uses it, or when a script reads a variable without that check. &lt;code&gt;testdata/script/prelude.txtar&lt;/code&gt; checks which pin &lt;code&gt;devvm_sha&lt;/code&gt; picks from each script&amp;rsquo;s pins on arm64 and amd64, with glibc and with musl. A CLI test or a Go test that sources one of these scripts sources &lt;code&gt;assets/prelude.sh&lt;/code&gt; first.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;internal/paths&lt;/code&gt; also owns how a path on the host is resolved and compared with a folder, in &lt;code&gt;resolve.go&lt;/code&gt;, whose comment says which resolver each question takes. &lt;code&gt;paths.Physical&lt;/code&gt; resolves every symlink as far as the path exists, for where a folder or file really is, such as a project folder against devvm&amp;rsquo;s own folders or an SSH key against the folders VMs mount. &lt;code&gt;paths.PhysicalParent&lt;/code&gt; resolves only the folder&amp;rsquo;s symlinks and keeps the last element as named, for a path that may itself be a symlink devvm mustn&amp;rsquo;t follow, such as a key&amp;rsquo;s recorded path or a Seatbelt rule. &lt;code&gt;filepath.EvalSymlinks&lt;/code&gt; itself, which fails when the path doesn&amp;rsquo;t exist, is for a path that must exist, such as the folder devvm runs in, or a stopped VM&amp;rsquo;s project folder, which each of a start&amp;rsquo;s three checks resolves with &lt;code&gt;filepath.EvalSymlinks&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/overview/#an-existing-vm"&gt;an existing VM&lt;/a&gt;). Then &lt;code&gt;paths.Within&lt;/code&gt; tells whether a path is a folder or inside it, and &lt;code&gt;paths.Below&lt;/code&gt; whether it&amp;rsquo;s inside it only. Both compare names, so both paths are resolved the same way first. A check that keeps a VM away from a folder, such as &lt;code&gt;project.Unsafe&lt;/code&gt;&amp;rsquo;s, an SSH key against the folders VMs mount, or a project folder against an agent&amp;rsquo;s folder, uses &lt;code&gt;paths.In&lt;/code&gt; or &lt;code&gt;paths.Under&lt;/code&gt; instead, which also compare the folders themselves and match when the path, or a folder above it, is the same folder as the other, by device and inode. On a volume that ignores case, as macOS&amp;rsquo;s do by default, &lt;code&gt;~/.Config/devvm&lt;/code&gt; is &lt;code&gt;~/.config/devvm&lt;/code&gt;, which a comparison of names alone misses.&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s state, &lt;code&gt;vm.json&lt;/code&gt;, has one owner too, &lt;code&gt;internal/state&lt;/code&gt;, which reads and writes the whole file and knows only its core fields. Every other package that keeps something of a VM&amp;rsquo;s owns one section of it, with its own type, its name (&lt;code&gt;Section&lt;/code&gt;), and an &lt;code&gt;Of&lt;/code&gt; that reads it through &lt;code&gt;state.Section&lt;/code&gt;: &lt;code&gt;internal/netpolicy&lt;/code&gt; owns &lt;code&gt;net&lt;/code&gt;, &lt;code&gt;internal/gitprotect&lt;/code&gt; &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;internal/ports&lt;/code&gt; &lt;code&gt;ports&lt;/code&gt;, &lt;code&gt;internal/sshagent&lt;/code&gt; &lt;code&gt;agent&lt;/code&gt;, &lt;code&gt;internal/tools&lt;/code&gt; &lt;code&gt;tools&lt;/code&gt;, &lt;code&gt;internal/secrets&lt;/code&gt; &lt;code&gt;secrets&lt;/code&gt;, and &lt;code&gt;internal/vm&lt;/code&gt; &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;clone&lt;/code&gt;, &lt;code&gt;devcontainer&lt;/code&gt;, &lt;code&gt;desktop&lt;/code&gt; and &lt;code&gt;links&lt;/code&gt; (&lt;code&gt;internal/vm/state.go&lt;/code&gt;). A section&amp;rsquo;s type keeps what the user asked for at its top level and what devvm made under &lt;code&gt;made&lt;/code&gt;. A change goes through &lt;code&gt;state.VM.Update&lt;/code&gt;, which takes the VM&amp;rsquo;s lock, reads the file again, runs the change and writes the file once: the change sets its section with &lt;code&gt;state.SetSection&lt;/code&gt; and works out a list&amp;rsquo;s new value from the file as it is then, never from what the command read earlier, so a change another devvm made meanwhile is kept. A change that fails writes nothing. &lt;code&gt;Update&lt;/code&gt; holds one VM&amp;rsquo;s lock, so a change takes no other lock inside it, and a change to several VMs updates each in turn. Test builds and the tests panic on a lock taken out of that order (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-state-layout"&gt;the lock rule&lt;/a&gt;). &lt;code&gt;state.VM.Claim&lt;/code&gt; is &lt;code&gt;Update&lt;/code&gt; that also holds the claims lock, for what no two VMs may have (&lt;code&gt;ports.Allocator&lt;/code&gt; chooses every VM&amp;rsquo;s host port through it), and &lt;code&gt;state.VM.Create&lt;/code&gt; writes a new VM&amp;rsquo;s whole state once, its ssh alias chosen under the claims lock. A build VM has no state, so &lt;code&gt;ports.Allocator.Build&lt;/code&gt; chooses its ssh port through &lt;code&gt;state.Claims&lt;/code&gt;, which holds the claims lock alone. A VM&amp;rsquo;s alias is one &lt;code&gt;vmname.IsAlias&lt;/code&gt; accepts, or devvm doesn&amp;rsquo;t use it. &lt;code&gt;internal/vm&lt;/code&gt;&amp;rsquo;s &lt;code&gt;checkState&lt;/code&gt; reads every section of the folder&amp;rsquo;s VM&amp;rsquo;s state as the VM is found, so a section that can&amp;rsquo;t be read stops the command instead of reading as empty. A new section adds its check there.&lt;/p&gt;
&lt;h3 data-hextra-search-id="agreement-tests"&gt;Agreement tests&lt;span class="hx:absolute hx:-mt-20" id="agreement-tests"&gt;&lt;/span&gt;
&lt;a href="#agreement-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When two places must agree but can&amp;rsquo;t be one, a test checks that they agree. &lt;code&gt;TestEveryPartHasAPolicy&lt;/code&gt; checks that every image part has its policy, &lt;code&gt;TestSharedToolsPolicies&lt;/code&gt; that the policies in &lt;code&gt;assets/shared-tools/&lt;/code&gt; are one for each shared tool in &lt;code&gt;image.SharedTools&lt;/code&gt;, &lt;code&gt;TestConfigTools&lt;/code&gt; that &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; lists each shared tool&amp;rsquo;s members and nothing else, &lt;code&gt;TestBuiltinPolicies&lt;/code&gt; that every policy devvm ships parses, &lt;code&gt;TestEveryMessageIsUsed&lt;/code&gt; that every message has a caller, &lt;code&gt;TestDocLinks&lt;/code&gt; that every doc link is a message and a heading, &lt;code&gt;TestPreludeUsers&lt;/code&gt; that only the scripts that get the prelude use it, &lt;code&gt;TestDefsComplete&lt;/code&gt; that every coding agent has its &lt;code&gt;[tool_alias]&lt;/code&gt; line and its row in the docs&amp;rsquo; Supported agents table, &lt;code&gt;TestProvidersComplete&lt;/code&gt; that every provider in &lt;code&gt;agents.Providers&lt;/code&gt; has its row in the docs&amp;rsquo; table of the API keys the proxy puts in, &lt;code&gt;TestToolchainsComplete&lt;/code&gt; that every toolchain has files that call for it and its row and section on the toolchains page, which names those files and its &lt;code&gt;PATH&lt;/code&gt; folders, &lt;code&gt;TestFormatsCoverLogins&lt;/code&gt; that every agent&amp;rsquo;s login file has its format in &lt;code&gt;internal/agentlogin&lt;/code&gt;, &lt;code&gt;TestBumpCoversPins&lt;/code&gt; that &lt;code&gt;scripts/bump.sh&lt;/code&gt; moves every pin it finds, or says why it&amp;rsquo;s left (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#updating-pinned-versions"&gt;updating pinned versions&lt;/a&gt;), and &lt;code&gt;TestReferenceIsCurrent&lt;/code&gt; that the CLI reference matches the commands. A new pair of places that must agree gets such a test.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-consolidation-pass"&gt;The consolidation pass&lt;span class="hx:absolute hx:-mt-20" id="the-consolidation-pass"&gt;&lt;/span&gt;
&lt;a href="#the-consolidation-pass" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A review of a body of work, and the review before a release, look across the code for copies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;two parsers of one format&lt;/li&gt;
&lt;li&gt;a path built outside &lt;code&gt;internal/paths&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;a list of files kept beside the folder that holds them&lt;/li&gt;
&lt;li&gt;a value encoded in a string&lt;/li&gt;
&lt;li&gt;two messages that say one thing&lt;/li&gt;
&lt;li&gt;a comment that says to keep two places in sync&lt;/li&gt;
&lt;li&gt;a test that copies a constant&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each copy gets one of three outcomes: extend the owner, make one owner, or leave it. Leave it when the only shared helper would be the wrong one, because a copy costs less than the wrong helper, and wait for a third copy before making one. The pass is part of those reviews, not a step every change runs.&lt;/p&gt;
&lt;h3 data-hextra-search-id="secrets-in-the-code"&gt;Secrets in the code&lt;span class="hx:absolute hx:-mt-20" id="secrets-in-the-code"&gt;&lt;/span&gt;
&lt;a href="#secrets-in-the-code" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A value that lets whoever holds it act as you or as a VM is a &lt;code&gt;redact.Secret&lt;/code&gt;, from the moment devvm reads it until the place it&amp;rsquo;s used. That covers a VM&amp;rsquo;s proxy password (&lt;code&gt;netpolicy.Key&lt;/code&gt;, &lt;code&gt;proxy.Config.Password&lt;/code&gt;, &lt;code&gt;backend.Confinement.ProxyPassword&lt;/code&gt;) and a build proxy&amp;rsquo;s, a secret&amp;rsquo;s value (&lt;code&gt;secrets.Store.Value&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt; and &lt;code&gt;Save&lt;/code&gt;, and what &lt;code&gt;ui.UI.Secret&lt;/code&gt; reads), the company proxy&amp;rsquo;s password and the &lt;code&gt;Proxy-Authorization&lt;/code&gt; the proxy sends it, the values the proxy caches for a VM&amp;rsquo;s bindings (&lt;code&gt;proxy.Lookup&lt;/code&gt;), and an agent&amp;rsquo;s API keys and tokens once they leave its login file (&lt;code&gt;agentlogin.File.Get&lt;/code&gt; and &lt;code&gt;SetKey&lt;/code&gt;, and the tokens a capture or a refresh brings). Two such values stay strings, as &lt;a href="https://next.devvm.dev/docs/contributing/design/#where-secret-values-live"&gt;where secret values live&lt;/a&gt; explains: the value on its way through &lt;code&gt;platform.KeychainGet&lt;/code&gt; and &lt;code&gt;KeychainSet&lt;/code&gt;, which &lt;code&gt;secrets.Store&lt;/code&gt; makes a &lt;code&gt;Secret&lt;/code&gt; at once, and devvm desktop&amp;rsquo;s VNC password, which you must see. A &lt;code&gt;Secret&lt;/code&gt; prints as &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; with &lt;code&gt;%v&lt;/code&gt;, &lt;code&gt;%s&lt;/code&gt;, &lt;code&gt;%q&lt;/code&gt;, &lt;code&gt;%x&lt;/code&gt;, &lt;code&gt;%#v&lt;/code&gt; and every other verb, so a log line, an error or a struct printed with &lt;code&gt;%+v&lt;/code&gt; never shows it. Its value is behind a pointer, because &lt;code&gt;fmt&lt;/code&gt; prints a value in an unexported field without calling its &lt;code&gt;Format&lt;/code&gt;, and such a field then shows only an address. Two &lt;code&gt;Secret&lt;/code&gt;s are equal with &lt;code&gt;==&lt;/code&gt; only when they&amp;rsquo;re the same one, so compare their values with &lt;code&gt;Reveal&lt;/code&gt;, or the structs that hold them with &lt;code&gt;reflect.DeepEqual&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Reveal&lt;/code&gt; is the only way to the value, and forbidigo refuses every call to it except in tests. So each place that must use a value says why in a &lt;code&gt;//nolint:forbidigo // &amp;lt;why&amp;gt;&lt;/code&gt; on that line. Those places are the proxy&amp;rsquo;s password check and the headers it puts values in, the store&amp;rsquo;s file and the Keychain, the VM&amp;rsquo;s proxy URL and a login&amp;rsquo;s file, its refresh and its claims. Anywhere else, pass the &lt;code&gt;Secret&lt;/code&gt; on. &lt;code&gt;testdata/lint/forbidigo.go&lt;/code&gt; keeps a call to &lt;code&gt;Reveal&lt;/code&gt; that the rule must report. The structure test refuses a struct that embeds &lt;code&gt;redact.Secret&lt;/code&gt; outside &lt;code&gt;internal/redact&lt;/code&gt;, which would take on its methods, and an interface that declares &lt;code&gt;Reveal() string&lt;/code&gt;, whose calls forbidigo wouldn&amp;rsquo;t see. It reads the source alone, so it doesn&amp;rsquo;t see a &lt;code&gt;Secret&lt;/code&gt; embedded through another type or reached through reflection.&lt;/p&gt;
&lt;p&gt;Encoding a &lt;code&gt;Secret&lt;/code&gt; as JSON or as text is an error (&lt;code&gt;redact.ErrEncode&lt;/code&gt;), never &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt;, so a value written somewhere by accident fails at once rather than losing your login. A file that must hold the real value therefore writes it through its own wire type, a struct with the value as a string that only that file&amp;rsquo;s reader and writer use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s config,&lt;/strong&gt; &lt;code&gt;proxy.json&lt;/code&gt;, is &lt;code&gt;configFile&lt;/code&gt;, with &lt;code&gt;Config&lt;/code&gt;&amp;rsquo;s fields in &lt;code&gt;Config&lt;/code&gt;&amp;rsquo;s order, so its bytes, and the &lt;code&gt;Sum&lt;/code&gt; that decides whether a running VM&amp;rsquo;s proxy starts again, match what earlier releases wrote. &lt;code&gt;TestConfigFile&lt;/code&gt; holds the two types together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s key in &lt;code&gt;vm.json&lt;/code&gt;&lt;/strong&gt; is &lt;code&gt;netpolicy.NetMade&lt;/code&gt;&amp;rsquo;s own &lt;code&gt;MarshalJSON&lt;/code&gt; and &lt;code&gt;UnmarshalJSON&lt;/code&gt;, through &lt;code&gt;netMade&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A secret&amp;rsquo;s file without a Keychain&lt;/strong&gt; is the value and a line&amp;rsquo;s end, which &lt;code&gt;secrets.Store.save&lt;/code&gt; writes and &lt;code&gt;saved&lt;/code&gt; reads.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A login&amp;rsquo;s file&lt;/strong&gt; is the agent&amp;rsquo;s own format, read and written whole as a map so that fields devvm doesn&amp;rsquo;t know stay, and a key or token leaves the map through &lt;code&gt;agentlogin&lt;/code&gt;&amp;rsquo;s &lt;code&gt;token&lt;/code&gt; and goes into it through &lt;code&gt;setToken&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To add a field that holds a secret, give it the type &lt;code&gt;redact.Secret&lt;/code&gt;. If a struct with it is written to a file, add the field to that file&amp;rsquo;s wire type, and check that a frozen release&amp;rsquo;s files still read and write the same bytes: &lt;code&gt;TestV010ProxyConfigs&lt;/code&gt; does it for &lt;code&gt;proxy.json&lt;/code&gt;, &lt;code&gt;TestFixtureVMStates&lt;/code&gt; for &lt;code&gt;vm.json&lt;/code&gt;&amp;rsquo;s sections, &lt;code&gt;TestFixtureStoreGet&lt;/code&gt; for a secret&amp;rsquo;s file on Linux, and &lt;code&gt;TestFixtureAgentStore&lt;/code&gt; for the agents&amp;rsquo; login files, which every read leaves as they were.&lt;/p&gt;
&lt;h2 data-hextra-search-id="changing-the-state-layout"&gt;Changing the state layout&lt;span class="hx:absolute hx:-mt-20" id="changing-the-state-layout"&gt;&lt;/span&gt;
&lt;a href="#changing-the-state-layout" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/internals/overview/#state-files"&gt;State files&lt;/a&gt; describes the layout, and &lt;a href="https://next.devvm.dev/docs/contributing/design/#the-state-layout"&gt;the design note&lt;/a&gt; says why it&amp;rsquo;s built that way. Every path in it comes from &lt;code&gt;internal/paths&lt;/code&gt;. &lt;code&gt;paths.Dirs&lt;/code&gt; names the shared folders and files, and &lt;code&gt;Dirs.VM(name)&lt;/code&gt; gives a VM&amp;rsquo;s &lt;code&gt;paths.VM&lt;/code&gt;, whose methods name each file in the VM&amp;rsquo;s folder: &lt;code&gt;Dirs.VMDir(hash)&lt;/code&gt;, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, for a project VM, and &lt;code&gt;run/builds/&amp;lt;name&amp;gt;/&lt;/code&gt; for a build VM. A new file of a VM&amp;rsquo;s gets a method on &lt;code&gt;paths.VM&lt;/code&gt;, so it lands in the VM&amp;rsquo;s folder, and &lt;code&gt;vmFolders.teardown&lt;/code&gt; in &lt;code&gt;internal/vm/teardown.go&lt;/code&gt; deletes it with the folder, with no list of files to update. A new socket goes in &lt;code&gt;Dirs.Run()&lt;/code&gt;, named by a hash, and &lt;code&gt;TestSocketsFit&lt;/code&gt; checks the longest path against &lt;code&gt;paths.SocketMax&lt;/code&gt;. A new record that only devvm writes is JSON, read with &lt;code&gt;encoding/json&lt;/code&gt;, which ignores fields it doesn&amp;rsquo;t know, and written whole with &lt;code&gt;state.WriteFile&lt;/code&gt;. A new default goes in &lt;code&gt;internal/settings&lt;/code&gt;, which reads &lt;code&gt;config.toml&lt;/code&gt; strictly and saves &lt;code&gt;settings.json&lt;/code&gt;, and a new lock is an OS file lock (&lt;code&gt;platform.LockFile&lt;/code&gt; and its kin) on a file that &lt;code&gt;paths&lt;/code&gt; names.&lt;/p&gt;
&lt;p&gt;The data folder and the config folder each hold a &lt;code&gt;version&lt;/code&gt; file with their layout version, &lt;code&gt;state.Layout&lt;/code&gt; in &lt;code&gt;internal/state/layout.go&lt;/code&gt;. Before each command that reads them, &lt;code&gt;state.CheckLayout&lt;/code&gt; takes &lt;code&gt;version.lock&lt;/code&gt; in the data folder and compares both files with &lt;code&gt;state.Layout&lt;/code&gt;. A folder without the file gets this devvm&amp;rsquo;s version, the same version goes on, and a newer one stops the command with &lt;code&gt;layout_newer&lt;/code&gt;, because a newer devvm changed the folders. An older one runs the migrations from that version to this one, in order, and then writes &lt;code&gt;state.Layout&lt;/code&gt; into both files. &lt;code&gt;skipsLayout&lt;/code&gt; in &lt;code&gt;internal/cli/root.go&lt;/code&gt; lists the commands that skip the check: help, completion, the version and devvm&amp;rsquo;s own hidden commands.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; makes two VMs on the allowlist tier, a forwarded port, a link and a secret, lists every file and folder under the data and config folders, and compares the lists with the ones at the end of the script, one for macOS and one for Linux. A change to the layout, such as a new file, a renamed folder or a file that moves, changes a listing, so the test fails until you update it. When it does, decide whether the change needs a new layout version:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A change that an older devvm would read wrongly, or a file that moves, raises &lt;code&gt;state.Layout&lt;/code&gt; by one.&lt;/li&gt;
&lt;li&gt;It adds a &lt;code&gt;state.Migration&lt;/code&gt; at the end of &lt;code&gt;migrations()&lt;/code&gt;, which changes the folders from the version before to the new one. A migration takes &lt;code&gt;paths.Dirs&lt;/code&gt;, and a run that it fails stops before the versions change, so the next run tries it again. &lt;code&gt;TestMigrations&lt;/code&gt; checks that there&amp;rsquo;s one migration for each version before this one, and &lt;code&gt;TestCheckLayout&lt;/code&gt; runs fake ones.&lt;/li&gt;
&lt;li&gt;It updates the listings in &lt;code&gt;layout.txtar&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A new file that an older devvm doesn&amp;rsquo;t need to know about, or a field added to a JSON file, which an older devvm ignores, keeps the version and changes only the listings.&lt;/p&gt;
&lt;h3 data-hextra-search-id="released-state"&gt;Released state&lt;span class="hx:absolute hx:-mt-20" id="released-state"&gt;&lt;/span&gt;
&lt;a href="#released-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Someone who upgrades devvm keeps their VMs, defaults, agent store and secrets as the release they came from left them. Until 1.0, an upgrade from every release since 0.1.0 has to work. Each final release that changed what devvm writes on disk has a frozen copy of the state it left, called its fixture, and the tests run today&amp;rsquo;s devvm on every fixture, so a change that breaks an older release&amp;rsquo;s state fails the gate.&lt;/p&gt;
&lt;h4 data-hextra-search-id="what-a-fixture-holds"&gt;What a fixture holds&lt;span class="hx:absolute hx:-mt-20" id="what-a-fixture-holds"&gt;&lt;/span&gt;
&lt;a href="#what-a-fixture-holds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;A release&amp;rsquo;s fixture is the folder &lt;code&gt;testdata/v&amp;lt;release&amp;gt;/&lt;/code&gt;. Its &lt;code&gt;darwin/&lt;/code&gt; folder holds the state that the release left on a Mac, and its &lt;code&gt;linux/&lt;/code&gt; folder the state it left on Linux. For 0.1.0, that&amp;rsquo;s four VMs&amp;rsquo; states, its defaults, its agent store and logins, the stubs&amp;rsquo; record of the VMs, and what its &lt;code&gt;--json&lt;/code&gt; printed for them, and the folder&amp;rsquo;s &lt;code&gt;README.md&lt;/code&gt; lists what each VM has. The release made these files itself. Its &lt;code&gt;generate.sh&lt;/code&gt; checks out the release&amp;rsquo;s tag in a temporary folder and runs &lt;code&gt;generate.txtar&lt;/code&gt; with that version&amp;rsquo;s own CLI test harness, then copies what the run left, with each file&amp;rsquo;s mode in &lt;code&gt;modes&lt;/code&gt;, because git doesn&amp;rsquo;t keep modes.&lt;/p&gt;
&lt;p&gt;A fixture is frozen. It&amp;rsquo;s generated once, from the release&amp;rsquo;s own binary, and never edited or generated again, so never run its &lt;code&gt;generate.sh&lt;/code&gt; from a newer devvm and never change its files. A release whose state is the same as the one before it adds no fixture, and neither does a release candidate, such as 0.1.1-rc.1, because only a final release that changes the state gets one.&lt;/p&gt;
&lt;h4 data-hextra-search-id="the-tests-on-every-fixture"&gt;The tests on every fixture&lt;span class="hx:absolute hx:-mt-20" id="the-tests-on-every-fixture"&gt;&lt;/span&gt;
&lt;a href="#the-tests-on-every-fixture" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The unit tests read every fixture&amp;rsquo;s files with today&amp;rsquo;s readers. &lt;code&gt;stateFixtures&lt;/code&gt; in &lt;code&gt;internal/vm/fixture_test.go&lt;/code&gt; lists each release&amp;rsquo;s expectations: its VMs, the version of their &lt;code&gt;vm.json&lt;/code&gt;, its layout version, its clones of one repo, and functions that check its VMs, its defaults and its agent store. 0.1.0&amp;rsquo;s entry is &lt;code&gt;v010Fixture&lt;/code&gt; in &lt;code&gt;fixture_v010_test.go&lt;/code&gt;. &lt;code&gt;TestFixtureVMStates&lt;/code&gt;, &lt;code&gt;TestFixtureVMsRead&lt;/code&gt;, &lt;code&gt;TestFixtureSettings&lt;/code&gt;, &lt;code&gt;TestFixtureAgentStore&lt;/code&gt; and &lt;code&gt;TestFixtureClonesReadAsOneRepo&lt;/code&gt; run once for each release and system, and they check that each field the release wrote reads and writes back unchanged. &lt;code&gt;TestStateFixturesListed&lt;/code&gt; fails when a folder in &lt;code&gt;testdata&lt;/code&gt; has no entry, or an entry has no folder. Two packages keep a table of their own for what only they read. In &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;fixtureBinaries&lt;/code&gt; records the SHA-256 of the binary that made each release&amp;rsquo;s state, which its proxy configs name, and &lt;code&gt;TestFixtureBindings&lt;/code&gt; and &lt;code&gt;TestFixtureProxyConfig&lt;/code&gt; read every release&amp;rsquo;s bindings files and proxy configs. In &lt;code&gt;internal/secrets&lt;/code&gt;, &lt;code&gt;storeFixtures&lt;/code&gt; names a secret that each release&amp;rsquo;s store on Linux keeps as a file, which &lt;code&gt;TestFixtureStoreGet&lt;/code&gt; reads through a VM&amp;rsquo;s binding. &lt;code&gt;TestV010Rules&lt;/code&gt; is a copy of 0.1.0&amp;rsquo;s own tests of the proxy&amp;rsquo;s rules, kept apart from today&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;The CLI tests run today&amp;rsquo;s commands on each fixture. A release&amp;rsquo;s scripts are in &lt;code&gt;testdata/script/&lt;/code&gt;, named &lt;code&gt;fixture_v&lt;/code&gt; and the release&amp;rsquo;s version without its dots, such as &lt;code&gt;fixture_v010.txtar&lt;/code&gt;, &lt;code&gt;fixture_v010_clone.txtar&lt;/code&gt; and &lt;code&gt;fixture_v010_network.txtar&lt;/code&gt; for 0.1.0. Each one puts the state into a sandbox with &lt;code&gt;fixture v&amp;lt;release&amp;gt;&lt;/code&gt;, which moves it to the sandbox&amp;rsquo;s folder: the folder&amp;rsquo;s path, each VM&amp;rsquo;s name hash, its folder&amp;rsquo;s and &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s identities and its backend&amp;rsquo;s place become what they are there, each host port, and each port that a VM or the defaults forward, becomes one of the sandbox&amp;rsquo;s own that nothing on this host listens on, and nothing else changes. The ports change because a launch that finds a VM&amp;rsquo;s port taken, by a program of yours or by another run of the tests, rightly chooses another one and edits the VM&amp;rsquo;s Lima config. It also warns that it can&amp;rsquo;t forward a port that a program has, such as a web server of yours on 3000. A script names a forwarded port by what it was, as &lt;code&gt;$FIXTURE_PORT_3000&lt;/code&gt;. The script then runs today&amp;rsquo;s devvm on it. Each &lt;code&gt;--json&lt;/code&gt; must have everything the release&amp;rsquo;s had (&lt;code&gt;json_superset&lt;/code&gt;), the read-only commands must change no file, and a launch must start each VM as it is, without a Lima edit. The scripts stay separate for each release, because their checks name that release&amp;rsquo;s VMs and what each one has, and &lt;code&gt;TestFixtureScripts&lt;/code&gt; in &lt;code&gt;internal/cli&lt;/code&gt; fails when a fixture has no script or a script names a fixture that isn&amp;rsquo;t there.&lt;/p&gt;
&lt;h4 data-hextra-search-id="changing-what-devvm-does-with-state"&gt;Changing what devvm does with state&lt;span class="hx:absolute hx:-mt-20" id="changing-what-devvm-does-with-state"&gt;&lt;/span&gt;
&lt;a href="#changing-what-devvm-does-with-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;A change that reads or writes state, such as a new command, a new section in &lt;code&gt;vm.json&lt;/code&gt; or a new field in a record, runs its new commands on every fixture in the same commit, and reading the files isn&amp;rsquo;t enough. Add the steps to each release&amp;rsquo;s scripts, as &lt;code&gt;fixture_v010_network.txtar&lt;/code&gt; runs rules by method and path on 0.1.0&amp;rsquo;s app VM and &lt;code&gt;fixture_v010_clone.txtar&lt;/code&gt; runs devvm clone add on its web VM. When a fixture&amp;rsquo;s test fails, today&amp;rsquo;s devvm breaks the state that the release&amp;rsquo;s users have. Fix devvm, or add a migration, but never change the fixture.&lt;/p&gt;
&lt;p&gt;A change in what devvm does with existing state gets a line in &lt;code&gt;CHANGELOG.md&lt;/code&gt;, in the Unreleased section at the bottom until its release moves it to the top: a step in What to do when the user has to act on it, and otherwise a line in the group of the people who notice it, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; says. When the user has to do something about it, such as run a command, devvm also tells them once, at the first launch after the upgrade.&lt;/p&gt;
&lt;h4 data-hextra-search-id="freezing-a-releases-state"&gt;Freezing a release&amp;rsquo;s state&lt;span class="hx:absolute hx:-mt-20" id="freezing-a-releases-state"&gt;&lt;/span&gt;
&lt;a href="#freezing-a-releases-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;At release time, after the tag exists, a final release that changed the state format gets its fixture. A release candidate gets none, even when it changed the state, and its final release&amp;rsquo;s fixture holds that state:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy the newest fixture&amp;rsquo;s &lt;code&gt;generate.sh&lt;/code&gt;, &lt;code&gt;generate.txtar&lt;/code&gt; and &lt;code&gt;README.md&lt;/code&gt; into &lt;code&gt;testdata/v&amp;lt;release&amp;gt;/&lt;/code&gt;. Set the tag, the version and the script&amp;rsquo;s name in &lt;code&gt;generate.sh&lt;/code&gt;, and add the VMs and commands to &lt;code&gt;generate.txtar&lt;/code&gt; that make the state the release added.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;generate.sh&lt;/code&gt; on a Mac and on Linux, which writes &lt;code&gt;darwin/&lt;/code&gt; and &lt;code&gt;linux/&lt;/code&gt;. 0.1.0&amp;rsquo;s were made on an arm64 Mac and on x86_64 Fedora.&lt;/li&gt;
&lt;li&gt;Add the release&amp;rsquo;s entries in &lt;code&gt;stateFixtures&lt;/code&gt;, &lt;code&gt;fixtureBinaries&lt;/code&gt; and &lt;code&gt;storeFixtures&lt;/code&gt;, and its scripts, made from the newest release&amp;rsquo;s scripts with checks of its own VMs.&lt;/li&gt;
&lt;li&gt;Commit the folder as the run left it. The older fixtures stay as they are.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 data-hextra-search-id="the-support-window"&gt;The support window&lt;span class="hx:absolute hx:-mt-20" id="the-support-window"&gt;&lt;/span&gt;
&lt;a href="#the-support-window" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;An upgrade from every release since 0.1.0 works until 1.0. When a release leaves the window, its fixture and the code that only its state needs, such as a reader of a field that only that release wrote, go together, in one commit that says which release left and why. The commit deletes &lt;code&gt;testdata/v&amp;lt;release&amp;gt;/&lt;/code&gt;, its scripts and its entries in the tables above.&lt;/p&gt;</description></item><item><title>Backends, toolchains and agents</title><link>https://next.devvm.dev/docs/contributing/extending/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/extending/</guid><description>
&lt;h2 data-hextra-search-id="how-a-backend-plugs-in"&gt;How a backend plugs in&lt;span class="hx:absolute hx:-mt-20" id="how-a-backend-plugs-in"&gt;&lt;/span&gt;
&lt;a href="#how-a-backend-plugs-in" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm runs every VM on Lima, but the rest of devvm reaches Lima only through the &lt;code&gt;backend.Backend&lt;/code&gt; interface in &lt;code&gt;internal/backend&lt;/code&gt;, so another backend is an addition rather than a change to the callers. A backend lives in a package of its own under &lt;code&gt;internal/backend&lt;/code&gt;, and it does four things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It implements &lt;code&gt;backend.Backend&lt;/code&gt;&lt;/strong&gt; and returns its errors instead of ending the run: a &lt;code&gt;msg.M&lt;/code&gt;, or &lt;code&gt;backend.Logged(m)&lt;/code&gt; once a logged command failed, so the command shows the run log&amp;rsquo;s end before the message. &lt;code&gt;Backend&lt;/code&gt; is the backend&amp;rsquo;s &lt;code&gt;Name&lt;/code&gt; and &lt;code&gt;Caps&lt;/code&gt; and four roles, each an interface of its own that every backend implements in full:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;backend.Host&lt;/code&gt; is what the backend needs of this machine and where it keeps its VMs there. &lt;code&gt;Problems&lt;/code&gt; lists what the host lacks for it, and &lt;code&gt;backend.Check(ctx, b)&lt;/code&gt; returns the first of them, so a backend doesn&amp;rsquo;t write a check of its own. &lt;code&gt;NameMax&lt;/code&gt; is the longest VM name it takes, &lt;code&gt;Location&lt;/code&gt; is where its VMs live when that can change between runs (&lt;code&gt;backend.LocationOf&lt;/code&gt;), and &lt;code&gt;DiskDirs&lt;/code&gt; and &lt;code&gt;Floors&lt;/code&gt; are the folders its disks are in and the free space it wants there (&lt;code&gt;backend.Space&lt;/code&gt;). A backend whose VMs can&amp;rsquo;t move returns &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; from &lt;code&gt;Location&lt;/code&gt;, and one whose disks aren&amp;rsquo;t on this machine returns no &lt;code&gt;DiskDirs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;backend.Images&lt;/code&gt; builds images and the shared tools&amp;rsquo; images and keeps the images. &lt;code&gt;BuildImage&lt;/code&gt; runs the spec&amp;rsquo;s &lt;code&gt;Recipe&lt;/code&gt; (&lt;code&gt;image.Recipe&lt;/code&gt;, which &lt;code&gt;internal/build&lt;/code&gt; puts together and &lt;code&gt;image.Input&lt;/code&gt; hashes) as it is, each &lt;code&gt;image.Step&lt;/code&gt; with its arguments and as root when it says so. &lt;code&gt;Origin&lt;/code&gt; is the backend&amp;rsquo;s own steps that base starts with, such as the Ubuntu image Lima pinned on this machine, a &lt;code&gt;--from&lt;/code&gt; image&amp;rsquo;s conversion, base&amp;rsquo;s disk size (&lt;code&gt;backend.BaseDiskGiB&lt;/code&gt;) and &lt;code&gt;base.yaml&lt;/code&gt;. Base&amp;rsquo;s size is &lt;code&gt;backend.BaseCPUs&lt;/code&gt;, &lt;code&gt;backend.BaseMemoryGiB&lt;/code&gt; and &lt;code&gt;backend.BaseDiskGiB&lt;/code&gt;, never read from a backend&amp;rsquo;s files. &lt;code&gt;internal/build&lt;/code&gt; puts them first in base&amp;rsquo;s recipe, as its &lt;code&gt;Origin&lt;/code&gt;, so base&amp;rsquo;s key hashes them, and &lt;code&gt;BuildImage&lt;/code&gt; is given them back and runs those rather than reading its own files again. &lt;code&gt;PinOrigin&lt;/code&gt; pins what base starts from on this machine, which &lt;code&gt;internal/build&lt;/code&gt; asks for before it keys a build (&lt;code&gt;backend.PinFirst&lt;/code&gt;): on Lima, that&amp;rsquo;s the newest Ubuntu cloud image (&lt;code&gt;state.UbuntuPin&lt;/code&gt;, found by &lt;code&gt;ubuntu.Finder&lt;/code&gt;). A base build&amp;rsquo;s &lt;code&gt;ImageSpec.Packages&lt;/code&gt;, a &lt;code&gt;backend.Packages&lt;/code&gt;, sends its packages into the VM&amp;rsquo;s &lt;code&gt;backend.PackagesDir&lt;/code&gt; before the steps and takes them out after, which &lt;code&gt;internal/build/packages.go&lt;/code&gt; records or replays and checks, and a step that exits &lt;code&gt;backend.ExitUnreachable&lt;/code&gt; fails as &lt;code&gt;build_sources_unreachable&lt;/code&gt;. &lt;code&gt;DeleteToolsLeft&lt;/code&gt; deletes the throwaway VMs that &lt;code&gt;BuildTools&lt;/code&gt; left, such as a killed run&amp;rsquo;s, and never another VM or an image, and it returns the ones it deleted, which devvm gc names. devvm gc asks for it while it holds the share&amp;rsquo;s lock, so no build of this data folder&amp;rsquo;s is using them, but a devvm with another data folder and the same Lima home holds a lock of its own (&lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;), so the two mustn&amp;rsquo;t build tools or run gc at once. A backend whose builds leave none does nothing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;backend.Machines&lt;/code&gt; makes, starts, stops, renames and deletes VMs, lists them, and runs commands and shells in them. A stopped VM changes only at &lt;code&gt;Start&lt;/code&gt;, which first checks with &lt;code&gt;backend.Validate&lt;/code&gt; that it can apply the VM&amp;rsquo;s &lt;code&gt;backend.Want&lt;/code&gt;, such as a disk no smaller than the VM&amp;rsquo;s own, and then applies what the &lt;code&gt;Want&lt;/code&gt; asks where it differs from the VM. &lt;code&gt;Start&lt;/code&gt; leaves a running VM as it is, and the callers, not the backend, warn that a change waits for the VM&amp;rsquo;s next start. On Lima, &lt;code&gt;Start&lt;/code&gt; owns the config&amp;rsquo;s &lt;code&gt;env:&lt;/code&gt;, &lt;code&gt;propagateProxyEnv&lt;/code&gt;, &lt;code&gt;dns&lt;/code&gt; and &lt;code&gt;hostResolver&lt;/code&gt;, and a project VM&amp;rsquo;s size, agent mounts and &lt;code&gt;forwardAgent&lt;/code&gt;, which it compares with the VM&amp;rsquo;s before its one edit (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;what devvm sets on a VM&lt;/a&gt;). Ports are never the backend&amp;rsquo;s: &lt;code&gt;vmssh.Forwards&lt;/code&gt; forwards them over the backend&amp;rsquo;s &lt;code&gt;SSH&lt;/code&gt;. &lt;code&gt;Running&lt;/code&gt; says how a VM runs now, in one &lt;code&gt;backend.Run&lt;/code&gt;: the ID of its current start, whether it&amp;rsquo;s confined to its proxy, and its lifeline, the file that the VM&amp;rsquo;s proxy and port forwarder follow. The backend runs no port forwarder of its own, and &lt;code&gt;SSH&lt;/code&gt; says how ssh, links and devvm&amp;rsquo;s forwarder (&lt;code&gt;vmssh.Forwards&lt;/code&gt;) reach a running VM&amp;rsquo;s sshd, a target that &lt;code&gt;vmssh.FromTarget&lt;/code&gt; checks. Every ssh of devvm&amp;rsquo;s to a VM, its port forwarder&amp;rsquo;s included, refuses a target that isn&amp;rsquo;t on this machine&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;, with &lt;code&gt;vmssh.FromTarget&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/backends/#what-each-backend-emulates"&gt;what each backend emulates&lt;/a&gt;). All three get it through &lt;code&gt;vmssh.Checked&lt;/code&gt;, which checks the review lets the backend&amp;rsquo;s ssh through, checks the target, and adds the VM&amp;rsquo;s host keys for its current start, reading the record (&lt;code&gt;vmssh.ReadKeys&lt;/code&gt;) or pinning the keys first (&lt;code&gt;vmssh.PinKeys&lt;/code&gt;). A VM whose ssh isn&amp;rsquo;t usable fails with a &lt;code&gt;*vmssh.UnusableError&lt;/code&gt; and one without host keys with &lt;code&gt;vmssh.ErrNoHostKeys&lt;/code&gt;, which the ssh config skips on. &lt;code&gt;Exec&lt;/code&gt; passes its &lt;code&gt;backend.ExecOpts&lt;/code&gt; streams on as they are. When they&amp;rsquo;re a terminal&amp;rsquo;s files, the command must get a terminal in the VM, as a shell does, because an agent&amp;rsquo;s login that draws full-screen needs one, and any other streams are pipes (&lt;code&gt;TestExecStreamsAsGiven&lt;/code&gt; on Lima).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;backend.Housekeeping&lt;/code&gt; is what devvm space and devvm gc ask: &lt;code&gt;Usage&lt;/code&gt;, &lt;code&gt;Strays&lt;/code&gt;, and &lt;code&gt;DevvmCache&lt;/code&gt; and &lt;code&gt;DeleteCache&lt;/code&gt; for its own caches. A backend that can&amp;rsquo;t tell returns none. devvm gc also asks &lt;code&gt;backend.Images&lt;/code&gt; for &lt;code&gt;DeleteToolsLeft&lt;/code&gt;, which sits beside &lt;code&gt;BuildTools&lt;/code&gt;, whose VMs it deletes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;backend.Forgetter&lt;/code&gt; is the one role a backend may leave out, for the files it keeps for a VM besides the VM. Lima keeps none. Lima&amp;rsquo;s type, &lt;code&gt;lima.Lima&lt;/code&gt;, holds the backend&amp;rsquo;s fields, &lt;code&gt;Name&lt;/code&gt;, &lt;code&gt;Caps&lt;/code&gt; and the helpers its roles share, and it embeds one type for each role, &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;images&lt;/code&gt;, &lt;code&gt;machines&lt;/code&gt; and &lt;code&gt;housekeeping&lt;/code&gt;, each over the &lt;code&gt;Lima&lt;/code&gt; it&amp;rsquo;s part of. &lt;code&gt;backendtest.Fake&lt;/code&gt; is split the same way. So no type has more methods than the structure test allows, and a new method goes on the type of its role.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It declares &lt;code&gt;Caps&lt;/code&gt;&lt;/strong&gt;, saying for each of &lt;code&gt;backend.Features&lt;/code&gt; whether it has the feature natively, emulates it, or lacks it (&lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt;). It lists every feature by hand, &lt;code&gt;None&lt;/code&gt; included, and &lt;code&gt;Registry.Register&lt;/code&gt; refuses &lt;code&gt;Caps&lt;/code&gt; that leave one out or rate a feature better than the one &lt;code&gt;Feature.BuiltOn&lt;/code&gt; says it&amp;rsquo;s built on (&lt;code&gt;Caps.Check&lt;/code&gt;). The callers, not the backend, decide what a VM needs, and they check it with the registry&amp;rsquo;s &lt;code&gt;Review.Require(b, vm, spec.Features()...)&lt;/code&gt; before they act. A feature the backend lacks fails in one line that names the VM and what to do, and devvm never falls back to something weaker. An emulation stays refused until its review passes: a design note in &lt;a href="https://next.devvm.dev/docs/contributing/design/"&gt;the design notes&lt;/a&gt;, a threat check with the security-audit skill, and end-to-end checks that prove its guarantee.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It&amp;rsquo;s registered in &lt;code&gt;registry.New&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;internal/backend/registry&lt;/code&gt;), the only place besides &lt;code&gt;internal/cli&lt;/code&gt; that imports a backend. The registry hands the backend out behind its guard, which checks every &lt;code&gt;CreateVM&lt;/code&gt;, &lt;code&gt;Start&lt;/code&gt;, &lt;code&gt;BuildImage&lt;/code&gt; and &lt;code&gt;BuildTools&lt;/code&gt; call before the backend sees it. The guard refuses a spec that needs a feature &lt;code&gt;Review.Require&lt;/code&gt; would refuse, using the specs&amp;rsquo; own &lt;code&gt;Features&lt;/code&gt;, and a build spec whose &lt;code&gt;ImageSpec.Validate&lt;/code&gt; or &lt;code&gt;ToolsSpec.Validate&lt;/code&gt; fails, such as one with a network that isn&amp;rsquo;t a build&amp;rsquo;s or a key that isn&amp;rsquo;t one. So a caller that forgets &lt;code&gt;Require&lt;/code&gt; still can&amp;rsquo;t reach a backend with a feature it lacks, and the backend doesn&amp;rsquo;t check those specs itself. The guard has every role&amp;rsquo;s methods, its own in place of the backend&amp;rsquo;s for those calls, so a guarded backend handed on as a &lt;code&gt;backend.Images&lt;/code&gt; or a &lt;code&gt;backend.Machines&lt;/code&gt; is still guarded. The guard&amp;rsquo;s type has only &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s methods, so code that looks for an optional role, such as &lt;code&gt;backend.Forgetter&lt;/code&gt;, uses &lt;code&gt;backend.As&lt;/code&gt; instead of a type assertion, and the structure test fails on a type assertion to a backend package&amp;rsquo;s type anywhere but the guard.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It names its images by key&lt;/strong&gt;, and an image&amp;rsquo;s key hashes the backend&amp;rsquo;s name, so two backends never share an image.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It passes the conformance suite&lt;/strong&gt;, &lt;code&gt;backendtest.Conformance(t, factory)&lt;/code&gt;, which checks the contract that &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s documentation gives. The backend&amp;rsquo;s tests call it with a factory that returns a new &lt;code&gt;backendtest.Subject&lt;/code&gt; for each check, and each check runs as a subtest. The subject is the backend, holding one image, whose key is &lt;code&gt;Image&lt;/code&gt;, and no VMs. &lt;code&gt;Dir&lt;/code&gt; is a folder of the check&amp;rsquo;s own for the folders its VMs mount, &lt;code&gt;Boots&lt;/code&gt; says whether its VMs start, and &lt;code&gt;Restart&lt;/code&gt; starts a running VM again outside &lt;code&gt;Start&lt;/code&gt;, as a command of the user&amp;rsquo;s own would. The suite checks every role&amp;rsquo;s answers and the empty answers each role allows, that a VM is made, renamed and deleted as its spec says, and that a missing VM is &lt;code&gt;backend.ErrNotFound&lt;/code&gt;. It also checks that &lt;code&gt;Running&lt;/code&gt; gives a stopped VM its lifeline with an empty &lt;code&gt;ID&lt;/code&gt;, that every start gets another &lt;code&gt;ID&lt;/code&gt;, that a VM is &lt;code&gt;Confined&lt;/code&gt; only while it runs on a start &lt;code&gt;Start&lt;/code&gt; made with &lt;code&gt;NetProxy&lt;/code&gt;, and that the registry&amp;rsquo;s guard still refuses what the backend lacks when the backend is used as &lt;code&gt;backend.Images&lt;/code&gt; or &lt;code&gt;backend.Machines&lt;/code&gt; alone. &lt;code&gt;checkProxyURL&lt;/code&gt; checks what the open tier needs of every backend, which has no feature of its own (&lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt;): a VM on the backend&amp;rsquo;s own network (&lt;code&gt;NetDirect&lt;/code&gt;) reaches a port on the host&amp;rsquo;s loopback, and the guest&amp;rsquo;s proxy settings come from the confinement (&lt;code&gt;Confinement.GuestProxy&lt;/code&gt;, &lt;code&gt;ProxyURL&lt;/code&gt;). When &lt;code&gt;Boots&lt;/code&gt; is false, the checks that need a running VM are skipped with the reason, and when &lt;code&gt;Restart&lt;/code&gt; is nil, so is the one that needs it. &lt;code&gt;backendtest.Fake&lt;/code&gt; runs the suite in &lt;code&gt;internal/backend/backendtest&lt;/code&gt;, and &lt;code&gt;TestConformance&lt;/code&gt; in &lt;code&gt;internal/backend/lima&lt;/code&gt; runs it on Lima twice: on the limactl stub, whose VMs start, and on real Lima&amp;rsquo;s dummy instances, which can&amp;rsquo;t boot, so the checks that need a running VM are left to the end-to-end tests. The real Lima run skips when limactl isn&amp;rsquo;t on &lt;code&gt;PATH&lt;/code&gt;. &lt;code&gt;TestConformanceFinds&lt;/code&gt; checks the suite itself: each of a set of fakes that breaks the contract in one method fails the check meant to catch it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The registry&amp;rsquo;s &lt;code&gt;For&lt;/code&gt; chooses a VM&amp;rsquo;s backend: a VM that exists gets the one its state records in &lt;code&gt;backend=&lt;/code&gt;, and a new VM gets &lt;code&gt;backend.Default&lt;/code&gt;, which is &lt;code&gt;lima&lt;/code&gt;. Tests set the registry&amp;rsquo;s &lt;code&gt;NewVMs&lt;/code&gt; to give new VMs a fake backend (&lt;code&gt;backendtest.Fake&lt;/code&gt;). The command line has no way to choose a backend, so a second backend would also add one, following the &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/cli/SKILL.md" target="_blank" rel="noopener"&gt;cli skill&lt;/a&gt;, together with its column in the tables that list VMs, images and caches. &lt;code&gt;--json&lt;/code&gt; output already names each VM&amp;rsquo;s, image&amp;rsquo;s and shared tool&amp;rsquo;s backend.&lt;/p&gt;
&lt;p&gt;A new backend gets a design note and a threat check with the security-audit skill before any of its emulations is marked reviewed, and that check covers what Lima gets from its VMs&amp;rsquo; design. A VM started outside devvm must not forward an agent devvm didn&amp;rsquo;t choose, a VM whose root can change its own network must not count as confined, a secret the proxy needs goes in a private file and never in a command&amp;rsquo;s arguments, and a socket on this machine goes in a private folder.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-a-toolchain"&gt;Adding a toolchain&lt;span class="hx:absolute hx:-mt-20" id="adding-a-toolchain"&gt;&lt;/span&gt;
&lt;a href="#adding-a-toolchain" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each toolchain is one &lt;code&gt;image.ToolDef&lt;/code&gt; entry in &lt;code&gt;image.SharedTools&lt;/code&gt;, in &lt;code&gt;internal/image/tool.go&lt;/code&gt;, and the rest of devvm reads every list of the toolchains and every fact of one from there: its members in the lock, the files in a project folder that call for it, its installer, the environment that every VM&amp;rsquo;s shells get, the folders of the VM&amp;rsquo;s home that go on every VM&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, and the members whose version files mise reads. &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;devvm tools&lt;/code&gt;, the picker, shell completion, the new VM&amp;rsquo;s summary and the &lt;code&gt;devcontainer.json&lt;/code&gt; features that devvm maps list the toolchains from the table too, and every launch writes the environment, the &lt;code&gt;PATH&lt;/code&gt; folders and the version files into the VM, so a new toolchain changes no image. A new toolchain that mise installs from the lock&amp;rsquo;s checked downloads, as it installs node, python and go, needs these files and nothing else:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;internal/image/tool.go&lt;/code&gt;: its entry, with its &lt;code&gt;Env&lt;/code&gt;, &lt;code&gt;PathDirs&lt;/code&gt; and &lt;code&gt;VersionFiles&lt;/code&gt; when it has them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;: a line in &lt;code&gt;[tools]&lt;/code&gt; for each member, with its hold, and a line in &lt;code&gt;[tool_alias]&lt;/code&gt; for each member that isn&amp;rsquo;t one of mise&amp;rsquo;s own (&lt;code&gt;core:&lt;/code&gt;), naming the backend it comes from.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/&amp;lt;name&amp;gt;.policy&lt;/code&gt;: the hosts its allowlist allows, such as its package registry and the downloads of the versions a project asks for.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;testdata/mise.lock&lt;/code&gt; and &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;: each member&amp;rsquo;s lock entry, which &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; writes into the second.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docs/content/docs/using/toolchains.md&lt;/code&gt;: its row in the table, in the registry&amp;rsquo;s order, its section, with what it brings, the files that call for it, its version files, its global installs and its allowlist, and its row in the glibc table of Which bases they run on.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tests/e2e/tools_test.go&lt;/code&gt;: its checks, such as a project&amp;rsquo;s VM that its files call for, a global install and a version file&amp;rsquo;s own version.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then the golden files in &lt;code&gt;internal/vm/testdata/golden&lt;/code&gt; take its environment, its &lt;code&gt;PATH&lt;/code&gt; folders and its version files with &lt;code&gt;UPDATE_GOLDEN=1 go test ./internal/vm -run Golden&lt;/code&gt;, and a reviewer reads their diff. &lt;code&gt;TestToolchainsComplete&lt;/code&gt;, &lt;code&gt;TestToolchainGuest&lt;/code&gt;, &lt;code&gt;TestSharedToolsPolicies&lt;/code&gt; and &lt;code&gt;TestConfigTools&lt;/code&gt; fail until those files match the table, and the structure test fails on a string literal elsewhere that is its name or a member&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;A toolchain that needs more than mise&amp;rsquo;s install gets code of its own, which the table can&amp;rsquo;t hold. A step in each VM, such as rust&amp;rsquo;s rustup in &lt;code&gt;~/.cargo&lt;/code&gt;, go&amp;rsquo;s telemetry switch or dotnet&amp;rsquo;s &lt;code&gt;/etc/dotnet/install_location&lt;/code&gt;, is a block of &lt;code&gt;assets/guest/sync.sh&lt;/code&gt; that reads the toolchain&amp;rsquo;s version from the VM&amp;rsquo;s tool list. An install that mise can&amp;rsquo;t check, such as rust&amp;rsquo;s, which rustup checks against its own signed manifest, or dotnet&amp;rsquo;s, whose SDK archive devvm adds to the lock with its SHA-512, is an &lt;code&gt;Installer&lt;/code&gt; of its own, with its branch in &lt;code&gt;assets/shared-tools/build.sh&lt;/code&gt; and its handling of the lock in &lt;code&gt;internal/tools&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-a-coding-agent"&gt;Adding a coding agent&lt;span class="hx:absolute hx:-mt-20" id="adding-a-coding-agent"&gt;&lt;/span&gt;
&lt;a href="#adding-a-coding-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each coding agent is one &lt;code&gt;agents.Def&lt;/code&gt; in &lt;code&gt;internal/agents/agents.go&lt;/code&gt;, and the rest of devvm reads every list of the agents and every fact of one from there: its shared tool (&lt;code&gt;image.SharedTools&lt;/code&gt; makes its entry, glibc-only or not), its settings folders and files with each file&amp;rsquo;s format, its &lt;code&gt;Seeds&lt;/code&gt;, its &lt;code&gt;Names&lt;/code&gt; and &lt;code&gt;NamedValues&lt;/code&gt;, the folder that &lt;code&gt;devvm agent import&lt;/code&gt; copies from, which of that folder&amp;rsquo;s entries are each machine&amp;rsquo;s own (its &lt;code&gt;FolderOwn&lt;/code&gt;), which neither the import nor the save copies and no VM gets, its login files and their kinds, its history and what an export leaves out of it (its logins, and what&amp;rsquo;s the VM&amp;rsquo;s own as a machine, its &lt;code&gt;HistoryOwn&lt;/code&gt;, which a VM made again keeps), where in that history it makes git worktrees, which &lt;code&gt;devvm rm&lt;/code&gt; and a remake with &lt;code&gt;--clean-home&lt;/code&gt; check for uncommitted changes first (its &lt;code&gt;Worktrees&lt;/code&gt;), the environment that every VM&amp;rsquo;s shells get, which turns off its self-update and telemetry, the secret every VM with it uses, how &lt;code&gt;devvm agent login&lt;/code&gt; logs it in (its &lt;code&gt;Login&lt;/code&gt;: the command lines of its own login, with a code and for a setup token, and whether the login comes back to a forwarded port or you paste a code back; or API keys alone), whether &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt; takes it, and its row in the docs&amp;rsquo; Supported agents table (its &lt;code&gt;Docs&lt;/code&gt;). Its &lt;code&gt;Seeds&lt;/code&gt; are the folders it reads in a VM as a seed of a folder of the VM&amp;rsquo;s own, such as Claude Code&amp;rsquo;s plugins. Each one has the link that the VM&amp;rsquo;s home puts the store&amp;rsquo;s folder at and the entries that &lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; copy, which &lt;code&gt;agents.MachineOwn&lt;/code&gt; judges. Its &lt;code&gt;Names&lt;/code&gt; and &lt;code&gt;NamedValues&lt;/code&gt; are the tables in its settings files whose keys are names you choose, such as its MCP servers&amp;rsquo;, which &lt;code&gt;agentlogin.Redact&lt;/code&gt; doesn&amp;rsquo;t judge as keys, read from the agent&amp;rsquo;s own docs. The commands&amp;rsquo; help, &lt;code&gt;--agents&lt;/code&gt;, the picker, shell completion, the messages and the CLI tests&amp;rsquo; lists of the agents all come from the registry too. A new agent that works like one devvm has needs these files and nothing else:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;internal/agents/agents.go&lt;/code&gt;: its &lt;code&gt;Def&lt;/code&gt; and its name&amp;rsquo;s constant.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;: its line in &lt;code&gt;[tool_alias]&lt;/code&gt;, the backend it comes from, and in &lt;code&gt;[tools]&lt;/code&gt;, its version.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/&amp;lt;name&amp;gt;.policy&lt;/code&gt;: the hosts its allowlist allows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;testdata/mise.lock&lt;/code&gt; and &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;: its lock entry, which &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; writes into the second.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docs/content/docs/using/coding-agents.md&lt;/code&gt;: a section on its login when it has one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CHANGELOG.md&lt;/code&gt;: its entry.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tests/e2e/network_test.go&lt;/code&gt;: its name in the network section&amp;rsquo;s &lt;code&gt;--agents&lt;/code&gt; list, which launches one VM with every agent, and the checks of its allowlist, its login and its copies there.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/guest/sync.sh&lt;/code&gt;, only when it needs setup in the VM beyond its settings and logins, as Claude Code&amp;rsquo;s link in &lt;code&gt;~/.local/bin&lt;/code&gt; and Codex&amp;rsquo;s lines in its &lt;code&gt;config.toml&lt;/code&gt; do.&lt;/li&gt;
&lt;li&gt;When it keeps a login file: a format for each of its kinds in a file of its own in &lt;code&gt;internal/agentlogin&lt;/code&gt;, named for the agent, with the &lt;code&gt;format&lt;/code&gt; interface&amp;rsquo;s methods, &lt;code&gt;kind&lt;/code&gt; naming its kind (and &lt;code&gt;keyFormat&lt;/code&gt; or &lt;code&gt;chatGPTFormat&lt;/code&gt; when its &lt;code&gt;Def&lt;/code&gt; says it saves API keys or holds a ChatGPT login, and &lt;code&gt;captureFormat&lt;/code&gt; when the VM&amp;rsquo;s proxy captures its logins: its token endpoints, the start of its &lt;code&gt;User-Agent&lt;/code&gt; when another agent shares an endpoint, its capture and its reply to the VM&amp;rsquo;s own refresh), added to the list in &lt;code&gt;formats&lt;/code&gt; in &lt;code&gt;format.go&lt;/code&gt;, with its fixture in &lt;code&gt;goldenLogins&lt;/code&gt; (&lt;code&gt;internal/agentlogin/golden_test.go&lt;/code&gt;) and its golden file, and its format&amp;rsquo;s section in &lt;code&gt;internals/network.md&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then &lt;code&gt;mise run cli-docs&lt;/code&gt; writes the agent&amp;rsquo;s row in the Supported agents table, its name in the README&amp;rsquo;s list and the CLI pages whose help lists the agents, and the golden files in &lt;code&gt;internal/vm/testdata/golden&lt;/code&gt; take its paths with &lt;code&gt;UPDATE_GOLDEN=1 go test ./internal/vm -run Golden&lt;/code&gt;. &lt;code&gt;TestDefsComplete&lt;/code&gt;, &lt;code&gt;TestFormatsCoverLogins&lt;/code&gt;, &lt;code&gt;TestSharedToolsPolicies&lt;/code&gt;, &lt;code&gt;TestConfigTools&lt;/code&gt; and &lt;code&gt;TestReferenceIsCurrent&lt;/code&gt; fail until those files match the registry. Code of the agent&amp;rsquo;s own, such as a settings filter or a login of its own, goes in a file named for the agent, such as &lt;code&gt;claude.go&lt;/code&gt; or &lt;code&gt;agentlogin_claude.go&lt;/code&gt;, and names the agent by its constant in &lt;code&gt;internal/agents&lt;/code&gt;, so the code for every agent calls a hook there rather than asking which agent it has. The structure test fails on a string literal elsewhere that is the agent&amp;rsquo;s name or holds its folder, on code outside the agent&amp;rsquo;s own files that compares with its constant, has a &lt;code&gt;case&lt;/code&gt; for it, looks for it or keys a map on it, on a list in Go that names every agent, tests included, and on a CLI test script&amp;rsquo;s line that lists agents as a message does, which &lt;code&gt;$AGENT_CHOICES&lt;/code&gt;, &lt;code&gt;$LOGIN_AGENTS&lt;/code&gt; and &lt;code&gt;$KEY_AGENTS&lt;/code&gt; stand in for. The network section of the e2e tests drives every agent, so the new one gets its checks there.&lt;/p&gt;
&lt;h3 data-hextra-search-id="adding-a-provider"&gt;Adding a provider&lt;span class="hx:absolute hx:-mt-20" id="adding-a-provider"&gt;&lt;/span&gt;
&lt;a href="#adding-a-provider" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The model providers whose API keys the VM&amp;rsquo;s proxy puts in for the agents with a key for each provider, opencode and pi, are one table, &lt;code&gt;agents.Providers&lt;/code&gt; in &lt;code&gt;internal/agents/agents.go&lt;/code&gt;. Each &lt;code&gt;agents.Provider&lt;/code&gt; holds the provider&amp;rsquo;s ID, which is its entry&amp;rsquo;s name in both agents&amp;rsquo; &lt;code&gt;auth.json&lt;/code&gt;, its name as people know it, the hosts the agents send its key to, its &lt;code&gt;Path&lt;/code&gt; when the agents send the key below one path of those hosts alone, such as OpenRouter&amp;rsquo;s &lt;code&gt;/api/&lt;/code&gt;, the &lt;code&gt;Headers&lt;/code&gt; they send it in, most often one but two for OpenRouter, whose Anthropic models take the key in &lt;code&gt;x-api-key&lt;/code&gt;, and its &lt;code&gt;Prefix&lt;/code&gt;, which starts the key&amp;rsquo;s placeholder when an agent checks how the provider&amp;rsquo;s keys start: pi takes an OpenAI key that doesn&amp;rsquo;t start with &lt;code&gt;sk-&lt;/code&gt; for a Sign in with ChatGPT login, so OpenAI&amp;rsquo;s is &lt;code&gt;sk-&lt;/code&gt;. The opencode and pi formats&amp;rsquo; bindings, &lt;code&gt;agentlogin.KeyProviders&lt;/code&gt;, which &lt;code&gt;devvm agent login --provider&lt;/code&gt; takes and its help lists, and the allowlist lines of each binding&amp;rsquo;s hosts all come from it. A new provider is its entry there, in the order of its ID, and its row in the table in &lt;code&gt;using/coding-agents.md&lt;/code&gt;&amp;rsquo;s API keys the proxy puts in, which &lt;code&gt;TestProvidersComplete&lt;/code&gt; checks against the registry. Read the hosts, the paths, the headers and any check of how a key starts in both agents&amp;rsquo; own source first, and in the SDK that each one sends its requests with, because a header that differs from the agents&amp;rsquo;, or one that an agent uses for some models alone, leaves the key&amp;rsquo;s placeholder in the request, and a host that the agents never send the key to would get the key anyway. The proxy puts a provider&amp;rsquo;s key in only when the header&amp;rsquo;s value is the placeholder alone, or &lt;code&gt;Bearer&lt;/code&gt; and the placeholder in &lt;code&gt;Authorization&lt;/code&gt;, so check that both agents send the key that way too. A &lt;code&gt;Path&lt;/code&gt; starts and ends with &lt;code&gt;/&lt;/code&gt;, is clean, and goes into each binding as its &lt;code&gt;Path&lt;/code&gt;, below which &lt;code&gt;pathWithin&lt;/code&gt; takes a request&amp;rsquo;s path, so set one only when every request of both agents with the key goes below it. Then &lt;code&gt;mise run cli-docs&lt;/code&gt; writes the CLI page whose help lists the providers, and &lt;code&gt;UPDATE_GOLDEN=1 go test ./internal/agentlogin -run Golden&lt;/code&gt; writes the golden files that list them.&lt;/p&gt;</description></item><item><title>Port forwarding</title><link>https://next.devvm.dev/docs/internals/ports/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/ports/</guid><description>
&lt;p&gt;This page explains how devvm&amp;rsquo;s forwarder forwards a VM&amp;rsquo;s ports to this machine, which ports it never takes, and how it runs. &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;Ports and size&lt;/a&gt; covers choosing a VM&amp;rsquo;s ports with &lt;code&gt;--ports&lt;/code&gt; and &lt;code&gt;devvm ports&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;devvm forwards a VM&amp;rsquo;s ports with its own forwarder, never with Lima&amp;rsquo;s own forwards. &lt;a href="https://next.devvm.dev/docs/internals/lima/#ports"&gt;Lima&lt;/a&gt; explains why, and what devvm sets on Lima instead.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-it-forwards"&gt;What it forwards&lt;span class="hx:absolute hx:-mt-20" id="what-it-forwards"&gt;&lt;/span&gt;
&lt;a href="#what-it-forwards" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;Ports&lt;/a&gt; lists which ports the forwarder forwards, for &lt;code&gt;--ports all&lt;/code&gt;, the default, and for a list such as &lt;code&gt;--ports 5173,8000-8010&lt;/code&gt;, and how soon. A listed port also carries a server on the VM&amp;rsquo;s loopback (&lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt;) to this machine. You can list port 22, which forwards the VM&amp;rsquo;s sshd to port 22 on this machine, while ssh by name keeps using the VM&amp;rsquo;s own ssh port.&lt;/p&gt;
&lt;p&gt;The forwarder never forwards a server on an address in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, on any VM, because that&amp;rsquo;s where a VM listens for its &lt;a href="#links-between-vms"&gt;links to other VMs&lt;/a&gt;, so a link never appears on this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;. A server of the VM&amp;rsquo;s own on &lt;code&gt;127.0.0.1&lt;/code&gt; with the same port is forwarded as usual. It also never forwards a server on &lt;code&gt;127.0.77.1&lt;/code&gt;, where the desktop&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/desktop/#the-local-proxy"&gt;local proxy&lt;/a&gt; listens, because the local proxy adds the VM&amp;rsquo;s password to what it sends to the VM&amp;rsquo;s proxy, and on this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; other users and programs could use it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-it-never-takes"&gt;What it never takes&lt;span class="hx:absolute hx:-mt-20" id="what-it-never-takes"&gt;&lt;/span&gt;
&lt;a href="#what-it-never-takes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The forwarder never takes a port that a program on this machine has on any address. That program keeps the port and its &lt;code&gt;localhost&lt;/code&gt; connections, and the forward waits until the VM&amp;rsquo;s server stops and starts again.&lt;/p&gt;
&lt;p&gt;The forwarder also never takes a port that devvm records for a VM, even while that port is free. Those are the ssh, proxy and desktop ports that devvm chooses for VMs, running or not, and the VM&amp;rsquo;s own ssh port. devvm chooses and records every VM&amp;rsquo;s ssh port, whatever its tier, so no forwarder takes it in the seconds before Lima binds it (&lt;a href="https://next.devvm.dev/docs/contributing/design/#ports-on-lima"&gt;the threat check&lt;/a&gt;). It chooses that port only from the 17 ports that every browser refuses (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;the ssh port&lt;/a&gt;), which devvm&amp;rsquo;s proxy and desktop ports never take. A forwarder never takes one of those 17 either, unless its VM lists it, so a VM that forwards every port can&amp;rsquo;t take the ports other VMs&amp;rsquo; ssh needs. When devvm chooses one of those ports, it also avoids every port that any VM lists, running or not, so a stopped VM&amp;rsquo;s listed ports stay free for it.&lt;/p&gt;
&lt;p&gt;When a start, or a change of a running VM&amp;rsquo;s ports, finds that a program on this machine has a listed port, devvm doesn&amp;rsquo;t forward that port and warns you (&lt;code&gt;ports_taken&lt;/code&gt;). The VM starts or runs on all the same, and the next start or change that finds the port free forwards it again. &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;Ports&lt;/a&gt; says what happens to a program that binds a port on all addresses after the forwarder has forwarded it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="ports-other-vms-forward"&gt;Ports other VMs forward&lt;span class="hx:absolute hx:-mt-20" id="ports-other-vms-forward"&gt;&lt;/span&gt;
&lt;a href="#ports-other-vms-forward" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A host port that two VMs could forward belongs to the running VM that forwards it, never to a stopped one, so a stopped VM&amp;rsquo;s listed ports are free to the others until it starts again. Each forwarder writes the ports it forwards to &lt;code&gt;ports.forwarded&lt;/code&gt; in its VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, after each change, with its pid on the first line and the ports it forwards on the second. The next three lines hold the ports it tried and couldn&amp;rsquo;t take, by why: those a program on this machine has, those past its limit of 256 forwards, and those this machine refused for another reason, such as a port below 1024 on Linux. It writes an empty record when it starts. A record counts only while that pid is the VM&amp;rsquo;s running forwarder, as &lt;code&gt;ports.pid&lt;/code&gt; and the process&amp;rsquo;s arguments say, so the record of a VM that stopped or crashed, whose forwarder ended with it, holds nothing. devvm also removes the record under the VM&amp;rsquo;s &lt;code&gt;ports.lock&lt;/code&gt; each time it starts the VM&amp;rsquo;s forwarder, so a pid used again never makes an old record count.&lt;/p&gt;
&lt;p&gt;At each report from its VM, every forwarder reads the other VMs&amp;rsquo; states and records again, and it never takes these ports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a port that another VM&amp;rsquo;s running forwarder forwards now&lt;/li&gt;
&lt;li&gt;a port that another VM lists while that VM has a claim on it, unless this VM lists it too. A VM has a claim while its forwarder runs, and while devvm holds its &lt;code&gt;ports.lock&lt;/code&gt; to start the forwarder again, so no other VM takes its listed ports between the old forwarder&amp;rsquo;s stop and the new one&amp;rsquo;s start.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A VM that lists a port comes before one that forwards every port. Besides its VM&amp;rsquo;s reports, every forwarder checks the ports it forwards against those rules every 10 seconds on its own clock and closes a forward whose port is now another VM&amp;rsquo;s, so a VM that keeps its session open without reporting can&amp;rsquo;t keep a port. Closing a forward also closes the connections it accepted that are still open, such as a browser&amp;rsquo;s keep-alive connections, so none of them reaches the old VM afterwards. A VM that forwards every port therefore gives up a port within about 10 seconds of a running VM listing it.&lt;/p&gt;
&lt;p&gt;A port the forwarder never takes for those reasons, and that its VM listens on, waits: the forwarder tries it again at each report, which comes at least every 10 seconds, and forwards it once it&amp;rsquo;s free, even when an earlier try found it taken. A port the other VM gives up can therefore take up to about 20 seconds to reach this VM: up to 10 for the other forwarder&amp;rsquo;s check and up to 10 for this one&amp;rsquo;s next report. When a start or a change of ports finds that another VM forwards one of the VM&amp;rsquo;s listed ports now, whether that VM lists it or forwards every port, devvm keeps the port in the VM&amp;rsquo;s list and warns you (&lt;code&gt;ports_held&lt;/code&gt;), and &lt;code&gt;devvm ports&lt;/code&gt; warns again, with the other VM in its JSON&amp;rsquo;s &lt;code&gt;held_by&lt;/code&gt;. A port that another VM forwards isn&amp;rsquo;t a program&amp;rsquo;s, so it never gets &lt;code&gt;ports_taken&lt;/code&gt;. A listed port of a running VM that its forwarder tried and couldn&amp;rsquo;t take is only logged by the forwarder, and &lt;code&gt;devvm ports&lt;/code&gt; warns about it, as &lt;a href="#when-it-cant-forward"&gt;When it can&amp;rsquo;t forward&lt;/a&gt; describes.&lt;/p&gt;
&lt;p&gt;When two VMs that list the same port start at once, neither waits for the other, because neither forwards it yet. The first forwarder to bind the port on this machine&amp;rsquo;s loopback has it, because the system lets one listener have it, and the other forwarder&amp;rsquo;s try fails. That forwarder sees the winner&amp;rsquo;s record at its next report and waits for the port from then on. No lock is needed for this, and no port is shared.&lt;/p&gt;
&lt;h2 data-hextra-search-id="how-it-reaches-the-vm"&gt;How it reaches the VM&lt;span class="hx:absolute hx:-mt-20" id="how-it-reaches-the-vm"&gt;&lt;/span&gt;
&lt;a href="#how-it-reaches-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The forwarder reaches the VM over the VM&amp;rsquo;s ssh, with a key and a host key that devvm pins, and it asks for no forwarding into this machine. Only a &lt;a href="#the-link-session"&gt;link session&lt;/a&gt; asks a VM for a remote forward, on a connection of its own. Every connection starts on this machine, and the VM opens none to it. The VM sees each forwarded connection only as one to its own loopback, and on a confined tier the VM still reaches only its proxy.&lt;/p&gt;
&lt;p&gt;A connection to a forwarded port, such as 5173, takes this path:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 455px; --devvm-diagram-width: 320px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 320 455" width="320" height="455" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="ddbfff724d47f759c--title" aria-describedby="ddbfff724d47f759c--desc"&gt;&lt;title id="ddbfff724d47f759c--title"&gt;A connection to a forwarded port&lt;/title&gt;&lt;desc id="ddbfff724d47f759c--desc"&gt;Your browser on this machine connects to localhost:5173, where devvm's forwarder, on this machine, takes it over ssh, with a key and a host key devvm pins, to the VM's sshd, which connects to your server on the VM's own loopback, 127.0.0.1:5173.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_browser_fwd_0"&gt;&lt;path d="M159.64,68L159.64,128"/&gt;&lt;path class="pele-marker" d="M159.64,135L156.28,127L163,127Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_fwd_sshd_0"&gt;&lt;path d="M159.64,195L159.64,269"/&gt;&lt;path class="pele-marker" d="M159.64,276L156.28,268L163,268Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_sshd_server_0"&gt;&lt;path d="M159.64,321L159.64,395"/&gt;&lt;path class="pele-marker" d="M159.64,402L156.28,394L163,394Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_browser_fwd_0"&gt;&lt;rect x="93.27" y="92.5" width="132.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="159.64" y="105.7" text-anchor="middle"&gt;localhost:5173&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_fwd_sshd_0"&gt;&lt;rect x="62.09" y="219.5" width="195.09" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="159.64" y="231.7"&gt;ssh, with a key and&lt;/tspan&gt;&lt;tspan x="159.64" y="247.7"&gt;a host key devvm pins&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_sshd_server_0"&gt;&lt;rect x="84.36" y="345.5" width="150.55" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="159.64" y="357.7"&gt;127.0.0.1:5173,&lt;/tspan&gt;&lt;tspan x="159.64" y="373.7"&gt;its own loopback&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="browser" transform="translate(159.64,38)"&gt;&lt;rect x="-151.64" y="-30" width="303.27" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;your browser, on this machine,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;where every connection starts&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="fwd" transform="translate(159.64,165)"&gt;&lt;rect x="-98.18" y="-30" width="196.36" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;devvm's forwarder,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;on this machine&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="sshd" transform="translate(159.64,298.5)"&gt;&lt;rect x="-75.91" y="-22.5" width="151.82" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the VM's sshd&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="server" transform="translate(159.64,424.5)"&gt;&lt;rect x="-116" y="-22.5" width="232" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;your server, in the VM&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;The forwarder is devvm&amp;rsquo;s own, the same on every backend. The backend only says how the forwarder reaches a running VM&amp;rsquo;s sshd, which is a user, a key and a port on this machine&amp;rsquo;s loopback, and which file the forwarder follows to know the VM still runs, as Lima&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/lima/#ports"&gt;Ports&lt;/a&gt; section describes.&lt;/p&gt;
&lt;p&gt;Each forwarded connection gets an ssh process of its own, which carries it over the forwarder&amp;rsquo;s ssh connection to the VM, and the forwarder carries at most 256 connections at once, refusing the next one. When accepting a connection fails while the forward still listens, such as when the forwarder runs out of open files in a burst, it tries again after a wait that starts at 5 ms and doubles with each failure in a row, up to a second, so the port answers again once files are free. Its log gets only the first failure of each run. When a forward closes, because the VM&amp;rsquo;s server stopped or its port is now another VM&amp;rsquo;s, the forwarder closes that forward&amp;rsquo;s open connections and ends their ssh processes too. A VM that never closes its end of a connection therefore can&amp;rsquo;t keep that connection&amp;rsquo;s ssh process, or one of the 256, after its port&amp;rsquo;s forward has gone.&lt;/p&gt;
&lt;p&gt;A connection&amp;rsquo;s ssh process also ends once the program on this machine has closed its side and the VM has sent nothing for 30 seconds, whether or not the VM closes its end. A program that only stops sending, and waits for an answer, still gets one for as long as the VM keeps sending it, however slowly the program reads it, but the VM has to send something at least every 30 seconds, its first byte included. So a program that stops sending and then waits longer than that for the answer to begin, such as &lt;code&gt;nc -N&lt;/code&gt; in front of a slow database query, has its connection cut. The same holds for every link&amp;rsquo;s connections (&lt;a href="#each-connection"&gt;each connection&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="its-process-and-files"&gt;Its process and files&lt;span class="hx:absolute hx:-mt-20" id="its-process-and-files"&gt;&lt;/span&gt;
&lt;a href="#its-process-and-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The forwarder runs as a hidden devvm command, &lt;code&gt;devvm _ports&lt;/code&gt;, one process for each VM. devvm starts it after each start of the VM, once the backend says the VM runs, and again with the new ports when you change a running VM&amp;rsquo;s ports. &lt;code&gt;devvm stop&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop it, and a VM that stops some other way ends it, because the forwarder exits once the backend&amp;rsquo;s process for the VM is gone. Which ports a VM forwards is in the VM&amp;rsquo;s state, which devvm reads each time it starts the forwarder, so &lt;code&gt;devvm ports&lt;/code&gt; changes the state and never the backend&amp;rsquo;s config, and the backend never hears of them. The forwarder&amp;rsquo;s log is &lt;code&gt;ports.log&lt;/code&gt; in the VM&amp;rsquo;s logs folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;, and its &lt;code&gt;ports.pid&lt;/code&gt;, &lt;code&gt;ports.status&lt;/code&gt;, &lt;code&gt;ports.lock&lt;/code&gt; and &lt;code&gt;ports.forwarded&lt;/code&gt; are in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, beside the VM&amp;rsquo;s host keys for its current start, &lt;code&gt;known_hosts&lt;/code&gt;, which the forwarder checks the VM against, as devvm&amp;rsquo;s ssh config does (&lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;ssh into VMs&lt;/a&gt;). Its control socket is &lt;code&gt;~/.local/share/devvm/run/port-&amp;lt;hash&amp;gt;.ctl&lt;/code&gt;, named by a hash of the VM&amp;rsquo;s name, outside the VM&amp;rsquo;s folder, because a unix socket&amp;rsquo;s path has fewer than 104 characters. &lt;a href="https://next.devvm.dev/docs/internals/processes/#the-port-forwarder"&gt;Processes&lt;/a&gt; has what the forwarder holds, what it reads from the VM and the bounds on its log, and &lt;a href="https://next.devvm.dev/docs/internals/processes/#ssh-masters-and-relays"&gt;ssh masters and relays&lt;/a&gt; has its ssh processes.&lt;/p&gt;
&lt;p&gt;devvm reads every list of ports the same way, whether it comes from &lt;code&gt;--ports&lt;/code&gt;, &lt;code&gt;devvm ports&lt;/code&gt; or the VM&amp;rsquo;s state. Each entry is a port from 1 to 65535 or a range of them, such as &lt;code&gt;8000-8010&lt;/code&gt;. When the VM&amp;rsquo;s state holds a list that devvm can&amp;rsquo;t read this way, such as a file edited by hand, the VM doesn&amp;rsquo;t start and devvm names the value it couldn&amp;rsquo;t read with &lt;code&gt;port_invalid&lt;/code&gt;, so a bad entry never becomes a port the VM didn&amp;rsquo;t ask for.&lt;/p&gt;
&lt;h2 data-hextra-search-id="when-it-cant-forward"&gt;When it can&amp;rsquo;t forward&lt;span class="hx:absolute hx:-mt-20" id="when-it-cant-forward"&gt;&lt;/span&gt;
&lt;a href="#when-it-cant-forward" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When a forwarder doesn&amp;rsquo;t start, devvm warns you and names its log (&lt;code&gt;ports_forward_failed&lt;/code&gt;), and the VM runs on without forwarded ports.&lt;/p&gt;
&lt;p&gt;When a running forwarder tries a listed port and can&amp;rsquo;t take it, it logs the port with the system&amp;rsquo;s error and records why in &lt;code&gt;ports.forwarded&lt;/code&gt;. &lt;code&gt;devvm ports&lt;/code&gt; warns about each such port by why:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ports_taken&lt;/code&gt;, when a program on this machine has the port, which the system reports as the address being in use. The forwarder tries the port again only once the VM&amp;rsquo;s server on it stops and starts again.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ports_limit&lt;/code&gt;, when the VM already forwards 256 ports, the most a forwarder forwards at once, so the forwarder didn&amp;rsquo;t try it. The forwarder tries the port again at the VM&amp;rsquo;s next report once it forwards fewer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ports_refused&lt;/code&gt;, when this machine denied the forwarder the port, such as Linux keeping ports below 1024 for root. The forwarder tries the port again only once the VM&amp;rsquo;s server on it stops and starts again.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Any other error, such as running out of open files for a moment, says nothing about the port, so the forwarder logs it alone, records nothing, and tries the port again at the VM&amp;rsquo;s next report.&lt;/p&gt;
&lt;p&gt;The forwarder listens on both &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;, and it treats an error on &lt;code&gt;::1&lt;/code&gt; as it would treat one on &lt;code&gt;127.0.0.1&lt;/code&gt;, closing the port&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; listener as well. A program that listens on the port&amp;rsquo;s &lt;code&gt;::1&lt;/code&gt; makes the port count as in use, and after any other error the forwarder tries the port again at the next report, so an error that passes never leaves a forward on IPv4 alone. A machine without IPv6 on its loopback gets the port on &lt;code&gt;127.0.0.1&lt;/code&gt; alone, and so does one that refuses the forwarder &lt;code&gt;::1&lt;/code&gt; while it allows &lt;code&gt;127.0.0.1&lt;/code&gt;, such as one whose security module denies IPv6 sockets, and the forwarder logs that.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm ports&lt;/code&gt; reads these from the forwarder&amp;rsquo;s record and binds nothing to find out, so it never takes a port that the forwarder is opening at that moment. A port that another VM forwards isn&amp;rsquo;t one of these, so it gets &lt;code&gt;ports_held&lt;/code&gt; instead. A record that the running forwarder didn&amp;rsquo;t write, or none, gives none of these warnings, and neither does a record from an older devvm&amp;rsquo;s forwarder after an upgrade, which lists every port it couldn&amp;rsquo;t take on one line, without saying why, so devvm never says a port is in use when it may not be.&lt;/p&gt;
&lt;h2 data-hextra-search-id="links-between-vms"&gt;Links between VMs&lt;span class="hx:absolute hx:-mt-20" id="links-between-vms"&gt;&lt;/span&gt;
&lt;a href="#links-between-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A &lt;a href="https://next.devvm.dev/docs/using/links/"&gt;link between VMs&lt;/a&gt; carries a client VM&amp;rsquo;s connections to a port that a target VM publishes. Like the forwarder, it goes over ssh, every connection starts on this machine, and it uses neither VM&amp;rsquo;s network, so no backend&amp;rsquo;s confinement changes and a confined VM still reaches nothing past its proxy over its own network. &lt;a href="https://next.devvm.dev/docs/contributing/design/#links-between-vms"&gt;The design note&lt;/a&gt; has the rules, the threat check and what the prototype showed.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-addresses"&gt;The addresses&lt;span class="hx:absolute hx:-mt-20" id="the-addresses"&gt;&lt;/span&gt;
&lt;a href="#the-addresses" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each target that a client links to gets an address of its own in &lt;code&gt;127.77.0.0/16&lt;/code&gt; in that client, starting at &lt;code&gt;127.77.0.1&lt;/code&gt;. devvm chooses it when the client&amp;rsquo;s first link to that target is made and keeps it for every port of that target, so two targets can share a port. The client&amp;rsquo;s &lt;code&gt;/etc/hosts&lt;/code&gt; holds a block between &lt;code&gt;# devvm links begin&lt;/code&gt; and &lt;code&gt;# devvm links end&lt;/code&gt;, with a line &lt;code&gt;127.77.x.y NAME NAME.devvm.internal&lt;/code&gt; for each target. The VM&amp;rsquo;s setup replaces the block whole at each launch, and again when links change on a running client. The setup writes the file in place, never renaming over it, and only when the block changed.&lt;/p&gt;
&lt;p&gt;A link listens at its target&amp;rsquo;s address on the target&amp;rsquo;s own port, never on the client&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt;. At each start, the setup sets &lt;code&gt;net.ipv4.ip_unprivileged_port_start&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; where it&amp;rsquo;s &lt;code&gt;1024&lt;/code&gt;, which is on Lima&amp;rsquo;s Alpine VMs, so a link to a port below 1024 listens on that port too. Lima&amp;rsquo;s Ubuntu and Debian VMs already have &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The addresses are internal to devvm. &lt;code&gt;devvm link&lt;/code&gt; and its JSON never show them, and the forwarder never forwards them (&lt;a href="#what-it-forwards"&gt;above&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-link-session"&gt;The link session&lt;span class="hx:absolute hx:-mt-20" id="the-link-session"&gt;&lt;/span&gt;
&lt;a href="#the-link-session" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For each running client with links, devvm runs a hidden command, &lt;code&gt;devvm _links VM&lt;/code&gt;, as one detached process on this machine. Its pid is in &lt;code&gt;links.pid&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, and its log is &lt;code&gt;links.log&lt;/code&gt; in the VM&amp;rsquo;s logs folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;. It keeps an ssh connection of its own to the client, never the forwarder&amp;rsquo;s, which starts with no forwards and asks for each link as a remote forward from &lt;code&gt;127.77.x.y:PORT&lt;/code&gt; in the client to a unix socket on this machine. That&amp;rsquo;s the only remote forward devvm asks a VM for. It reads the client&amp;rsquo;s links again every second and adds or cancels one forward at a time as they change, and a cancel leaves the connections that are open. A link whose address and port a program in the client already holds fails alone, with &lt;code&gt;link_port_taken&lt;/code&gt; in the session&amp;rsquo;s log, which the next launch shows. Each line that the session&amp;rsquo;s ssh processes print starts with &lt;code&gt;ssh:&lt;/code&gt; in its log, so no line of theirs reads as one of the session&amp;rsquo;s own, and devvm link add and the launch read only the session&amp;rsquo;s own lines.&lt;/p&gt;
&lt;p&gt;The process ends once the client no longer runs the start it was made for, or has no links left, and &lt;code&gt;devvm stop&lt;/code&gt; stops it with the client, which ends its connections and removes its sockets. &lt;a href="https://next.devvm.dev/docs/internals/processes/#the-link-session"&gt;Processes&lt;/a&gt; has what the session holds, what it reads from the VMs and the bounds on its log.&lt;/p&gt;
&lt;p&gt;Every VM&amp;rsquo;s sshd allows remote forwards on &lt;code&gt;127.77.0.0/16&lt;/code&gt; alone, with &lt;code&gt;AllowTcpForwarding all&lt;/code&gt;, &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; and &lt;code&gt;PermitListen 127.77.*:*&lt;/code&gt;, written once into every image, so links never change or reload sshd. sshd matches the address a request names against that rule as text, so a remote forward on &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;0.0.0.0&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt; is refused. Root in the client can change sshd, so those settings protect only an honest VM. What keeps the VM from choosing where its connections go on this machine is the host&amp;rsquo;s ssh client, which accepts a forwarded channel only for a forward it asked for and connects it only to that link&amp;rsquo;s socket.&lt;/p&gt;
&lt;h3 data-hextra-search-id="each-connection"&gt;Each connection&lt;span class="hx:absolute hx:-mt-20" id="each-connection"&gt;&lt;/span&gt;
&lt;a href="#each-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A program in the client that connects to &lt;code&gt;db:5432&lt;/code&gt; takes this path:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 580px; --devvm-diagram-width: 293px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 293 580" width="293" height="580" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d895e190151e6a7be--title" aria-describedby="d895e190151e6a7be--desc"&gt;&lt;title id="d895e190151e6a7be--title"&gt;A connection over a link&lt;/title&gt;&lt;desc id="d895e190151e6a7be--desc"&gt;Your program in the client connects to db:5432, which /etc/hosts names as 127.77.0.1. The client's sshd passes it over the link session's ssh, which this machine opened, to devvm _links on this machine, which connects over ssh, with the target's key and pinned host key, to the target's sshd, and so to the server on the target's own loopback, 127.0.0.1:5432.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_app_csshd_0"&gt;&lt;path d="M146.27,53L146.27,127"/&gt;&lt;path class="pele-marker" d="M146.27,134L142.91,126L149.63,126Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_csshd_links_0"&gt;&lt;path d="M146.27,179L146.27,253"/&gt;&lt;path class="pele-marker" d="M146.27,260L142.91,252L149.63,252Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_links_tsshd_0"&gt;&lt;path d="M146.27,320L146.27,394"/&gt;&lt;path class="pele-marker" d="M146.27,401L142.91,393L149.63,393Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_tsshd_server_0"&gt;&lt;path d="M146.27,446L146.27,520"/&gt;&lt;path class="pele-marker" d="M146.27,527L142.91,519L149.63,519Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_app_csshd_0"&gt;&lt;rect x="30.91" y="77.5" width="230.73" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="146.27" y="89.7"&gt;db:5432, which /etc/hosts&lt;/tspan&gt;&lt;tspan x="146.27" y="105.7"&gt;names as 127.77.0.1&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_csshd_links_0"&gt;&lt;rect x="30.91" y="203.5" width="230.73" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="146.27" y="215.7"&gt;the link session's ssh,&lt;/tspan&gt;&lt;tspan x="146.27" y="231.7"&gt;which this machine opened&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_links_tsshd_0"&gt;&lt;rect x="26.45" y="344.5" width="239.64" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="146.27" y="356.7"&gt;ssh, with the target's key&lt;/tspan&gt;&lt;tspan x="146.27" y="372.7"&gt;and pinned host key&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_tsshd_server_0"&gt;&lt;rect x="71" y="470.5" width="150.55" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="146.27" y="482.7"&gt;127.0.0.1:5432,&lt;/tspan&gt;&lt;tspan x="146.27" y="498.7"&gt;its own loopback&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="app" transform="translate(146.27,30.5)"&gt;&lt;rect x="-138.27" y="-22.5" width="276.55" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;your program, in the client&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="csshd" transform="translate(146.27,156.5)"&gt;&lt;rect x="-93.73" y="-22.5" width="187.45" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the client's sshd&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="links" transform="translate(146.27,290)"&gt;&lt;rect x="-84.82" y="-30" width="169.64" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;devvm _links,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;on this machine&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="tsshd" transform="translate(146.27,423.5)"&gt;&lt;rect x="-93.73" y="-22.5" width="187.45" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the target's sshd&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="server" transform="translate(146.27,549.5)"&gt;&lt;rect x="-129.36" y="-22.5" width="258.73" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the server, in the target&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;ol&gt;
&lt;li&gt;The client&amp;rsquo;s sshd carries the connection over the link session to this machine, where ssh connects it to the link&amp;rsquo;s unix socket. The socket is mode 600, in &lt;code&gt;~/.local/share/devvm/run&lt;/code&gt; (mode 700), and named by a hash of the client, the address and the port, because a socket&amp;rsquo;s path has fewer than 104 characters.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm _links&lt;/code&gt; checks the link again. The link must still exist, the target must be the VM it was made for, by its ID, the port must be published, the &lt;a href="https://next.devvm.dev/docs/using/links/#links-and-network-tiers"&gt;tier rule&lt;/a&gt; must hold, and the target must be running, as its backend says. For a client on a confined tier, the target&amp;rsquo;s tier must also be enforced as the target runs, as &lt;code&gt;devvm ls&lt;/code&gt; shows it, because a target that got a confined tier while it ran stays outside its proxy until its next start, and one whose self-check failed may reach the internet directly. devvm never starts the target for a connection. The link session asks the target&amp;rsquo;s backend whether the target is running and how its ssh reaches it, and the connections to that target share that answer for one second, so a burst of connections asks the backend once and devvm notices a target that stops within a second. For a client on a confined tier, the check of the target&amp;rsquo;s tier asks the backend for each connection, so it notices at once that the target stopped, and devvm logs the connection as refused because the target isn&amp;rsquo;t running, not because its tier isn&amp;rsquo;t in force. An answer that a connection closing cut short isn&amp;rsquo;t shared, so the other connections ask again. devvm makes every other check again for each connection, including the check of the target&amp;rsquo;s tier as it runs.&lt;/li&gt;
&lt;li&gt;It carries the connection over one ssh connection that it keeps to each target, with the target&amp;rsquo;s key and pinned host key, and the target&amp;rsquo;s sshd connects to &lt;code&gt;127.0.0.1:PORT&lt;/code&gt; in the target. That connection to a target ends when the target stops, and the next one reads the target&amp;rsquo;s host keys again, because a VM whose Lima config changed gets new ones when it boots.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;An HTTP client that uses the VM&amp;rsquo;s proxy settings sends &lt;code&gt;db:5432&lt;/code&gt; to the VM&amp;rsquo;s proxy instead, and the proxy connects to the same link socket on this machine (&lt;a href="https://next.devvm.dev/docs/internals/network/#links-through-the-proxy"&gt;links through the proxy&lt;/a&gt;). Steps 2 and 3 are the same for it, so the link&amp;rsquo;s checks, its cap and its events hold for both ways in.&lt;/p&gt;
&lt;p&gt;At most 256 of a client&amp;rsquo;s connections are carried at once, and the next one is refused. A link&amp;rsquo;s socket holds at most 128 connections waiting to be accepted on macOS, and &lt;code&gt;devvm _links&lt;/code&gt; accepts nothing while it starts a process, so it accepts a burst of connections whole before it starts any of their ssh processes: it hands them on once 5 ms pass with nothing more to accept, once the first has waited 50 ms, or once 257 wait. Each one it accepted is carried, or refused when 256 are carried already. The ssh connection to a target takes in two file descriptors for each connection it carries, more than macOS&amp;rsquo;s default limit of 256 open files allows, so &lt;code&gt;devvm _links&lt;/code&gt; and the port forwarder give the ssh processes they start the higher limit that devvm runs with. Each connection carried or refused is written to the client&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/network/#log-files"&gt;event log&lt;/a&gt;, which &lt;code&gt;devvm network log&lt;/code&gt; shows, so every VM gets an event log for its links&amp;rsquo; connections, whatever its tier.&lt;/p&gt;
&lt;h3 data-hextra-search-id="when-links-change"&gt;When links change&lt;span class="hx:absolute hx:-mt-20" id="when-links-change"&gt;&lt;/span&gt;
&lt;a href="#when-links-change" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm link add&lt;/code&gt; and &lt;code&gt;devvm link rm&lt;/code&gt; record the change in the client&amp;rsquo;s state on this machine, never in a VM. On a running client they send its setup again, which rewrites &lt;code&gt;/etc/hosts&lt;/code&gt;, and they start &lt;code&gt;devvm _links&lt;/code&gt; if it isn&amp;rsquo;t running. &lt;code&gt;devvm _links&lt;/code&gt; reads the links again every second and writes the list that the client&amp;rsquo;s proxy reads, so the proxy reaches a new link as soon as its forward is in place. A stopped client gets the change when it next starts. Links change nothing else in the VM: no link name is in its &lt;code&gt;NO_PROXY&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-setup"&gt;the VM&amp;rsquo;s setup&lt;/a&gt;), so no daemon restarts, and on Lima no link changes the VM&amp;rsquo;s Lima config or its ssh host keys.&lt;/p&gt;
&lt;p&gt;When a link goes, &lt;code&gt;devvm _links&lt;/code&gt; stops listening for it and ends the connections that are open through it, with their ssh processes. Each connection&amp;rsquo;s ssh process waits for the target&amp;rsquo;s sshd to end its channel, so ending it is what keeps a target that never closes its end from holding that process, and one of the client&amp;rsquo;s 256 connections, after the link has gone. When a target starts again, the connections still open through its old ssh connection end once the next connection to the target arrives, which makes a new ssh connection, or once the old one dies. A link whose name now leads to another target at the same address and port, because one link was removed and another added within the same second, ends the old target&amp;rsquo;s connections the same way.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm rm&lt;/code&gt; of a target removes every link to it from every client&amp;rsquo;s state and updates the running clients, and &lt;code&gt;devvm gc --orphans&lt;/code&gt; removes links to VMs whose state is gone and the sockets that a killed link session left.&lt;/p&gt;
&lt;h3 data-hextra-search-id="groups"&gt;Groups&lt;span class="hx:absolute hx:-mt-20" id="groups"&gt;&lt;/span&gt;
&lt;a href="#groups" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A &lt;a href="https://next.devvm.dev/docs/using/links/#groups"&gt;group&lt;/a&gt; is recorded in each of its VMs&amp;rsquo; own state, with the name the others reach it by, so a VM made again in a folder, which gets new state, is in none. The links a group makes are links in each VM&amp;rsquo;s state like the ones &lt;code&gt;devvm link add&lt;/code&gt; makes, marked as the group&amp;rsquo;s, so the link session, the proxy&amp;rsquo;s list and every check of a connection treat them alike. devvm works out each VM&amp;rsquo;s group links again from its own links and the other VMs&amp;rsquo; published ports whenever one of them joins or leaves, publishes or unpublishes a port, or adds or removes a link of its own, and it records and applies only the VMs whose links changed, as &lt;a href="#when-links-change"&gt;above&lt;/a&gt;. &lt;a href="https://next.devvm.dev/docs/contributing/design/#groups"&gt;The design note&lt;/a&gt; has the rules and the threat check.&lt;/p&gt;</description></item><item><title>Ports and size</title><link>https://next.devvm.dev/docs/using/ports-size/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/ports-size/</guid><description>
&lt;p&gt;This page covers the ports a VM forwards to this machine and the CPUs, memory and disk it gets. You choose both when devvm makes a VM, and you can change both later with &lt;code&gt;devvm ports&lt;/code&gt; and &lt;code&gt;devvm size&lt;/code&gt;. &lt;a href="https://next.devvm.dev/docs/internals/ports/"&gt;Port forwarding&lt;/a&gt; explains how devvm&amp;rsquo;s forwarder works.&lt;/p&gt;
&lt;h2 data-hextra-search-id="size-and-ports"&gt;Size and ports&lt;span class="hx:absolute hx:-mt-20" id="size-and-ports"&gt;&lt;/span&gt;
&lt;a href="#size-and-ports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A new VM gets its image&amp;rsquo;s size unless you set one with &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; and &lt;code&gt;--disk&lt;/code&gt;, as in &lt;code&gt;devvm --cpus 6&lt;/code&gt;. For &lt;code&gt;base&lt;/code&gt; that&amp;rsquo;s 4 CPUs, 8 GiB of memory and a 100 GiB disk. On a machine with fewer than 4 CPUs, base gets as many CPUs as the machine has, and when 8 GiB would leave the machine less than 2 GiB of its own, base gets half of the machine&amp;rsquo;s memory, which is 4 GiB on an 8 GiB machine. When devvm builds base on such a machine, it says how many CPUs and how much memory base gets, and &lt;code&gt;devvm size -g&lt;/code&gt; sets the size that new VMs get instead.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--cpus&lt;/code&gt; takes a whole number. &lt;code&gt;--memory&lt;/code&gt; and &lt;code&gt;--disk&lt;/code&gt; take a size in GiB, written &lt;code&gt;16&lt;/code&gt;, &lt;code&gt;16G&lt;/code&gt; or &lt;code&gt;16GiB&lt;/code&gt;, and decimals are allowed.&lt;/li&gt;
&lt;li&gt;What the flags leave unset comes from the &lt;code&gt;[size]&lt;/code&gt; table of &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; when it sets it, else from what &lt;code&gt;devvm size -g&lt;/code&gt; and &lt;code&gt;devvm setup&lt;/code&gt; saved (&lt;a href="#choosing-new-vms-size"&gt;choosing new VMs&amp;rsquo; size&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm refuses more CPUs than this machine has, and a disk smaller than the image&amp;rsquo;s, because disks can&amp;rsquo;t shrink. It refuses them before it builds anything.&lt;/li&gt;
&lt;li&gt;devvm also refuses more memory than a VM can have, because a VM that asks for all of this machine&amp;rsquo;s memory doesn&amp;rsquo;t start. A VM can have this machine&amp;rsquo;s memory less 2 GiB, counted in whole GiB, so 6 GiB on an 8 GiB machine. On a machine with 4 GiB or less, it can have half, so 2 GiB on a 4 GiB machine. When you ask for more, devvm says how much memory this machine has and the most you can give a VM, so you can run the command again with that.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A new VM forwards every TCP port from 1024 up that it listens on, unless &lt;code&gt;--ports&lt;/code&gt; says otherwise, as in &lt;code&gt;devvm --ports 5173&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--ports&lt;/code&gt; takes &lt;code&gt;all&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt;, or ports and ranges such as &lt;code&gt;5173,8000-8010&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Without &lt;code&gt;--ports&lt;/code&gt;, the default comes from &lt;code&gt;ports&lt;/code&gt; in &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; when it sets it, else from what &lt;code&gt;devvm ports -g&lt;/code&gt; saved, and without either, a new VM forwards every port.&lt;/li&gt;
&lt;li&gt;When you customize a new VM without &lt;code&gt;--ports&lt;/code&gt;, devvm asks whether it forwards every port, none or the ports you type, starting from the default, and saves the answer for that VM alone (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm refuses a default that isn&amp;rsquo;t a valid value, as it refuses a bad flag, and for one in &lt;code&gt;config.toml&lt;/code&gt; it names the file and the line (&lt;a href="https://next.devvm.dev/docs/using/settings/#when-devvm-cant-read-it"&gt;when devvm can&amp;rsquo;t read it&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="ports"&gt;Ports&lt;span class="hx:absolute hx:-mt-20" id="ports"&gt;&lt;/span&gt;
&lt;a href="#ports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM forwards the TCP ports it listens on to the same port on this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, so a server on &lt;code&gt;:5173&lt;/code&gt; in the VM is at &lt;code&gt;localhost:5173&lt;/code&gt; here. To change which ports a VM forwards:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ports &lt;span class="c1"&gt;# what this folder&amp;#39;s VM forwards: all, none or a list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ports 5173,8000-8010 &lt;span class="c1"&gt;# only these ports and ranges&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ports add &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# one more&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ports rm &lt;span class="m"&gt;5173&lt;/span&gt; &lt;span class="c1"&gt;# one fewer, as listed; the last leaves none&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ports none &lt;span class="c1"&gt;# nothing; devvm ports all forwards every port again&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ports -g none &lt;span class="c1"&gt;# what new VMs forward (default: all)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;A change applies at once. A stopped VM forwards the new ports from its next start. On a running VM, devvm starts its forwarder again with the new ports while the VM runs on, so a server on an added port reaches this machine within a few seconds. The connections that were open through the old forwarder close, so a client that was connected through it has to connect again.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;add&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; take ports and ranges, not &lt;code&gt;all&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;. devvm refuses &lt;code&gt;rm&lt;/code&gt; on a VM that forwards every port, because there&amp;rsquo;s no list to remove from. &lt;code&gt;-g&lt;/code&gt; also works with &lt;code&gt;add&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ports -g&lt;/code&gt; shows what new VMs forward, followed by where it came from after a &lt;code&gt;#&lt;/code&gt;, and &lt;code&gt;devvm ports -g --json&lt;/code&gt; adds it as &lt;code&gt;source&lt;/code&gt;. When &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; sets &lt;code&gt;ports&lt;/code&gt;, &lt;code&gt;devvm ports -g&lt;/code&gt; refuses to change it and names the file, so edit &lt;code&gt;config.toml&lt;/code&gt; instead (&lt;a href="https://next.devvm.dev/docs/using/settings/#where-a-default-comes-from"&gt;where a default comes from&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm forwards ports on every &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt;, and it forwards no ports from builds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When a VM forwards every port, devvm forwards each TCP port from 1024 up that a server in the VM listens on, whether on the VM&amp;rsquo;s loopback or on all its addresses. When a VM lists its ports, devvm forwards those ports alone, however many there are, ports below 1024 included. A port reaches this machine within a few seconds of the server starting, only on &lt;code&gt;localhost&lt;/code&gt; (&lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;), and the forward goes away when the server stops. At most 256 ports are forwarded at once (&lt;a href="https://next.devvm.dev/docs/internals/ports/#when-it-cant-forward"&gt;when it can&amp;rsquo;t forward&lt;/a&gt;). Your browser sends the cookies of every app you use on &lt;code&gt;localhost&lt;/code&gt; to a forwarded port as well, so the server in the VM gets them (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;your browser&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A VM never takes a port that a program on this machine already has, a port that another running VM forwards or lists, or a port that devvm uses for its VMs&amp;rsquo; ssh and proxies (&lt;a href="https://next.devvm.dev/docs/internals/ports/#what-it-never-takes"&gt;what it never takes&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When a port you listed is taken by a program on this machine as the VM starts, or as you change its ports, devvm warns you and the VM runs on without that port. The next start or change that finds the port free forwards it.&lt;/li&gt;
&lt;li&gt;A program that starts on a port after the VM&amp;rsquo;s forward does can still bind it on all addresses, as most servers do, and then that program&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; connections reach the VM.&lt;/li&gt;
&lt;li&gt;When the VM&amp;rsquo;s server listens on a listed port that the VM can&amp;rsquo;t forward, because a program on this machine has it, the VM already forwards 256 ports, or this machine doesn&amp;rsquo;t let devvm use the port, such as one below 1024 on Linux, &lt;code&gt;devvm ports&lt;/code&gt; warns you and says which of these it is (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-listed-port-isnt-forwarded"&gt;a listed port isn&amp;rsquo;t forwarded&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;If the forwarder can&amp;rsquo;t start at all, devvm warns you and names its log, and the VM runs on without forwarded ports.&lt;/li&gt;
&lt;li&gt;The ports devvm uses for its VMs&amp;rsquo; ssh are the 17 that every browser refuses, so no page in your browser reaches a VM&amp;rsquo;s ssh, and at most 17 VMs run at once (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#too-many-vms-at-once"&gt;too many VMs at once&lt;/a&gt;). A VM that forwards every port leaves those 17 out, and forwards one only when you list it, which &lt;code&gt;devvm ports&lt;/code&gt; and each launch warn of.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;UDP isn&amp;rsquo;t forwarded, on any backend.&lt;/strong&gt; Run the UDP client in the VM instead, or tunnel it over a forwarded TCP port with &lt;a href="http://www.dest-unreach.org/socat/doc/socat.html" target="_blank" rel="noopener"&gt;socat&lt;/a&gt;, installed on both sides. For a UDP server on port 8125 in the VM, with TCP port 9125 forwarded:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;socat TCP-LISTEN:9125,fork,reuseaddr UDP:127.0.0.1:8125 &lt;span class="c1"&gt;# in the VM&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;socat UDP-LISTEN:8125,fork TCP:127.0.0.1:9125 &lt;span class="c1"&gt;# on this machine&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;TCP is a stream, so datagrams can arrive merged or split. This suits low-rate request and response traffic, such as DNS, statsd or syslog, but not high-rate or latency-sensitive traffic, such as games, QUIC or WebRTC media.&lt;/p&gt;
&lt;h3 data-hextra-search-id="two-vms-and-one-port"&gt;Two VMs and one port&lt;span class="hx:absolute hx:-mt-20" id="two-vms-and-one-port"&gt;&lt;/span&gt;
&lt;a href="#two-vms-and-one-port" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Only a running VM holds a port. A stopped VM&amp;rsquo;s listed ports are what it forwards when it runs again, so another VM can forward them meanwhile:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/a &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm ports add &lt;span class="m"&gt;5173&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm stop &lt;span class="c1"&gt;# a lists 5173, then stops&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/b &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm &lt;span class="c1"&gt;# b forwards 5173 while a is stopped&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/a &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm &lt;span class="c1"&gt;# a starts, and warns that b has 5173&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ports &lt;span class="c1"&gt;# in a: 5173, and the same warning&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The running VM that forwards a port keeps it. When a VM that lists the same port starts, or you change its ports, devvm warns that it forwards the port once the other VM stops forwarding it, and &lt;code&gt;devvm ports&lt;/code&gt; repeats that warning while it lasts. When the other VM stops, or stops forwarding the port, the VM forwards it within about 20 seconds, without a restart.&lt;/li&gt;
&lt;li&gt;A VM that lists a port comes before a VM that forwards every port. A VM that forwards every port takes no port that a running VM lists, and it gives up such a port within about 10 seconds of that VM listing it, even when the VM that forwards every port goes quiet. devvm warns about it as about any other VM.&lt;/li&gt;
&lt;li&gt;While devvm starts a VM again, its listed ports stay its own, so no other VM takes them in between.&lt;/li&gt;
&lt;li&gt;When two VMs that list the same port start at once, the first one whose server listens on the port forwards it, and the other waits for it.&lt;/li&gt;
&lt;li&gt;A VM that crashed holds no port, because its forwarder ends with it.&lt;/li&gt;
&lt;li&gt;The ports devvm chooses for VMs&amp;rsquo; ssh, proxies and desktops never take a port that any VM lists, running or not.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ports&lt;/code&gt; also warns when a program on this machine has one of a running VM&amp;rsquo;s listed ports, which the VM then doesn&amp;rsquo;t forward.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;While a VM is stopped, another VM serving on its port gets that port&amp;rsquo;s place in your browser.&lt;/strong&gt; Your browser keeps site data, storage and service workers for &lt;code&gt;localhost:5173&lt;/code&gt; whichever VM answers there, as it would for two projects that use one port on any machine. A service worker that the other VM&amp;rsquo;s app registered can keep answering for &lt;code&gt;localhost:5173&lt;/code&gt; after the first VM takes the port back, so clear that site&amp;rsquo;s data in your browser when you switch.&lt;/p&gt;
&lt;h2 data-hextra-search-id="size"&gt;Size&lt;span class="hx:absolute hx:-mt-20" id="size"&gt;&lt;/span&gt;
&lt;a href="#size" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To see or change a VM&amp;rsquo;s size:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm size &lt;span class="c1"&gt;# what this folder&amp;#39;s VM has: cpus=4 memory=8GiB disk=100GiB&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm size --cpus &lt;span class="m"&gt;6&lt;/span&gt; --memory &lt;span class="m"&gt;16&lt;/span&gt; &lt;span class="c1"&gt;# change it; what isn&amp;#39;t given stays&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm size --disk &lt;span class="m"&gt;200&lt;/span&gt; &lt;span class="c1"&gt;# a bigger disk; never a smaller one&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm size -g --memory &lt;span class="m"&gt;16&lt;/span&gt; &lt;span class="c1"&gt;# the size new VMs get (default: the image&amp;#39;s)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm size -g &lt;span class="c1"&gt;# cpus=, memory= and disk= lines, empty for the image&amp;#39;s, each with its source&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The flags take the same values as for a new VM and have the same limits, so devvm refuses more CPUs than this machine has and more memory than a VM can have (&lt;a href="#size-and-ports"&gt;size and ports&lt;/a&gt;). &lt;code&gt;devvm size -g&lt;/code&gt; checks a default size in the same way when you set it. A VM that already has more memory keeps it and still starts, because devvm checks a size only when you set one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm size -g&lt;/code&gt; ends each line with where its value came from, after a &lt;code&gt;#&lt;/code&gt;: the path of &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt;, &lt;code&gt;devvm: settings.json&lt;/code&gt; for what &lt;code&gt;devvm size -g&lt;/code&gt; or &lt;code&gt;devvm setup&lt;/code&gt; saved, or &lt;code&gt;devvm: default&lt;/code&gt; for the image&amp;rsquo;s. When &lt;code&gt;config.toml&lt;/code&gt; sets &lt;code&gt;cpus&lt;/code&gt;, &lt;code&gt;memory&lt;/code&gt; or &lt;code&gt;disk&lt;/code&gt;, &lt;code&gt;devvm size -g&lt;/code&gt; refuses to change that one and names the file, so edit &lt;code&gt;config.toml&lt;/code&gt; instead (&lt;a href="https://next.devvm.dev/docs/using/settings/#where-a-default-comes-from"&gt;where a default comes from&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A stopped VM gets its new size when it next starts, such as with &lt;code&gt;devvm&lt;/code&gt;, and until then &lt;code&gt;devvm size&lt;/code&gt; shows what the VM has now and says what changes. For a running VM, devvm asks in a terminal whether to restart it now, which stops anything running in it, and if you answer yes, devvm restarts it as &lt;code&gt;devvm restart&lt;/code&gt; does. Otherwise, and without a terminal or with &lt;code&gt;--no-input&lt;/code&gt;, the VM keeps its size until it next starts, for example with &lt;code&gt;devvm restart&lt;/code&gt;. When devvm opens the running VM while its new size still waits, it asks once more in a terminal, with no as the default unless an agent&amp;rsquo;s new folders wait too, and a yes restarts the VM with its new size before the shell opens (&lt;a href="https://next.devvm.dev/docs/using/vms/#restarting-and-stopping"&gt;restarting&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Disks grow but never shrink, so devvm refuses a disk smaller than the VM&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;When a VM&amp;rsquo;s state file holds a size that isn&amp;rsquo;t a number, such as after an edit by hand, devvm refuses to start the VM or show its size and names the value, so set that part again, such as with &lt;code&gt;devvm size --cpus 4&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="choosing-new-vms-size"&gt;Choosing new VMs&amp;rsquo; size&lt;span class="hx:absolute hx:-mt-20" id="choosing-new-vms-size"&gt;&lt;/span&gt;
&lt;a href="#choosing-new-vms-size" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm asks for the CPUs and memory that new VMs get on your first run, before it asks which features base gets, and again whenever you run &lt;code&gt;devvm setup&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup &lt;span class="c1"&gt;# asks its questions, the size among them&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm size -g --cpus &lt;span class="m"&gt;6&lt;/span&gt; --memory &lt;span class="m"&gt;16&lt;/span&gt; &lt;span class="c1"&gt;# only the size, without asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Before the two questions, devvm says how many CPUs and how much memory this machine has. Each question shows in brackets the value new VMs get now. That&amp;rsquo;s what &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; sets or &lt;code&gt;devvm size -g&lt;/code&gt; saved, or else base&amp;rsquo;s own size fitted to this machine: 4 CPUs and 8 GiB, or less on a machine that doesn&amp;rsquo;t have room for them (&lt;a href="#size-and-ports"&gt;size and ports&lt;/a&gt;). Confirm to keep the value, or enter another one. devvm checks what you type as it checks &lt;code&gt;--cpus&lt;/code&gt; and &lt;code&gt;--memory&lt;/code&gt;, and when this machine can&amp;rsquo;t give it, devvm says why and asks again.&lt;/p&gt;
&lt;p&gt;devvm doesn&amp;rsquo;t ask for a value that &lt;code&gt;config.toml&lt;/code&gt; sets, and says so. It saves only the values you type, where &lt;code&gt;devvm size -g&lt;/code&gt; saves them, and keeps a saved disk size as it is. When you keep both values, devvm saves nothing, so new VMs go on getting the image&amp;rsquo;s size. Either way, devvm prints the size new VMs get. A new size changes only the VMs made after it, and nothing is rebuilt, so existing VMs keep their size until you change it with &lt;code&gt;devvm size&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The first run asks once, because that run also chooses base&amp;rsquo;s features, and devvm asks only before they&amp;rsquo;re chosen. It asks only when all of these hold (&lt;a href="https://next.devvm.dev/docs/using/command-line/#questions-devvm-asks"&gt;questions devvm asks&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;devvm runs in a terminal&lt;/li&gt;
&lt;li&gt;no size is set&lt;/li&gt;
&lt;li&gt;you didn&amp;rsquo;t give &lt;code&gt;--cpus&lt;/code&gt; or &lt;code&gt;--memory&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, devvm asks nothing, and new VMs get the image&amp;rsquo;s size. &lt;code&gt;devvm setup&lt;/code&gt; asks only in a terminal, without &lt;code&gt;--no-input&lt;/code&gt;, and only when you give it no flags (&lt;a href="https://next.devvm.dev/docs/using/settings/#devvm-setup"&gt;devvm setup&lt;/a&gt;). To set the size without asking, use &lt;code&gt;devvm size -g --cpus N --memory GiB&lt;/code&gt;, which takes the same values and has the same limits.&lt;/p&gt;
&lt;h3 data-hextra-search-id="disk-use"&gt;Disk use&lt;span class="hx:absolute hx:-mt-20" id="disk-use"&gt;&lt;/span&gt;
&lt;a href="#disk-use" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM&amp;rsquo;s disk size is how far the disk can grow, not how much space it takes. A project VM starts as a copy of its image&amp;rsquo;s disk that shares the image&amp;rsquo;s blocks, so a new VM takes almost nothing until it writes (&lt;a href="https://next.devvm.dev/docs/internals/lima/#clones-and-overlays"&gt;clones and overlays&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;macOS:&lt;/strong&gt; the copy is an APFS clone. &lt;code&gt;du&lt;/code&gt; counts the shared blocks as the clone&amp;rsquo;s own, so it overcounts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux:&lt;/strong&gt; the copy is a qcow2 overlay of the image&amp;rsquo;s disk, which holds only the VM&amp;rsquo;s changes, about 12 MB for a new VM instead of 2 GB.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="free-space"&gt;Free space&lt;span class="hx:absolute hx:-mt-20" id="free-space"&gt;&lt;/span&gt;
&lt;a href="#free-space" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Before devvm builds an image or makes a VM, it checks the free space on the disk that will hold it, and it refuses to start the step when there&amp;rsquo;s less free than the step needs:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;building &lt;code&gt;base&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;8 GiB&lt;/td&gt;
&lt;td&gt;8 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;building any other image&lt;/td&gt;
&lt;td&gt;2 GiB&lt;/td&gt;
&lt;td&gt;8 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;building shared tool images&lt;/td&gt;
&lt;td&gt;3 GiB for each build VM, and 0.5 GiB for each tool&lt;/td&gt;
&lt;td&gt;9 GiB for each build VM, and 0.5 GiB for each tool&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;making a VM&lt;/td&gt;
&lt;td&gt;2 GiB&lt;/td&gt;
&lt;td&gt;2 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;devvm rounds each number up to whole GiB, so building one shared tool with Lima on macOS needs 4 GiB, and building all ten in one build VM needs 8 GiB. Each build checks again before it starts, which means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The first VM on a Mac&lt;/strong&gt; builds base, so it needs 8 GiB free.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tool images&lt;/strong&gt; that build side by side need room for each build VM, up to four, and devvm runs fewer when this machine&amp;rsquo;s memory, its CPUs or this disk has room for fewer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A tools build&lt;/strong&gt; also checks the disk of devvm&amp;rsquo;s data folder, where the shared tool images come out.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/internals/images/#free-space"&gt;Free space&lt;/a&gt; explains which disks devvm checks, what each one needs and how the numbers were measured. &lt;code&gt;devvm doctor&lt;/code&gt; also warns when the disk that holds images has less free space than building base needs, but the warning doesn&amp;rsquo;t make doctor fail. When devvm refuses, see &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#not-enough-free-space"&gt;Not enough free space&lt;/a&gt; for how to make room.&lt;/p&gt;
&lt;h2 data-hextra-search-id="as-json"&gt;As JSON&lt;span class="hx:absolute hx:-mt-20" id="as-json"&gt;&lt;/span&gt;
&lt;a href="#as-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm size --json&lt;/code&gt; and &lt;code&gt;devvm ports --json&lt;/code&gt; print what the commands show as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. With &lt;code&gt;-g&lt;/code&gt;, they print the same fields for new VMs. With &lt;code&gt;--json&lt;/code&gt; they only show, so devvm refuses &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt;, &lt;code&gt;--disk&lt;/code&gt; or a list of ports with it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm size --json&lt;/code&gt; has &lt;code&gt;cpus&lt;/code&gt;, &lt;code&gt;memory_gib&lt;/code&gt; and &lt;code&gt;disk_gib&lt;/code&gt;, and leaves out what isn&amp;rsquo;t set. For &lt;code&gt;-g&lt;/code&gt;, that&amp;rsquo;s what new VMs take from the image. When the VM&amp;rsquo;s size changes at its next start, &lt;code&gt;pending&lt;/code&gt; has the &lt;code&gt;cpus&lt;/code&gt;, &lt;code&gt;memory_gib&lt;/code&gt; and &lt;code&gt;disk_gib&lt;/code&gt; that change.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;cpus&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;memory_gib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;disk_gib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;pending&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;memory_gib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With &lt;code&gt;-g&lt;/code&gt;, &lt;code&gt;devvm size --json&lt;/code&gt; also has &lt;code&gt;sources&lt;/code&gt;, which says where each of &lt;code&gt;cpus&lt;/code&gt;, &lt;code&gt;memory&lt;/code&gt; and &lt;code&gt;disk&lt;/code&gt; came from: &lt;code&gt;config.toml&lt;/code&gt;, &lt;code&gt;settings.json&lt;/code&gt; for what devvm saved, or &lt;code&gt;built-in&lt;/code&gt; for the image&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/using/settings/#where-a-default-comes-from"&gt;where a default comes from&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;cpus&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;memory_gib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sources&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;cpus&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;settings.json&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;disk&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;built-in&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;memory&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;config.toml&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm ports --json&lt;/code&gt; has &lt;code&gt;ports&lt;/code&gt;, which is &lt;code&gt;all&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt; or a list of ports and ranges, written as &lt;code&gt;devvm ports&lt;/code&gt; takes it. With &lt;code&gt;-g&lt;/code&gt;, it also has &lt;code&gt;source&lt;/code&gt;, which is &lt;code&gt;config.toml&lt;/code&gt;, &lt;code&gt;settings.json&lt;/code&gt; or &lt;code&gt;built-in&lt;/code&gt;.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;ports&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;5173,8000-8010&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When another running VM forwards some of the VM&amp;rsquo;s listed ports, &lt;code&gt;devvm ports --json&lt;/code&gt; also has &lt;code&gt;held_by&lt;/code&gt;, with each such VM&amp;rsquo;s &lt;code&gt;vm&lt;/code&gt;, its name, and &lt;code&gt;ports&lt;/code&gt;, the ports it forwards that this VM waits for (&lt;a href="#two-vms-and-one-port"&gt;two VMs and one port&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;ports&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;5173,8000-8010&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;held_by&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;vm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm-b-0123456789abcd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;ports&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;5173&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>The desktop</title><link>https://next.devvm.dev/docs/internals/desktop/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/desktop/</guid><description>
&lt;p&gt;This page explains how &lt;code&gt;devvm desktop&lt;/code&gt; serves a VM&amp;rsquo;s desktop on this machine, how it checks a viewer&amp;rsquo;s password and keeps the clipboard out of the VM, and why devvm uses VNC and never forwards X11. &lt;a href="https://next.devvm.dev/docs/using/desktop/"&gt;A VM&amp;rsquo;s desktop&lt;/a&gt; covers adding the desktop and opening it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="in-the-vm"&gt;In the VM&lt;span class="hx:absolute hx:-mt-20" id="in-the-vm"&gt;&lt;/span&gt;
&lt;a href="#in-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The built-in &lt;code&gt;desktop&lt;/code&gt; layer installs Xfce, TigerVNC&amp;rsquo;s &lt;code&gt;Xvnc&lt;/code&gt;, &lt;code&gt;socat&lt;/code&gt; for &lt;a href="#the-local-proxy"&gt;the local proxy&lt;/a&gt; and a command of devvm&amp;rsquo;s, &lt;code&gt;devvm-desktop&lt;/code&gt;, into the &lt;code&gt;desktop&lt;/code&gt; image, which only the VMs with the layer are made from (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-desktop-layer"&gt;the desktop layer&lt;/a&gt;). Its packages come from the distribution&amp;rsquo;s archive as it is when the layer builds, and it downloads nothing else. When you run &lt;code&gt;devvm desktop&lt;/code&gt;, devvm first checks that the VM has &lt;code&gt;devvm-desktop&lt;/code&gt;, and refuses a VM without it (&lt;code&gt;desktop_no_layer&lt;/code&gt;). Then it runs &lt;code&gt;devvm-desktop start off&lt;/code&gt;, or &lt;code&gt;start on&lt;/code&gt; with &lt;code&gt;--clipboard&lt;/code&gt;, as the VM&amp;rsquo;s user.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm-desktop&lt;/code&gt; starts &lt;code&gt;Xvnc&lt;/code&gt; on display &lt;code&gt;:1&lt;/code&gt; unless it&amp;rsquo;s running. &lt;code&gt;Xvnc&lt;/code&gt; listens on the socket &lt;code&gt;/run/devvm-desktop/vnc.sock&lt;/code&gt; alone, in a folder of the VM&amp;rsquo;s user&amp;rsquo;s own (mode 700), the socket itself mode 600. It listens on no TCP port (&lt;code&gt;-rfbport -1&lt;/code&gt;), and takes no X11 connections over TCP (&lt;code&gt;-nolisten tcp&lt;/code&gt;), so devvm&amp;rsquo;s port forwarder never sees it, even on a VM that forwards every port. It asks for no password of its own (&lt;code&gt;-SecurityTypes None&lt;/code&gt;), because devvm checks the viewer&amp;rsquo;s password on this machine first. The clipboard settings (&lt;code&gt;AcceptCutText&lt;/code&gt;, &lt;code&gt;SendCutText&lt;/code&gt;, &lt;code&gt;SetPrimary&lt;/code&gt;, &lt;code&gt;SendPrimary&lt;/code&gt;) are on or off as asked, and on a desktop that runs already, &lt;code&gt;devvm-desktop&lt;/code&gt; changes them in place with &lt;code&gt;vncconfig&lt;/code&gt;. Then it starts an Xfce session on the display, in a D-Bus session of its own, with the session&amp;rsquo;s proxy settings pointed at &lt;a href="#the-local-proxy"&gt;the VM&amp;rsquo;s local proxy&lt;/a&gt;. Nothing starts the desktop at boot, so a VM whose desktop you never open runs none. Its log is &lt;code&gt;~/.cache/devvm-desktop.log&lt;/code&gt; in the VM.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-local-proxy"&gt;The local proxy&lt;span class="hx:absolute hx:-mt-20" id="the-local-proxy"&gt;&lt;/span&gt;
&lt;a href="#the-local-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every request from the VM to its &lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;proxy&lt;/a&gt; carries the VM&amp;rsquo;s password in &lt;code&gt;Proxy-Authorization&lt;/code&gt;, and the VM&amp;rsquo;s proxy settings carry it in their URL, &lt;code&gt;http://devvm:[email protected]:PORT&lt;/code&gt;. Command-line tools take the password from that URL, but Chrome, Chromium and Firefox ignore it and ask for the proxy&amp;rsquo;s username and password instead, on every site. So the desktop&amp;rsquo;s programs use a local proxy in the VM, &lt;code&gt;devvm-local-proxy&lt;/code&gt;, which needs no password and adds the VM&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s setup writes &lt;code&gt;devvm-local-proxy&lt;/code&gt; into &lt;code&gt;/usr/local/bin&lt;/code&gt; at each launch, mode 700 and the VM&amp;rsquo;s user&amp;rsquo;s, with the VM&amp;rsquo;s proxy address and password in it, and installs it whole, so a connection that&amp;rsquo;s already running keeps the copy it started with. The VM already holds the same password in its environment. &lt;code&gt;devvm-desktop&lt;/code&gt; runs &lt;code&gt;devvm-local-proxy start&lt;/code&gt; before it starts &lt;code&gt;Xvnc&lt;/code&gt;, which starts &lt;code&gt;socat&lt;/code&gt; unless it&amp;rsquo;s running, so the local proxy starts with the desktop and runs until the VM stops. &lt;code&gt;socat&lt;/code&gt; listens on &lt;code&gt;127.0.77.1:3128&lt;/code&gt; alone, which is on the VM&amp;rsquo;s loopback, takes connections only from &lt;code&gt;127.0.0.0/8&lt;/code&gt;, carries at most 256 at once, and runs &lt;code&gt;devvm-local-proxy&lt;/code&gt; on each connection itself. Its log is &lt;code&gt;~/.cache/devvm-local-proxy.log&lt;/code&gt;. The address comes from devvm&amp;rsquo;s proxy code (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;), which the setup gets as &lt;code&gt;DEVVM_LOCAL_PROXY&lt;/code&gt;, and &lt;code&gt;devvm-desktop&lt;/code&gt; sets &lt;code&gt;http_proxy&lt;/code&gt;, &lt;code&gt;https_proxy&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt; to &lt;code&gt;http://127.0.77.1:3128&lt;/code&gt; for the Xfce session. On Xfce, Chrome and Chromium read those variables for their proxy, and Firefox reads them first when its proxy setting is the system&amp;rsquo;s, which is its default.&lt;/p&gt;
&lt;p&gt;For each connection, &lt;code&gt;devvm-local-proxy&lt;/code&gt; reads the request line and the headers, waiting at most 30 seconds for each line and taking at most 100 headers. It takes only what a proxy is sent:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a &lt;code&gt;CONNECT&lt;/code&gt; to a host and port, which becomes a tunnel;&lt;/li&gt;
&lt;li&gt;a request for an absolute &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt; URL, such as &lt;code&gt;GET http://example.com/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Anything else gets &lt;code&gt;400&lt;/code&gt;, and nothing of it reaches the VM&amp;rsquo;s proxy. That includes a request in origin form, such as &lt;code&gt;GET /&lt;/code&gt;, which is what a web page sends when it reaches the local proxy as a server, so a page in the browser can&amp;rsquo;t use it. The local proxy drops the client&amp;rsquo;s own &lt;code&gt;Proxy-Authorization&lt;/code&gt; and &lt;code&gt;Proxy-Connection&lt;/code&gt; headers and adds the VM&amp;rsquo;s password. For a request that isn&amp;rsquo;t a &lt;code&gt;CONNECT&lt;/code&gt;, it drops &lt;code&gt;Connection&lt;/code&gt; and &lt;code&gt;Keep-Alive&lt;/code&gt; and asks for &lt;code&gt;Connection: close&lt;/code&gt;, because the password goes with each request&amp;rsquo;s head and the local proxy reads only the first, so each connection carries one request. Then it connects to the VM&amp;rsquo;s proxy, and to nothing else, sends the head and carries the rest both ways with &lt;code&gt;socat&lt;/code&gt;. The VM&amp;rsquo;s proxy decides as it does for any request: a host the tier allows is reached, and one it doesn&amp;rsquo;t allow gets the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt; with its reason.&lt;/p&gt;
&lt;p&gt;devvm&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/ports/#what-it-forwards"&gt;port forwarder&lt;/a&gt; never forwards a server on &lt;code&gt;127.0.77.1&lt;/code&gt;, on any port, because a forward would put a proxy that adds the VM&amp;rsquo;s password on this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, where other users and programs could reach it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="on-this-machine"&gt;On this machine&lt;span class="hx:absolute hx:-mt-20" id="on-this-machine"&gt;&lt;/span&gt;
&lt;a href="#on-this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm desktop&lt;/code&gt; listens on &lt;code&gt;127.0.0.1&lt;/code&gt; alone, on the VM&amp;rsquo;s port. That&amp;rsquo;s the port its state records in its &lt;code&gt;ports&lt;/code&gt; section (&lt;code&gt;host.desktop&lt;/code&gt;) while no program on this machine has it, and otherwise a new one that no program and no VM has, which devvm chooses and records in its place under the claims lock, as it does every port it chooses for a VM. New ports come from 20000 up to just below the range this machine gives outgoing connections, which starts at 32768 on Linux by default and 49152 on macOS, because Linux refuses a listener on a port that a live outgoing connection holds. devvm reads that range from the system, and when it can&amp;rsquo;t, or the range leaves fewer than 1000 ports above 20000, it picks from 20000 to 32767. The port is among those devvm records for VMs, with their ssh and proxy ports, so no VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/ports/#what-it-never-takes"&gt;port forwarder&lt;/a&gt; takes it and no new VM gets it for its ssh or its proxy. devvm listens without address reuse, so a program that has the port on any address keeps it. The listener stays open until you press Ctrl+C, or until the VM no longer runs, which devvm checks every 5 seconds (&lt;code&gt;desktop_vm_stopped&lt;/code&gt;). Nothing else listens for the desktop on this machine, at any other time.&lt;/p&gt;
&lt;p&gt;Each connection to the port goes through devvm&amp;rsquo;s relay, which runs in &lt;code&gt;devvm desktop&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The relay speaks VNC&amp;rsquo;s protocol (RFB 3.8, and 3.7 and 3.3 for older viewers) as a server, and offers VNC&amp;rsquo;s own authentication alone. It sends a random challenge and checks the viewer&amp;rsquo;s answer against the VM&amp;rsquo;s password, with one check at a time, so a wrong answer holds every other viewer&amp;rsquo;s check for a second, and at one guess a second, guessing the password would take thousands of years. A viewer whose answer is wrong is refused and never reaches the VM.&lt;/li&gt;
&lt;li&gt;Only then does the relay connect to the VM: an ssh channel to the VM&amp;rsquo;s socket (&lt;code&gt;ssh -W /run/devvm-desktop/vnc.sock&lt;/code&gt;), through devvm&amp;rsquo;s ssh config&amp;rsquo;s entry for the VM, with its pinned host key. The channel opens no session, and it carries no agent and no forwarding either way (&lt;code&gt;IdentityAgent=none&lt;/code&gt;, &lt;code&gt;ForwardAgent=no&lt;/code&gt;, &lt;code&gt;ForwardX11=no&lt;/code&gt;, &lt;code&gt;ClearAllForwardings=yes&lt;/code&gt;). The relay does the viewer&amp;rsquo;s side of the VM&amp;rsquo;s handshake, asking for no authentication, and tells the viewer it&amp;rsquo;s in.&lt;/li&gt;
&lt;li&gt;From then on it carries the viewer&amp;rsquo;s messages to the VM and the VM&amp;rsquo;s to the viewer. Without &lt;code&gt;--clipboard&lt;/code&gt;, it reads each of the viewer&amp;rsquo;s messages and drops its clipboard ones (&lt;code&gt;ClientCutText&lt;/code&gt;, extended clipboard ones included). It ends a connection that sends a message it doesn&amp;rsquo;t know, so nothing it can&amp;rsquo;t read reaches the VM.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;At most 8 viewers connect at once. The VM&amp;rsquo;s password is 8 characters of lowercase letters and digits without &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;o&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt; and &lt;code&gt;i&lt;/code&gt;, about 40 bits, because VNC&amp;rsquo;s authentication uses 8 characters at most. devvm makes it the first time and keeps it in the VM&amp;rsquo;s state, in its &lt;code&gt;desktop&lt;/code&gt; section (&lt;code&gt;made.password&lt;/code&gt;), in a file that only you can read. It never goes into the VM, and devvm prints it only with the address, never into the run log. &lt;a href="https://next.devvm.dev/docs/internals/processes/#the-desktop-relay"&gt;Processes&lt;/a&gt; describes the relay alongside devvm&amp;rsquo;s other processes, and it lists the &lt;a href="https://next.devvm.dev/docs/internals/processes/#listeners-a-vm-reaches"&gt;listeners&lt;/a&gt; that a VM&amp;rsquo;s bytes reach.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-the-vm-can-and-cant-change"&gt;What the VM can and can&amp;rsquo;t change&lt;span class="hx:absolute hx:-mt-20" id="what-the-vm-can-and-cant-change"&gt;&lt;/span&gt;
&lt;a href="#what-the-vm-can-and-cant-change" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Root in the VM can change its desktop, or run another server on the socket in its place. The relay doesn&amp;rsquo;t depend on the VM&amp;rsquo;s server for its guarantees:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The password:&lt;/strong&gt; the relay checks it on this machine before it opens the channel, so a VM&amp;rsquo;s server that asks for none still gets no viewer without it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The address:&lt;/strong&gt; the relay listens on this machine&amp;rsquo;s loopback, so no server in the VM reaches other machines through it. A server root starts on a TCP port of the VM&amp;rsquo;s is an ordinary server of the VM&amp;rsquo;s, which the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;ports&lt;/a&gt; forward to this machine&amp;rsquo;s loopback, or don&amp;rsquo;t, as for any other.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;This machine&amp;rsquo;s clipboard:&lt;/strong&gt; without &lt;code&gt;--clipboard&lt;/code&gt;, the relay drops it, whatever the VM&amp;rsquo;s server accepts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No way out:&lt;/strong&gt; every connection starts on this machine, and the VM opens none to it through the relay. The channel is a local forward that devvm&amp;rsquo;s ssh asks for, which the VM&amp;rsquo;s sshd connects to the VM&amp;rsquo;s own socket. On a confined tier, the VM&amp;rsquo;s own connections still reach only its proxy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The relay can&amp;rsquo;t stop a VM&amp;rsquo;s server from sending its clipboard to the viewer, because that would mean reading every screen update the server sends. So the VM&amp;rsquo;s clipboard stays off this machine only while its server is as devvm set it up, or while the viewer doesn&amp;rsquo;t take it, which Screen Sharing&amp;rsquo;s Use Shared Clipboard setting decides.&lt;/p&gt;
&lt;h2 data-hextra-search-id="why-not-x11"&gt;Why not X11&lt;span class="hx:absolute hx:-mt-20" id="why-not-x11"&gt;&lt;/span&gt;
&lt;a href="#why-not-x11" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;ssh&amp;rsquo;s X11 forwarding gives programs in the VM a connection to this machine&amp;rsquo;s display, and an X11 program on a display can read the keys typed into other windows on it, read their contents and send them input. So devvm turns X11 forwarding off on both sides of the VM&amp;rsquo;s ssh. Its ssh config&amp;rsquo;s entries set &lt;code&gt;ForwardX11 no&lt;/code&gt;, and the VM&amp;rsquo;s sshd has &lt;code&gt;X11Forwarding no&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;ssh into VMs&lt;/a&gt;). With VNC, the VM&amp;rsquo;s programs draw on a display of the VM&amp;rsquo;s own, and this machine only shows a picture of it, so nothing in the VM reaches this machine&amp;rsquo;s windows.&lt;/p&gt;</description></item><item><title>Managing VMs</title><link>https://next.devvm.dev/docs/using/vms/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/vms/</guid><description>
&lt;p&gt;This page covers a VM from the time devvm makes it until you delete it: opening, restarting and stopping it, deleting it, listing your VMs, and what devvm does when you run a command in a subfolder or when the project folder is made again, moved, deleted or on a disk that isn&amp;rsquo;t connected. &lt;a href="https://next.devvm.dev/docs/internals/overview/"&gt;Overview&lt;/a&gt; has each step devvm takes for a new VM and an existing one.&lt;/p&gt;
&lt;h2 data-hextra-search-id="opening-a-vm"&gt;Opening a VM&lt;span class="hx:absolute hx:-mt-20" id="opening-a-vm"&gt;&lt;/span&gt;
&lt;a href="#opening-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm makes a new VM from its image of base and the layers you chose, building the image first if it isn&amp;rsquo;t built yet, then starts the VM and opens a shell in it in devvm&amp;rsquo;s place, so devvm ends when the shell does. The VM mounts only the project folder, read-write, and the shared tools and its &lt;a href="https://next.devvm.dev/docs/using/coding-agents/"&gt;agents&amp;rsquo; config folders&lt;/a&gt;, read-only, or with &lt;code&gt;--clone&lt;/code&gt; it gets its own clone of the repo instead of the folder. devvm also locks the &lt;code&gt;.git&lt;/code&gt; hooks and config of the folder and of the repos nested in it against changes from the VM. On macOS it locks them with a file flag, and on Linux it makes them read-only in the VM where the kernel lets it and only watches them where it doesn&amp;rsquo;t (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;.git protection&lt;/a&gt;). For a VM that exists, devvm starts it if it&amp;rsquo;s stopped and opens it as it is.&lt;/p&gt;
&lt;p&gt;A VM is running or stopped from the time devvm makes it until you delete it.&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 511px; --devvm-diagram-width: 695px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 695 511" width="695" height="511" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d5580c2579ef0a142--title" aria-describedby="d5580c2579ef0a142--desc"&gt;&lt;title id="d5580c2579ef0a142--title"&gt;A VM's states&lt;/title&gt;&lt;desc id="d5580c2579ef0a142--desc"&gt;devvm makes a VM, which is then running. devvm restart and devvm update keep it running, devvm stop stops it, and devvm, devvm restart or devvm update start it again. devvm rm deletes it, running or stopped. When its image changes, a VM is outdated, and it keeps its image until devvm update.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_none_running_0"&gt;&lt;path d="M263.88,53L263.88,113"/&gt;&lt;path class="pele-marker" d="M263.88,120L260.52,112L267.24,112Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_running_running_0"&gt;&lt;path d="M320.32,134.5C346.32,126.5 346.32,158.5 327.01,152.56"/&gt;&lt;path class="pele-marker" d="M320.32,150.5L328.95,149.64L326.97,156.06Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_running_stopped_0"&gt;&lt;path d="M245.93,165L245.93,172.88Q245.93,183 235.81,183L70.55,183Q58.55,183 58.55,195L58.55,269Q58.55,281 70.55,281L129.36,281Q141.36,281 141.36,293L141.36,308.5"/&gt;&lt;path class="pele-marker" d="M141.36,315.5L138,307.5L144.72,307.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_stopped_running_0"&gt;&lt;path d="M157.36,315.5L157.36,293Q157.36,281 169.36,281L181.45,281Q193.45,281 193.45,269L193.45,205Q193.45,193 205.45,193L249.93,193Q261.93,193 261.93,181L261.93,172"/&gt;&lt;path class="pele-marker" d="M261.93,165L265.29,173L258.57,173Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_running_deleted_0"&gt;&lt;path d="M277.93,165L277.93,427.5Q277.93,439.5 265.93,439.5L248,439.5Q239.75,439.5 239.75,447.75L239.75,450.5"/&gt;&lt;path class="pele-marker" d="M239.75,457.5L236.39,449.5L243.11,449.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_stopped_deleted_0"&gt;&lt;path d="M149.36,360.5L149.36,427.5Q149.36,439.5 161.36,439.5L215.5,439.5Q223.75,439.5 223.75,447.75L223.75,450.5"/&gt;&lt;path class="pele-marker" d="M223.75,457.5L220.39,449.5L227.11,449.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_none_running_0"&gt;&lt;rect x="237.61" y="77.5" width="52.55" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="263.88" y="90.7" text-anchor="middle"&gt;devvm&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_running_running_0"&gt;&lt;rect x="352.32" y="126.5" width="132.73" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="418.68" y="138.7"&gt;devvm restart,&lt;/tspan&gt;&lt;tspan x="418.68" y="154.7"&gt;devvm update&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_running_stopped_0"&gt;&lt;rect x="10" y="228" width="97.09" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="58.55" y="241.2" text-anchor="middle"&gt;devvm stop&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_stopped_running_0"&gt;&lt;rect x="127.09" y="213" width="132.73" height="48" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="193.45" y="225.2"&gt;devvm,&lt;/tspan&gt;&lt;tspan x="193.45" y="241.2"&gt;devvm restart,&lt;/tspan&gt;&lt;tspan x="193.45" y="257.2"&gt;devvm update&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_running_deleted_0"&gt;&lt;rect x="238.3" y="329" width="79.27" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="277.93" y="342.2" text-anchor="middle"&gt;devvm rm&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_stopped_deleted_0"&gt;&lt;rect x="109.73" y="401.5" width="79.27" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="149.36" y="414.7" text-anchor="middle"&gt;devvm rm&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-stadium" data-id="none" transform="translate(263.88,30.5)"&gt;&lt;rect x="-47.52" y="-22.5" width="95.05" height="45" rx="22.5" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;no VM&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-stadium" data-id="running" transform="translate(263.88,142.5)"&gt;&lt;rect x="-56.43" y="-22.5" width="112.86" height="45" rx="22.5" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;running&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-stadium" data-id="stopped" transform="translate(149.36,338)"&gt;&lt;rect x="-56.43" y="-22.5" width="112.86" height="45" rx="22.5" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;stopped&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-stadium" data-id="deleted" transform="translate(231.75,480)"&gt;&lt;rect x="-56.43" y="-22.5" width="112.86" height="45" rx="22.5" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;deleted&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-braces" data-id="outdated" transform="translate(527.24,338)"&gt;&lt;rect x="-159.18" y="-39" width="318.36" height="78" fill="none" stroke="none"/&gt;&lt;path d="M-147.18,-39q-6,0 -6,6V-6q0,6 -6,6q6,0 6,6V33q0,6 6,6" fill="none" stroke="var(--_b)"/&gt;&lt;path d="M147.18,-39q6,0 6,6V-6q0,6 6,6q-6,0 -6,6V33q0,6 -6,6" fill="none" stroke="var(--_b)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;When its image changes, a VM&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;is outdated, and it keeps&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;its image until devvm update.&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;The shell, and an agent&amp;rsquo;s login with &lt;code&gt;devvm agent login&lt;/code&gt;, get your terminal&amp;rsquo;s &lt;code&gt;COLORTERM&lt;/code&gt; when it&amp;rsquo;s &lt;code&gt;truecolor&lt;/code&gt; or &lt;code&gt;24bit&lt;/code&gt;, so programs in the VM, such as coding agents, show 24-bit color as they do on this machine (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-shells-colors"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="restarting-and-stopping"&gt;Restarting and stopping&lt;span class="hx:absolute hx:-mt-20" id="restarting-and-stopping"&gt;&lt;/span&gt;
&lt;a href="#restarting-and-stopping" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm restart &lt;span class="c1"&gt;# stop this folder&amp;#39;s VM, start it again and open a shell in it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm stop &lt;span class="c1"&gt;# stop it and its proxy&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm restart&lt;/code&gt; stops this folder&amp;rsquo;s VM, then starts it and opens a shell in it as devvm does. Some changes apply only when a VM starts, and a restart applies them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a new size for a running VM&lt;/li&gt;
&lt;li&gt;a change into or out of the open tier&lt;/li&gt;
&lt;li&gt;a change to its SSH agent forwarding&lt;/li&gt;
&lt;li&gt;the config folders of an agent that &lt;code&gt;devvm tools add&lt;/code&gt; added&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When you make one of these changes to a running VM with &lt;code&gt;devvm size&lt;/code&gt;, &lt;code&gt;devvm network&lt;/code&gt; into or out of open or &lt;code&gt;devvm ssh-agent&lt;/code&gt;, or change its &lt;code&gt;.git&lt;/code&gt; protection on macOS with &lt;code&gt;devvm git-protect&lt;/code&gt;, which waits for the VM to stop, devvm asks in a terminal whether to restart the VM now, because anything running in it stops. If you answer yes, devvm restarts it as &lt;code&gt;devvm restart&lt;/code&gt; does and opens a shell in it. If you answer no, devvm keeps the change and says that &lt;code&gt;devvm restart&lt;/code&gt; applies it, and it does the same without asking when there&amp;rsquo;s no terminal or you pass &lt;code&gt;--no-input&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When devvm opens a running VM that still has changes waiting for its next start, it names them, such as its size and its agent folder mounts, and asks in a terminal once whether to restart the VM now. It names each change on a line of its own, and when more than two wait, it names the first and says how many more there are. The default answer depends on what waits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Yes (&lt;code&gt;[Y/n]&lt;/code&gt;)&lt;/strong&gt; when the VM&amp;rsquo;s agent folder mounts are among the changes, because an agent you just added needs its folders.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No (&lt;code&gt;[y/N]&lt;/code&gt;)&lt;/strong&gt; otherwise, because the VM is already running and you may only want its shell.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you answer yes, devvm stops the VM, starts it with the changes and opens a shell in it. If you answer no, or there&amp;rsquo;s no terminal, or you pass &lt;code&gt;--no-input&lt;/code&gt;, devvm warns about each change and opens a shell in the running VM.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm stop&lt;/code&gt; stops this folder&amp;rsquo;s VM and its proxy (&lt;a href="https://next.devvm.dev/docs/internals/overview/#stopping-a-vm"&gt;stopping a VM&lt;/a&gt;). Once the VM is stopped, devvm locks its &lt;code&gt;.git&lt;/code&gt; again and checks it, as a launch that finds the VM stopped does, and it takes the VM&amp;rsquo;s entry out of devvm&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;ssh config&lt;/a&gt;. devvm, &lt;code&gt;devvm restart&lt;/code&gt;, and the commands that need the VM running, such as &lt;code&gt;devvm host&lt;/code&gt;, start it again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="deleting-a-vm"&gt;Deleting a VM&lt;span class="hx:absolute hx:-mt-20" id="deleting-a-vm"&gt;&lt;/span&gt;
&lt;a href="#deleting-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm &lt;span class="c1"&gt;# delete this folder&amp;#39;s VM, after asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm --force &lt;span class="c1"&gt;# the same without asking, as a script must&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm --no-export &lt;span class="c1"&gt;# without exporting its agents&amp;#39; history first&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm devvm-web-71a99b1076d92c &lt;span class="c1"&gt;# a VM whose folder is gone, by its name from devvm ls&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm rm&lt;/code&gt; deletes this folder&amp;rsquo;s VM together with what devvm keeps for it. That&amp;rsquo;s the VM&amp;rsquo;s state, its own allowlist, its network log, its &lt;code&gt;.git&lt;/code&gt; locks or, for a &lt;code&gt;--clone&lt;/code&gt; VM, the repo&amp;rsquo;s &lt;code&gt;devvm&lt;/code&gt; remote, and its ssh config entry (&lt;a href="https://next.devvm.dev/docs/internals/overview/#deleting-a-vm"&gt;deleting a VM&lt;/a&gt;). It asks first in a terminal, and &lt;code&gt;--force&lt;/code&gt; deletes without asking, which &lt;code&gt;devvm rm&lt;/code&gt; needs when there&amp;rsquo;s no terminal.&lt;/p&gt;
&lt;p&gt;When the VM has an agent, devvm first exports the agents&amp;rsquo; history, unless you give &lt;code&gt;--no-export&lt;/code&gt;, and when the export fails, devvm keeps the VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;history&lt;/a&gt;). For a &lt;code&gt;--clone&lt;/code&gt; VM, devvm offers to fetch the branches this repo hasn&amp;rsquo;t fetched, and it deletes the VM&amp;rsquo;s uncommitted changes only after you confirm. &lt;code&gt;--no-clone-check&lt;/code&gt; skips that check and warns you that the clone&amp;rsquo;s unfetched commits and uncommitted changes go with the VM (&lt;a href="https://next.devvm.dev/docs/using/clone/#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;). When the VM has opencode, devvm also checks the worktrees opencode made in it, which an export leaves out, and asks before their uncommitted changes go. It starts a stopped VM for that check, even with &lt;code&gt;--no-export&lt;/code&gt;, and &lt;code&gt;--no-worktree-check&lt;/code&gt; skips the check, so with &lt;code&gt;--no-export&lt;/code&gt; as well, devvm deletes a stopped VM without starting it (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Some VMs devvm deletes only after you confirm, and it asks these questions only in a terminal, where &lt;code&gt;--force&lt;/code&gt; never answers them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the VM made for an earlier folder at this path (&lt;a href="#a-folder-made-again"&gt;a folder made again&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;in a folder without a VM of its own, the VM of the nearest folder with one that this folder is inside, which &lt;code&gt;devvm rm&lt;/code&gt; acts on and names (&lt;a href="#a-subfolder"&gt;a subfolder&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To delete a VM whose folder you deleted or moved, give its name, as in &lt;code&gt;devvm rm devvm-web-71a99b1076d92c&lt;/code&gt; (&lt;a href="#a-vm-whose-folder-is-gone"&gt;a VM whose folder is gone&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="listing-vms"&gt;Listing VMs&lt;span class="hx:absolute hx:-mt-20" id="listing-vms"&gt;&lt;/span&gt;
&lt;a href="#listing-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm ls&lt;/code&gt; prints a table of the project VMs, sorted by name, with a header first. Images and build VMs aren&amp;rsquo;t in it.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s name, &lt;code&gt;devvm-&amp;lt;folder&amp;gt;-&amp;lt;hash&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STATUS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its state as its backend reports it, such as &lt;code&gt;Running&lt;/code&gt; or &lt;code&gt;Stopped&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;IMAGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its image, base and its layers, with a base from a container image as &lt;code&gt;base (from node:24)&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/from/"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TOOLS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its shared tools, joined with commas, such as &lt;code&gt;node,claude&lt;/code&gt;, or &lt;code&gt;-&lt;/code&gt; for none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GIT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its &lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt;, &lt;code&gt;on&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt;, or &lt;code&gt;clone&lt;/code&gt; for a &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt;, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;, or &lt;code&gt;unenforced&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt;), and &lt;code&gt;internet (learning)&lt;/code&gt; while it &lt;a href="https://next.devvm.dev/docs/safety/network/#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LINKS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;how many &lt;a href="https://next.devvm.dev/docs/using/links/"&gt;links&lt;/a&gt; it has to ports of your other VMs, or &lt;code&gt;-&lt;/code&gt; for none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FOLDER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its project folder, with &lt;code&gt;(gone)&lt;/code&gt; after it when nothing is at that path, which &lt;code&gt;devvm rm VM&lt;/code&gt; deals with (&lt;a href="#a-vm-whose-folder-is-gone"&gt;a VM whose folder is gone&lt;/a&gt;), or &lt;code&gt;(not connected)&lt;/code&gt; when the folder was on a disk that isn&amp;rsquo;t connected (&lt;a href="#a-folder-on-a-disk-that-isnt-connected"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A value the VM&amp;rsquo;s state doesn&amp;rsquo;t have shows as &lt;code&gt;-&lt;/code&gt;, so a VM whose creation didn&amp;rsquo;t finish shows only its name and status.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-ls-json"&gt;devvm ls &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-ls-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-ls-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm ls --json&lt;/code&gt; prints the same list as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. &lt;code&gt;vms&lt;/code&gt; has a VM&amp;rsquo;s columns as fields, sorted by name. &lt;code&gt;image&lt;/code&gt; is the image alone, &lt;code&gt;tools&lt;/code&gt; is the list of its shared tools, &lt;code&gt;[]&lt;/code&gt; for none, and &lt;code&gt;from&lt;/code&gt; is the container image its base started from, which is left out for a base from Ubuntu&amp;rsquo;s cloud image. A value the VM&amp;rsquo;s state doesn&amp;rsquo;t have is &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;. &lt;code&gt;folder&lt;/code&gt; is the folder alone, and &lt;code&gt;folder_state&lt;/code&gt; is &lt;code&gt;there&lt;/code&gt; when something is at its path, &lt;code&gt;gone&lt;/code&gt; when nothing is, and &lt;code&gt;not_connected&lt;/code&gt; when the folder was on a disk that isn&amp;rsquo;t connected. &lt;code&gt;links&lt;/code&gt; is how many links the VM has, &lt;code&gt;0&lt;/code&gt; for none. &lt;code&gt;net&lt;/code&gt; is the tier alone, and a VM that&amp;rsquo;s learning the hosts it needs also has &lt;code&gt;learning_since&lt;/code&gt;, the time it started learning.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;vms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm-website-71a99b1076d92c&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;status&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Running&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;image&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;base&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tools&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;node&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;claude&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;from&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;node:24&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;git&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;on&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;net&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;internet&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;learning_since&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2026-11-07T10:00:00Z&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;folder&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/code/website&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;folder_state&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;there&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;links&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="a-subfolder"&gt;A subfolder&lt;span class="hx:absolute hx:-mt-20" id="a-subfolder"&gt;&lt;/span&gt;
&lt;a href="#a-subfolder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/some-project/src
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="c1"&gt;# open the parent folder&amp;#39;s VM, with the shell here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --here &lt;span class="c1"&gt;# make a VM for this subfolder instead&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --parent &lt;span class="c1"&gt;# use the parent folder&amp;#39;s VM even in a repo of its own&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A VM mounts its whole project folder, so the folders inside it are in the VM at the same paths. When the folder you run a command in has no VM of its own, devvm looks for one in the folders it&amp;rsquo;s inside, starting with the nearest. It stops before your home folder and the filesystem root, so it never uses a VM made for either. It stops at the nearest folder that has a VM, and when that VM was made for an earlier folder at its path (&lt;a href="#a-folder-made-again"&gt;a folder made again&lt;/a&gt;), or its backend has lost it, the folder you&amp;rsquo;re in has no VM, so devvm never reaches past it to a VM further out. Using a parent folder&amp;rsquo;s VM mounts nothing new, because the subfolder is already inside the folder that VM mounts.&lt;/p&gt;
&lt;p&gt;In such a subfolder, such as &lt;code&gt;~/some-project/src&lt;/code&gt;, each command does this:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;In a subfolder&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;opens the parent folder&amp;rsquo;s VM there, with the shell at the subfolder&amp;rsquo;s path, and first prints a line that names the VM and the folder it was made for. It does the same with or without a terminal, and it asks nothing. &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; change nothing on the parent folder&amp;rsquo;s VM, as on any VM that exists, and devvm warns that they don&amp;rsquo;t (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;adding and removing tools&lt;/a&gt;). In a parent folder&amp;rsquo;s &lt;code&gt;--clone&lt;/code&gt; VM, the shell opens in the subfolder when the clone has it (&lt;a href="https://next.devvm.dev/docs/using/clone/#subfolders"&gt;subfolders&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm --here&lt;/code&gt;, &lt;code&gt;devvm --clone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;make a new VM for the subfolder instead, and &lt;code&gt;devvm --clone&lt;/code&gt; makes the subfolder&amp;rsquo;s own clone VM. Once the subfolder has its own VM, devvm opens that one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm stop&lt;/code&gt;, &lt;code&gt;restart&lt;/code&gt;, &lt;code&gt;tools&lt;/code&gt;, &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;ports&lt;/code&gt;, &lt;code&gt;host&lt;/code&gt; and &lt;code&gt;code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;use the parent folder&amp;rsquo;s VM in the same way, without asking. Each one first prints a line that names the VM and the folder it was made for. &lt;code&gt;devvm host&lt;/code&gt; gives the subfolder as the folder to open in the VM, and &lt;code&gt;devvm code&lt;/code&gt; opens the subfolder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm rm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;never deletes a parent folder&amp;rsquo;s VM unasked. In a terminal, it names the VM and its folder and asks before deleting it, with no as the default, and &lt;code&gt;--force&lt;/code&gt; never answers that question. Without a terminal, it refuses and tells you to run &lt;code&gt;devvm rm&lt;/code&gt; in the parent folder instead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm adopt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;acts only on the VM made for this folder&amp;rsquo;s own path, never on a parent folder&amp;rsquo;s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The commands that give the VM more access ask in the same way as &lt;code&gt;devvm rm&lt;/code&gt;, because the parent folder&amp;rsquo;s project may not expect them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm secret use&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ssh-agent on&lt;/code&gt; and &lt;code&gt;devvm ssh-agent devvm&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm network&lt;/code&gt; with a lower tier, such as &lt;code&gt;devvm network open&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm network allow&lt;/code&gt;, and &lt;code&gt;devvm network rm&lt;/code&gt; when it removes a deny&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm git-protect off&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In a terminal, each one names the VM and its folder and asks before it changes the VM, with no as the default. Without a terminal, it refuses and tells you to run it in the parent folder, or in a terminal to confirm. The commands that take access away, such as &lt;code&gt;devvm secret unuse&lt;/code&gt; and &lt;code&gt;devvm network deny&lt;/code&gt;, ask nothing.&lt;/p&gt;
&lt;p&gt;A subfolder that is a git repo of its own is treated as a separate project, and so is a subfolder inside such a repo, when the repo is below the folder with the VM. That covers a nested repo, a submodule and a worktree, which each have a &lt;code&gt;.git&lt;/code&gt; folder or file of their own. When you run &lt;code&gt;devvm&lt;/code&gt; there, devvm makes a new VM for the subfolder, with or without a terminal, and asks nothing. The other commands don&amp;rsquo;t use the parent folder&amp;rsquo;s VM there, and they say this folder has no VM, as in any folder without one.&lt;/p&gt;
&lt;p&gt;Every command that acts on this folder&amp;rsquo;s VM, &lt;code&gt;devvm&lt;/code&gt; included, takes &lt;code&gt;--here&lt;/code&gt; and &lt;code&gt;--parent&lt;/code&gt;, and each finds the VM in the same way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--here&lt;/code&gt; uses only this folder&amp;rsquo;s own VM, so &lt;code&gt;devvm --here&lt;/code&gt; makes one when the folder has none, and the other commands say this folder has no VM.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--parent&lt;/code&gt; uses the VM of the nearest folder with one that this folder is inside, even across a git repo of its own and even when this folder has a VM of its own, so &lt;code&gt;devvm --parent&lt;/code&gt; in a repo of its own opens the project&amp;rsquo;s VM there. When no folder that this folder is inside has a VM, a command given &lt;code&gt;--parent&lt;/code&gt; fails and changes nothing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can&amp;rsquo;t give the two together, or either of them with &lt;code&gt;-g&lt;/code&gt;, and &lt;code&gt;devvm --clone&lt;/code&gt; doesn&amp;rsquo;t take &lt;code&gt;--parent&lt;/code&gt;, because a clone VM is always the folder&amp;rsquo;s own. &lt;code&gt;devvm rm VM&lt;/code&gt; takes neither, because it deletes the VM you name, and neither does &lt;code&gt;devvm adopt&lt;/code&gt;, because it acts only on this folder&amp;rsquo;s own path. With &lt;code&gt;--parent&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; and the commands that give the VM more access still ask before they change the parent folder&amp;rsquo;s VM.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-nested-project-replaced"&gt;A nested project replaced&lt;span class="hx:absolute hx:-mt-20" id="a-nested-project-replaced"&gt;&lt;/span&gt;
&lt;a href="#a-nested-project-replaced" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A project with a VM of its own inside a folder with another VM, such as a nested repo, is in both VMs, because the parent folder&amp;rsquo;s VM mounts everything inside its folder. Code in the parent folder&amp;rsquo;s VM can do two things to it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It can change the nested project&amp;rsquo;s files, though not the hooks and config of its &lt;code&gt;.git&lt;/code&gt; while the parent folder&amp;rsquo;s VM protects it, as &lt;a href="https://next.devvm.dev/docs/safety/git-protection/#nested-repos"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt; does for the repos nested in a VM&amp;rsquo;s folder.&lt;/li&gt;
&lt;li&gt;It can move the nested project folder aside and put a link in its place, or another folder. On Linux, if devvm then started the nested project&amp;rsquo;s VM, the VM would mount whatever the link points to, such as your home folder. On macOS the VM mounts the project folder itself, wherever it was moved, and never what a link at its path points to.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On both, devvm checks the nested project folder just before it starts the VM and again once the VM runs. If the folder is now a link, sits below a link, or is another folder, devvm doesn&amp;rsquo;t start the VM, or it stops the VM again, and it tells you which. Then:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Find what replaced the folder.&lt;/li&gt;
&lt;li&gt;Move the project folder back to its path.&lt;/li&gt;
&lt;li&gt;Run the command again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Replacing the folder while the VM runs never shows the VM what the link points to. On Linux the VM keeps the folder it mounted when it started, and on macOS the VM gets &amp;ldquo;Operation not permitted&amp;rdquo; for its project folder, as it does when the folder was moved aside while the VM started and put back later, so run &lt;code&gt;devvm restart&lt;/code&gt; once the folder is back. To keep a nested project out of the parent folder&amp;rsquo;s VM altogether, move it out of the parent folder.&lt;/p&gt;
&lt;p&gt;Each time &lt;code&gt;devvm&lt;/code&gt; makes or opens the nested project&amp;rsquo;s VM, it warns once and names the VM of the nearest parent folder that mounts the project. It warns whether that VM runs or not, because the VM can write to the folder whenever it runs. A &lt;code&gt;--clone&lt;/code&gt; VM mounts nothing, so devvm doesn&amp;rsquo;t warn when you open one, and a parent folder&amp;rsquo;s &lt;code&gt;--clone&lt;/code&gt; VM never counts. The other commands, &lt;code&gt;devvm restart&lt;/code&gt; included, don&amp;rsquo;t warn.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-folder-made-again"&gt;A folder made again&lt;span class="hx:absolute hx:-mt-20" id="a-folder-made-again"&gt;&lt;/span&gt;
&lt;a href="#a-folder-made-again" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM belongs to the folder it was made for, which devvm knows by its path and by the folder itself (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;). When that folder was deleted and a new one made at the same path, every command that opens, stops or changes the VM refuses it, such as &lt;code&gt;devvm&lt;/code&gt;, &lt;code&gt;devvm stop&lt;/code&gt;, &lt;code&gt;devvm restart&lt;/code&gt; and &lt;code&gt;devvm tools&lt;/code&gt;. Two commands deal with a folder made again, and each acts only after you confirm in a terminal:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm rm&lt;/code&gt; deletes the VM and never exports its history, because its folder is gone. The VM may hold that project&amp;rsquo;s work, so &lt;code&gt;--force&lt;/code&gt; never answers this question.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm adopt&lt;/code&gt; gives the VM to this folder, with its files, secrets and allowlist. Its &lt;code&gt;.git&lt;/code&gt; protection starts again, as if &lt;code&gt;.git&lt;/code&gt; had just appeared. &lt;code&gt;devvm adopt --force&lt;/code&gt; gives it without asking, which &lt;code&gt;devvm adopt&lt;/code&gt; needs when there&amp;rsquo;s no terminal.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What devvm does in the cases between:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A restart of your Mac&lt;/strong&gt; can give the folder&amp;rsquo;s disk another device number, but that doesn&amp;rsquo;t make it a new folder, so the VM opens as before. The exception is a VM that has recorded its folder&amp;rsquo;s volume, when the folder is on another volume now, such as a copy of the disk with a volume ID of its own, mounted at the same path.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A folder devvm can&amp;rsquo;t read at all,&lt;/strong&gt; as when code in a VM that mounts it took away your read permission, leaves devvm unable to tell whether the folder is the VM&amp;rsquo;s, so every command on the folder&amp;rsquo;s VM refuses it, naming the folder and why it can&amp;rsquo;t be read. Make the folder readable to you again, with &lt;code&gt;chmod u+rx&lt;/code&gt; on it, and the VM opens as before.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A Btrfs snapshot on Linux&lt;/strong&gt; that you roll back to at the folder&amp;rsquo;s path is another subvolume, once the VM has recorded its folder&amp;rsquo;s volume, so its folder is another folder, as is the folder after you give its volume a new UUID. You give it the VM with &lt;code&gt;devvm adopt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="a-moved-or-renamed-folder"&gt;A moved or renamed folder&lt;span class="hx:absolute hx:-mt-20" id="a-moved-or-renamed-folder"&gt;&lt;/span&gt;
&lt;a href="#a-moved-or-renamed-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mv ~/code/app ~/work/app
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/work/app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm &lt;span class="c1"&gt;# devvm asks whether to move the VM here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm adopt --force &lt;span class="c1"&gt;# the same without asking, as a script must&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm adopt VM &lt;span class="c1"&gt;# give a copy on another disk the VM, by its name from devvm ls&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When you move or rename a project folder on the same disk, as with &lt;code&gt;mv ~/code/app ~/work/app&lt;/code&gt;, the folder keeps its VM once you say so. The first time you run a command on this folder&amp;rsquo;s VM at the folder&amp;rsquo;s new path, such as &lt;code&gt;devvm&lt;/code&gt; or &lt;code&gt;devvm stop&lt;/code&gt;, devvm finds the VM made for the folder at its old path, names the VM and that path, and asks whether to move the VM here, with no as the default:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Yes:&lt;/strong&gt; the VM belongs to the folder at its new path, with its home folder, secrets, allowlist, links and settings, and devvm finds it there from then on without asking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No:&lt;/strong&gt; the folder has no VM, so &lt;code&gt;devvm&lt;/code&gt; makes a new one, and the old VM stays with the old path, where &lt;code&gt;devvm rm VM&lt;/code&gt; deletes it (&lt;a href="#a-vm-whose-folder-is-gone"&gt;a VM whose folder is gone&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Without a terminal,&lt;/strong&gt; devvm refuses and tells you to run &lt;code&gt;devvm adopt&lt;/code&gt; in a terminal, or &lt;code&gt;devvm adopt --force&lt;/code&gt;, which moves the VM without asking.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once the VM has moved, this is what changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The VM mounts the folder at its new path from its next start. When the VM is running as you move it, it still mounts the old path, so devvm stops it before it moves it, and &lt;code&gt;devvm&lt;/code&gt; then starts it with the folder at its new path. If a VM runs with its folder at another path all the same, devvm asks whether to restart it as it opens the VM, with yes as the default, and when you answer no, it warns that the VM mounts the folder at its new path only when it next starts.&lt;/li&gt;
&lt;li&gt;The folder&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; moves with it, locks and all, so its &lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;.git protection&lt;/a&gt; goes on as before.&lt;/li&gt;
&lt;li&gt;Links to the VM and its group go by the VM&amp;rsquo;s name, so they stay, and a link whose TARGET is the folder&amp;rsquo;s path finds the VM at its new path.&lt;/li&gt;
&lt;li&gt;The folder&amp;rsquo;s path in the VM changes with it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Claude Code&amp;rsquo;s history follows the folder. Claude Code keeps a folder&amp;rsquo;s sessions and its settings for that folder, such as whether you trust it and the MCP servers you added there, by the folder&amp;rsquo;s path. At the VM&amp;rsquo;s next start, devvm moves them in the VM from the old path to the new one, so &lt;code&gt;claude --continue&lt;/code&gt; and &lt;code&gt;claude --resume&lt;/code&gt; offer the sessions from before the move. When Claude Code already has sessions at the new path, the old path&amp;rsquo;s sessions join them, and a session the new path already has stays as it is. Settings that Claude Code already keeps for the new path stay as they are, and the old path&amp;rsquo;s stay under the old path. devvm moves only what Claude Code keeps for the project folder itself, so sessions you started in one of its subfolders stay under that subfolder&amp;rsquo;s old path.&lt;/p&gt;
&lt;p&gt;Codex records each session&amp;rsquo;s folder in the session, and &lt;code&gt;codex resume&lt;/code&gt; and &lt;code&gt;codex resume --last&lt;/code&gt; look only at the current folder&amp;rsquo;s sessions, so they miss the ones from the old path. To find them:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex resume --all &lt;span class="c1"&gt;# list the sessions of every folder, the old path&amp;#39;s included&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex resume ID &lt;span class="c1"&gt;# resume a session by its ID, wherever it started&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;opencode keeps the sessions of a git repo by the repo&amp;rsquo;s first commit, so they follow the folder without any change. In a folder that isn&amp;rsquo;t a git repo, opencode keeps sessions by the folder&amp;rsquo;s path, so they stay under the old path.&lt;/p&gt;
&lt;p&gt;devvm offers the move only when the folder at the new path is the folder the VM was made for, and when nothing is at the old path any more, or only a symlink to the new path. devvm knows the folder by its device, inode and birth time, or by its volume, inode and birth time after a restart gave its disk another device number (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;). There&amp;rsquo;s no offer in these cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A copy:&lt;/strong&gt; a copy of the folder is another folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Some file systems:&lt;/strong&gt; a folder on a file system that may give a new folder the inode number of a deleted one, such as a network share, a FUSE file system or a USB drive formatted with FAT or exFAT, never gets the offer. &lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;One VM per folder&lt;/a&gt; lists the file systems that do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another user&amp;rsquo;s folder:&lt;/strong&gt; devvm offers no VM for a folder that another user owns. On a Mac, a volume that ignores ownership, as disk images and external disks often do, shows every folder as yours, so devvm can&amp;rsquo;t tell another user&amp;rsquo;s folder there from yours. Check that a folder on such a volume is yours before you say yes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Moved after a restart, before its volume was recorded:&lt;/strong&gt; a VM records its folder&amp;rsquo;s volume when it&amp;rsquo;s made, adopted or moved, and a VM made before records it at its first launch that finds its folder. Until then, a folder moved after a restart gets no offer, because the restart may have given its disk another device number. The same goes for a folder whose volume is still to check after a restart when devvm also can&amp;rsquo;t read the volume at the move, and for a folder on a file system whose volume devvm can&amp;rsquo;t tell, such as XFS or tmpfs on Linux. &lt;code&gt;devvm adopt VM&lt;/code&gt; moves the VM to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;--clone&lt;/code&gt; VM,&lt;/strong&gt; which keeps its own clone of the repo at the old path inside the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Several VMs:&lt;/strong&gt; when more than one VM was made for the folder at paths it had before, devvm moves none of them and names them, so you can choose one with &lt;code&gt;devvm adopt VM&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm refuses to move a VM to a folder that it wouldn&amp;rsquo;t make a new VM for, such as your home folder (&lt;a href="https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses"&gt;project folders devvm refuses&lt;/a&gt;). A new folder at the old path gets a new VM of its own, with another name.&lt;/p&gt;
&lt;p&gt;Moving a folder to another disk copies it, so the folder at the new path is another folder, which devvm never offers the VM to on its own. To give the copy the VM, delete the folder at the old path or disconnect its disk, then run &lt;code&gt;devvm adopt VM&lt;/code&gt; in the copy, with the VM&amp;rsquo;s name as &lt;code&gt;devvm ls&lt;/code&gt; lists it. devvm names the VM and its old path and asks first, with no as the default, and &lt;code&gt;--force&lt;/code&gt; moves it without asking, which &lt;code&gt;devvm adopt VM&lt;/code&gt; needs when there&amp;rsquo;s no terminal. The VM&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; protection starts again, as if &lt;code&gt;.git&lt;/code&gt; had just appeared, because the copy&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; is another folder too. devvm refuses a VM whose folder is still there, a &lt;code&gt;--clone&lt;/code&gt; VM, and a folder that has a VM of its own, which you delete first with &lt;code&gt;devvm rm&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-vm-whose-folder-is-gone"&gt;A VM whose folder is gone&lt;span class="hx:absolute hx:-mt-20" id="a-vm-whose-folder-is-gone"&gt;&lt;/span&gt;
&lt;a href="#a-vm-whose-folder-is-gone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you delete or move a project folder, its VM stays, because the VM may hold work that&amp;rsquo;s nowhere else and devvm never deletes a VM on its own. A folder you moved gets its VM back at its new path once you say so (&lt;a href="#a-moved-or-renamed-folder"&gt;a moved or renamed folder&lt;/a&gt;), and until then the VM&amp;rsquo;s folder counts as gone. &lt;code&gt;devvm ls&lt;/code&gt; writes &lt;code&gt;(gone)&lt;/code&gt; after the folder of each VM whose folder is gone (&lt;a href="#listing-vms"&gt;listing VMs&lt;/a&gt;), and &lt;code&gt;devvm space&lt;/code&gt; names each one with its folder. A folder on a disk that isn&amp;rsquo;t connected isn&amp;rsquo;t gone, and &lt;a href="#a-folder-on-a-disk-that-isnt-connected"&gt;a folder on a disk that isn&amp;rsquo;t connected&lt;/a&gt; covers it. A folder that was deleted and made again at the same path isn&amp;rsquo;t gone, and devvm handles it as &lt;a href="#a-folder-made-again"&gt;a folder made again&lt;/a&gt;. &lt;a href="https://next.devvm.dev/docs/internals/overview/#a-vm-whose-folder-is-gone"&gt;A VM whose folder is gone&lt;/a&gt; explains how devvm tells.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ls &lt;span class="c1"&gt;# the VMs, with (gone) after a folder that&amp;#39;s gone&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm devvm-web-71a99b1076d92c &lt;span class="c1"&gt;# delete one by its name, after asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm devvm-web-71a99b1076d92c --no-export &lt;span class="c1"&gt;# a stopped one with an agent, without its history&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm devvm-web-71a99b1076d92c --no-export --no-worktree-check &lt;span class="c1"&gt;# a stopped one with opencode, without checking its worktrees&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm rm VM&lt;/code&gt; deletes a VM whose folder is gone, and you can run it in any folder. VM is the VM&amp;rsquo;s name, as &lt;code&gt;devvm ls&lt;/code&gt; lists it, or the alias that ssh reaches it by. In a terminal, devvm names the VM and its folder and asks before deleting it, with no as the default. &lt;code&gt;--force&lt;/code&gt; deletes it without asking, which &lt;code&gt;devvm rm VM&lt;/code&gt; needs when there&amp;rsquo;s no terminal. Like &lt;code&gt;devvm rm&lt;/code&gt;, it deletes what devvm keeps for the VM, and when the VM has an agent, devvm first exports the agents&amp;rsquo; history unless you give &lt;code&gt;--no-export&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;history&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The export reads the history from the running VM. Starting a stopped VM would make its folder again, because Lima makes a missing folder that a VM mounts, so for a stopped VM with an agent devvm refuses and tells you to run &lt;code&gt;devvm rm VM --no-export&lt;/code&gt;. devvm reads opencode&amp;rsquo;s worktrees from the running VM too, so for a stopped VM with opencode it tells you to run &lt;code&gt;devvm rm VM --no-export --no-worktree-check&lt;/code&gt;. If you moved the folder and want the history, run &lt;code&gt;devvm history export&lt;/code&gt; or &lt;code&gt;devvm rm&lt;/code&gt; in the folder at its new path, which moves the VM there first (&lt;a href="#a-moved-or-renamed-folder"&gt;a moved or renamed folder&lt;/a&gt;). A &lt;code&gt;--clone&lt;/code&gt; VM mounts no project folder, so devvm starts it to export the history. Its clone&amp;rsquo;s work can&amp;rsquo;t be fetched into a repo that&amp;rsquo;s gone, though, so devvm refuses to delete it unless you give &lt;code&gt;--no-clone-check&lt;/code&gt;, which deletes the VM and that work with it.&lt;/p&gt;
&lt;p&gt;Given this folder&amp;rsquo;s own VM, &lt;code&gt;devvm rm VM&lt;/code&gt; does what &lt;code&gt;devvm rm&lt;/code&gt; does. It refuses these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A folder that&amp;rsquo;s still there:&lt;/strong&gt; devvm refuses a VM whose folder is still there, including a VM made for an earlier folder at that path, and tells you to run &lt;code&gt;devvm rm&lt;/code&gt; in that folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A state changed by hand:&lt;/strong&gt; a VM whose state names this folder while the folder has a VM of its own, which only a state changed by hand can do, is refused as a VM whose folder is still there, so &lt;code&gt;devvm rm VM&lt;/code&gt; never deletes the folder&amp;rsquo;s own VM in its place.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An unknown name:&lt;/strong&gt; devvm refuses a name that isn&amp;rsquo;t one of your VMs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM its backend lost:&lt;/strong&gt; devvm refuses a VM that its backend no longer has, for which &lt;code&gt;devvm gc --orphans&lt;/code&gt; deletes what devvm keeps (&lt;a href="https://next.devvm.dev/docs/using/space/#leftovers-of-a-vm-deleted-outside-devvm"&gt;leftovers of a VM deleted outside devvm&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="a-folder-on-a-disk-that-isnt-connected"&gt;A folder on a disk that isn&amp;rsquo;t connected&lt;span class="hx:absolute hx:-mt-20" id="a-folder-on-a-disk-that-isnt-connected"&gt;&lt;/span&gt;
&lt;a href="#a-folder-on-a-disk-that-isnt-connected" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When a project folder is on an external disk, a USB stick or a network share that isn&amp;rsquo;t connected, nothing is at its path, but the folder may still hold the project&amp;rsquo;s work, and so may the VM. devvm tells this apart from a deleted folder by the disk: it finds the nearest folder above the path that&amp;rsquo;s still there, and when that folder is on another disk than the project folder was, the project folder isn&amp;rsquo;t connected. &lt;code&gt;devvm ls&lt;/code&gt; writes &lt;code&gt;(not connected)&lt;/code&gt; after such a folder, and &lt;code&gt;devvm space&lt;/code&gt; names each such VM with its folder. To use the VM again, connect the disk.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm rm VM&lt;/code&gt; refuses such a VM when there&amp;rsquo;s no terminal, even with &lt;code&gt;--force&lt;/code&gt;, and tells you to connect the disk, or to run &lt;code&gt;devvm rm VM&lt;/code&gt; in a terminal to delete the VM anyway. In a terminal, devvm names the VM and its folder and asks before deleting it, with no as the default, and &lt;code&gt;--force&lt;/code&gt; never answers that question. Otherwise it deletes the VM as it deletes one whose folder is gone. A folder that you moved to another disk and then deleted counts as not connected too, so devvm asks in that case as well.&lt;/p&gt;</description></item><item><title>Network tiers</title><link>https://next.devvm.dev/docs/internals/network/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/network/</guid><description>
&lt;p&gt;This page explains how devvm confines a VM to its proxy on each tier, what the proxy does with each connection, and how your secrets get into the VM&amp;rsquo;s requests without the VM holding them. &lt;a href="https://next.devvm.dev/docs/safety/network/"&gt;Network tiers&lt;/a&gt; covers choosing a tier, the allowlists and their rules, the secrets and the logs as you use them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="starting-a-vm-on-its-tier"&gt;Starting a VM on its tier&lt;span class="hx:absolute hx:-mt-20" id="starting-a-vm-on-its-tier"&gt;&lt;/span&gt;
&lt;a href="#starting-a-vm-on-its-tier" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s state records its tier in its &lt;code&gt;net&lt;/code&gt; section, as &lt;code&gt;&amp;quot;tier&amp;quot;&lt;/code&gt;: &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tiers&lt;/a&gt;). A section without a tier reads as &lt;code&gt;allowlist&lt;/code&gt;, and one with a tier devvm doesn&amp;rsquo;t know can&amp;rsquo;t be read, so devvm refuses the VM rather than take it as open. The tier decides the VM&amp;rsquo;s confinement: on every tier but open, the VM starts confined to its proxy, and an open VM starts on its backend&amp;rsquo;s own network with its proxy&amp;rsquo;s port and password in its confinement, so its guest&amp;rsquo;s proxy settings name the proxy all the same (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;). A running VM keeps the confinement it started with until its next start.&lt;/p&gt;
&lt;p&gt;When devvm starts a VM on a confined tier, it takes these steps in order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It readies the VM&amp;rsquo;s own CA and the next one (&lt;a href="#the-vms-ca"&gt;the VM&amp;rsquo;s CA&lt;/a&gt;), and on macOS it keeps them out of Time Machine.&lt;/li&gt;
&lt;li&gt;It writes the VM&amp;rsquo;s &lt;a href="#secrets"&gt;secrets&lt;/a&gt; as the VM&amp;rsquo;s proxy sees them.&lt;/li&gt;
&lt;li&gt;It starts the VM&amp;rsquo;s &lt;a href="#the-proxy"&gt;proxy&lt;/a&gt; on a free port on the host&amp;rsquo;s loopback, and waits for the proxy to say it&amp;rsquo;s listening.&lt;/li&gt;
&lt;li&gt;It starts the VM &lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confined&lt;/a&gt;, with the VM&amp;rsquo;s proxy settings pointing at the proxy.&lt;/li&gt;
&lt;li&gt;It runs &lt;a href="#the-self-check"&gt;the self-check&lt;/a&gt; before the VM&amp;rsquo;s setup and before its shell.&lt;/li&gt;
&lt;li&gt;It sets the VM up, as &lt;a href="#the-vms-setup"&gt;the VM&amp;rsquo;s setup&lt;/a&gt; describes. The setup puts the VM&amp;rsquo;s CA and the next one in the VM, points the tools that don&amp;rsquo;t read the environment at the proxy, and writes the VM&amp;rsquo;s placeholders and its &lt;a href="#agents-logins-and-settings"&gt;agents&amp;rsquo; logins and settings&lt;/a&gt; with your keys taken out.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;An open VM&amp;rsquo;s start takes the same steps, but it starts the VM unconfined and runs &lt;a href="#the-self-check"&gt;the open self-check&lt;/a&gt;. Its proxy has the VM&amp;rsquo;s CAs and its secrets as any VM&amp;rsquo;s does, and applies no rules. Its setup installs both CAs in the VM, points the same tools at the proxy, and writes the same placeholders and copies of the agents&amp;rsquo; logins and settings, so an open VM holds no real secret either. The VM reaches its proxy directly, through the &lt;code&gt;HTTPS_PROXY&lt;/code&gt; that names it (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;Lima&lt;/a&gt;), and a request that goes around the proxy carries only the placeholder.&lt;/p&gt;
&lt;p&gt;So an open VM runs on its backend&amp;rsquo;s own network, and it reaches this machine and your LAN directly, as a VM without a proxy would. Its environment names its proxy all the same (&lt;code&gt;HTTP_PROXY&lt;/code&gt;, &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and their lowercase forms), and the proxy reaches every host and address for it, this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; and your LAN included, so a tool behaves the same through the proxy as it does directly. Its &lt;code&gt;NO_PROXY&lt;/code&gt; names the VM itself and this machine as the VM reaches it, &lt;code&gt;host.lima.internal&lt;/code&gt;, so requests to those go directly. Every launch checks that an open VM&amp;rsquo;s proxy is set in the VM and answers it, and when it doesn&amp;rsquo;t, devvm warns you and opens the VM all the same. An open VM gets a placeholder for each secret it may use, as every VM does, and only its proxy puts the real value in, so a request that goes around the proxy, directly from the VM, carries only the placeholder, and the secret&amp;rsquo;s host refuses it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="vms-that-cant-be-confined"&gt;VMs that can&amp;rsquo;t be confined&lt;span class="hx:absolute hx:-mt-20" id="vms-that-cant-be-confined"&gt;&lt;/span&gt;
&lt;a href="#vms-that-cant-be-confined" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM whose backend can&amp;rsquo;t confine it to its proxy (&lt;code&gt;egress-proxy&lt;/code&gt;) can only be open: devvm refuses to make it on any other tier, unasked, in one line that names the backend and &lt;code&gt;--network open&lt;/code&gt; (&lt;code&gt;net_tier_backend&lt;/code&gt;), and the registry&amp;rsquo;s check refuses &lt;code&gt;devvm network&lt;/code&gt; with a confined tier.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-proxy"&gt;The proxy&lt;span class="hx:absolute hx:-mt-20" id="the-proxy"&gt;&lt;/span&gt;
&lt;a href="#the-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;One proxy runs for each VM. It runs on the host as &lt;code&gt;devvm _proxy&lt;/code&gt;, a hidden command, and listens on a loopback port. The VM reaches nothing else over its network, so every connection the VM makes goes through its proxy.&lt;/p&gt;
&lt;p&gt;The proxy is two processes. &lt;code&gt;devvm _proxy&lt;/code&gt;, the broker, does what only the host should do. It looks up each bound value, sends the token requests of logins made in the VM, connects to the VM&amp;rsquo;s links&amp;rsquo; sockets, reads the files that change while the proxy runs, relays the VM&amp;rsquo;s SSH agent, follows the VM&amp;rsquo;s lifeline, and looks up the names and opens the connections that the child asks for. Its child, &lt;code&gt;devvm _proxy-child&lt;/code&gt;, does everything this section describes with the VM&amp;rsquo;s requests, and asks the broker over a socketpair for each of those, by something the broker finds in its own config, so a child that a VM took over can&amp;rsquo;t make the broker act for another VM, another secret or another file. No byte of the VM&amp;rsquo;s requests crosses that socket, because the broker hands the child each connection, so the broker adds a hop to opening a connection but none to what it carries. On Linux, before it reads a byte of the VM&amp;rsquo;s, the child confines itself with Landlock and a seccomp filter to its logs and the Nix cache, with no connection of its own, no unix socket and no program to run, and on macOS a Seatbelt profile does the same (&lt;a href="#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;). So a child that a VM took over can&amp;rsquo;t read your files, reach an ssh master&amp;rsquo;s socket or connect to this machine&amp;rsquo;s loopback. &lt;a href="https://next.devvm.dev/docs/internals/processes/#a-vms-proxy"&gt;Processes&lt;/a&gt; has what each holds, reads and writes, and &lt;a href="https://next.devvm.dev/docs/contributing/design/#the-proxys-broker"&gt;the proxy&amp;rsquo;s broker&lt;/a&gt; has the protocol and its threat check. The one other way out of the VM is the &lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;links&lt;/a&gt; you add to it, which this machine carries over ssh to the ports your other VMs publish, so they don&amp;rsquo;t use the VM&amp;rsquo;s network. The proxy is a second entrance to those links, for the VM&amp;rsquo;s HTTP clients (&lt;a href="#links-through-the-proxy"&gt;links through the proxy&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Other programs on the host can also reach that port, so the port alone doesn&amp;rsquo;t identify the VM. Every request must carry the VM&amp;rsquo;s password in &lt;code&gt;Proxy-Authorization&lt;/code&gt;, with the user &lt;code&gt;devvm&lt;/code&gt;, or it gets &lt;code&gt;407&lt;/code&gt;. Each VM has its own random password in its proxy settings. The proxy reads the password from its config, a file only you can read, never from its arguments, which other users can see, and it refuses to start without one (&lt;a href="#devvm-_proxy"&gt;devvm _proxy&lt;/a&gt;). The VM&amp;rsquo;s settings also get the password through files (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;Lima&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;For each connection, the proxy does the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It sends a request for one of the VM&amp;rsquo;s own links to that link before any rule, and passes its bytes on as they are (&lt;a href="#links-through-the-proxy"&gt;links through the proxy&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;It checks &lt;code&gt;CONNECT host:port&lt;/code&gt; and absolute-form requests (&lt;code&gt;GET http://host/…&lt;/code&gt;) against the VM&amp;rsquo;s &lt;a href="#policy-files"&gt;policy files&lt;/a&gt;, and then tunnels or forwards the allowed ones untouched.&lt;/li&gt;
&lt;li&gt;It takes only host names, made of letters, digits, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt; and &lt;code&gt;.&lt;/code&gt;, and addresses. It lowercases a name and drops one trailing dot, and the name that&amp;rsquo;s left may have no empty label, so &lt;code&gt;evil.test..&lt;/code&gt;, &lt;code&gt;evil..test&lt;/code&gt; and &lt;code&gt;.evil.test&lt;/code&gt; get &lt;code&gt;400&lt;/code&gt; too, because a company proxy that drops trailing dots would otherwise reach a host that a deny of &lt;code&gt;evil.test&lt;/code&gt; never matched. It lowercases only ASCII, so a name with any other character keeps that character and gets &lt;code&gt;400&lt;/code&gt;, because Unicode&amp;rsquo;s case folding turns some letters into ASCII ones, such as the Kelvin sign into &lt;code&gt;k&lt;/code&gt;, so the host it judged wouldn&amp;rsquo;t be the one the VM named. An address is bare, or an IPv6 address in one pair of brackets, so &lt;code&gt;[evil.com]:443&lt;/code&gt;, &lt;code&gt;[1.2.3.4]:443&lt;/code&gt; and a stray bracket get &lt;code&gt;400&lt;/code&gt; too. An IPv6 address with a zone, such as &lt;code&gt;[fe80::1%en0]&lt;/code&gt;, gets &lt;code&gt;400&lt;/code&gt;, and so does one with an empty zone. An address keeps its trailing dot, because the dot can only be its zone&amp;rsquo;s, and dropping it would leave an empty zone, which Go&amp;rsquo;s address parser reads as no address but a resolver may read as the address alone. Anything else gets &lt;code&gt;400&lt;/code&gt; before the policy or the log sees it. Everything else that reads a host reads it in the same form: a rule&amp;rsquo;s host, a secret&amp;rsquo;s hosts, &lt;code&gt;NO_PROXY&lt;/code&gt;, &lt;code&gt;devvm network lock&lt;/code&gt;&amp;rsquo;s risks and ticks, a secret&amp;rsquo;s &lt;code&gt;--host&lt;/code&gt;, an MCP server&amp;rsquo;s host, &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registry and a partial clone&amp;rsquo;s remotes.&lt;/li&gt;
&lt;li&gt;It refuses &lt;code&gt;devvm.proxy&lt;/code&gt;, its own domain, and any name under it, in a &lt;code&gt;CONNECT&lt;/code&gt; and as a host, with &lt;code&gt;403&lt;/code&gt;, before the links, the policy or a company proxy see the name, on every tier. Only a request in absolute form for &lt;code&gt;http://devvm.proxy/&lt;/code&gt; itself reaches its endpoints, and &lt;code&gt;CONNECT transparent.devvm.proxy:PORT&lt;/code&gt; is &lt;a href="#tools-that-skip-the-proxy"&gt;transparent mode&lt;/a&gt;&amp;rsquo;s. It refuses the stand-in address, &lt;code&gt;198.18.0.1&lt;/code&gt;, with a reason that says the tool resolved the name itself.&lt;/li&gt;
&lt;li&gt;It resolves names itself and dials the addresses it checked, through its broker, which checks each address again before it connects (&lt;a href="#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;). It looks each name up absolute, with a trailing dot, so this machine&amp;rsquo;s resolver never adds its DNS search domain, which macOS takes from the network&amp;rsquo;s settings and Linux from &lt;code&gt;/etc/resolv.conf&lt;/code&gt;&amp;rsquo;s &lt;code&gt;search&lt;/code&gt;. Otherwise, with &lt;code&gt;api.corp.example.com&lt;/code&gt; denied and &lt;code&gt;**&lt;/code&gt; allowing the rest, &lt;code&gt;CONNECT api:443&lt;/code&gt; would reach &lt;code&gt;api.corp.example.com&lt;/code&gt;, a name that no rule judged, and so would &lt;code&gt;api.eu&lt;/code&gt; reach &lt;code&gt;api.eu.corp.example.com&lt;/code&gt; when &lt;code&gt;api.eu&lt;/code&gt; itself has no address. It refuses the host&amp;rsquo;s own addresses and internal ones unless a rule names the address. Internal addresses are loopback, private, link-local, multicast, unspecified, CGNAT &lt;code&gt;100.64.0.0/10&lt;/code&gt; and the other ranges that aren&amp;rsquo;t the public internet, among them IPv4&amp;rsquo;s documentation ranges &lt;code&gt;192.0.2.0/24&lt;/code&gt;, &lt;code&gt;198.51.100.0/24&lt;/code&gt; and &lt;code&gt;203.0.113.0/24&lt;/code&gt; and the old 6to4 relays&amp;rsquo; &lt;code&gt;192.88.99.0/24&lt;/code&gt;, and IPv6&amp;rsquo;s Teredo &lt;code&gt;2001::/32&lt;/code&gt;, documentation &lt;code&gt;2001:db8::/32&lt;/code&gt; and &lt;code&gt;3fff::/20&lt;/code&gt;, discard-only &lt;code&gt;100::/64&lt;/code&gt;, benchmarking &lt;code&gt;2001:2::/48&lt;/code&gt;, ORCHID &lt;code&gt;2001:10::/28&lt;/code&gt; and ORCHIDv2 &lt;code&gt;2001:20::/28&lt;/code&gt;, SRv6 &lt;code&gt;5f00::/16&lt;/code&gt; and IPv4-translated &lt;code&gt;::ffff:0:a.b.c.d&lt;/code&gt;. An address with an IPv6 zone is also internal, whatever its address, because a zone ties it to one of this machine&amp;rsquo;s links. An address with an IPv4 address in it counts as that IPv4 address, both a NAT64 address &lt;code&gt;64:ff9b::a.b.c.d&lt;/code&gt; and a 6to4 address in &lt;code&gt;2002::/16&lt;/code&gt;, such as &lt;code&gt;2002:a00:1::1&lt;/code&gt; for &lt;code&gt;10.0.0.1&lt;/code&gt;, and the 6to4 network, a &lt;code&gt;/48&lt;/code&gt;, of one of the host&amp;rsquo;s own 6to4 addresses counts as the host&amp;rsquo;s, because the machines on its LAN share it. A deny for an IPv4 address covers both forms. An allow for an IPv4 address covers its NAT64 form, which this network&amp;rsquo;s own translator carries, but not its 6to4 form, because 6to4 traffic goes through relays that anyone may run, so a 6to4 address is allowed only by a rule that names it. A Teredo address holds its IPv4 addresses scrambled, and the proxy doesn&amp;rsquo;t read them, so a broad IPv6 allow such as &lt;code&gt;::/0&lt;/code&gt; lets in the Teredo form of a denied IPv4 address.&lt;/li&gt;
&lt;li&gt;It requires a TLS ClientHello in a tunnel to name the &lt;code&gt;CONNECT&lt;/code&gt; host in its SNI, in ASCII, letters&amp;rsquo; case aside. The proxy doesn&amp;rsquo;t see the &lt;code&gt;Host&lt;/code&gt; inside the encrypted traffic, so a CDN that routes by it can reach other sites it serves.&lt;/li&gt;
&lt;li&gt;For a host with a bound secret, it replaces the placeholder in one header with the real value, as &lt;a href="#how-the-proxy-puts-them-in"&gt;how the proxy puts them in&lt;/a&gt; describes.&lt;/li&gt;
&lt;li&gt;For a host whose rules narrow it to some methods or paths, it decrypts the host&amp;rsquo;s HTTPS and checks each request, as &lt;a href="#requests-by-method-and-path"&gt;requests by method and path&lt;/a&gt; describes. Everything else passes unread.&lt;/li&gt;
&lt;li&gt;It carries at most 1024 &lt;code&gt;CONNECT&lt;/code&gt; tunnels, holds at most 2048 connections of every kind and has at most 2048 requests to hosts under way at once for the VM, as described below.&lt;/li&gt;
&lt;li&gt;It logs every decision (&lt;a href="#log-files"&gt;log files&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A &lt;code&gt;CONNECT&lt;/code&gt; tunnel meets the proxy&amp;rsquo;s checks in this order:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 1778px; --devvm-diagram-width: 751px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 751 1778" width="751" height="1778" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d7e25dc882f151683--title" aria-describedby="d7e25dc882f151683--desc"&gt;&lt;title id="d7e25dc882f151683--title"&gt;The proxy's checks on a CONNECT tunnel&lt;/title&gt;&lt;desc id="d7e25dc882f151683--desc"&gt;The proxy checks a CONNECT tunnel from the VM in order: the VM's password, else 407, a host name or an address, else 400, and fewer than 1024 tunnels open, else 503. transparent.devvm.proxy takes the host from its first bytes, TLS's SNI or each HTTP Host, and closes the tunnel when there's none, and devvm.proxy, its names and 198.18.0.1 get 403. One of the VM's links goes to the link's socket untouched, and a transparent connection to one is refused. Any other host must be on the allowlist and not denied, else 403, which a transparent TLS connection gets over the VM's CA, and it must be public and not this machine's or an address a rule names, and on port 443 when rules judge its requests, else 403. A bound host, on port 443, or one whose requests are judged, is intercepted with the VM's CA, where each request must name the host, else 421, and be allowed by the rules, else 403, before its placeholder is swapped for the real value. Any other tunnel passes untouched when its TLS SNI names the CONNECT host, or it isn't TLS.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_conn_pw_0"&gt;&lt;path d="M307.05,53L307.05,91"/&gt;&lt;path class="pele-marker" d="M307.05,98L303.69,90L310.41,90Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_pw_name_0"&gt;&lt;path d="M307.05,158L307.05,196"/&gt;&lt;path class="pele-marker" d="M307.05,203L303.69,195L310.41,195Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_name_room_0"&gt;&lt;path d="M307.05,263L307.05,301"/&gt;&lt;path class="pele-marker" d="M307.05,308L303.69,300L310.41,300Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_room_reserved_0"&gt;&lt;path d="M307.05,368L307.05,406"/&gt;&lt;path class="pele-marker" d="M307.05,413L303.69,405L310.41,405Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_reserved_named0_0"&gt;&lt;path d="M228.14,458L228.14,464Q228.14,476 216.14,476L162.73,476Q150.73,476 150.73,488L150.73,531.5"/&gt;&lt;path class="pele-marker" d="M150.73,538.5L147.37,530.5L154.09,530.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_named0_link_0"&gt;&lt;path d="M150.73,616.5L150.73,627Q150.73,639 162.73,639L225.42,639Q237.05,639 237.05,650.63L237.05,654.5"/&gt;&lt;path class="pele-marker" d="M237.05,661.5L233.69,653.5L240.41,653.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_reserved_own_0"&gt;&lt;path d="M385.95,458L385.95,464Q385.95,476 397.95,476L451.36,476Q463.36,476 463.36,488L463.36,531.5"/&gt;&lt;path class="pele-marker" d="M463.36,538.5L460,530.5L466.72,530.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_own_link_0"&gt;&lt;path d="M463.36,616.5L463.36,627Q463.36,639 451.36,639L388.67,639Q377.05,639 377.05,650.63L377.05,654.5"/&gt;&lt;path class="pele-marker" d="M377.05,661.5L373.69,653.5L380.41,653.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_link_linked_0"&gt;&lt;path d="M237.05,706.5L237.05,712.5Q237.05,724.5 225.05,724.5L156.05,724.5Q144.05,724.5 144.05,736.5L144.05,789"/&gt;&lt;path class="pele-marker" d="M144.05,796L140.69,788L147.41,788Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_link_allow_0"&gt;&lt;path d="M377.05,706.5L377.05,712.5Q377.05,724.5 389.05,724.5L458.05,724.5Q470.05,724.5 470.05,736.5L470.05,780"/&gt;&lt;path class="pele-marker" d="M470.05,787L466.69,779L473.41,779Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_allow_floor_0"&gt;&lt;path d="M470.05,883L470.05,921"/&gt;&lt;path class="pele-marker" d="M470.05,928L466.69,920L473.41,920Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_floor_narrowed_0"&gt;&lt;path d="M470.05,1006L470.05,1044"/&gt;&lt;path class="pele-marker" d="M470.05,1051L466.69,1043L473.41,1043Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_narrowed_bound_0"&gt;&lt;path d="M470.05,1147L470.05,1185"/&gt;&lt;path class="pele-marker" d="M470.05,1192L466.69,1184L473.41,1184Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_bound_sni_0"&gt;&lt;path d="M349.36,1252L349.36,1312"/&gt;&lt;path class="pele-marker" d="M349.36,1319L346,1311L352.72,1311Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_sni_tunnel_0"&gt;&lt;path d="M349.36,1397L349.36,1473.5"/&gt;&lt;path class="pele-marker" d="M349.36,1480.5L346,1472.5L352.72,1472.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_bound_intercept_0"&gt;&lt;path d="M590.73,1252L590.73,1321"/&gt;&lt;path class="pele-marker" d="M590.73,1328L587.37,1320L594.09,1320Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_intercept_named_0"&gt;&lt;path d="M590.73,1388L590.73,1457"/&gt;&lt;path class="pele-marker" d="M590.73,1464L587.37,1456L594.09,1456Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_named_rules_0"&gt;&lt;path d="M590.73,1542L590.73,1580"/&gt;&lt;path class="pele-marker" d="M590.73,1587L587.37,1579L594.09,1579Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_rules_swap_0"&gt;&lt;path d="M590.73,1665L590.73,1703"/&gt;&lt;path class="pele-marker" d="M590.73,1710L587.37,1702L594.09,1702Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_reserved_named0_0"&gt;&lt;rect x="133.36" y="496" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="150.73" y="509.2" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_reserved_own_0"&gt;&lt;rect x="450.45" y="496" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="463.36" y="509.2" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_link_linked_0"&gt;&lt;rect x="126.68" y="744.5" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="144.05" y="757.7" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_link_allow_0"&gt;&lt;rect x="457.14" y="744.5" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="470.05" y="757.7" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_bound_sni_0"&gt;&lt;rect x="336.45" y="1276.5" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="349.36" y="1289.7" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_sni_tunnel_0"&gt;&lt;rect x="278.55" y="1421.5" width="141.64" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="349.36" y="1434.7" text-anchor="middle"&gt;yes, or not TLS&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_bound_intercept_0"&gt;&lt;rect x="573.36" y="1276.5" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="590.73" y="1289.7" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="conn" transform="translate(307.05,30.5)"&gt;&lt;rect x="-147.18" y="-22.5" width="294.36" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;CONNECT host:port from the VM&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="pw" transform="translate(307.05,128)"&gt;&lt;rect x="-98.18" y="-30" width="196.36" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;the VM's password?&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;no: 407&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="name" transform="translate(307.05,233)"&gt;&lt;rect x="-133.82" y="-30" width="267.64" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;a host name or an address?&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;no: 400&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="room" transform="translate(307.05,338)"&gt;&lt;rect x="-147.18" y="-30" width="294.36" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;fewer than 1024 tunnels open?&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;no: 503&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-hex" data-id="reserved" transform="translate(307.05,435.5)"&gt;&lt;polygon points="-124.91,-22.5 124.91,-22.5 136.16,0 124.91,22.5 -124.91,22.5 -136.16,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;transparent.devvm.proxy?&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="named0" transform="translate(150.73,577.5)"&gt;&lt;rect x="-142.73" y="-39" width="285.45" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;the host in its first bytes:&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;TLS's SNI, or each HTTP Host&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;none: closed&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-hex" data-id="link" transform="translate(307.05,684)"&gt;&lt;polygon points="-116,-22.5 116,-22.5 127.25,0 116,22.5 -116,22.5 -127.25,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;one of the VM's links?&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="own" transform="translate(463.36,577.5)"&gt;&lt;rect x="-124.91" y="-39" width="249.82" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;devvm.proxy or under it,&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;or 198.18.0.1?&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;yes: 403&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="linked" transform="translate(144.05,835)"&gt;&lt;rect x="-116" y="-39" width="232" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;the link's socket,&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;tunneled untouched&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;(transparent: refused)&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="allow" transform="translate(470.05,835)"&gt;&lt;rect x="-165" y="-48" width="330" height="96" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-22.1"&gt;on the allowlist, and not denied?&lt;/tspan&gt;&lt;tspan x="0" y="-4.1"&gt;no: 403&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;(transparent TLS: 403&lt;/tspan&gt;&lt;tspan x="0" y="31.9"&gt;over the VM's CA)&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="floor" transform="translate(470.05,967)"&gt;&lt;rect x="-151.64" y="-39" width="303.27" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;public and not this machine's,&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;or an address a rule names?&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;no: 403&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="narrowed" transform="translate(470.05,1099)"&gt;&lt;rect x="-124.91" y="-48" width="249.82" height="96" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-22.1"&gt;rules by method and path&lt;/tspan&gt;&lt;tspan x="0" y="-4.1"&gt;judge its requests:&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;on port 443?&lt;/tspan&gt;&lt;tspan x="0" y="31.9"&gt;no: 403&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-hex" data-id="bound" transform="translate(470.05,1222)"&gt;&lt;polygon points="-133.82,-30 133.82,-30 148.82,0 133.82,30 -133.82,30 -148.82,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;a bound host, on port 443,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;or its requests judged?&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="sni" transform="translate(349.36,1358)"&gt;&lt;rect x="-93.73" y="-39" width="187.45" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;its TLS SNI names&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;the CONNECT host?&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;no: closed&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="tunnel" transform="translate(349.36,1503)"&gt;&lt;rect x="-98.18" y="-22.5" width="196.36" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;tunneled untouched&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="intercept" transform="translate(590.73,1358)"&gt;&lt;rect x="-93.73" y="-30" width="187.45" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;intercepted, with&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;the VM's CA&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="named" transform="translate(590.73,1503)"&gt;&lt;rect x="-98.18" y="-39" width="196.36" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;each request names&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;the host?&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;no: 421&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="rules" transform="translate(590.73,1626)"&gt;&lt;rect x="-151.64" y="-39" width="303.27" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;each request allowed by&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;the rules, by method and path?&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;no: 403&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="swap" transform="translate(590.73,1740)"&gt;&lt;rect x="-120.45" y="-30" width="240.91" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;the placeholder swapped&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;for the real value&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;A tunnel that the proxy doesn&amp;rsquo;t intercept carries the bytes both ways as they are. When the VM finishes sending, the proxy closes its side of the connection to the far end, so the far end sees the end of what the VM sent and can still answer. The tunnel ends when the far end&amp;rsquo;s bytes end, or when the proxy can&amp;rsquo;t pass them on because the VM&amp;rsquo;s connection has gone, and then the proxy closes both connections. In a tunnel to a host the policy allows, the far end&amp;rsquo;s bytes reach the VM at once, so a protocol whose server speaks first, such as SMTP, gets its greeting before the VM sends anything. The VM&amp;rsquo;s bytes wait until the proxy has checked them: when the first one starts a TLS record, the proxy reads the whole ClientHello and checks its SNI before any of it reaches the far end, and any other first byte passes at once. The VM may wait as long as it likes before its first byte, as on any open tunnel, but once a ClientHello starts, it must arrive whole, in one record of at most 16 KiB and 256 bytes, within 10 seconds, or the proxy closes the tunnel and logs why. The proxy reads no record past that length, so a VM can&amp;rsquo;t make it hold 64 KiB for each of its tunnels, nor hold a slot by sending its ClientHello a byte at a time.&lt;/p&gt;
&lt;p&gt;The proxy carries at most 1024 &lt;code&gt;CONNECT&lt;/code&gt; tunnels for the VM at once, including tunnels to links and intercepted ones, from the request until the tunnel ends. That&amp;rsquo;s four times the 256 connections a browser such as Chrome keeps open at most, and many times what a package manager opens, such as npm&amp;rsquo;s 15 sockets or uv&amp;rsquo;s 50 downloads, so several installs and builds at once fit. Each tunnel holds two of the proxy&amp;rsquo;s file descriptors, so the limit keeps a VM that opens tunnels without end from taking them all. A &lt;code&gt;CONNECT&lt;/code&gt; past the limit gets &lt;code&gt;503&lt;/code&gt;, which a client may retry, and the reason &lt;code&gt;1024 tunnels open already&lt;/code&gt;, logged as a refused block, so neither the VM&amp;rsquo;s prompt nor &lt;code&gt;devvm network log&lt;/code&gt; suggests an allow rule. The proxy&amp;rsquo;s own log, &lt;code&gt;proxy.log&lt;/code&gt;, says when the VM reaches the limit, once until a tunnel ends.&lt;/p&gt;
&lt;p&gt;The proxy also holds at most 2048 of the VM&amp;rsquo;s connections at once, of every kind, which counts plain HTTP requests in absolute form, idle kept-alive connections and a request that goes on after its client has gone, as well as tunnels. That&amp;rsquo;s twice the tunnels&amp;rsquo; limit, so a &lt;code&gt;CONNECT&lt;/code&gt; past the tunnels&amp;rsquo; limit still gets its &lt;code&gt;503&lt;/code&gt; first. A connection counts from its first request with the VM&amp;rsquo;s password, and a request on a connection past the limit gets &lt;code&gt;503&lt;/code&gt;, after which the proxy closes the connection. On a Linux host, the limit of 256 connections that QEMU carries to the proxy at once comes first, and a connection past it gets a &lt;code&gt;503&lt;/code&gt; before it reaches the proxy (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-qemu-wrapper-and-its-keeper"&gt;the QEMU wrapper&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Every program on this machine can reach the proxy&amp;rsquo;s port, an open VM&amp;rsquo;s included, so a connection that hasn&amp;rsquo;t sent the VM&amp;rsquo;s password yet never takes the VM&amp;rsquo;s room. Such connections wait in a pool of their own, at most 128 at once, and one more closes the one that has waited longest, which a real client rarely is, because it sends its request at once. Holding connections open can&amp;rsquo;t take the VM&amp;rsquo;s room, but a program that opens connections as fast as this machine accepts them still slows the proxy for the VM, through the system&amp;rsquo;s queue of connections waiting to be accepted (&lt;a href="https://next.devvm.dev/docs/contributing/design/#transparent-mode"&gt;design&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The proxy also has at most 2048 requests to hosts under way at once, plain HTTP&amp;rsquo;s and those inside intercepted tunnels together. Each is a connection of its own to the host, so the tunnels&amp;rsquo; HTTP/2 requests, 100 at once in each, can&amp;rsquo;t add up to more connections than the proxy can open. A request past the limit gets &lt;code&gt;503&lt;/code&gt;, which a client may retry.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;proxy.log&lt;/code&gt; says when the VM reaches either limit, once a minute at most (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#rogue-agents"&gt;attack vectors&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Nothing bounds how long a request or a tunnel lasts, so a long download, a WebSocket, a model&amp;rsquo;s slow stream and server-sent events go on for as long as they take. The proxy bounds what a connection makes it hold instead:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A connection to the proxy waits at most 10 minutes for its next request, as the HTTP inside an intercepted tunnel or a transparent connection does, which is longer than a client keeps one idle.&lt;/li&gt;
&lt;li&gt;A request without the VM&amp;rsquo;s password gets &lt;code&gt;407&lt;/code&gt;, and the proxy closes its connection after it, so nothing without the password keeps a connection open.&lt;/li&gt;
&lt;li&gt;A request takes at most 64 KiB of headers, including in an intercepted tunnel, a transparent connection and the &lt;code&gt;403&lt;/code&gt; page&amp;rsquo;s TLS connection.&lt;/li&gt;
&lt;li&gt;HTTP/2 inside an intercepted tunnel or a transparent connection carries at most 100 requests at once, which is what most servers allow, and each is a request the proxy makes to the host.&lt;/li&gt;
&lt;li&gt;A plain HTTP request in absolute form goes on when its client half-closes after sending, because some clients do, so the proxy can&amp;rsquo;t tell from that alone that the client has gone. The request goes on while its answer keeps coming, and once its client has stopped sending and a minute passes with nothing to pass on, the proxy ends it, so a client that went away doesn&amp;rsquo;t leave a request waiting on a host that never answers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="links-through-the-proxy"&gt;Links through the proxy&lt;span class="hx:absolute hx:-mt-20" id="links-through-the-proxy"&gt;&lt;/span&gt;
&lt;a href="#links-through-the-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM&amp;rsquo;s &lt;code&gt;NO_PROXY&lt;/code&gt; names only the VM itself, so an HTTP client that uses the VM&amp;rsquo;s proxy settings sends a request for a link, such as &lt;code&gt;http://db:5432/&lt;/code&gt;, to the proxy. A running VM can&amp;rsquo;t take a new environment, so the proxy carries those requests itself, and a link added while the VM runs works for every HTTP client at once.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm _links&lt;/code&gt; writes every link the VM has, carried or not, to a list, &lt;code&gt;links.json&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, mode 600 in a folder of mode 700, whenever they change or the file is gone. Each entry has the link&amp;rsquo;s names (&lt;code&gt;NAME&lt;/code&gt; and &lt;code&gt;NAME.devvm.internal&lt;/code&gt;), its address and port in the VM, its target, and its socket on this machine. The list stays when &lt;code&gt;devvm _links&lt;/code&gt; ends, and devvm removes it with the VM, so a link that isn&amp;rsquo;t carried, which has no socket, is refused rather than asked of the rules. devvm puts the list&amp;rsquo;s path in the proxy&amp;rsquo;s config as &lt;code&gt;links&lt;/code&gt;, and its run folder, where the links&amp;rsquo; sockets are, as &lt;code&gt;link_sockets&lt;/code&gt;. The proxy checks the list for every request and reads it again when it has changed, as it does the policy files. A list it can&amp;rsquo;t read has no links, which its log says once. The list must be a regular file, not a symbolic link, that only you can write, and at most 1 MiB.&lt;/p&gt;
&lt;p&gt;The proxy checks a request&amp;rsquo;s host against the list after the VM&amp;rsquo;s password and before any rule, as it does for &lt;code&gt;devvm.proxy&lt;/code&gt;. It lowercases the host and drops one trailing dot, and then a host and port match only an entry that names them exactly, so &lt;code&gt;DB.:5432&lt;/code&gt; matches &lt;code&gt;db:5432&lt;/code&gt;, while &lt;code&gt;db..:5432&lt;/code&gt;, &lt;code&gt;db.devvm:5432&lt;/code&gt; and &lt;code&gt;127.77.0.1:5432&lt;/code&gt; don&amp;rsquo;t. The request names a host and a port, never a socket. An entry counts only when its socket is the one that &lt;code&gt;devvm _links&lt;/code&gt; names for this VM&amp;rsquo;s link at that address and port, in the run folder of devvm&amp;rsquo;s data folder, so the proxy never connects to another VM&amp;rsquo;s link or to any other socket, whatever the list holds. Its address must also be in &lt;code&gt;127.77.0.0/16&lt;/code&gt;. Any other name under &lt;code&gt;devvm.internal&lt;/code&gt; is refused with &lt;code&gt;403&lt;/code&gt; and logged as a refused block, whatever the rules allow, so the rules, the host&amp;rsquo;s resolver and a company proxy never see one. A host and port on no entry are otherwise the policy&amp;rsquo;s, as before.&lt;/p&gt;
&lt;p&gt;For a match, the proxy&amp;rsquo;s broker finds the host and port in its own read of the list again, connects to that link&amp;rsquo;s socket and hands the connection to the child, so the child never reaches devvm&amp;rsquo;s run folder, where every VM&amp;rsquo;s link sockets are. It&amp;rsquo;s the same socket that the link&amp;rsquo;s remote forward reaches, so &lt;code&gt;devvm _links&lt;/code&gt; checks the connection as it checks every other (&lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;each connection&lt;/a&gt;), and the 256-connection cap counts both. A &lt;code&gt;CONNECT&lt;/code&gt; is tunneled as it is, with no SNI check and no interception, and an absolute-form request, such as &lt;code&gt;GET http://db:5432/&lt;/code&gt;, goes to the socket in origin form, without &lt;code&gt;Proxy-Authorization&lt;/code&gt; or &lt;code&gt;Proxy-Connection&lt;/code&gt;, over a new connection for each request, which ends when the client gives up the request. A kept-alive connection to the proxy that asks for a link and then for another host has each request handled on its own. HTTPS in absolute form gets &lt;code&gt;400&lt;/code&gt;, because &lt;code&gt;CONNECT&lt;/code&gt; carries it. The proxy puts no secret into a link&amp;rsquo;s connection, even when a secret&amp;rsquo;s hosts would match the link&amp;rsquo;s name, and its rules don&amp;rsquo;t apply, so &lt;code&gt;devvm network deny db&lt;/code&gt; doesn&amp;rsquo;t stop the link &lt;code&gt;db&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The proxy logs nothing for a link&amp;rsquo;s connection that it passes on, because &lt;code&gt;devvm _links&lt;/code&gt; logs it as &lt;code&gt;link&lt;/code&gt;, once. When the socket doesn&amp;rsquo;t answer, because the link was removed since the proxy read the list or &lt;code&gt;devvm _links&lt;/code&gt; isn&amp;rsquo;t running, the proxy answers &lt;code&gt;502&lt;/code&gt; and logs &lt;code&gt;link_refused&lt;/code&gt; with the reason &lt;code&gt;not carried&lt;/code&gt;. A socket whose backlog is full refuses a connection, so the proxy tries again for under a second.&lt;/p&gt;
&lt;h3 data-hextra-search-id="through-a-company-proxy"&gt;Through a company proxy&lt;span class="hx:absolute hx:-mt-20" id="through-a-company-proxy"&gt;&lt;/span&gt;
&lt;a href="#through-a-company-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When devvm starts a VM&amp;rsquo;s proxy, it reads &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt; from its own environment, each in capitals first and then in lowercase, as Go&amp;rsquo;s clients do. When its environment sets neither &lt;code&gt;HTTPS_PROXY&lt;/code&gt; nor &lt;code&gt;HTTP_PROXY&lt;/code&gt;, it reads &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; table instead, its &lt;code&gt;https&lt;/code&gt;, &lt;code&gt;http&lt;/code&gt; and &lt;code&gt;no-proxy&lt;/code&gt;, and never a mix of the two. It writes them into the proxy&amp;rsquo;s config, &lt;code&gt;proxy.json&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, as &lt;code&gt;upstream&lt;/code&gt;, so a password in the environment&amp;rsquo;s URL is in a file only you can read and in no process&amp;rsquo;s arguments. devvm checks the settings first: a proxy URL is &lt;code&gt;http://user:password@host:port&lt;/code&gt;, or &lt;code&gt;host:port&lt;/code&gt; alone, and a proxy without a port is on port 80. devvm refuses an &lt;code&gt;https://&lt;/code&gt; or &lt;code&gt;socks5://&lt;/code&gt; proxy (&lt;code&gt;upstream_proxy_scheme&lt;/code&gt;) and a setting it can&amp;rsquo;t read (&lt;code&gt;upstream_proxy_invalid&lt;/code&gt;), so a VM doesn&amp;rsquo;t start until you change it.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;config.toml&lt;/code&gt; URL never holds a password (&lt;code&gt;proxy_password_in_config&lt;/code&gt;, as it&amp;rsquo;s read), because people copy that file between machines and keep it with their dotfiles. When its URL names a user, &lt;code&gt;upstream&lt;/code&gt; gets &lt;code&gt;&amp;quot;secret&amp;quot;: &amp;quot;proxy&amp;quot;&lt;/code&gt;, and the proxy looks the &lt;code&gt;proxy&lt;/code&gt; secret up as it starts, through the same lookup as the &lt;a href="#where-secrets-are-saved"&gt;secrets it puts in&lt;/a&gt;, the Keychain or &lt;code&gt;~/.local/share/devvm/secrets/proxy&lt;/code&gt;, and uses it as the password of each URL that names a user and none of its own. So &lt;code&gt;proxy.json&lt;/code&gt; never holds that password. A proxy whose lookup fails doesn&amp;rsquo;t start, and devvm checks that the secret is saved before it makes a new VM, starts a VM&amp;rsquo;s proxy, or builds an image or the shared tools (&lt;code&gt;proxy_password_missing&lt;/code&gt;), and before it stops a running VM to start it again, as &lt;code&gt;devvm restart&lt;/code&gt; does, so a refused restart leaves the VM running. It also checks before it changes a running VM&amp;rsquo;s tier between &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt;, which the VM&amp;rsquo;s proxy applies at once, so the VM&amp;rsquo;s state never names a tier that its proxy doesn&amp;rsquo;t enforce. Each of these is one check of the company proxy&amp;rsquo;s settings, which devvm runs with the check of your CAs before a VM is made, stopped to start again, or given another confined tier while it runs (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm&amp;rsquo;s own requests on this machine go through the same company proxy. They are the download of its own mise, the list of Ubuntu&amp;rsquo;s cloud images, and the registries &lt;code&gt;--from&lt;/code&gt; asks for digests. When the environment sets the proxy, their clients use Go&amp;rsquo;s own environment proxy. When &lt;code&gt;config.toml&lt;/code&gt; sets it, devvm&amp;rsquo;s route to the company proxy is their transport&amp;rsquo;s proxy. At the first request, the route looks the &lt;code&gt;proxy&lt;/code&gt; secret up and puts it in each URL that names a user and none of its own. It routes each request as a VM&amp;rsquo;s proxy does: &lt;code&gt;HTTPS_PROXY&lt;/code&gt;&amp;rsquo;s for HTTPS, &lt;code&gt;HTTP_PROXY&lt;/code&gt;&amp;rsquo;s for plain HTTP, and directly for &lt;code&gt;NO_PROXY&lt;/code&gt;&amp;rsquo;s hosts, &lt;code&gt;localhost&lt;/code&gt; and loopback addresses. Go sends the user and password only to the company proxy, in &lt;code&gt;Proxy-Authorization&lt;/code&gt;. A missing password fails the request without a retry. The mise that devvm runs on this machine inherits devvm&amp;rsquo;s environment, so it uses the environment&amp;rsquo;s proxy as it is. With &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s proxy, devvm adds &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt; to mise&amp;rsquo;s environment, in capitals and in lowercase, with the password in each URL that names a user. mise takes a proxy&amp;rsquo;s password only in its URL, so its environment is the one place it can go. It&amp;rsquo;s never in mise&amp;rsquo;s arguments or in a file.&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s proxy refreshes Codex&amp;rsquo;s and opencode&amp;rsquo;s OAuth logins through the company proxy it sends the VM&amp;rsquo;s requests through, its &lt;code&gt;upstream&lt;/code&gt;, whether that came from the environment or from &lt;code&gt;config.toml&lt;/code&gt;. As it starts, it makes that upstream&amp;rsquo;s route for its own requests, with the &lt;code&gt;proxy&lt;/code&gt; secret it looked up as the password, as devvm makes the route for its own requests. It carries the route in each lookup&amp;rsquo;s context, and the login&amp;rsquo;s refresh takes it from there as its transport&amp;rsquo;s proxy. A VM&amp;rsquo;s proxy without an upstream sends the refresh directly, as it does the VM&amp;rsquo;s requests.&lt;/p&gt;
&lt;p&gt;An open VM&amp;rsquo;s proxy goes through the company proxy as a confined VM&amp;rsquo;s does. Its guest gets no proxy settings of devvm&amp;rsquo;s environment: Lima&amp;rsquo;s &lt;code&gt;propagateProxyEnv&lt;/code&gt; is off for every VM whose guest names devvm&amp;rsquo;s proxy, so neither the shell&amp;rsquo;s nor &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s password reaches the guest.&lt;/p&gt;
&lt;p&gt;devvm warns (&lt;code&gt;upstream_proxy_gone&lt;/code&gt;) when the config the VM&amp;rsquo;s proxy last started with has an &lt;code&gt;upstream&lt;/code&gt; and the one it starts it with now has none, as happens when a shell without the settings starts it.&lt;/p&gt;
&lt;p&gt;The proxy decides each request as it does without a company proxy, by the host name the VM asked for, and only then picks the way out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A host that &lt;code&gt;NO_PROXY&lt;/code&gt; names, &lt;code&gt;localhost&lt;/code&gt;, a name under &lt;code&gt;.localhost&lt;/code&gt; and a loopback or unspecified address go directly, through the checks above.&lt;/li&gt;
&lt;li&gt;A tunnel, and the connection the proxy makes to a bound host to put a secret in, go through &lt;code&gt;HTTPS_PROXY&lt;/code&gt;&amp;rsquo;s proxy. The proxy sends &lt;code&gt;CONNECT host:port&lt;/code&gt; with the name the VM asked for, and &lt;code&gt;Proxy-Authorization: Basic&lt;/code&gt; from the URL&amp;rsquo;s user and password, and it reads the answer. Anything but &lt;code&gt;200&lt;/code&gt; refuses the VM&amp;rsquo;s request, naming the company proxy by its host and port. Over that tunnel, the proxy&amp;rsquo;s TLS connection to a bound host checks the server&amp;rsquo;s certificate against the system&amp;rsquo;s roots and the &lt;a href="#a-companys-ca"&gt;CAs in your CA folder&lt;/a&gt;, as it does directly.&lt;/li&gt;
&lt;li&gt;A plain HTTP request goes to &lt;code&gt;HTTP_PROXY&lt;/code&gt;&amp;rsquo;s proxy in absolute form, with its &lt;code&gt;Proxy-Authorization&lt;/code&gt; in place of the VM&amp;rsquo;s. The company proxy&amp;rsquo;s address in the request has no password, so no error the proxy logs holds one.&lt;/li&gt;
&lt;li&gt;Without &lt;code&gt;HTTPS_PROXY&lt;/code&gt; or &lt;code&gt;HTTP_PROXY&lt;/code&gt;, those requests go directly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;NO_PROXY&lt;/code&gt; is a comma-separated list, which the proxy reads as Go&amp;rsquo;s clients read it. In it, &lt;code&gt;*&lt;/code&gt; matches every host, and an address or a CIDR matches addresses. A name matches itself and its subdomains, while a name with a leading &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;*.&lt;/code&gt; matches only its subdomains. Any entry can end in a port, which limits it to that port, and an entry whose port no request has, such as &lt;code&gt;git.test:0&lt;/code&gt;, or whose port isn&amp;rsquo;t in plain decimal, such as &lt;code&gt;git.test:080&lt;/code&gt;, matches nothing. The proxy reads a name in &lt;code&gt;NO_PROXY&lt;/code&gt; as it reads the host of every request, lowercased in ASCII alone and without one trailing dot, so a name with a character that isn&amp;rsquo;t printable ASCII matches no host, because Unicode&amp;rsquo;s case folding would turn the Kelvin sign into &lt;code&gt;k&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The company proxy resolves the names it&amp;rsquo;s sent, so the proxy can&amp;rsquo;t hold it to the addresses it checked, and the floor changes for those requests. An address in the VM&amp;rsquo;s request is checked as before, and a host whose last label is all digits or starts with &lt;code&gt;0x&lt;/code&gt;, such as &lt;code&gt;127.1&lt;/code&gt;, gets &lt;code&gt;400&lt;/code&gt;, because a company proxy may read it as an address. For a name, the proxy asks this machine&amp;rsquo;s resolver, for at most three seconds, and refuses the request when any answer is internal or denied, unless a rule names the address. A name this machine can&amp;rsquo;t resolve, which is common behind a company proxy, goes to the company proxy unchecked when a rule names it, as itself or under &lt;code&gt;*.domain&lt;/code&gt;. When only &lt;code&gt;**&lt;/code&gt; allows it, the proxy refuses it with &lt;code&gt;403&lt;/code&gt;, and the event log says that this machine can&amp;rsquo;t resolve it and only &lt;code&gt;**&lt;/code&gt; allows it. The proxy reads at most 64 KiB of the company proxy&amp;rsquo;s answer to &lt;code&gt;CONNECT&lt;/code&gt;. &lt;a href="https://next.devvm.dev/docs/contributing/design/#a-company-proxy"&gt;The design note&lt;/a&gt; explains what that leaves open, which &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;Attack vectors&lt;/a&gt; lists, and how builds reach the company proxy through a proxy of their own.&lt;/p&gt;
&lt;p&gt;The event log&amp;rsquo;s &lt;code&gt;upstream&lt;/code&gt; field names the company proxy, by host and port, for each tunnel and request that went through it, and &lt;code&gt;devvm network log&lt;/code&gt; adds &lt;code&gt;through host:port&lt;/code&gt; to the line. The proxy&amp;rsquo;s own log names both company proxies by host and port when it starts. Neither holds the user or the password.&lt;/p&gt;
&lt;h3 data-hextra-search-id="how-long-a-proxy-runs"&gt;How long a proxy runs&lt;span class="hx:absolute hx:-mt-20" id="how-long-a-proxy-runs"&gt;&lt;/span&gt;
&lt;a href="#how-long-a-proxy-runs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The proxy exits when the VM&amp;rsquo;s Lima hostagent does, which it learns from the hostagent&amp;rsquo;s pid file, the VM&amp;rsquo;s lifeline (&lt;code&gt;lifeline&lt;/code&gt; in its config). The proxy starts before the VM, so it waits for the lifeline to name a process that runs. What the file held when the proxy started is an earlier start&amp;rsquo;s, and the proxy waits past it, but when a new start writes the file and its process is already gone, the proxy exits. Once it follows a start, it runs while the file holds what it held then and that process runs, so a VM started again gets a new proxy. If the hostagent never appears, the proxy exits 15 minutes after it started, and &lt;code&gt;devvm stop&lt;/code&gt; stops it at once. It&amp;rsquo;s the broker that follows the lifeline, and its child ends with it, as &lt;a href="https://next.devvm.dev/docs/internals/processes/#a-vms-proxy"&gt;processes&lt;/a&gt; describes. The broker closes the socket between them, the child stops listening, closes its connections and exits, and the broker kills a child that hasn&amp;rsquo;t ended 6 seconds later. A child that ends ends its broker, and neither starts the other again, so the VM has no network until devvm&amp;rsquo;s next command starts its proxy again, as after any proxy&amp;rsquo;s crash. &lt;code&gt;devvm stop&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; also stop a child that outlived its broker, by &lt;code&gt;run/proxy-child.pid&lt;/code&gt; and its arguments.&lt;/p&gt;
&lt;p&gt;A VM that starts again gets a new proxy on the same port. A running VM also gets a new proxy when the config devvm would start it with differs from the one it started with, which devvm tells by the SHA-256 of each. The config holds everything that, changed, starts the proxy again: the VM&amp;rsquo;s list of policies, the VM&amp;rsquo;s CA and the next one, by the SHA-256 of each certificate, so a CA that was replaced counts, the SHA-256 of devvm&amp;rsquo;s binary, so a proxy from another devvm binary counts, the &lt;a href="#a-companys-ca"&gt;CAs in your CA folder&lt;/a&gt;, the &lt;a href="#through-a-company-proxy"&gt;company proxy&lt;/a&gt; settings in devvm&amp;rsquo;s environment and the &lt;a href="#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt;&amp;rsquo;s cap. A config that&amp;rsquo;s gone, or that the proxy wouldn&amp;rsquo;t read, counts as one that differs. To start a new proxy, devvm stops the old one with &lt;code&gt;SIGTERM&lt;/code&gt;, and with &lt;code&gt;SIGKILL&lt;/code&gt; when it&amp;rsquo;s still running two seconds later. The old proxy counts as stopped only once its process is gone, not once its arguments can no longer be read, because an ending process loses its memory before its files, and for that moment its port still looks taken by another program, which would fail the launch with &lt;code&gt;proxy_port_taken&lt;/code&gt;. &lt;code&gt;SIGKILL&lt;/code&gt; goes only to a process whose arguments devvm can still read as the proxy&amp;rsquo;s, so a proxy still ending gets none, and neither does another process given its pid since, even one whose arguments devvm can&amp;rsquo;t read. If it still runs two seconds after that, devvm stops with &lt;code&gt;proxy_stop_failed&lt;/code&gt; and starts nothing, because the old proxy would go on with its old settings.&lt;/p&gt;
&lt;p&gt;devvm counts a proxy as started only once the proxy says it&amp;rsquo;s listening on the VM&amp;rsquo;s port and is still running, because a program that took the port first would otherwise get the VM&amp;rsquo;s traffic. The proxy says so in a status file of its own in the VM&amp;rsquo;s run folder (&lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/proxy.status&lt;/code&gt;), which devvm names to it when it starts it and removes before each start. The file holds the proxy&amp;rsquo;s pid and the address it listens on, so a status that an earlier proxy left, or that another program wrote, never counts. While devvm waits, the proxy counts as running as long as its pid file still names it, it hasn&amp;rsquo;t ended, and its arguments are the VM&amp;rsquo;s proxy&amp;rsquo;s, &lt;code&gt;_proxy -config&lt;/code&gt; with the VM&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt;, or still devvm&amp;rsquo;s own, or can&amp;rsquo;t be read yet. On Linux, a process that has just started shows devvm&amp;rsquo;s own arguments for a moment, then none, because the kernel lets devvm go on as the new program begins to replace devvm&amp;rsquo;s copy, and shows the program&amp;rsquo;s arguments only once it has loaded. If the proxy doesn&amp;rsquo;t start, devvm stops and names the proxy&amp;rsquo;s log (&lt;code&gt;proxy_start_failed&lt;/code&gt;). When a stopped VM&amp;rsquo;s port was taken by another program, devvm chooses a new free port. A running VM&amp;rsquo;s backend holds the port it started with, so when a running VM&amp;rsquo;s proxy is gone and another program took its port, devvm can&amp;rsquo;t start the proxy again (&lt;code&gt;proxy_port_taken&lt;/code&gt;). devvm then stops the VM (&lt;code&gt;net_proxy_down_stopped&lt;/code&gt;), and it does the same when the proxy fails to start for any other reason once the old one was stopped, or when none of the VM&amp;rsquo;s runs, because a confined VM never runs on without its proxy. The next &lt;code&gt;devvm&lt;/code&gt; starts both. A running VM&amp;rsquo;s old proxy has the VM&amp;rsquo;s port, so it can&amp;rsquo;t be kept while the new one starts. On a launch, a link&amp;rsquo;s change or a &lt;code&gt;devvm network&lt;/code&gt; change, what can refuse the proxy&amp;rsquo;s start is checked before the old one stops: the company proxy and its password, your CAs, and the VM&amp;rsquo;s CA and secret files. A refusal there leaves the VM and its old proxy running as they were, and devvm says so (&lt;code&gt;net_proxy_kept&lt;/code&gt;), but only while the old proxy enforces what the VM&amp;rsquo;s state asks for now: the same built-in policies, policy files and deny files for the VM&amp;rsquo;s tier, open or not, from the same devvm binary. An old proxy with a looser tier than the state&amp;rsquo;s, or from another devvm binary, whose built-in policies&amp;rsquo; rules may differ, is stopped with the VM, because it would fail open. The comparison leaves out the company proxy and your CAs that the old proxy started with, so an old proxy kept this way still goes through the company proxy, and trusts the CAs, of its own start. &lt;code&gt;devvm restart&lt;/code&gt; checks only the company proxy and your CAs before it stops the VM, and its start checks the rest. An interrupt during the start of a confined VM stops the VM and its proxy too (&lt;code&gt;interrupted_start&lt;/code&gt;, a cleanup that the start registers around the backend&amp;rsquo;s start), because a backend can leave the VM running while its start still waits for it. Lima&amp;rsquo;s hostagent keeps running the VM after &lt;code&gt;limactl start&lt;/code&gt; ends, and devvm records the confined start only once &lt;code&gt;limactl start&lt;/code&gt; returns. Without the stop, the VM would run with no record of its confined start, so &lt;code&gt;devvm ls&lt;/code&gt; would show it as &lt;code&gt;unenforced&lt;/code&gt; and its next launch would offer to restart it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-childs-sandbox"&gt;The child&amp;rsquo;s sandbox&lt;span class="hx:absolute hx:-mt-20" id="the-childs-sandbox"&gt;&lt;/span&gt;
&lt;a href="#the-childs-sandbox" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The child makes no connection of its own, on either system. It asks its broker to look up each name the floor judges, and to open each connection, to an address the child&amp;rsquo;s floor kept or to a company proxy, and the broker hands it the connection, as it hands it a link&amp;rsquo;s. The broker connects to an address only once its own read of the VM&amp;rsquo;s policy files and of this machine&amp;rsquo;s addresses allows it, as the floor does, and it looks at the policy files at each connection, so a rule such as &lt;code&gt;devvm network allow 127.0.0.1:5432&lt;/code&gt; applies from the next connection. So even a child that a VM took over reaches this machine&amp;rsquo;s loopback, its own addresses and the private and link-local ranges only where a rule names the address, as the VM does. It still reaches the internet, a host on this machine&amp;rsquo;s network whose address is public, such as a printer&amp;rsquo;s global IPv6 address, and whatever a company proxy reaches, which it speaks to with its password, this machine&amp;rsquo;s loopback included when the company proxy runs here. The broker connects to the company proxy at the address in its own config, so one on this machine&amp;rsquo;s loopback, such as a VPN client&amp;rsquo;s, works. It looks names up through this machine&amp;rsquo;s resolver, whatever its address, so the child sends no DNS. The broker carries at most 256 lookups and 1024 connections at once for the child, each lookup within 20 seconds and each connection within 15, and the child cancels one whose request has gone. The child also holds at most 8448 open files, a limit it sets on itself before it&amp;rsquo;s confined, so it can&amp;rsquo;t keep every connection the broker hands it (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-proxys-broker"&gt;the design note&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;On macOS, the broker starts its child through &lt;code&gt;/usr/bin/sandbox-exec&lt;/code&gt;, with a Seatbelt profile that denies everything the child doesn&amp;rsquo;t need, so the child is confined from its first instruction, before it reads a byte of the VM&amp;rsquo;s. The broker writes the profile for each start from what the child needs, and passes it to &lt;code&gt;sandbox-exec&lt;/code&gt; as an argument, so it&amp;rsquo;s never a file on disk. It runs devvm&amp;rsquo;s binary by its real path, with its links resolved, because Seatbelt matches real paths. The profile allows the child the following, and nothing else:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;devvm&amp;rsquo;s binary:&lt;/strong&gt; running it and reading it, for its SHA-256, and the metadata of its folder, which CoreFoundation looks at for the program&amp;rsquo;s bundle before Security checks a certificate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The system:&lt;/strong&gt; the rules that the system&amp;rsquo;s own &lt;code&gt;dyld-support.sb&lt;/code&gt; profile gives a program to start, reading the system&amp;rsquo;s libraries in &lt;code&gt;/usr/lib&lt;/code&gt; and &lt;code&gt;/System/Library&lt;/code&gt; and the time zone, the metadata of the links &lt;code&gt;/etc&lt;/code&gt;, &lt;code&gt;/var&lt;/code&gt; and &lt;code&gt;/tmp&lt;/code&gt;, through which those paths lead, and reading &lt;code&gt;sysctl&lt;/code&gt;, which the floor reads the host&amp;rsquo;s addresses with, except the process table&amp;rsquo;s &lt;code&gt;kern.proc&lt;/code&gt; names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its folders:&lt;/strong&gt; reading and writing in the VM&amp;rsquo;s logs folder and the shared Nix cache, where it can make only regular files, and change their mode and times, but not their flags, ACLs, owner, set-id bits or extended attributes, and can remove no folder. It makes no hard link anywhere. The broker makes the cache&amp;rsquo;s folders before the child starts, as the child can&amp;rsquo;t make a folder. A build&amp;rsquo;s child gets its own &lt;code&gt;logs/&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The files that change:&lt;/strong&gt; the metadata of your policy files, the VM&amp;rsquo;s bindings and the links&amp;rsquo; list, which the child looks at with &lt;code&gt;stat&lt;/code&gt; alone, and of their targets when they&amp;rsquo;re links, and of every link on the way to any of those files or folders.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Checking certificates:&lt;/strong&gt; the mach services &lt;code&gt;com.apple.trustd&lt;/code&gt; and &lt;code&gt;com.apple.trustd.agent&lt;/code&gt;, which check certificates for Go&amp;rsquo;s &lt;code&gt;crypto/x509&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The network:&lt;/strong&gt; accepting on the listener the broker gave it, and reading and writing the connections it accepted and those the broker handed it, which need no rule of their own. The profile allows no network out at all, so the child connects nowhere and sends no datagram itself, because Seatbelt checks every &lt;code&gt;connect&lt;/code&gt; and every send with an address.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Signals and processes:&lt;/strong&gt; signals to itself, and looking only at itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So the child can&amp;rsquo;t read your home folder or devvm&amp;rsquo;s other folders, its run folder, its config and the other VMs&amp;rsquo; among them, and can&amp;rsquo;t reach the Keychain, whose service &lt;code&gt;com.apple.SecurityServer&lt;/code&gt; the profile never allows, nor any unix socket, such as an ssh master&amp;rsquo;s control socket or an SSH agent&amp;rsquo;s. It can&amp;rsquo;t bind a port, fork or run a program, signal another process, list the processes, or read another process&amp;rsquo;s path, details or arguments (&lt;code&gt;process-info&lt;/code&gt;, &lt;code&gt;kern.proc&lt;/code&gt;). macOS answers a process&amp;rsquo;s arguments (&lt;code&gt;kern.procargs2&lt;/code&gt;) to a sandboxed process only within its own process group, and the child runs alone in a session of its own, so it can read only its own. A policy file that&amp;rsquo;s a link to another file is looked at where it pointed as the proxy started, and when it points elsewhere later, the child&amp;rsquo;s &lt;code&gt;stat&lt;/code&gt; is refused, so the child asks the broker for the file at every request instead, which reads it as before.&lt;/p&gt;
&lt;p&gt;On Linux, the child confines itself once it has opened its logs and the Nix cache and loaded the system&amp;rsquo;s roots and its time zone. It does so before it says it&amp;rsquo;s ready, so before it reads a byte of the VM&amp;rsquo;s. It sets &lt;code&gt;no_new_privs&lt;/code&gt; on every thread, restricts every thread with Landlock, and installs a seccomp filter on every thread. Landlock and &lt;code&gt;prctl&lt;/code&gt; change only the thread that calls them, and Go&amp;rsquo;s runtime runs the child on several threads, so the child makes each call on every thread at once through Go&amp;rsquo;s call for all of a process&amp;rsquo;s threads, which works only in a binary without cgo, as devvm&amp;rsquo;s releases are. From Landlock&amp;rsquo;s ABI 8 it restricts every thread in one call instead (&lt;code&gt;LANDLOCK_RESTRICT_SELF_TSYNC&lt;/code&gt;), and the filter goes on every thread in one call (&lt;code&gt;SECCOMP_FILTER_FLAG_TSYNC&lt;/code&gt;). Landlock holds the child to these files, whatever their permissions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its folders:&lt;/strong&gt; the VM&amp;rsquo;s logs folder, and for a VM with the nix layer the shared Nix cache, where it reads, writes, lists, makes, deletes, renames and empties regular files, from Landlock&amp;rsquo;s ABI 2, which lets the cache rename a file from its top folder into &lt;code&gt;nar/&lt;/code&gt;. It makes no folder, link, FIFO, socket or device there, and nothing in them runs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nothing else:&lt;/strong&gt; it can&amp;rsquo;t read, write or list any other file, your home folder, devvm&amp;rsquo;s folders and &lt;code&gt;/etc&lt;/code&gt; included, or run a program. Landlock doesn&amp;rsquo;t restrict &lt;code&gt;stat&lt;/code&gt;, so the child still looks at the changing files, and learns whether a file of yours exists, its size and when it changed, but not what it holds. Landlock also doesn&amp;rsquo;t restrict a file&amp;rsquo;s mode, owner, extended attributes or times, or, below ABI 3, a truncation by path, so the seccomp filter refuses those.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From ABI 4 Landlock also refuses the child a TCP port&amp;rsquo;s bind and every TCP connection, from ABI 6 a signal to any process outside it and a connection to an abstract unix socket that isn&amp;rsquo;t its own, from ABI 9 a connection to a named unix socket, and from ABI 10 every UDP bind and datagram. On a kernel at ABI 6 or 7 without Landlock&amp;rsquo;s fix for signals between a process&amp;rsquo;s threads, the child leaves its signals unscoped, because Go&amp;rsquo;s runtime signals each of its threads to restrict itself in turn, and those signals would be refused and hang the start. Landlock&amp;rsquo;s network rules match only ports, so they can&amp;rsquo;t refuse an address alone, and the seccomp filter refuses the child every connection of its own on every kernel.&lt;/p&gt;
&lt;p&gt;The seccomp filter refuses the child, with &lt;code&gt;EPERM&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sockets:&lt;/strong&gt; every socket but a netlink route socket (&lt;code&gt;AF_NETLINK&lt;/code&gt; with &lt;code&gt;NETLINK_ROUTE&lt;/code&gt;), which the floor reads the host&amp;rsquo;s addresses through and which reaches the kernel alone, a socketpair, &lt;code&gt;connect&lt;/code&gt;, &lt;code&gt;listen&lt;/code&gt;, and &lt;code&gt;sendto&lt;/code&gt;, &lt;code&gt;sendmsg&lt;/code&gt; and &lt;code&gt;sendmmsg&lt;/code&gt; with &lt;code&gt;MSG_FASTOPEN&lt;/code&gt;, which would connect a TCP socket as it sends, such as its listener once a &lt;code&gt;shutdown&lt;/code&gt; has closed it. So the child has no socket of its own to connect, and can&amp;rsquo;t connect one it holds again. Below Landlock&amp;rsquo;s ABI 9, the filter is also what keeps it from the ssh masters&amp;rsquo; control sockets, &lt;code&gt;docker.sock&lt;/code&gt; and your SSH agent&amp;rsquo;s socket.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Calls around the filter:&lt;/strong&gt; the three &lt;code&gt;io_uring&lt;/code&gt; calls, whose operations wouldn&amp;rsquo;t pass it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other processes:&lt;/strong&gt; &lt;code&gt;ptrace&lt;/code&gt;, &lt;code&gt;process_vm_readv&lt;/code&gt;, &lt;code&gt;process_vm_writev&lt;/code&gt; and &lt;code&gt;pidfd_getfd&lt;/code&gt;, which reach another process&amp;rsquo;s memory or descriptors, and what changes how another process runs, which Landlock&amp;rsquo;s scope of signals doesn&amp;rsquo;t cover: &lt;code&gt;prlimit64&lt;/code&gt; other than on the child itself, as a limit such as &lt;code&gt;RLIMIT_CPU&lt;/code&gt; can kill a process, &lt;code&gt;setpriority&lt;/code&gt;, &lt;code&gt;ioprio_set&lt;/code&gt;, &lt;code&gt;sched_setaffinity&lt;/code&gt;, &lt;code&gt;sched_setscheduler&lt;/code&gt;, &lt;code&gt;sched_setparam&lt;/code&gt; and &lt;code&gt;sched_setattr&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Watching files:&lt;/strong&gt; &lt;code&gt;inotify_init&lt;/code&gt;, &lt;code&gt;inotify_init1&lt;/code&gt;, &lt;code&gt;inotify_add_watch&lt;/code&gt;, &lt;code&gt;fanotify_init&lt;/code&gt; and &lt;code&gt;fanotify_mark&lt;/code&gt;, which would tell it the names of files outside its folders as they change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file&amp;rsquo;s metadata by its path:&lt;/strong&gt; &lt;code&gt;chmod&lt;/code&gt;, &lt;code&gt;fchmodat&lt;/code&gt; and &lt;code&gt;fchmodat2&lt;/code&gt;, &lt;code&gt;chown&lt;/code&gt;, &lt;code&gt;lchown&lt;/code&gt; and &lt;code&gt;fchownat&lt;/code&gt;, the extended attributes&amp;rsquo; &lt;code&gt;setxattr&lt;/code&gt;, &lt;code&gt;lsetxattr&lt;/code&gt;, &lt;code&gt;removexattr&lt;/code&gt;, &lt;code&gt;lremovexattr&lt;/code&gt;, &lt;code&gt;setxattrat&lt;/code&gt; and &lt;code&gt;removexattrat&lt;/code&gt;, &lt;code&gt;truncate&lt;/code&gt;, and the times&amp;rsquo; &lt;code&gt;utime&lt;/code&gt;, &lt;code&gt;utimes&lt;/code&gt;, &lt;code&gt;futimesat&lt;/code&gt;, and &lt;code&gt;utimensat&lt;/code&gt; with a path. The calls on a descriptor that the child opened, which Landlock checked as it opened it, stay: &lt;code&gt;fchmod&lt;/code&gt;, &lt;code&gt;fchown&lt;/code&gt;, &lt;code&gt;ftruncate&lt;/code&gt; and &lt;code&gt;utimensat&lt;/code&gt; on a descriptor, which its logs and the Nix cache use.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The kernel&amp;rsquo;s keyrings:&lt;/strong&gt; &lt;code&gt;add_key&lt;/code&gt;, &lt;code&gt;request_key&lt;/code&gt; and &lt;code&gt;keyctl&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What it never does:&lt;/strong&gt; running a program (&lt;code&gt;execve&lt;/code&gt;, &lt;code&gt;execveat&lt;/code&gt;), a process of its own (&lt;code&gt;fork&lt;/code&gt; and &lt;code&gt;vfork&lt;/code&gt;, and &lt;code&gt;clone&lt;/code&gt; for anything but a thread), a namespace (&lt;code&gt;unshare&lt;/code&gt;, &lt;code&gt;setns&lt;/code&gt;, and &lt;code&gt;clone&lt;/code&gt; with a namespace&amp;rsquo;s flag), &lt;code&gt;bpf&lt;/code&gt;, &lt;code&gt;userfaultfd&lt;/code&gt; and &lt;code&gt;perf_event_open&lt;/code&gt;. &lt;code&gt;clone3&lt;/code&gt; gets &lt;code&gt;ENOSYS&lt;/code&gt;, as a kernel without it answers, because its flags are behind a pointer that the filter can&amp;rsquo;t read, so a caller falls back to &lt;code&gt;clone&lt;/code&gt;, whose flags it can.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It kills the child for a system call of any architecture but its own, and on amd64 for the x32 numbers, so the 32-bit calls, &lt;code&gt;socketcall&lt;/code&gt; among them, can&amp;rsquo;t get around it. The child needs none of these, because the broker looks up its names, the listener and the socket to the broker were open before, every connection it opens comes from the broker, and Go&amp;rsquo;s runtime starts its threads with &lt;code&gt;clone&lt;/code&gt; and the thread&amp;rsquo;s flag. The broker sets itself undumpable (&lt;code&gt;PR_SET_DUMPABLE&lt;/code&gt;), so on a kernel without Landlock, where nothing else would, the child can&amp;rsquo;t read the broker&amp;rsquo;s memory or open its descriptors through &lt;code&gt;/proc&lt;/code&gt;. Other processes of yours stay readable through &lt;code&gt;/proc&lt;/code&gt; there, unless the kernel&amp;rsquo;s Yama restricts &lt;code&gt;ptrace&lt;/code&gt;, as Ubuntu&amp;rsquo;s does. Once confined, the child checks that it lists its own folders, that it fails to list &lt;code&gt;/&lt;/code&gt; and to read &lt;code&gt;/etc/hosts&lt;/code&gt; with Landlock, and that it fails to make a unix or an IPv4 socket, to connect, to listen and to send with &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; with the filter. It also reads the host&amp;rsquo;s own addresses again, through a netlink socket, and a read that fails or finds none fails the start, because the floor would refuse none of them without it. The confinement takes at most 2 seconds, within the broker&amp;rsquo;s 4, and a confinement or a check that fails fails the start, which devvm reports as the proxy failing to start (&lt;code&gt;proxy_start_failed&lt;/code&gt;). A kernel without Landlock, below ABI 2, or without seccomp filters, leaves that part out, and the child runs with what there is, which it says.&lt;/p&gt;
&lt;p&gt;On both systems, the child checks that what confines its files holds before it says it&amp;rsquo;s ready. It opens its broker&amp;rsquo;s config, the file named in its arguments, which the profile or Landlock must refuse it, and closes it unread if it opens. Its ready message says how it&amp;rsquo;s confined, and the broker writes that to &lt;code&gt;run/proxy.confined&lt;/code&gt; as one line of a level, &lt;code&gt;full&lt;/code&gt;, &lt;code&gt;partial&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;, then what confines it and, for a child that isn&amp;rsquo;t fully confined, why, from a fixed set of words, so devvm never prints what a child wrote:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;run/proxy.confined&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;full seatbelt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the profile confines the child, and its check held&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;none seatbelt check-failed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the child ran under the profile, but could open its broker&amp;rsquo;s config&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;none sandbox-exec-missing&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;there&amp;rsquo;s no &lt;code&gt;/usr/bin/sandbox-exec&lt;/code&gt;, so the broker started the child unconfined&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;none sandbox-exec-failed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sandbox-exec&lt;/code&gt; failed to start the child under its profile, so the broker started it again unconfined&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;none unsupported&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm doesn&amp;rsquo;t confine the child on this system, or this devvm, built with cgo as the tests&amp;rsquo; race detector is, can&amp;rsquo;t reach its threads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;full landlock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;on Linux, Landlock from ABI 6 with its signals scoped, and the seccomp filter, confine the child, and its check held. Below ABI 9 the filter alone refuses it a unix socket, and below ABI 10 a UDP socket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;partial landlock landlock-signals&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;this kernel&amp;rsquo;s Landlock is ABI 4 or 5, or 6 or 7 without its fix for signals between threads, so the child can also signal your other processes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;partial landlock landlock-below-abi4&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;this kernel&amp;rsquo;s Landlock is ABI 2 or 3, which refuses no TCP of the child&amp;rsquo;s, though the filter refuses it every socket and connection of its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;partial landlock no-seccomp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;this kernel has no seccomp filters, so only Landlock confines the child, which below ABI 4 can connect anywhere itself, this machine&amp;rsquo;s loopback included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;partial seccomp no-landlock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;this kernel has no Landlock, or only ABI 1, so only the filter confines the child, which can read and write your files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;none no-landlock-or-seccomp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;this kernel has neither, so the child runs with the broker&amp;rsquo;s access, and can connect anywhere itself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;none landlock check-failed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the child confined itself, but could open its broker&amp;rsquo;s config&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The broker starts the child again unconfined only when &lt;code&gt;sandbox-exec&lt;/code&gt; failed before devvm&amp;rsquo;s code ran. That&amp;rsquo;s when the child had already ended before it answered, either with &lt;code&gt;sandbox-exec&lt;/code&gt;&amp;rsquo;s own exit status, 65 for a profile it refused or 71 for a program it couldn&amp;rsquo;t run, or killed by &lt;code&gt;SIGABRT&lt;/code&gt; or &lt;code&gt;SIGKILL&lt;/code&gt;, as the system kills a program that a profile refuses what it needs to load. The broker decides that before it stops the child itself, so a child that its own stop ended never counts. Nothing of a VM&amp;rsquo;s can cause those failures, so the second start, which has what&amp;rsquo;s left of the broker&amp;rsquo;s 4 seconds, never trades a confined child for an unconfined one at a VM&amp;rsquo;s request. A program of yours that sent the child one of those signals in that moment could, and the proxy&amp;rsquo;s log and devvm doctor then say the child runs unconfined. A child that answers &lt;code&gt;failed&lt;/code&gt;, ends any other way, or doesn&amp;rsquo;t answer in time fails the start, as it would unconfined, because what it read by then could be a VM&amp;rsquo;s. A ready that names a sandbox the broker didn&amp;rsquo;t start the child under, or another than the one it did, breaks the protocol&amp;rsquo;s rules, so a child can&amp;rsquo;t claim more than it was given. The broker writes a warning in &lt;code&gt;proxy.log&lt;/code&gt; for each child that isn&amp;rsquo;t fully confined, and devvm doctor warns of each running VM whose proxy says so (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;). A proxy that hasn&amp;rsquo;t written &lt;code&gt;run/proxy.confined&lt;/code&gt; yet, such as one still starting or one that a devvm from before the broker started, gets no warning.&lt;/p&gt;
&lt;h2 data-hextra-search-id="policy-files"&gt;Policy files&lt;span class="hx:absolute hx:-mt-20" id="policy-files"&gt;&lt;/span&gt;
&lt;a href="#policy-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On the allowlist tier, a VM&amp;rsquo;s proxy reads these policies, in this order, as one list. &lt;a href="https://next.devvm.dev/docs/safety/network/#allowlists"&gt;Allowlists&lt;/a&gt; describes what they allow and the rules they hold. The other tiers read fewer, and one list of devvm&amp;rsquo;s makes each tier&amp;rsquo;s:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;internet:&lt;/strong&gt; one built-in policy, &lt;code&gt;network/internet.policy&lt;/code&gt;, which holds &lt;code&gt;**:*&lt;/code&gt;, every host and address on any port, then &lt;code&gt;secrets.policy&lt;/code&gt;, then your files below, whose denies alone apply. The proxy&amp;rsquo;s config lists those files in &lt;code&gt;deny_policies&lt;/code&gt;, and the proxy drops their allows as it reads them, keeping their denies and a broken deny. &lt;code&gt;**&lt;/code&gt; lifts no floor, so internal addresses and this machine&amp;rsquo;s stay refused.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;none:&lt;/strong&gt; the built-in policies of the VM&amp;rsquo;s agents, each agent&amp;rsquo;s &lt;code&gt;shared-tools/&amp;lt;agent&amp;gt;.policy&lt;/code&gt;, such as &lt;code&gt;shared-tools/claude.policy&lt;/code&gt;, and no other built-in one, then &lt;code&gt;secrets.policy&lt;/code&gt;, then your files as denies alone. The VM&amp;rsquo;s links come before every rule, as on every tier.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;open:&lt;/strong&gt; no policy at all. The proxy&amp;rsquo;s config has &lt;code&gt;&amp;quot;open&amp;quot;: true&lt;/code&gt;, which allows every host and address on every port, internal ones and this machine&amp;rsquo;s included, and a config with &lt;code&gt;open&lt;/code&gt; and any policy is refused. The floor doesn&amp;rsquo;t apply, and a name that the host can&amp;rsquo;t resolve goes to the company proxy unjudged, as it does for a build.&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Policy&lt;/th&gt;
&lt;th&gt;Read for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;layers/base.policy&lt;/code&gt; (built in)&lt;/td&gt;
&lt;td&gt;every VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;shared-tools/&amp;lt;name&amp;gt;.policy&lt;/code&gt; (built in)&lt;/td&gt;
&lt;td&gt;each shared tool in the VM&amp;rsquo;s image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;layers/&amp;lt;name&amp;gt;.policy&lt;/code&gt; (built in)&lt;/td&gt;
&lt;td&gt;each built-in layer in the VM&amp;rsquo;s image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~/.config/devvm/layers/&amp;lt;name&amp;gt;.policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each of your layers in the VM&amp;rsquo;s image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~/.config/devvm/policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;that VM only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/secrets.policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every VM, which devvm writes with the hosts of the VM&amp;rsquo;s secrets and logins and of its agents&amp;rsquo; &lt;a href="#logins-made-in-a-vm"&gt;token endpoints&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The built-in policies are paths in devvm&amp;rsquo;s own files, which are &lt;a href="https://next.devvm.dev/docs/internals/install/#devvms-own-files"&gt;built into the binary&lt;/a&gt;, and no copy of them is ever on disk. The same list holds both kinds for a VM: the built-in ones go in the proxy&amp;rsquo;s config as names in &lt;code&gt;builtin_policies&lt;/code&gt;, and your files as paths in &lt;code&gt;policies&lt;/code&gt;. The proxy reads the built-in ones from the binary once, as it starts, ahead of your files in the list, and never again, so only an upgrade of devvm changes them, and an upgrade starts every VM&amp;rsquo;s proxy again because the binary changed. A built-in policy that&amp;rsquo;s missing, or that holds a line that isn&amp;rsquo;t a rule, is a bug in devvm, so the proxy refuses to start rather than run with fewer rules than devvm meant, and devvm stops the VM as for any proxy that doesn&amp;rsquo;t start. A missing file of yours, on the other hand, has no rules. &lt;code&gt;devvm network&lt;/code&gt; reads the built-in policies from the binary too, and it labels each with its name (&lt;code&gt;# devvm: layers/base.policy&lt;/code&gt;, and &lt;code&gt;&amp;quot;builtin&amp;quot;&lt;/code&gt; with &lt;code&gt;--json&lt;/code&gt;) where it shows your files&amp;rsquo; paths. Both lists are in the config that a proxy started with, so a change to either starts the proxy again.&lt;/p&gt;
&lt;p&gt;The proxy, &lt;code&gt;devvm network&lt;/code&gt; and &lt;code&gt;devvm doctor&lt;/code&gt; read every policy with one parser, which returns each line that holds more than a comment, with its number and whether it&amp;rsquo;s a rule. A line is a rule only when one check takes it, which is exactly what &lt;code&gt;devvm network allow&lt;/code&gt; and &lt;code&gt;deny&lt;/code&gt; take (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;). Each time the proxy reads a file, it logs each line that isn&amp;rsquo;t a rule, with its file, number and text, quoted, to its own log, &lt;code&gt;proxy.log&lt;/code&gt; in the VM&amp;rsquo;s &lt;code&gt;logs/&lt;/code&gt; folder. It skips such a line, unless the line starts with &lt;code&gt;!&lt;/code&gt;, which makes it a broken deny. A broken deny fails closed: while any of the VM&amp;rsquo;s policy files has one, the proxy&amp;rsquo;s policy denies every name and every address, and each request gets &lt;code&gt;403&lt;/code&gt; and a refused block whose reason names the file and the line, so neither the VM&amp;rsquo;s prompt nor &lt;code&gt;devvm network log&lt;/code&gt; suggests an allow rule. The VM&amp;rsquo;s links and the proxy&amp;rsquo;s own answers at &lt;code&gt;devvm.proxy&lt;/code&gt; come before the rules, so they still work, and tunnels already open stay open, as they do for any new deny. Fixing the line lifts it at the proxy&amp;rsquo;s next read of the file, which is the next connection. The proxy reads a file again when its mtime, size or inode changes, or when it comes back after it was missing, whatever its mtime. It also reads a file again at every connection while its mtime is less than 2 seconds old, because some filesystems keep mtimes only to the second or two, so a second write within that time could leave the stamp as it was. A change of a file&amp;rsquo;s mode or owner alone, with &lt;code&gt;chmod&lt;/code&gt; or &lt;code&gt;chown&lt;/code&gt;, changes none of the three, so the proxy doesn&amp;rsquo;t see it until the file&amp;rsquo;s next write. The same goes for the bindings file and the links list, so one that you make readable or writable by others after the proxy read it keeps its last contents until it changes, and the proxy refuses it then. A file the proxy refused is read again at the next connection, so fixing its mode works at once. An error other than a missing file keeps its last rules and its broken deny, which the proxy&amp;rsquo;s log says once. The proxy, &lt;code&gt;devvm network&lt;/code&gt; and &lt;code&gt;devvm doctor&lt;/code&gt; read a policy file only when it&amp;rsquo;s a regular file, through a symbolic link if it&amp;rsquo;s one, of at most 1 MiB, through devvm&amp;rsquo;s one reader of files a VM can write or swap. They open it without blocking and check the file they opened, so a FIFO or a link to &lt;code&gt;/dev/zero&lt;/code&gt; in a policy file&amp;rsquo;s place can&amp;rsquo;t hang them, and each refuses it with a named error, one for a file that isn&amp;rsquo;t regular and one for a file that&amp;rsquo;s too long. A leading byte-order mark isn&amp;rsquo;t part of the first line. devvm warns about each line that isn&amp;rsquo;t a rule, with &lt;code&gt;policy_broken_deny&lt;/code&gt; for a broken deny and &lt;code&gt;policy_not_rule&lt;/code&gt; for the others. A launch of a confined VM warns about the VM&amp;rsquo;s policy files as it readies the VM&amp;rsquo;s proxy, &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; about the file they change, and &lt;code&gt;devvm doctor&lt;/code&gt; about the files you edit: &lt;code&gt;~/.config/devvm/policy&lt;/code&gt;, your layers&amp;rsquo; and each VM&amp;rsquo;s own. &lt;code&gt;devvm network&lt;/code&gt; also marks the line, and &lt;code&gt;--json&lt;/code&gt; lists it in &lt;code&gt;not_rules&lt;/code&gt;. A unit test parses every policy file that devvm ships and fails on any line that isn&amp;rsquo;t a rule.&lt;/p&gt;
&lt;p&gt;Each change that &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; or &lt;code&gt;rm&lt;/code&gt; makes rewrites the file whole, through a link if the file is one, so a proxy never reads half of it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="quiet-hosts"&gt;Quiet hosts&lt;span class="hx:absolute hx:-mt-20" id="quiet-hosts"&gt;&lt;/span&gt;
&lt;a href="#quiet-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A built-in policy can hold &lt;code&gt;quiet HOST&lt;/code&gt; or &lt;code&gt;quiet HOST:PORT&lt;/code&gt; lines, for one exact host name, never &lt;code&gt;*.name&lt;/code&gt; or &lt;code&gt;**&lt;/code&gt;, so a quiet line can&amp;rsquo;t hide a whole domain&amp;rsquo;s blocks (&lt;a href="https://next.devvm.dev/docs/safety/network/#quiet-hosts"&gt;quiet hosts&lt;/a&gt;). The policy parser returns such a line as one that isn&amp;rsquo;t a rule, marked as a quiet line, so the check of a rule and &lt;code&gt;devvm network allow&lt;/code&gt; never take one. The proxy&amp;rsquo;s read of its built-in policies keeps it as a rule marked &lt;code&gt;quiet&lt;/code&gt;, which allows and denies nothing, so the proxy leaves it out of the rules a decision reads. It matches a host and port against the built-in quiet rules alone, as it matches any rule, but only while no rule covers that host and port, whether an allow, a deny or one that narrows, and never on an open policy or one with a broken deny. The proxy drops a quiet line in any other file and logs it, and devvm warns about it with &lt;code&gt;policy_quiet_not_own&lt;/code&gt;. A quiet host is blocked as any host no rule allows, and an allow of yours still lifts it. The proxy marks a block&amp;rsquo;s event quiet only when its reason is the one for a host no rule allows, it isn&amp;rsquo;t refused whatever the rules say, and a quiet rule matches, for the proxy&amp;rsquo;s path and the transparent one alike, so a block for another reason, such as an internal address, a failed connection or a deny of yours, keeps its notice. A quiet event is logged with &lt;code&gt;&amp;quot;quiet&amp;quot;: true&lt;/code&gt; but never counted among the blocks that &lt;code&gt;/blocked&lt;/code&gt; and &lt;code&gt;/blocked/new&lt;/code&gt; serve, so neither the VM&amp;rsquo;s prompt nor &lt;code&gt;devvm-why&lt;/code&gt; sees it, and the proxy&amp;rsquo;s block page writes no allow command for it. &lt;code&gt;devvm network log&lt;/code&gt; gives it no allow command and a row of its own apart from the same host&amp;rsquo;s other blocks, and ends its line &lt;code&gt;, quiet&lt;/code&gt;, and &lt;code&gt;devvm network lock&lt;/code&gt; leaves it out of what it offers, judging it with the proxy&amp;rsquo;s own match of quiet rules. &lt;code&gt;devvm network&lt;/code&gt; marks a built-in quiet line, its &lt;code&gt;--json&lt;/code&gt; lists the hosts in &lt;code&gt;quiet&lt;/code&gt;, and the agents&amp;rsquo; table on the coding agents page leaves quiet lines out. Each quiet line in devvm&amp;rsquo;s files has a comment that names the host&amp;rsquo;s use and the maker&amp;rsquo;s page that documents it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="requests-by-method-and-path"&gt;Requests by method and path&lt;span class="hx:absolute hx:-mt-20" id="requests-by-method-and-path"&gt;&lt;/span&gt;
&lt;a href="#requests-by-method-and-path" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A rule for a host name or &lt;code&gt;*.name&lt;/code&gt; can have its methods and then its path after it, each after spaces or tabs, such as &lt;code&gt;api.github.com GET,HEAD /repos/&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#rules-by-method-and-path"&gt;rules by method and path&lt;/a&gt;). The policy parser reads such a line as one rule, whose text is its canonical form: the host as before, the methods in capitals in the order of the proxy&amp;rsquo;s list of methods, and the path as written, joined by one space. That&amp;rsquo;s what &lt;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;deny&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; write from &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt;, and what they compare a line by, so &lt;code&gt;HEAD,get&lt;/code&gt; and &lt;code&gt;GET,HEAD&lt;/code&gt; are the same rule. A method outside that list, &lt;code&gt;CONNECT&lt;/code&gt; among them, an address, a CIDR or &lt;code&gt;**&lt;/code&gt; with methods or a path, and a path that isn&amp;rsquo;t a pattern aren&amp;rsquo;t rules, so a typo in a deny is a broken deny, which denies everything, rather than a deny of nothing.&lt;/p&gt;
&lt;p&gt;The proxy judges a host in two steps. For the connection, &lt;code&gt;CONNECT host:port&lt;/code&gt; or an absolute-form request, a deny that narrows doesn&amp;rsquo;t refuse the host, and an allow that narrows allows it, so a host that only rules by method and path allow is reached. Its requests are then judged one by one when a rule that narrows covers the host and either it&amp;rsquo;s a deny or no rule allows the whole host. Both come from one read of the policy files, the rules that cover the host, so a file that changes between the two can&amp;rsquo;t give the connection one rule&amp;rsquo;s verdict and another&amp;rsquo;s way through. Such a host&amp;rsquo;s &lt;code&gt;CONNECT&lt;/code&gt; on a port the proxy intercepts, &lt;code&gt;:443&lt;/code&gt;, is intercepted with the VM&amp;rsquo;s CA, as a bound host&amp;rsquo;s is, and on any other port, or without a CA, it&amp;rsquo;s refused with &lt;code&gt;403&lt;/code&gt;, logged as a refused block, because the proxy can&amp;rsquo;t see the requests in it. An absolute-form request, plain HTTP on any port or &lt;code&gt;https://&lt;/code&gt;, is judged before it&amp;rsquo;s forwarded.&lt;/p&gt;
&lt;p&gt;Inside an intercepted tunnel, the proxy&amp;rsquo;s own HTTP server reads each request, HTTP/1.1 kept alive or HTTP/2, and calls one handler for each, which checks that the request names the host (&lt;code&gt;421&lt;/code&gt; otherwise), then judges it with the rules as they are then, then forwards it. So every request on a connection is judged, not just the first, and a rule added or removed applies from the tunnel&amp;rsquo;s next request. A WebSocket is judged by its upgrade request, after which the proxy passes its bytes as they are, so for a host that rules narrow, an &lt;code&gt;Upgrade&lt;/code&gt; to any other protocol, such as &lt;code&gt;h2c&lt;/code&gt;, whose requests would pass the same way, is refused, and so is a &lt;code&gt;CONNECT&lt;/code&gt; inside the tunnel. A refused request gets &lt;code&gt;403&lt;/code&gt;, and the event log gets a &lt;code&gt;blocked&lt;/code&gt; event with its method and path. A deny&amp;rsquo;s refusal is marked refused, so neither the VM&amp;rsquo;s prompt nor &lt;code&gt;devvm network log --blocked&lt;/code&gt; suggests an allow, and a request that no allow covers suggests the allow of the whole host. An allowed request&amp;rsquo;s &lt;code&gt;forward&lt;/code&gt; event names the rule that allowed it, as its &lt;code&gt;rule&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The proxy&amp;rsquo;s judge of a request takes the rules that cover the host and port in order. A whole deny refuses, then a &lt;code&gt;CONNECT&lt;/code&gt; and an upgrade to a protocol other than WebSocket are refused when a rule narrows the host, and so is, when a rule narrows it by method, a method that the request names besides its own that isn&amp;rsquo;t exactly one of the proxy&amp;rsquo;s methods, then each deny that narrows refuses what it matches, and then the first allow that matches lets the request through. One matcher judges both rules and &lt;a href="#how-the-proxy-puts-them-in"&gt;secrets&amp;rsquo; bindings&lt;/a&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A path in plain form:&lt;/strong&gt; the path as the proxy forwards it starts with &lt;code&gt;/&lt;/code&gt;, has nothing percent-encoded, no &lt;code&gt;\&lt;/code&gt; or &lt;code&gt;;&lt;/code&gt;, and is clean, with no &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;..&lt;/code&gt; segment and no doubled slash. The query is no part of it. These are the forms that servers read apart, by decoding an encoded slash or dot, reading &lt;code&gt;\&lt;/code&gt; as &lt;code&gt;/&lt;/code&gt;, dropping &lt;code&gt;;&lt;/code&gt; and what follows it, or not cleaning the path, so a request in any of them could reach a path that the proxy didn&amp;rsquo;t judge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A pattern:&lt;/strong&gt; its segments are split at &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt; matches any run of characters within one, and &lt;code&gt;**&lt;/code&gt; as a whole segment matches one segment or more. A pattern&amp;rsquo;s last &lt;code&gt;/&lt;/code&gt; stands for &lt;code&gt;/**&lt;/code&gt;, so &lt;code&gt;/api/&lt;/code&gt; is &lt;code&gt;/api/**&lt;/code&gt;, which is a binding&amp;rsquo;s path below which the value goes in. A path&amp;rsquo;s one trailing &lt;code&gt;/&lt;/code&gt; may be there or not. Matching is a table over the pattern&amp;rsquo;s and the path&amp;rsquo;s segments, linear in the path for each of the pattern&amp;rsquo;s at most 32 segments, so a VM&amp;rsquo;s long path can&amp;rsquo;t make it slow.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The methods a request names:&lt;/strong&gt; besides its own, each value of a header that some servers take the method from, &lt;code&gt;X-HTTP-Method&lt;/code&gt; or any with &lt;code&gt;method-override&lt;/code&gt; in its name, read in any case and with &lt;code&gt;_&lt;/code&gt; for &lt;code&gt;-&lt;/code&gt;, as Rack&amp;rsquo;s and CGI&amp;rsquo;s servers turn &lt;code&gt;-&lt;/code&gt; into &lt;code&gt;_&lt;/code&gt;, and each &lt;code&gt;_method&lt;/code&gt; parameter of the query, in any case of its name. A value that isn&amp;rsquo;t exactly one of the proxy&amp;rsquo;s methods, trimmed, is odd: a list such as &lt;code&gt;DELETE, GET&lt;/code&gt;, which servers read apart, lower case or nothing. The proxy reads no body, so a form&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt; field is the &lt;code&gt;POST&lt;/code&gt;&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An allow, and a binding,&lt;/strong&gt; match strictly: the request&amp;rsquo;s method, and every method it names besides, as written, must be among the rule&amp;rsquo;s methods, with none odd, and its path must be plain and match the pattern in its own case. A request the matcher can&amp;rsquo;t judge alike for every server is never allowed by a rule with a path.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A deny&lt;/strong&gt; matches broadly: the method, or any method the request names besides, every word of a list among them, in any case, or any odd one; and the path in any case, any path that isn&amp;rsquo;t plain, the path above a pattern that ends with &lt;code&gt;/&lt;/code&gt; or &lt;code&gt;/**&lt;/code&gt;, the path with its last segment cut at its first &lt;code&gt;.&lt;/code&gt;, which frameworks that take a format from a suffix (Rails, Spring) route to the same handler, and the path with each segment&amp;rsquo;s trailing dots dropped, as servers that drop a trailing dot read it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A query servers read apart:&lt;/strong&gt; while a rule narrows the host by method, a query with a &lt;code&gt;;&lt;/code&gt;, which some servers split pairs at and Go&amp;rsquo;s query parser skips the pair around, or with an escape that doesn&amp;rsquo;t decode, which Go&amp;rsquo;s parser drops, is odd, so a &lt;code&gt;_method&lt;/code&gt; hidden in it can&amp;rsquo;t pass.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In a user&amp;rsquo;s terms, the methods a request names work like this. Some servers take a request&amp;rsquo;s method from a header or a parameter instead of the request itself, so the proxy judges a request by every method it names. It reads the &lt;code&gt;X-HTTP-Method-Override&lt;/code&gt; and &lt;code&gt;X-HTTP-Method&lt;/code&gt; headers and every header with &lt;code&gt;method-override&lt;/code&gt; in its name, in any case and with &lt;code&gt;_&lt;/code&gt; for &lt;code&gt;-&lt;/code&gt;, as some servers read &lt;code&gt;X_HTTP_METHOD_OVERRIDE&lt;/code&gt;, and the &lt;code&gt;_method&lt;/code&gt; parameter of the query. While a rule by method covers a host, a request there whose header or parameter isn&amp;rsquo;t exactly one of those methods in capitals, such as &lt;code&gt;DELETE, GET&lt;/code&gt;, &lt;code&gt;delete&lt;/code&gt; or nothing at all, is refused, because servers could read it either way, and so is a request whose query has a &lt;code&gt;;&lt;/code&gt; in it, which some servers split the query at, or a query with an escape that doesn&amp;rsquo;t decode. Otherwise an allow needs the request&amp;rsquo;s own method and every one it names to be among its methods, so an allow of &lt;code&gt;GET&lt;/code&gt; refuses a &lt;code&gt;GET&lt;/code&gt; that says it&amp;rsquo;s a &lt;code&gt;DELETE&lt;/code&gt;, and a deny refuses a request that names any of its methods. The proxy doesn&amp;rsquo;t read a request&amp;rsquo;s body, so a &lt;code&gt;_method&lt;/code&gt; field in a form that a &lt;code&gt;POST&lt;/code&gt; sends, which some frameworks take as the method, is judged as the &lt;code&gt;POST&lt;/code&gt; it is: a deny of &lt;code&gt;POST&lt;/code&gt; refuses it, and an allow of &lt;code&gt;POST&lt;/code&gt; lets it through whatever the field says.&lt;/p&gt;
&lt;p&gt;Paths work like this. Servers don&amp;rsquo;t all read a request&amp;rsquo;s path alike, so a rule&amp;rsquo;s path matches only a path that every server reads the same way: one with nothing percent-encoded, no &lt;code&gt;\&lt;/code&gt; or &lt;code&gt;;&lt;/code&gt;, no &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;..&lt;/code&gt; part and no doubled slash. An allow matches exactly, its method and its path in their own case, and no path in any other form. A deny matches broadly instead. It matches in any case and every path that isn&amp;rsquo;t in that plain form, a deny whose path ends with &lt;code&gt;/&lt;/code&gt; also matches the path above it, a path&amp;rsquo;s last segment matches with what follows its first &lt;code&gt;.&lt;/code&gt; cut off too, as frameworks that take a format from a suffix route &lt;code&gt;/admin.json&lt;/code&gt; to &lt;code&gt;/admin&lt;/code&gt;, and every segment matches with its trailing dots dropped, as some servers drop them, so a deny of &lt;code&gt;/config.json&lt;/code&gt; refuses &lt;code&gt;/config.json.&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Judging a request costs the policy files&amp;rsquo; stat, which every connection already has, and a scan of the host&amp;rsquo;s rules. Decrypting the tunnel costs a TLS handshake with a certificate from the VM&amp;rsquo;s CA, which the proxy keeps for the 1024 hosts it used most recently, and another to the host, so the proxy decrypts only the hosts whose rules need it: a host that a whole allow covers, with no deny that narrows, stays a tunnel that the proxy doesn&amp;rsquo;t read.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-vms-setup"&gt;The VM&amp;rsquo;s setup&lt;span class="hx:absolute hx:-mt-20" id="the-vms-setup"&gt;&lt;/span&gt;
&lt;a href="#the-vms-setup" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On every launch, the VM&amp;rsquo;s setup does the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It installs the VM&amp;rsquo;s own CA and the next one into the VM&amp;rsquo;s trust store, as &lt;code&gt;devvm-proxy.crt&lt;/code&gt; and &lt;code&gt;devvm-proxy-next.crt&lt;/code&gt;, so the proxy&amp;rsquo;s certificates for hosts with a bound secret verify, in this VM only. It never gets their keys.&lt;/li&gt;
&lt;li&gt;It points the programs that ignore the proxy variables at the proxy. Those are apt, sudo (which keeps the variables), every ssh connection, Docker&amp;rsquo;s daemon and containers with the &lt;a href="https://next.devvm.dev/docs/using/images/#docker"&gt;docker layer&lt;/a&gt;, and Nix&amp;rsquo;s daemon with the &lt;a href="https://next.devvm.dev/docs/internals/images/#the-nix-layer"&gt;nix layer&lt;/a&gt;. Under systemd, each daemon gets a drop-in, &lt;code&gt;devvm-proxy.conf&lt;/code&gt;, that holds the VM&amp;rsquo;s own proxy address and nothing else, and without systemd, Docker&amp;rsquo;s settings in &lt;code&gt;/etc/conf.d/docker&lt;/code&gt; get a block instead, and Nix&amp;rsquo;s daemon gets &lt;code&gt;/etc/conf.d/nix-daemon&lt;/code&gt;. Every VM has a proxy, an open one&amp;rsquo;s included, so every VM gets them, and the setup restarts a daemon whose settings changed. An ssh connection gets a &lt;code&gt;ProxyCommand&lt;/code&gt; that tunnels through the proxy, and the proxy checks its host and port against the allowlist.&lt;/li&gt;
&lt;li&gt;It writes &lt;code&gt;devvm-local-proxy&lt;/code&gt;, a proxy on the VM&amp;rsquo;s loopback that adds the VM&amp;rsquo;s password to each request, for browsers, which ask for a proxy&amp;rsquo;s password rather than take it from the proxy variables. The desktop layer starts it and points the desktop&amp;rsquo;s session at it (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#the-local-proxy"&gt;the local proxy&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;With the nix layer, it points Nix at the &lt;a href="#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt; first: &lt;code&gt;/etc/nix/devvm-cache.conf&lt;/code&gt;, which &lt;code&gt;/etc/nix/nix.conf&lt;/code&gt; includes with &lt;code&gt;!include&lt;/code&gt;, sets &lt;code&gt;substituters = http://devvm.proxy/nix https://cache.nixos.org&lt;/code&gt;. Every VM gets that file, an open one&amp;rsquo;s included, and the setup restarts Nix&amp;rsquo;s daemon when the file changed.&lt;/li&gt;
&lt;li&gt;It sets &lt;code&gt;NO_PROXY&lt;/code&gt; and &lt;code&gt;no_proxy&lt;/code&gt; to the VM itself, &lt;code&gt;localhost,127.0.0.1,::1&lt;/code&gt;, in the daemons&amp;rsquo; settings above and in Docker&amp;rsquo;s client settings (&lt;code&gt;~/.docker/config.json&lt;/code&gt;), as the VM&amp;rsquo;s backend does in the environment it sets at each start. The VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;links&lt;/a&gt; aren&amp;rsquo;t in it, because HTTP clients reach them &lt;a href="#links-through-the-proxy"&gt;through the proxy&lt;/a&gt;, so a change of links changes no daemon&amp;rsquo;s settings and restarts nothing.&lt;/li&gt;
&lt;li&gt;It puts the VM&amp;rsquo;s placeholders in &lt;code&gt;~/.config/devvm/env&lt;/code&gt;, which login shells read, as &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt; and &lt;code&gt;GH_TOKEN&lt;/code&gt;. When &lt;code&gt;github&lt;/code&gt; is bound, it also sets up git&amp;rsquo;s credential helper for GitHub over HTTPS.&lt;/li&gt;
&lt;li&gt;It adds &lt;code&gt;devvm-why&lt;/code&gt;, the note before each prompt, and the notes for Claude Code and Codex (&lt;a href="https://next.devvm.dev/docs/safety/network/#inside-the-vm"&gt;inside the VM&lt;/a&gt;). &lt;code&gt;devvm-why&lt;/code&gt; prints the proxy&amp;rsquo;s &lt;code&gt;/blocked&lt;/code&gt;, and when that list is empty, the proxy&amp;rsquo;s answer adds that a connection refused, or a DNS error, for an allowed host comes from a tool that skipped the proxy where devvm can&amp;rsquo;t send it there, with a link to &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-tool-that-skips-the-proxy-fails"&gt;troubleshooting&lt;/a&gt;. With transparent mode, &lt;code&gt;devvm-why&lt;/code&gt; then prints &lt;code&gt;devvm-transparent status&lt;/code&gt; as root, through &lt;code&gt;sudo -n&lt;/code&gt;. The notes, a block between &lt;code&gt;&amp;lt;!-- devvm-proxy --&amp;gt;&lt;/code&gt; markers in &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; and &lt;code&gt;~/.codex/AGENTS.md&lt;/code&gt;, say to run &lt;code&gt;devvm-why&lt;/code&gt; after a connection error or a &lt;code&gt;403&lt;/code&gt; from the proxy, that a tool that ignores the proxy settings still reaches the proxy by name over HTTPS, HTTP and the ports the rules name, and that a refused connection on another port, or a DNS error, while &lt;code&gt;devvm-why&lt;/code&gt; shows nothing blocked means the tool skipped the proxy and needs its own proxy setting or &lt;code&gt;$HTTPS_PROXY&lt;/code&gt;. The setup writes them only when the VM has a proxy address, and replaces the block on every launch.&lt;/li&gt;
&lt;li&gt;On a VM that runs confined to its proxy, with transparent mode on, it sets up &lt;a href="#tools-that-skip-the-proxy"&gt;transparent mode&lt;/a&gt;, and on any other VM it takes transparent mode out.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each placeholder ends in a random value of the VM&amp;rsquo;s own, its salt, which isn&amp;rsquo;t its password.&lt;/p&gt;
&lt;h2 data-hextra-search-id="tools-that-skip-the-proxy"&gt;Tools that skip the proxy&lt;span class="hx:absolute hx:-mt-20" id="tools-that-skip-the-proxy"&gt;&lt;/span&gt;
&lt;a href="#tools-that-skip-the-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On a confined VM, transparent mode sends a tool that ignores the proxy settings to the VM&amp;rsquo;s proxy by the names it looks up (&lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;what it covers&lt;/a&gt;). Nothing new runs or listens on the host, and the backends don&amp;rsquo;t change: the VM reaches its proxy over the path its proxy settings use, and the proxy judges each connection as it judges &lt;code&gt;CONNECT host:port&lt;/code&gt;. Every piece in the VM is a program that devvm configures, dnsmasq, nftables and socat, which base installs, and one script, &lt;code&gt;devvm-transparent&lt;/code&gt;, which each launch sends. A tool that looks up &lt;code&gt;api.example.com&lt;/code&gt; and connects to it goes this way:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Its lookup reaches dnsmasq in the VM. glibc and musl both ask &lt;code&gt;127.0.0.1:53&lt;/code&gt; themselves, which is where Lima&amp;rsquo;s DNS setting for a confined VM points (&lt;a href="#the-vms-resolver"&gt;the VM&amp;rsquo;s resolver&lt;/a&gt;). An nftables rule sends &lt;code&gt;127.0.0.1:53&lt;/code&gt; to dnsmasq, which listens on the stand-in address, &lt;code&gt;198.18.0.1&lt;/code&gt;, alone. That rule takes every connection to &lt;code&gt;127.0.0.1:53&lt;/code&gt; in the VM, so a DNS server of the user&amp;rsquo;s own there, or a forward of port 53 to it, gets nothing.&lt;/li&gt;
&lt;li&gt;dnsmasq answers the A query with &lt;code&gt;198.18.0.1&lt;/code&gt;, with a time to live of 0, and every other type, AAAA and HTTPS included, with an empty answer, never &lt;code&gt;REFUSED&lt;/code&gt;, which musl waits 5 seconds on. It has no upstream server, so no query leaves the VM, and it reads &lt;code&gt;/etc/hosts&lt;/code&gt; first, so &lt;code&gt;localhost&lt;/code&gt;, the VM&amp;rsquo;s hostname, &lt;code&gt;host.lima.internal&lt;/code&gt; and the &lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;links&lt;/a&gt;&amp;rsquo; names keep their own addresses. Names under &lt;code&gt;devvm.internal&lt;/code&gt; that aren&amp;rsquo;t a link&amp;rsquo;s don&amp;rsquo;t exist, and neither does a name without a dot, nor a name under the search domains that the VM&amp;rsquo;s resolver appends to one, which Lima takes from this machine&amp;rsquo;s network and dnsmasq reads from &lt;code&gt;/etc/resolv.conf&lt;/code&gt; as it starts. So a single-label name that isn&amp;rsquo;t in &lt;code&gt;/etc/hosts&lt;/code&gt; doesn&amp;rsquo;t resolve, rather than turning into a name of this machine&amp;rsquo;s network. dnsmasq can&amp;rsquo;t tell a name the resolver made that way from one a tool names whole, so every name under those domains gets no answer, such as &lt;code&gt;git.corp.example.com&lt;/code&gt; under &lt;code&gt;corp.example.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The tool connects to &lt;code&gt;198.18.0.1:443&lt;/code&gt;. The address is on the VM&amp;rsquo;s loopback interface, so the connection stays in the VM, and an nftables rule sends it to a socat listener on &lt;code&gt;198.18.0.1:61443&lt;/code&gt;. Nothing binds port 443 or 80 itself, so your own servers keep them.&lt;/li&gt;
&lt;li&gt;socat opens an ordinary &lt;code&gt;CONNECT transparent.devvm.proxy:443&lt;/code&gt; to the VM&amp;rsquo;s proxy, with the VM&amp;rsquo;s password, which it reads from a file, never from its arguments. Each port has a listener of its own, so the port reaches the proxy in the target, and nothing the VM sends can change it.&lt;/li&gt;
&lt;li&gt;The proxy checks the password, takes one of the VM&amp;rsquo;s 1024 tunnel slots, and reads the connection&amp;rsquo;s first bytes for at most 10 seconds. A TLS record is read whole, and its ClientHello&amp;rsquo;s server name (SNI) is the host. An HTTP/1.x request line or HTTP/2&amp;rsquo;s preface makes each request&amp;rsquo;s &lt;code&gt;Host&lt;/code&gt; the host, judged on its own. Anything else is refused and logged as a refused block of &lt;code&gt;transparent.devvm.proxy&lt;/code&gt;, with why: no SNI, an address as the SNI, a name with anything but ASCII, a name under &lt;code&gt;devvm.proxy&lt;/code&gt;, or bytes that name no host, such as SSH&amp;rsquo;s, Postgres&amp;rsquo;s &lt;code&gt;SSLRequest&lt;/code&gt; or a server that speaks first.&lt;/li&gt;
&lt;li&gt;From there the connection is &lt;code&gt;CONNECT host:443&lt;/code&gt;: the links, the policy and the floor, interception for a bound host, the tunnel and its SNI check, the log, and &lt;code&gt;/blocked&lt;/code&gt;, in the order &lt;code&gt;CONNECT&lt;/code&gt; has them. The ClientHello goes on to whatever serves it first, so the far end gets it byte for byte. The proxy dials the host it judged, by name, so the VM can&amp;rsquo;t name one host and reach another. Its events carry &lt;code&gt;&amp;quot;via&amp;quot;: &amp;quot;dns&amp;quot;&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A blocked TLS host gets a TLS handshake with a certificate for its SNI name from the VM&amp;rsquo;s own CA, signed as interception signs, then the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt; text for every request on the connection, over HTTP/1.1 or HTTP/2. The proxy resolves nothing and dials nothing for it. Without a CA, or once it has ended, the connection closes, and the block is logged all the same. A plain HTTP request is always forwarded as &lt;code&gt;http://&lt;/code&gt;, whatever its request line says, so no secret goes into it, and a &lt;code&gt;Host&lt;/code&gt; that names another port than the connection&amp;rsquo;s gets &lt;code&gt;400&lt;/code&gt;, as does a &lt;code&gt;CONNECT&lt;/code&gt; inside it. A link&amp;rsquo;s name gets a refused block on both ways, because dnsmasq never gives a link&amp;rsquo;s name the stand-in address. Its name in &lt;code&gt;/etc/hosts&lt;/code&gt; reaches it. A &lt;code&gt;Host&lt;/code&gt; of &lt;code&gt;devvm.proxy&lt;/code&gt; reaches &lt;code&gt;/blocked&lt;/code&gt; alone and gets &lt;code&gt;403&lt;/code&gt; for every other endpoint, the CA, the ports and the Nix cache, because socat adds the password for any client, a container without the proxy settings included.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The ports.&lt;/strong&gt; The proxy serves the ports to redirect at &lt;code&gt;http://devvm.proxy/transparent/ports&lt;/code&gt;: 80 and 443, then each port an allow rule names for hosts by name, &lt;code&gt;**:8443&lt;/code&gt; included, the lowest first, at most 32 of them. It leaves out &lt;code&gt;:*&lt;/code&gt;, address rules&amp;rsquo; ports, 22 and 53, and every port but 80 and 443 while a deny is broken. The proxy&amp;rsquo;s own log names the ports past 32, once each time they change. &lt;code&gt;devvm-transparent&lt;/code&gt; fetches the list every 10 seconds and at each launch, and takes it only when it&amp;rsquo;s 2 to 34 ports, each once, with 80 and 443 and neither 22 nor 53. A new port gets the lowest free listener from 61100 to 61131, and a port that stays keeps its own. The list shows the VM the ports its rules name, never their hosts, which it can&amp;rsquo;t read otherwise. That&amp;rsquo;s a small disclosure, and it gives the VM nothing to reach: each connection is still judged by its own host and port.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The nftables table.&lt;/strong&gt; The table &lt;code&gt;inet devvm_transparent&lt;/code&gt; is loaded whole, in one transaction, and &lt;code&gt;devvm-transparent&lt;/code&gt; loads it again within 10 seconds when something removes it, such as &lt;code&gt;nft flush ruleset&lt;/code&gt;. Its NAT chains run at priority -110, before Docker&amp;rsquo;s at -100, and the first NAT chain that gives a connection a mapping is the only one that does, so they give every TCP and UDP port of the stand-in address one: a redirected port goes to its listener, DNS to dnsmasq, and every other port to port 61079, where nothing listens, so the kernel refuses it at once with a reset, or for UDP, QUIC included, with a port-unreachable. Docker&amp;rsquo;s chains, which would send a published port&amp;rsquo;s traffic to a container, so never see the stand-in address, and neither a VM process nor a container that connects to &lt;code&gt;db.example.com:5432&lt;/code&gt; reaches a container that publishes 5432. The refused connections are logged in the kernel&amp;rsquo;s log, five a second at most, which &lt;code&gt;devvm-transparent status&lt;/code&gt; reads. DNS to any public server goes to dnsmasq too, from the VM and from Docker&amp;rsquo;s bridges (&lt;code&gt;docker0&lt;/code&gt; and &lt;code&gt;br-*&lt;/code&gt;), so Docker&amp;rsquo;s fallback servers, &lt;code&gt;8.8.8.8&lt;/code&gt; and &lt;code&gt;8.8.4.4&lt;/code&gt;, and resolvers that tools hard-code reach it. So does DNS to the VM&amp;rsquo;s own name servers but loopback&amp;rsquo;s, as &lt;code&gt;/etc/resolv.conf&lt;/code&gt; and systemd-resolved&amp;rsquo;s list name them, such as the one Lima&amp;rsquo;s DHCP adds beside &lt;code&gt;127.0.0.1&lt;/code&gt;, which Docker gives its containers once it drops the loopback one; &lt;code&gt;devvm-transparent&lt;/code&gt; reads them again every 10 seconds. Other loopback addresses, private, link-local and CGNAT ones are left alone, so a DNS server on a container&amp;rsquo;s or the LAN&amp;rsquo;s address still answers, and Lima&amp;rsquo;s DNS addresses that aren&amp;rsquo;t the VM&amp;rsquo;s name servers answer nothing, as the host&amp;rsquo;s confinement has it. Two filter chains run before every NAT chain, at priority -150: one drops traffic to the stand-in address from any interface but the loopback and Docker&amp;rsquo;s bridges, such as Podman&amp;rsquo;s or LXD&amp;rsquo;s bridges and Lima&amp;rsquo;s network, and both drop anything to it but TCP, UDP and ICMP, such as SCTP, which no NAT rule maps. So neither reaches Docker&amp;rsquo;s DNAT of a published port through the stand-in address. An input rule keeps the same interfaces off it again, and only connections the NAT rules translated, and DNS, reach it. The listeners&amp;rsquo; ports, 61080, 61443 and 61100 to 61131, and the dead port, 61079, are above Linux&amp;rsquo;s range for outgoing connections, 32768 to 60999, so no connection out is given one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The service.&lt;/strong&gt; &lt;code&gt;devvm-transparent run&lt;/code&gt; is the service, under systemd or OpenRC, as root: it adds &lt;code&gt;198.18.0.1/32&lt;/code&gt; to &lt;code&gt;lo&lt;/code&gt;, loads the table, starts dnsmasq and a socat listener for each port, and then restarts any of them that ends within a second, sends dnsmasq &lt;code&gt;SIGHUP&lt;/code&gt; when &lt;code&gt;/etc/hosts&lt;/code&gt; changes, and fetches the ports every tenth second. dnsmasq runs as the user &lt;code&gt;devvm-transparent&lt;/code&gt;, and so does each socat connection&amp;rsquo;s process, which reads the password file through its group. When the service stops, it removes the table, the address and what it started, so names stop resolving, and a stopped or broken service never leaves a way out. It starts at each boot, before any launch, with the last ports and settings, and each launch&amp;rsquo;s setup turns it on, off, or restarts it when its settings changed, such as a new proxy port or password. Its files are root&amp;rsquo;s, in &lt;code&gt;/etc/devvm/transparent&lt;/code&gt;, and the VM&amp;rsquo;s password, which every program in the VM has in its environment already, is in files only, never in a process&amp;rsquo;s arguments. On an open VM, and with transparent mode off, the setup stops and removes all of it, and flushes systemd-resolved&amp;rsquo;s cache. The setup decides by the confinement the VM runs with, so a VM whose tier changed into or out of open keeps what it had until its next start.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What doesn&amp;rsquo;t change.&lt;/strong&gt; The host&amp;rsquo;s confinement is the boundary: root in the VM can change or stop all of this, and then names stop resolving, or a query to Lima&amp;rsquo;s DNS goes nowhere, as for a VM without transparent mode. The &lt;a href="#the-self-check"&gt;self-check&lt;/a&gt;&amp;rsquo;s direct connection is to an address on port 443, so transparent mode never answers it. The VM&amp;rsquo;s names never reach the host&amp;rsquo;s resolver for a blocked host, because the proxy asks the policy before it resolves anything. &lt;a href="https://next.devvm.dev/docs/contributing/design/#transparent-mode"&gt;Design notes&lt;/a&gt; has the threat check.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-vms-resolver"&gt;The VM&amp;rsquo;s resolver&lt;span class="hx:absolute hx:-mt-20" id="the-vms-resolver"&gt;&lt;/span&gt;
&lt;a href="#the-vms-resolver" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On a confined VM, Lima&amp;rsquo;s DNS setting gives the guest one name server, its own &lt;code&gt;127.0.0.1&lt;/code&gt;, and each launch&amp;rsquo;s setup makes the system&amp;rsquo;s resolver ask it directly. systemd-resolved&amp;rsquo;s stub, &lt;code&gt;127.0.0.53&lt;/code&gt;, would ask &lt;code&gt;127.0.0.1&lt;/code&gt; in turn, and when nothing listens there, because transparent mode is off or stopped, the stub can keep retrying it over UDP and TCP without answering, so a lookup through glibc waits out its own timeout instead of failing. So the setup replaces &lt;code&gt;/etc/resolv.conf&lt;/code&gt;, which on Ubuntu is a link to the stub&amp;rsquo;s file, with a file of its own that names &lt;code&gt;127.0.0.1&lt;/code&gt; alone, with the stub&amp;rsquo;s search line and a timeout of one second, tried twice, which is plenty because dnsmasq answers in the VM itself. glibc then gets a refusal at once when nothing listens, and dnsmasq&amp;rsquo;s answer through the nftables rule when transparent mode runs, as musl on Alpine does.&lt;/p&gt;
&lt;p&gt;systemd-resolved still runs, so &lt;code&gt;resolvectl&lt;/code&gt; and the programs that ask it over D-Bus still go through it. Docker reads &lt;code&gt;/etc/resolv.conf&lt;/code&gt; and finds only a loopback server there, so on its default bridge it gives containers its fallback servers, and on a network of their own, such as Compose&amp;rsquo;s, its embedded DNS server asks &lt;code&gt;127.0.0.1&lt;/code&gt; from the VM&amp;rsquo;s side. The nftables table sends both to dnsmasq. The setup writes its file only on a guest with systemd that has the stub&amp;rsquo;s file and whose &lt;code&gt;/etc/resolv.conf&lt;/code&gt; is the stub&amp;rsquo;s link or the setup&amp;rsquo;s own file, so a file or link of your own stays, and it copies the search line again at each launch. When it can&amp;rsquo;t write the file, it says so in one line and the launch goes on. systemd-resolved reads a file that isn&amp;rsquo;t its own link as servers and search domains of its own, so while the VM is confined it takes &lt;code&gt;127.0.0.1&lt;/code&gt; from the setup&amp;rsquo;s file, and a search line of &lt;code&gt;.&lt;/code&gt; sends every name there. It keeps them after the file is a link again, until it restarts. So on an open VM, the setup puts the stub&amp;rsquo;s link back and restarts systemd-resolved, which then asks Lima&amp;rsquo;s DNS. Going back needs only the setup&amp;rsquo;s own file, which it writes nowhere else, and when the stub&amp;rsquo;s file is missing afterwards, the setup says that names may not resolve.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-shared-nix-cache"&gt;The shared Nix cache&lt;span class="hx:absolute hx:-mt-20" id="the-shared-nix-cache"&gt;&lt;/span&gt;
&lt;a href="#the-shared-nix-cache" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;VMs with the &lt;a href="https://next.devvm.dev/docs/internals/images/#the-nix-layer"&gt;nix layer&lt;/a&gt; share their downloads from Nix&amp;rsquo;s binary cache, so each package comes from cache.nixos.org once per machine instead of once per VM. Each VM keeps its own Nix store and daemon, and only the host writes the cache, so no VM can change what another VM gets. The &lt;a href="https://next.devvm.dev/docs/contributing/design/#the-shared-nix-cache"&gt;design note&lt;/a&gt; says why it&amp;rsquo;s a cache that the host fills rather than a shared store.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In the VM.&lt;/strong&gt; devvm starts the VM&amp;rsquo;s proxy with &lt;code&gt;nix_cache&lt;/code&gt; set to &lt;code&gt;~/.local/share/devvm/cache/nix-cache&lt;/code&gt; in its config when the VM&amp;rsquo;s image has the nix layer, and the VM&amp;rsquo;s setup puts &lt;code&gt;http://devvm.proxy/nix&lt;/code&gt; before &lt;code&gt;https://cache.nixos.org&lt;/code&gt; in Nix&amp;rsquo;s &lt;code&gt;substituters&lt;/code&gt; (&lt;a href="#the-vms-setup"&gt;the VM&amp;rsquo;s setup&lt;/a&gt;). It leaves &lt;code&gt;trusted-public-keys&lt;/code&gt; as Nix has it, which is cache.nixos.org&amp;rsquo;s key alone. Nix&amp;rsquo;s daemon reaches &lt;code&gt;devvm.proxy&lt;/code&gt; through its own proxy settings, so its requests are absolute-form &lt;code&gt;GET&lt;/code&gt;s with the VM&amp;rsquo;s password, and the proxy answers them itself, as it does &lt;code&gt;/blocked&lt;/code&gt; and &lt;code&gt;/ca.pem&lt;/code&gt;, and never forwards them. When the cache answers with anything but a file, Nix goes on to cache.nixos.org, through the proxy as any other download.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What a VM can ask for.&lt;/strong&gt; The proxy takes only &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;HEAD&lt;/code&gt; requests with no query, for three kinds of path under &lt;code&gt;/nix/&lt;/code&gt;. These are &lt;code&gt;nix-cache-info&lt;/code&gt;, a narinfo named &lt;code&gt;&amp;lt;hash&amp;gt;.narinfo&lt;/code&gt; with a 32-character hash in Nix&amp;rsquo;s base 32, and a NAR named &lt;code&gt;nar/&amp;lt;hash&amp;gt;.nar&lt;/code&gt; with a 52-character hash and no suffix or &lt;code&gt;.xz&lt;/code&gt;, &lt;code&gt;.zst&lt;/code&gt; or &lt;code&gt;.bz2&lt;/code&gt;. Anything else gets &lt;code&gt;400&lt;/code&gt;. The proxy makes up &lt;code&gt;nix-cache-info&lt;/code&gt; itself, with priority 30, so Nix asks the cache before cache.nixos.org, whose priority is 40. It serves the other files from the folder, or fetches them from &lt;code&gt;https://cache.nixos.org&lt;/code&gt; when the VM&amp;rsquo;s policy allows &lt;code&gt;cache.nixos.org:443&lt;/code&gt; and, when &lt;a href="#requests-by-method-and-path"&gt;rules by method and path&lt;/a&gt; narrow that host, a &lt;code&gt;GET&lt;/code&gt; of the file&amp;rsquo;s path there. That&amp;rsquo;s the only host it fetches from, and its fetches go through the same address floor and company proxy as the VM&amp;rsquo;s own requests. It follows no redirect, and nothing of the VM&amp;rsquo;s request goes with it, so nothing a VM sends is ever stored.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the host checks.&lt;/strong&gt; Before it keeps a narinfo, the proxy checks that its &lt;code&gt;StorePath&lt;/code&gt; is the path the VM asked for, and that &lt;code&gt;cache.nixos.org-1&lt;/code&gt;, whose Ed25519 key devvm pins, signed its fingerprint, &lt;code&gt;1;StorePath;NarHash;NarSize;References&lt;/code&gt;. The signature doesn&amp;rsquo;t cover the NAR&amp;rsquo;s URL, so the proxy also checks that the URL is named by the narinfo&amp;rsquo;s own &lt;code&gt;NarHash&lt;/code&gt; or &lt;code&gt;FileHash&lt;/code&gt;, and no narinfo can put a file in another NAR&amp;rsquo;s place. It fetches a NAR only after it checked a narinfo that names it, never for a &lt;code&gt;HEAD&lt;/code&gt;, and it keeps the NAR only when its SHA-256 and size are that narinfo&amp;rsquo;s &lt;code&gt;FileHash&lt;/code&gt; and &lt;code&gt;FileSize&lt;/code&gt;. The host can&amp;rsquo;t check a NAR&amp;rsquo;s &lt;code&gt;NarHash&lt;/code&gt;, which is the hash of the archive before compression, because the proxy uses Go&amp;rsquo;s standard library alone, and that has no xz or zstd. Each VM&amp;rsquo;s Nix checks the signature and the &lt;code&gt;NarHash&lt;/code&gt; again, so a narinfo with an added reference, or a corrupted NAR, fails there too. A file that fails a check, a not-found and an error all get &lt;code&gt;404&lt;/code&gt;, and the proxy keeps nothing of them, so Nix goes to cache.nixos.org itself.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The folder and its cap.&lt;/strong&gt; The proxy writes each file whole into a temporary file in the folder, then renames it into place, mode 600 in folders of 700. The cache&amp;rsquo;s cap is the &lt;code&gt;nix-cache.size&lt;/code&gt; &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention setting&lt;/a&gt;, 10 GiB when it&amp;rsquo;s off, which devvm puts in the proxy&amp;rsquo;s config as &lt;code&gt;nix_cache_max&lt;/code&gt; when the proxy starts. The cap counts the disk each file takes, in whole blocks, and a NAR being fetched counts at its full size from the start. When a new file would take the cache past its cap, the proxy deletes the least recently used files, down to nine tenths of the cap, and when the NARs being fetched leave no room, it refuses the fetch. One proxy fetches each NAR once, however many requests ask for it, and at most four at once. A request that missed the cache looks again once it&amp;rsquo;s its turn to fetch, so a fetch that ended in between is served from the cache, not downloaded and counted against the cap a second time. A hit marks a file used by setting its modification time. Every VM&amp;rsquo;s proxy and devvm gc take one lock on the folder before they change it, so the cap holds while many VMs fill it, and a running total in the folder saves counting it for each file. Each tries the lock without waiting, again and again for at most 5 seconds, because a proxy&amp;rsquo;s child that a VM took over could hold it for ever. Past that, the request gets &lt;code&gt;404&lt;/code&gt;, so Nix goes to cache.nixos.org itself, and devvm gc skips the trim and says so (&lt;code&gt;nix_cache_locked&lt;/code&gt;). devvm gc and the daily retention run also trim the cache to its cap, and &lt;code&gt;devvm gc --nix-cache&lt;/code&gt; empties it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What a child could leave there.&lt;/strong&gt; A VM&amp;rsquo;s proxy&amp;rsquo;s child writes the cache, so devvm reads it as it reads a file a VM can write. Its trim and its count of the cache open the folder as a root that no link leads out of, take &lt;code&gt;nar/&lt;/code&gt; only when it&amp;rsquo;s a folder and never a link, count and delete only regular files, and delete a link as itself, never what it leads to, so a link a child leaves never leads devvm to your files. Each proxy makes &lt;code&gt;nar/&lt;/code&gt; and sets the cache&amp;rsquo;s folders to yours alone through the folders it opened, never by their paths. The proxy deletes anything at &lt;code&gt;nar/&lt;/code&gt; that isn&amp;rsquo;t a folder, such as a link, as itself, makes a folder in its place and warns of it in its log, so its change of mode never reaches a folder of yours. Every proxy reads a cached file only when it&amp;rsquo;s a regular file, never through a link and without waiting on a FIFO, and takes the lock only on a regular file with one link.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Logs.&lt;/strong&gt; Each request is a &lt;code&gt;nix-cache&lt;/code&gt; event in the VM&amp;rsquo;s own &lt;a href="#log-files"&gt;log&lt;/a&gt;, with its path and what came of it: &lt;code&gt;hit&lt;/code&gt;, &lt;code&gt;fetched&lt;/code&gt;, or why it wasn&amp;rsquo;t found or was refused. &lt;code&gt;devvm network log&lt;/code&gt; shows these as &lt;code&gt;cache&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Open VMs&lt;/strong&gt; have their proxy too, so they share the cache. An open proxy allows cache.nixos.org as it allows every host.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What stays open.&lt;/strong&gt; What one VM can learn of another through the cache, and how it can push other VMs&amp;rsquo; files out, is under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;Attack vectors&lt;/a&gt;. Private caches, such as Cachix or one behind a &lt;code&gt;netrc&lt;/code&gt;, are never shared, because only root in a VM can add a substituter, and Nix reaches it directly through the proxy&amp;rsquo;s allowlist.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-companys-ca"&gt;A company&amp;rsquo;s CA&lt;span class="hx:absolute hx:-mt-20" id="a-companys-ca"&gt;&lt;/span&gt;
&lt;a href="#a-companys-ca" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The CA certificates in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt;) reach every project VM, whatever its tier, and the VM&amp;rsquo;s proxy. Builds trust them too, as &lt;a href="https://next.devvm.dev/docs/internals/images/#a-companys-ca-in-builds"&gt;Images and caching&lt;/a&gt; describes, and so does the mise that resolves the shared tools&amp;rsquo; versions on this machine, which on macOS trusts them for every connection but its Sigstore client&amp;rsquo;s, as the host&amp;rsquo;s mise below explains.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reading them.&lt;/strong&gt; devvm reads the folder&amp;rsquo;s &lt;code&gt;*.pem&lt;/code&gt; and &lt;code&gt;*.crt&lt;/code&gt; files at each launch, each build, each proxy start and each run of the host&amp;rsquo;s mise, and nothing outside the folder. It looks at the folder and each of those files itself, never at what a link leads to, and follows no link: a folder that is a link fails with &lt;code&gt;ca_folder_link&lt;/code&gt;, and a file that is one, dangling or not, with &lt;code&gt;ca_link&lt;/code&gt;. A link into a project folder would otherwise let that project&amp;rsquo;s VM write the CA that every VM, build and proxy trusts. A file or folder that it can&amp;rsquo;t read fails with &lt;code&gt;ca_unreadable&lt;/code&gt; or &lt;code&gt;ca_folder_unreadable&lt;/code&gt;, which name it and carry the error. It decodes every PEM block and refuses a block that isn&amp;rsquo;t &lt;code&gt;CERTIFICATE&lt;/code&gt; (&lt;code&gt;ca_not_certificate&lt;/code&gt;), a certificate that &lt;code&gt;crypto/x509&lt;/code&gt; can&amp;rsquo;t parse (&lt;code&gt;ca_invalid&lt;/code&gt;) and a certificate without CA basic constraints (&lt;code&gt;ca_not_ca&lt;/code&gt;). It also refuses a file with no certificate in it. It tells a private key apart by its PEM type, not by the file&amp;rsquo;s name, and a refusal fails the whole launch or build. What leaves the host is each certificate encoded again from its parsed bytes, once each, so the text around a block never does.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Installing them.&lt;/strong&gt; devvm&amp;rsquo;s guest script &lt;code&gt;ca.sh DIR&lt;/code&gt; runs as root and makes devvm&amp;rsquo;s CAs in &lt;code&gt;/usr/local/share/ca-certificates&lt;/code&gt; exactly DIR&amp;rsquo;s &lt;code&gt;devvm-*.crt&lt;/code&gt; files: the VM&amp;rsquo;s own CA and its next one, &lt;code&gt;devvm-proxy.crt&lt;/code&gt; and &lt;code&gt;devvm-proxy-next.crt&lt;/code&gt;, and the user&amp;rsquo;s &lt;code&gt;devvm-extra-N.crt&lt;/code&gt;. When anything changed, it runs &lt;code&gt;update-ca-certificates --fresh&lt;/code&gt;, so a CA that went leaves neither the bundle nor its hashed link. &lt;code&gt;update-ca-certificates&lt;/code&gt; tells the hooks in &lt;code&gt;/etc/ca-certificates/update.d&lt;/code&gt; only about the CAs it links, never about a file that was deleted, so &lt;code&gt;ca.sh&lt;/code&gt; tells them itself. It runs each hook that &lt;code&gt;run-parts&lt;/code&gt; would run, with a &lt;code&gt;-/etc/ssl/certs/NAME.pem&lt;/code&gt; line on its input for each CA it removed, as Debian&amp;rsquo;s &lt;code&gt;update-ca-certificates&lt;/code&gt; does for a CA it deselects. That way Java&amp;rsquo;s &lt;code&gt;cacerts&lt;/code&gt; (ca-certificates-java&amp;rsquo;s &lt;code&gt;jks-keystore&lt;/code&gt; hook) and Mono&amp;rsquo;s store drop a removed CA, in a project VM and in an image whose layer installed Java. A hook that rebuilds its store from the bundle ignores that input. A hook that fails stops nothing, and &lt;code&gt;ca.sh&lt;/code&gt; says so in the run log. It also writes them all to &lt;code&gt;/etc/ssl/devvm.pem&lt;/code&gt;, for Node. In a system without &lt;code&gt;update-ca-certificates&lt;/code&gt;, such as a container image before its &lt;code&gt;ca-certificates&lt;/code&gt; package, it adds them to &lt;code&gt;/etc/ssl/certs/ca-certificates.crt&lt;/code&gt; itself. It keeps the bundle as it was in &lt;code&gt;/var/lib/devvm-ca&lt;/code&gt;, or a mark that there was none, and puts it back once they go, and a package that arrives in between makes the bundle again from the same folder. Run without DIR, &lt;code&gt;ca.sh&lt;/code&gt; removes every one of devvm&amp;rsquo;s files. Its unit tests run it in a folder that stands for &lt;code&gt;/&lt;/code&gt; (&lt;code&gt;DEVVM_CA_ROOT&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Project VMs.&lt;/strong&gt; The setup that devvm sends at each launch carries &lt;code&gt;ca.sh&lt;/code&gt; and the certificates in &lt;code&gt;ca/&lt;/code&gt;, and &lt;code&gt;sync.sh&lt;/code&gt; runs it, so a change applies at the next launch and a running VM needs no restart. Every project VM starts with the CAs&amp;rsquo; variables below in its environment, whatever its tier and whether there are CAs or not, so adding a CA changes nothing that its backend sets at a start. On Lima, the clone that makes the VM sets the environment too, and the VM&amp;rsquo;s first start adds its proxy&amp;rsquo;s address to it in the one edit before its first boot. The variables are &lt;code&gt;NODE_EXTRA_CA_CERTS=/etc/ssl/devvm.pem&lt;/code&gt;, which is empty when there are none (Node warns only about a missing file), &lt;code&gt;SSL_CERT_FILE&lt;/code&gt;, &lt;code&gt;REQUESTS_CA_BUNDLE&lt;/code&gt; and &lt;code&gt;PIP_CERT&lt;/code&gt;, set to the system&amp;rsquo;s bundle, and &lt;code&gt;UV_SYSTEM_CERTS=1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The proxy.&lt;/strong&gt; As devvm readies a VM&amp;rsquo;s proxy, it reads the folder too, and writes the bundle into the proxy&amp;rsquo;s config, &lt;code&gt;proxy.json&lt;/code&gt; in the VM&amp;rsquo;s run folder, as &lt;code&gt;upstream_cas&lt;/code&gt;, which the proxy adds to the system&amp;rsquo;s roots for its own TLS connections. Each secret lookup&amp;rsquo;s context carries those roots, and an agent&amp;rsquo;s OAuth refresh on the host takes them from there and sets them on its client, so it goes through a company proxy that inspects TLS as the VM&amp;rsquo;s own requests do. devvm&amp;rsquo;s other host requests, such as registry digests and Ubuntu&amp;rsquo;s image check, use the host&amp;rsquo;s own store, as the host&amp;rsquo;s other programs do. A VM can&amp;rsquo;t change that file or the folder, so the proxy&amp;rsquo;s roots grow only by what you put there. A proxy whose bundle differs from the folder&amp;rsquo;s starts again, as one whose CA was replaced does.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The host&amp;rsquo;s mise.&lt;/strong&gt; The client that downloads devvm&amp;rsquo;s own mise adds the folder&amp;rsquo;s CAs to the system&amp;rsquo;s roots, and a download whose server&amp;rsquo;s certificate it still doesn&amp;rsquo;t trust fails with &lt;code&gt;tools_untrusted&lt;/code&gt;, in place of &lt;code&gt;mise_download_failed&lt;/code&gt;. That mise, a release build, uses rustls with the platform&amp;rsquo;s verifier, so it trusts the system&amp;rsquo;s roots, and it falls back to Mozilla&amp;rsquo;s own only when none load. On Linux it reads the system&amp;rsquo;s roots from files, as OpenSSL does. When the environment sets neither &lt;code&gt;SSL_CERT_FILE&lt;/code&gt; nor &lt;code&gt;SSL_CERT_DIR&lt;/code&gt;, it reads the first bundle it finds, such as &lt;code&gt;/etc/ssl/certs/ca-certificates.crt&lt;/code&gt;, and the folders &lt;code&gt;/etc/ssl/certs&lt;/code&gt; and &lt;code&gt;/etc/pki/tls/certs&lt;/code&gt;, and otherwise it reads only what they name. On macOS it asks Security.framework, which trusts what the Keychain trusts and reads no variable. With CAs in the folder, each run of mise gets them in its temporary folder, and &lt;code&gt;MISE_EXTRA_CA_CERTS&lt;/code&gt; names them, which mise adds to its roots on both systems. mise&amp;rsquo;s Sigstore client, which fetches the trust root (&lt;code&gt;tuf-repo-cdn.sigstore.dev&lt;/code&gt;) that its lock-time provenance checks need, ignores that setting, so on Linux devvm also writes a bundle of the system&amp;rsquo;s bundle and the folder&amp;rsquo;s CAs, and &lt;code&gt;SSL_CERT_FILE&lt;/code&gt; names it, which every client in mise reads. The system&amp;rsquo;s bundle is the file that &lt;code&gt;SSL_CERT_FILE&lt;/code&gt; names when devvm&amp;rsquo;s environment sets it. When devvm&amp;rsquo;s environment sets neither variable, &lt;code&gt;SSL_CERT_DIR&lt;/code&gt; names the system&amp;rsquo;s folders, so mise still reads them. Otherwise mise reads the folders that devvm&amp;rsquo;s environment names, and none when it sets only &lt;code&gt;SSL_CERT_FILE&lt;/code&gt;, so a bundle of your own keeps mise to the CAs that you chose and the folder&amp;rsquo;s. On macOS nothing but the Keychain reaches that client, so a CA that a proxy signs that host with has to be trusted there. Each run of mise also logs to a file in its folder (&lt;code&gt;MISE_LOG_FILE&lt;/code&gt;). When a failed resolve&amp;rsquo;s log has rustls&amp;rsquo;s &lt;code&gt;invalid peer certificate&lt;/code&gt;, devvm fails with &lt;code&gt;tools_untrusted&lt;/code&gt;, which names the folder, in place of &lt;code&gt;tools_resolve_failed&lt;/code&gt; or &lt;code&gt;tools_need_resolve&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks:&lt;/strong&gt; in &lt;code&gt;project&lt;/code&gt;, a VM trusts a test CA from its next launch (&lt;code&gt;openssl verify&lt;/code&gt; against the system&amp;rsquo;s bundle, and curl reaching an HTTPS server on the host that the CA signed), has the variables, fails its launch on a file that isn&amp;rsquo;t a certificate, and trusts the CA no more once the folder is emptied; in &lt;code&gt;tools&lt;/code&gt;, Node fetches from that server.&lt;/p&gt;
&lt;h2 data-hextra-search-id="secrets"&gt;Secrets&lt;span class="hx:absolute hx:-mt-20" id="secrets"&gt;&lt;/span&gt;
&lt;a href="#secrets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/safety/network/#secrets"&gt;Secrets&lt;/a&gt; lists each secret with its hosts and header. This section describes where devvm keeps them and how the proxy puts them into requests.&lt;/p&gt;
&lt;h3 data-hextra-search-id="where-secrets-are-saved"&gt;Where secrets are saved&lt;span class="hx:absolute hx:-mt-20" id="where-secrets-are-saved"&gt;&lt;/span&gt;
&lt;a href="#where-secrets-are-saved" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On macOS, devvm saves a secret in the Keychain, under the service &lt;code&gt;devvm&lt;/code&gt; and the account that is the secret&amp;rsquo;s name, such as &lt;code&gt;claude&lt;/code&gt;, &lt;code&gt;github&lt;/code&gt; or &lt;code&gt;stripe&lt;/code&gt;. It saves it through &lt;code&gt;security -i&lt;/code&gt;, giving the value on its input, so the value is in no process&amp;rsquo;s arguments. &lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt; names another service, made of letters, digits, &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt; and &lt;code&gt;-&lt;/code&gt; only. On other systems, devvm saves a secret in &lt;code&gt;~/.local/share/devvm/secrets/&amp;lt;name&amp;gt;&lt;/code&gt;, a file only you can read.&lt;/p&gt;
&lt;p&gt;A &lt;a href="https://next.devvm.dev/docs/safety/network/#your-own-secrets"&gt;secret of your own&lt;/a&gt; keeps its value under &lt;code&gt;custom.&amp;lt;name&amp;gt;&lt;/code&gt;, as its Keychain account or its file&amp;rsquo;s name, which no known secret&amp;rsquo;s name can be, so a known secret that devvm adds later never finds a value of yours. Its definition is in &lt;code&gt;~/.local/share/devvm/custom-secrets.json&lt;/code&gt;: its name, an ID of 16 random bytes made as it&amp;rsquo;s first saved, its hosts, header, variable, prefix, scheme, path, methods and whether it may be Basic&amp;rsquo;s username, as one JSON object of &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt;, written whole and mode 600, and never its value. A path that devvm writes there has &lt;code&gt;&amp;quot;path_pattern&amp;quot;: true&lt;/code&gt;, as &lt;code&gt;*&lt;/code&gt; in it is a wildcard, and devvm refuses a saved path with a &lt;code&gt;*&lt;/code&gt; but without it, which was saved as a prefix whose &lt;code&gt;*&lt;/code&gt; was itself, rather than read it as wider than it was saved, so the commands that read the list fail and name the file, as for any entry they refuse. devvm changes the list only while it holds &lt;code&gt;custom-secrets.lock&lt;/code&gt; beside it, so two runs of devvm secret set at once never lose one another&amp;rsquo;s secret. It saves the value before the definition, and when a new secret&amp;rsquo;s definition can&amp;rsquo;t be written, it deletes the value again. devvm secret rm unbinds a secret&amp;rsquo;s VMs and deletes it, and devvm secret use binds a VM to the definition that&amp;rsquo;s there, each under the same lock, so neither can come between the other&amp;rsquo;s check and its change. A value devvm can&amp;rsquo;t save whole is refused before the one saved is touched: &lt;code&gt;security -i&lt;/code&gt; reads its commands in lines of 4096 bytes, so a value has at most 3,800 bytes, and devvm checks the whole line before it runs &lt;code&gt;security&lt;/code&gt;. Each value is printable ASCII alone, because a header carries nothing else and the Keychain gives what isn&amp;rsquo;t back in hex.&lt;/p&gt;
&lt;p&gt;Inside devvm, a secret&amp;rsquo;s value has a type of its own from the moment devvm reads it, as you paste it, from the Keychain or its file, or from an agent&amp;rsquo;s login file, until the place that uses it. The same goes for a VM&amp;rsquo;s proxy password and the company proxy&amp;rsquo;s password. Printed in any way, in an error, a warning or devvm&amp;rsquo;s run log, that type shows &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; and never the value, and devvm can&amp;rsquo;t write it into a file by accident, because only the files that must hold the real value write it: the Keychain or the secret&amp;rsquo;s file, the proxy&amp;rsquo;s config, the VM&amp;rsquo;s state and the agents&amp;rsquo; login files (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#secrets-in-the-code"&gt;secrets in the code&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Each VM&amp;rsquo;s state records, for each secret of yours it uses, the definition&amp;rsquo;s ID and the hosts the secret had when devvm secret use bound it. The VM&amp;rsquo;s binding has the secret&amp;rsquo;s hosts that are in that record, so a host the secret gains reaches a VM only once devvm secret use binds it again, and a VM bound to another definition by the name gets no binding at all. The proxy&amp;rsquo;s lookup checks every &lt;code&gt;secret&lt;/code&gt; binding against the secret as it&amp;rsquo;s saved before it gives a value: its hosts within the secret&amp;rsquo;s, and its header, scheme, path, methods, Basic username switch, ID and placeholder the secret&amp;rsquo;s own. A binding that doesn&amp;rsquo;t match gets nothing, and the proxy logs &lt;code&gt;secret_binding_changed&lt;/code&gt;. Writing the bindings of every running VM again goes on past a VM whose files can&amp;rsquo;t be written and returns every failure together, so one VM never keeps the others&amp;rsquo; proxies from dropping a secret. A proxy whose bindings file did change drops every value it has cached at once. One whose file couldn&amp;rsquo;t be written keeps a cached value for at most its 5 minutes, and only for the hosts it had. devvm checks every entry again each time it reads the list, as devvm secret set checks what you give it, so an entry edited by hand with a wildcard host or a known secret&amp;rsquo;s name is refused, and a list it can&amp;rsquo;t read fails the command that reads it, naming the file, rather than leaving a secret out. It reads the list as the proxy reads its own files: a regular file, not a symbolic link, that&amp;rsquo;s yours and that only you may write. Only a command that needs one of your secrets reads it, so a VM that uses none of them launches whatever the list holds. Your secrets&amp;rsquo; names never shadow devvm&amp;rsquo;s own, nor an agent&amp;rsquo;s login&amp;rsquo;s, whose bindings are named after the agent, such as &lt;code&gt;codex-key&lt;/code&gt; or &lt;code&gt;pi-openai&lt;/code&gt;, and their placeholders have &lt;code&gt;secret-&lt;/code&gt; before the name, which no login&amp;rsquo;s placeholder has. &lt;code&gt;devvm secret rm&lt;/code&gt; unbinds a secret of yours from each VM that uses it before it deletes the secret, so a failure part way leaves the secret saved rather than a VM bound to a name that a secret saved later could take.&lt;/p&gt;
&lt;h3 data-hextra-search-id="how-the-proxy-puts-them-in"&gt;How the proxy puts them in&lt;span class="hx:absolute hx:-mt-20" id="how-the-proxy-puts-them-in"&gt;&lt;/span&gt;
&lt;a href="#how-the-proxy-puts-them-in" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A secret&amp;rsquo;s hosts join the VM&amp;rsquo;s allowlist on port 443, whether a value is saved or not. A secret of yours has exact host names alone, because a wildcard would reach names that others may own under a shared domain, and devvm can&amp;rsquo;t tell those domains from the rest without the public suffix list.&lt;/p&gt;
&lt;p&gt;For each secret that has a value, devvm writes the VM&amp;rsquo;s bindings to &lt;code&gt;secrets.json&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, as one JSON object, whole and mode 600. It&amp;rsquo;s of &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt; while every binding has no methods and no path but a prefix longer than &lt;code&gt;/&lt;/code&gt; that ends with &lt;code&gt;/&lt;/code&gt; and has no &lt;code&gt;*&lt;/code&gt;, so a proxy that knows only version 1, still running from before an upgrade, keeps the VM&amp;rsquo;s bindings, its agents&amp;rsquo; logins included. One from after bindings gained paths reads such a file alike. A proxy of devvm 0.1.0 or 0.1.1-rc.1 ignores the path, which for the built-in bindings only widens OpenRouter&amp;rsquo;s key to all of openrouter.ai, as 0.1.0 bound it, until the VM starts again with a new proxy. A secret of yours saved with the path &lt;code&gt;/&lt;/code&gt; has none, as &lt;code&gt;/&lt;/code&gt; is every path. A binding with methods or another path makes it &lt;code&gt;&amp;quot;version&amp;quot;: 2&lt;/code&gt;, which such a proxy refuses, so it puts no value in rather than put one in for every method, and devvm warns about each VM whose proxy is from another devvm binary when it writes one (&lt;code&gt;secrets_other_binary&lt;/code&gt;). A binding holds the secret&amp;rsquo;s name, its kind, its hosts, header and placeholder, sometimes a path and methods, and never its value. The kind is &lt;code&gt;secret&lt;/code&gt; for one that devvm keeps and &lt;code&gt;login&lt;/code&gt; for one of an agent&amp;rsquo;s logins, with the agent whose login file holds it, so where a value comes from never depends on its name. The proxy reads the file only when it&amp;rsquo;s a regular file, not a symbolic link, that only you can read or write, and a file it can&amp;rsquo;t read that way has no bindings until devvm writes it again. For a bound host, the proxy intercepts &lt;code&gt;:443&lt;/code&gt; tunnels instead of passing them through. It terminates TLS with a certificate from &lt;a href="#the-vms-ca"&gt;the VM&amp;rsquo;s own CA&lt;/a&gt;. Each certificate it makes for a host lasts a day, but never past the CA&amp;rsquo;s own end or before its start, because a client checks the whole chain. The proxy keeps the certificates of the 1024 hosts it used most recently and makes a new one for any other, so a binding with a wildcard host such as &lt;code&gt;*.example.com&lt;/code&gt;, which needs a certificate for each name the VM asks for, can&amp;rsquo;t grow the proxy&amp;rsquo;s memory without end. It then puts the real value in the binding&amp;rsquo;s header and forwards the request over a new TLS connection. Absolute-form &lt;code&gt;https://&lt;/code&gt; requests get the same.&lt;/p&gt;
&lt;p&gt;How the proxy puts the value in depends on the binding&amp;rsquo;s kind. A &lt;code&gt;secret&lt;/code&gt; binding&amp;rsquo;s placeholder is replaced only when exactly one value of its header holds it, as it is or inside &lt;code&gt;Basic&lt;/code&gt; credentials, and that value has one of four shapes. It&amp;rsquo;s the placeholder alone, or for &lt;code&gt;Authorization&lt;/code&gt;, &lt;code&gt;Bearer&lt;/code&gt;, &lt;code&gt;Token&lt;/code&gt; or the binding&amp;rsquo;s own &lt;code&gt;scheme&lt;/code&gt; in any case, one space and the placeholder, because &lt;code&gt;gh&lt;/code&gt; sends the GitHub token after &lt;code&gt;token&lt;/code&gt;. It&amp;rsquo;s also &lt;code&gt;Basic&lt;/code&gt; credentials, canonical base64 after one space, whose password is the placeholder, after a username of printable ASCII without a colon and at most 64 characters, because git sends the GitHub token as &lt;code&gt;x-access-token:&amp;lt;token&amp;gt;&lt;/code&gt; that way. With the binding&amp;rsquo;s &lt;code&gt;basic_user&lt;/code&gt;, it may be the username instead, before a password of printable ASCII of at most 64 characters, as Stripe takes its key. The proxy then puts the value where the placeholder was and nowhere else. A username, framed bytes, a doubled placeholder and a &lt;code&gt;Digest&lt;/code&gt; field are all places that a server can echo when it refuses a request, as Elasticsearch names the user it couldn&amp;rsquo;t authenticate, so those keep the placeholder. A &lt;code&gt;login&lt;/code&gt; binding&amp;rsquo;s placeholder is replaced only when the header has one value and that value is the placeholder alone, or, for &lt;code&gt;Authorization&lt;/code&gt;, &lt;code&gt;Bearer&lt;/code&gt; in any case, one space and the placeholder. Every agent sends its logins that way: an API key alone in &lt;code&gt;x-api-key&lt;/code&gt; or &lt;code&gt;x-goog-api-key&lt;/code&gt;, every other key and every OAuth login&amp;rsquo;s access token after &lt;code&gt;Bearer&lt;/code&gt;, and an MCP server&amp;rsquo;s header as the whole value that the VM&amp;rsquo;s copy replaced. Any other value keeps the placeholder, and so does a header that&amp;rsquo;s sent twice, which a server may join into one value. So code in the VM can&amp;rsquo;t put text of its own before or after a real API key, and a provider that quotes part of a key it refuses, as xAI&amp;rsquo;s, OpenAI&amp;rsquo;s and DeepSeek&amp;rsquo;s errors do, quotes only the placeholder. The proxy&amp;rsquo;s own log names the binding and its header when it leaves a placeholder for that reason, without a value.&lt;/p&gt;
&lt;p&gt;A binding can also have a path, a pattern as a rule&amp;rsquo;s is, and methods, and then the proxy puts its value in only for a request that they match as a rule&amp;rsquo;s allow does, with the one matcher of &lt;a href="#requests-by-method-and-path"&gt;requests by method and path&lt;/a&gt;, so a request with another method, or with a method-override header that names another, keeps the placeholder. Only a secret of yours has methods, from devvm secret set&amp;rsquo;s &lt;code&gt;--method&lt;/code&gt;, and a binding without them goes in for every method. A path that ends with &lt;code&gt;/&lt;/code&gt; matches everything below it. OpenRouter&amp;rsquo;s API keys are bound below &lt;code&gt;/api/&lt;/code&gt;, because opencode and pi send them only to &lt;code&gt;openrouter.ai/api/v1/&lt;/code&gt;, so the rest of the site gets the placeholder. They&amp;rsquo;re bound in two headers, each a binding of its own with the same name and placeholder. pi sends the key in &lt;code&gt;x-api-key&lt;/code&gt; to &lt;code&gt;/api/v1/messages&lt;/code&gt; for OpenRouter&amp;rsquo;s &lt;code&gt;anthropic/*&lt;/code&gt; models, which it calls with Anthropic&amp;rsquo;s API, and in &lt;code&gt;Authorization&lt;/code&gt; after &lt;code&gt;Bearer&lt;/code&gt; for every other model. opencode sends it in &lt;code&gt;Authorization&lt;/code&gt; today, and in &lt;code&gt;x-api-key&lt;/code&gt; for a model whose first API in the models.dev catalog is Anthropic&amp;rsquo;s Messages API, because it uses a model&amp;rsquo;s first API. The proxy compares the path as it forwards it, after a token endpoint&amp;rsquo;s capture has set it, and it takes the path only in a form that every server reads alike: clean already, without a &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;..&lt;/code&gt; segment or a doubled slash, with nothing percent-encoded, so no encoded slash or dot can move the request elsewhere after the check, and without a backslash or a &lt;code&gt;;&lt;/code&gt;, which some servers read as a separator or drop with what follows. A request for &lt;code&gt;/api/../settings&lt;/code&gt;, &lt;code&gt;/api%2F..%2Fsettings&lt;/code&gt; or &lt;code&gt;/%61pi/v1&lt;/code&gt; keeps the placeholder. A bindings file with a path that isn&amp;rsquo;t a pattern, or with methods that aren&amp;rsquo;t in their canonical form, has no bindings. Each request must name the bound host, and one that names another host gets &lt;code&gt;421&lt;/code&gt;. The proxy checks the bindings file for every request and reads it again when it has changed, so removing a binding applies to tunnels that are already open.&lt;/p&gt;
&lt;p&gt;The proxy&amp;rsquo;s broker is devvm itself, so it looks a value up in its own process, from the Keychain, devvm&amp;rsquo;s secrets folder or the agent&amp;rsquo;s login file, by the binding&amp;rsquo;s kind, when the child asks for it. The child names the binding by its kind, agent and name alone, and the broker finds that binding in its own read of the VM&amp;rsquo;s bindings file and looks the value up with its own copy of it, so a child can ask for no value that isn&amp;rsquo;t bound to its VM. It runs no other devvm for it, no devvm command prints a secret, and no value is in any process&amp;rsquo;s arguments. On macOS it asks the Keychain through &lt;code&gt;security find-generic-password&lt;/code&gt;, whose output is the value. A lookup takes at most 20 seconds, and the broker makes one at a time, so two requests never refresh a login at once. The broker keeps values for 5 minutes, or 30 seconds for agents&amp;rsquo; logins, and a failed lookup for 5 seconds, so a child can&amp;rsquo;t make it run &lt;code&gt;security&lt;/code&gt; or try a refresh back to back, and it drops them all when the bindings file changes, so a secret set right after a failure goes in at the next request. The child keeps a value only until the broker&amp;rsquo;s lookup is that old, and neither logs one. Each keeps a value by its binding&amp;rsquo;s kind, agent and name together, so a binding never gets the value of another one with the same name. A lookup that fails puts nothing in, and the proxy&amp;rsquo;s own log says why, without the value, such as &lt;code&gt;agent_refresh_failed&lt;/code&gt; when refreshing a Codex login failed. It refuses with &lt;code&gt;403&lt;/code&gt; the GitHub API calls that would make a credential of their own with the GitHub token, which are adding an account or deploy key, registering a runner and adding a webhook, whether the repo or organization is named or given by its ID. Every HTTPS request it forwards is checked, inside an intercepted tunnel and in absolute form alike, before it goes anywhere.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tests:&lt;/strong&gt; the unit tests check what a secret of yours may be and what devvm secret set&amp;rsquo;s flags change, that every variable the VM&amp;rsquo;s scripts export, and the proxy&amp;rsquo;s, is one it can&amp;rsquo;t take, each shape its value goes in and each that keeps the placeholder, and that a binding&amp;rsquo;s path and methods let it in only for the requests they match, each request of a kept-alive or HTTP/2 connection on its own. They check that a binding that isn&amp;rsquo;t the secret&amp;rsquo;s as it&amp;rsquo;s saved gets nothing, that a value too long for the Keychain&amp;rsquo;s line is refused before anything runs, and that every secret&amp;rsquo;s placeholder has one shape, the VM&amp;rsquo;s own, and is never taken as a value. They check the list, its mode and its checks on reading, that no value is in it or in a VM&amp;rsquo;s bindings, and that only a VM that uses the secret gets its binding and hosts, that two bindings of one name are cached apart, and use, a new value and the question that names the VMs before a delete. The CLI tests check every refusal before anything runs, the value on stdin and at a prompt and never in a command&amp;rsquo;s arguments, the list, &lt;code&gt;--json&lt;/code&gt;, the binding and the variable a VM gets and the other VM doesn&amp;rsquo;t, and the delete (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#the-tests-behind-how-it-works"&gt;the tests behind it&lt;/a&gt;). &lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;network&lt;/code&gt;): a secret of yours bound to a host that the run&amp;rsquo;s company proxy fakes; the VM&amp;rsquo;s variable is its placeholder, the host gets the real value in the secret&amp;rsquo;s header, another host gets only the placeholder, and no log holds the value. Once the section has saved, bound and captured its secrets, and again at its end, no VM&amp;rsquo;s proxy password and none of the tokens, keys and logins the section used are in devvm&amp;rsquo;s run logs, its other logs or any VM&amp;rsquo;s proxy logs, as they are or in Basic credentials, and no VM&amp;rsquo;s proxy password is in Lima&amp;rsquo;s logs, &lt;code&gt;ha.stderr.log&lt;/code&gt; and the serial logs.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-vms-ca"&gt;The VM&amp;rsquo;s CA&lt;span class="hx:absolute hx:-mt-20" id="the-vms-ca"&gt;&lt;/span&gt;
&lt;a href="#the-vms-ca" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each VM has a CA of its own, whatever its tier, which only its proxy signs with and only that VM trusts, so a copy of one VM&amp;rsquo;s key can impersonate sites to that VM alone, and no VM&amp;rsquo;s proxy can make a certificate that another VM accepts. A CA is ECDSA P-256, valid for 30 days from an hour before it&amp;rsquo;s made, and it names no host. Its common name holds its serial number, so no two CAs share a name. devvm keeps the VM&amp;rsquo;s CAs in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/ca/&lt;/code&gt;: the current CA as &lt;code&gt;ca.pem&lt;/code&gt; and its key &lt;code&gt;ca.key&lt;/code&gt;, and the next CA as &lt;code&gt;next.pem&lt;/code&gt; and its key &lt;code&gt;next.key&lt;/code&gt;. The folder and both keys are yours alone (modes 700 and 600), devvm writes each file whole, a key before its certificate, and on macOS it keeps the folder out of Time Machine. The keys never leave this machine: the VM gets the two certificates and nothing else. The proxy reads each certificate and key only when it&amp;rsquo;s a regular file, not a symbolic link, and refuses a key that anybody but you may read or write.&lt;/p&gt;
&lt;p&gt;At each launch, devvm readies both CAs before the proxy starts, holding the folder&amp;rsquo;s lock, &lt;code&gt;lock&lt;/code&gt;, so two launches of one VM at once take turns. The current CA stays while it has over a week left. When it has less, or there&amp;rsquo;s none, the next CA takes its place if it has started and has over a week left, and otherwise devvm makes a new current CA. The next CA starts a week and an hour before the current one ends, and lasts 30 days too. When it doesn&amp;rsquo;t follow the current one that way, by ending after it and starting by the time it&amp;rsquo;s replaced, devvm makes it again. A key without its certificate, or a CA that lasts longer than 30 days, is made again too. Each launch&amp;rsquo;s setup installs both certificates in the VM, so the VM trusts the next CA weeks before the proxy uses it.&lt;/p&gt;
&lt;p&gt;The proxy holds both CAs, and it signs with the next one from an hour after that CA&amp;rsquo;s start, which is a week before the current one ends and the moment from which the next launch would make it the current one. The hour lets a VM whose clock is behind see that the CA has started. The switch needs no launch and no new proxy, because the VM already trusts the next CA, so a VM that you don&amp;rsquo;t open again keeps verifying the proxy&amp;rsquo;s certificates until the next CA ends, which is at least 30 days less an hour after its last launch. A proxy keeps the CAs it started with, because the VM trusts no others, and a launch that replaced either one starts the proxy again with the new ones, as &lt;a href="#how-long-a-proxy-runs"&gt;how long a proxy runs&lt;/a&gt; describes. &lt;code&gt;/ca.pem&lt;/code&gt; at &lt;code&gt;devvm.proxy&lt;/code&gt; serves both certificates.&lt;/p&gt;
&lt;p&gt;A VM that runs past its next CA&amp;rsquo;s end without a launch can&amp;rsquo;t verify the proxy&amp;rsquo;s certificates any more. From then on, its proxy answers each &lt;code&gt;CONNECT&lt;/code&gt; to a bound host&amp;rsquo;s &lt;code&gt;:443&lt;/code&gt; with &lt;code&gt;403&lt;/code&gt; before any tunnel opens, and it logs a refused block with the reason &lt;code&gt;devvm's CA has ended: open the VM again (devvm in its folder) for a new one&lt;/code&gt;, so neither the VM&amp;rsquo;s prompt nor &lt;code&gt;devvm network log&lt;/code&gt; suggests an allow rule. Absolute-form &lt;code&gt;https://&lt;/code&gt; requests involve no certificate for the VM, so they go on getting their secrets. The VM&amp;rsquo;s other connections work until you open it again. Running &lt;code&gt;devvm&lt;/code&gt; in the VM&amp;rsquo;s folder then makes a new CA and a next one and starts the proxy again with them, which ends the connections open through the old one, and the launch&amp;rsquo;s setup installs both in the VM.&lt;/p&gt;
&lt;p&gt;The CAs live as long as the VM&amp;rsquo;s folder. A remake keeps the folder, so the VM keeps its CAs, and so does a change of tier. &lt;code&gt;devvm rm&lt;/code&gt;, &lt;code&gt;devvm gc --orphans&lt;/code&gt;, and devvm deleting a VM whose creation it interrupted or whose folder an earlier VM of the project left, delete the folder, and the CAs and their keys with it.&lt;/p&gt;
&lt;p&gt;In a user&amp;rsquo;s terms: to put a secret in, the proxy shows the VM a certificate from the VM&amp;rsquo;s own CA, which every VM has, an open one&amp;rsquo;s included, and which no other VM trusts, so one VM&amp;rsquo;s proxy can&amp;rsquo;t make certificates that another VM accepts. Each CA lasts 30 days, and its key stays on this machine. Each launch installs the VM&amp;rsquo;s current CA and the next one, which starts a week before the current one ends, and the proxy switches to the next CA then on its own, without a launch. So a VM that you don&amp;rsquo;t open again keeps working for at least 30 days after its last launch with &lt;code&gt;devvm&lt;/code&gt; in its folder. Connecting with &lt;code&gt;ssh&lt;/code&gt; alone isn&amp;rsquo;t a launch. When a VM runs past its next CA&amp;rsquo;s end without a launch, its proxy refuses its HTTPS connections to secrets&amp;rsquo; hosts, and &lt;code&gt;devvm network log --blocked&lt;/code&gt; gives the reason &lt;code&gt;devvm's CA has ended&lt;/code&gt;. The VM&amp;rsquo;s other requests keep working. Running &lt;code&gt;devvm&lt;/code&gt; in the VM&amp;rsquo;s folder installs new CAs, which also starts the VM&amp;rsquo;s proxy again and ends the connections open through it (&lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;saving and binding secrets&lt;/a&gt;). &lt;code&gt;devvm rm&lt;/code&gt; deletes a VM&amp;rsquo;s CAs with the VM, and a VM keeps them when its tier changes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tests:&lt;/strong&gt; the unit tests check the dates, the modes, the switch and each CA that&amp;rsquo;s made again, that launches at once take turns on the lock, that an open VM&amp;rsquo;s proxy has the VM&amp;rsquo;s CAs, salt and secrets file and that a VM keeps its CAs as its tier changes, that a client trusting both CAs verifies the proxy&amp;rsquo;s certificates before the switch and after it, with the same proxy, that the proxy refuses a key others may read and a symbolic link, and that two proxies&amp;rsquo; certificates come from their own CAs. The CLI tests check each VM&amp;rsquo;s CA files and modes, that two VMs&amp;rsquo; CAs differ, that the setup sends both certificates and no key, an open VM&amp;rsquo;s too, and that a VM turned off and on again keeps its CAs (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#the-tests-behind-how-it-works"&gt;the tests behind it&lt;/a&gt;). &lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;network&lt;/code&gt;): a second confined VM, whose CAs differ from the first&amp;rsquo;s; each VM trusts its own two and none of the other&amp;rsquo;s; no key is anywhere in the VM; each proxy serves its own CAs at &lt;code&gt;/ca.pem&lt;/code&gt;, and its certificates verify with its own VM&amp;rsquo;s CAs and not with the other&amp;rsquo;s; &lt;code&gt;devvm rm&lt;/code&gt; deletes a VM&amp;rsquo;s CA with its folder.&lt;/p&gt;
&lt;h2 data-hextra-search-id="agents-logins-and-settings"&gt;Agents&amp;rsquo; logins and settings&lt;span class="hx:absolute hx:-mt-20" id="agents-logins-and-settings"&gt;&lt;/span&gt;
&lt;a href="#agents-logins-and-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Agents&amp;rsquo; login files also stay on the host, in devvm&amp;rsquo;s agent store, which &lt;code&gt;devvm agent import&lt;/code&gt; fills, and so do &lt;a href="#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;). devvm never reads an agent&amp;rsquo;s own login file in the home folder for a VM. When a VM&amp;rsquo;s image has the agent and the store has a login file for it, the login&amp;rsquo;s bindings join the VM&amp;rsquo;s, and their hosts join its allowlist on port 443.&lt;/p&gt;
&lt;p&gt;Codex&amp;rsquo;s login is &lt;code&gt;~/.local/share/devvm/logins/codex/.codex/auth.json&lt;/code&gt;, opencode&amp;rsquo;s is &lt;code&gt;~/.local/share/devvm/logins/opencode/.local/share/opencode/auth.json&lt;/code&gt; and pi&amp;rsquo;s is &lt;code&gt;~/.local/share/devvm/logins/pi/.pi/agent/auth.json&lt;/code&gt;, the store&amp;rsquo;s copies of &lt;code&gt;~/.codex/auth.json&lt;/code&gt;, &lt;code&gt;~/.local/share/opencode/auth.json&lt;/code&gt; and &lt;code&gt;~/.pi/agent/auth.json&lt;/code&gt;. The VM&amp;rsquo;s copy holds placeholders, shaped like a JWT where the tools read claims, and the bindings put the store&amp;rsquo;s API key or access token into requests for the provider&amp;rsquo;s hosts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For Codex, those are OpenAI&amp;rsquo;s hosts, &lt;code&gt;api.openai.com&lt;/code&gt;, and &lt;code&gt;chatgpt.com&lt;/code&gt; for a ChatGPT login.&lt;/li&gt;
&lt;li&gt;For opencode, they&amp;rsquo;re the hosts of the API keys of the providers in &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt;, each in the headers that its row names, and of OpenAI and GitHub Copilot logins, but not Copilot Enterprise. opencode keeps one entry per provider, &lt;code&gt;{&amp;quot;type&amp;quot;:&amp;quot;api&amp;quot;,&amp;quot;key&amp;quot;,&amp;quot;metadata&amp;quot;}&lt;/code&gt;, &lt;code&gt;{&amp;quot;type&amp;quot;:&amp;quot;oauth&amp;quot;,&amp;quot;refresh&amp;quot;,&amp;quot;access&amp;quot;,&amp;quot;expires&amp;quot;,&amp;quot;accountId&amp;quot;,&amp;quot;enterpriseUrl&amp;quot;}&lt;/code&gt; or &lt;code&gt;{&amp;quot;type&amp;quot;:&amp;quot;wellknown&amp;quot;,&amp;quot;key&amp;quot;,&amp;quot;token&amp;quot;}&lt;/code&gt;. A bound key&amp;rsquo;s entry reaches the VM as &lt;code&gt;{&amp;quot;type&amp;quot;,&amp;quot;key&amp;quot;}&lt;/code&gt; alone, its key the placeholder, so its &lt;code&gt;metadata&lt;/code&gt; stays on this machine, and a bound OAuth login&amp;rsquo;s keeps only the fields that name its account beside the placeholders (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;For pi, they&amp;rsquo;re the hosts of the same providers&amp;rsquo; API keys, each in the same headers. Both agents name each of these providers by the same ID, and neither puts a key in a URL, such as Gemini&amp;rsquo;s &lt;code&gt;?key=&lt;/code&gt;, which the proxy couldn&amp;rsquo;t fill in, because it swaps the placeholder in a header alone. pi keeps one entry per provider, &lt;code&gt;{&amp;quot;type&amp;quot;:&amp;quot;api_key&amp;quot;,&amp;quot;key&amp;quot;,&amp;quot;env&amp;quot;}&lt;/code&gt; or &lt;code&gt;{&amp;quot;type&amp;quot;:&amp;quot;oauth&amp;quot;,&amp;quot;access&amp;quot;,&amp;quot;refresh&amp;quot;,&amp;quot;expires&amp;quot;}&lt;/code&gt;, and devvm binds only the first kind, with a key that&amp;rsquo;s a value rather than a &lt;code&gt;!command&lt;/code&gt; or a &lt;code&gt;$NAME&lt;/code&gt; or &lt;code&gt;${NAME}&lt;/code&gt; template, which pi fills in from the entry&amp;rsquo;s &lt;code&gt;env&lt;/code&gt; or the environment (&lt;code&gt;$$&lt;/code&gt; is a literal &lt;code&gt;$&lt;/code&gt;). A bound entry reaches the VM as &lt;code&gt;{&amp;quot;type&amp;quot;,&amp;quot;key&amp;quot;}&lt;/code&gt; alone, its key the placeholder, so nothing else of it, its &lt;code&gt;env&lt;/code&gt; included, leaves this machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The store keeps opencode&amp;rsquo;s login in the &lt;code&gt;auth.json&lt;/code&gt; format of opencode 1: one entry per provider, &lt;code&gt;{&amp;quot;type&amp;quot;:&amp;quot;api&amp;quot;,&amp;quot;key&amp;quot;}&lt;/code&gt; or &lt;code&gt;{&amp;quot;type&amp;quot;:&amp;quot;oauth&amp;quot;,&amp;quot;access&amp;quot;,&amp;quot;refresh&amp;quot;,&amp;quot;expires&amp;quot;}&lt;/code&gt; with its expiry in milliseconds. opencode 2 keeps its logins in the &lt;code&gt;credential&lt;/code&gt; table of its SQLite database, &lt;code&gt;~/.local/share/opencode/opencode.db&lt;/code&gt;, and imports &lt;code&gt;auth.json&lt;/code&gt; into it once, in the migration that makes the table, so a VM&amp;rsquo;s opencode gets the VM&amp;rsquo;s copy when it first runs there. A VM&amp;rsquo;s placeholders don&amp;rsquo;t change when the host refreshes a login, so the database&amp;rsquo;s copies keep working. After that, the store&amp;rsquo;s opencode logins reach the database through &lt;code&gt;opencode auth import&lt;/code&gt;, as &lt;code&gt;auth export&lt;/code&gt; entries with the IDs &lt;code&gt;cred_devvm_&amp;lt;provider&amp;gt;&lt;/code&gt;: the placeholder of each API key that the proxy puts in, each key that &lt;code&gt;[pass-keys]&lt;/code&gt; passes, with its &lt;code&gt;metadata&lt;/code&gt;, and the OpenAI login&amp;rsquo;s placeholders from one of opencode&amp;rsquo;s Codex logins. The VM&amp;rsquo;s setup sends these entries on every launch, and &lt;code&gt;devvm agent login opencode --api-key --provider PROVIDER&lt;/code&gt; sends them at once, both on the input of devvm&amp;rsquo;s guest script &lt;code&gt;opencode.sh&lt;/code&gt;, never in a command&amp;rsquo;s arguments. The script keeps the last entries it got in &lt;code&gt;~/.local/state/devvm/opencode-import.json&lt;/code&gt; in the VM. When opencode has made its database and the new entries differ from the record, or the database no longer holds one of their IDs because it was made again, such as after you delete it or a history import replaces it, it logs out of devvm&amp;rsquo;s entries from the last ones with &lt;code&gt;opencode auth logout&lt;/code&gt;, because &lt;code&gt;opencode auth import&lt;/code&gt; skips an ID it already has, and then imports the new ones and makes each of them its provider&amp;rsquo;s active credential with &lt;code&gt;opencode auth switch&lt;/code&gt;, so a ChatGPT login for another account or a key saved from another VM reaches every VM at its next launch. Credentials that you added in the VM yourself have other IDs, so they stay in the database, and &lt;code&gt;opencode auth switch&lt;/code&gt; makes one of them active again. Before opencode has made its database, the script does nothing and records nothing, because opencode 2.2.5 doesn&amp;rsquo;t always import &lt;code&gt;auth.json&lt;/code&gt; as it makes the database, so the first launch after opencode has run imports every entry. The script imports each entry on its own, so an entry that opencode refuses doesn&amp;rsquo;t keep the others out, and &lt;code&gt;devvm agent login&lt;/code&gt; names the providers that opencode refused. A failed import leaves the record as it was, so the next launch tries again. The script and its record live in the VM rather than in the VM&amp;rsquo;s state on the host, because only the VM knows whether its database exists and what it last imported, and a VM that is set up again or has its home copied keeps both together.&lt;/p&gt;
&lt;p&gt;Each VM&amp;rsquo;s placeholders end in its own random value, so no other VM&amp;rsquo;s placeholder gets its secrets. devvm reads a login file only when it&amp;rsquo;s a regular file, so a FIFO or a device in its place can&amp;rsquo;t hold devvm. devvm refreshes OAuth logins on the host, one lookup at a time, and writes them back to the store&amp;rsquo;s file, so a VM never holds the refresh token of a login devvm keeps. Claude Code&amp;rsquo;s logins to MCP servers that you make in a VM are that VM&amp;rsquo;s own (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-login"&gt;Claude Code&amp;rsquo;s login&lt;/a&gt;). A refresh that has started finishes and is written back even when the request that needed it ends, because OpenAI may already have replaced the refresh token. When a refresh fails, or the store&amp;rsquo;s login no longer has what a binding names, the proxy puts nothing in, and its own log says to log in again with the agent and import the login again (&lt;code&gt;agent_refresh_failed&lt;/code&gt;, &lt;code&gt;agent_provider_refresh_failed&lt;/code&gt; for one of opencode&amp;rsquo;s providers, &lt;code&gt;codex_no_key&lt;/code&gt;, &lt;code&gt;codex_no_chatgpt&lt;/code&gt;), or names the login file it couldn&amp;rsquo;t read (&lt;code&gt;login_read_failed&lt;/code&gt;). The VM&amp;rsquo;s copy of Codex&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; holds only the fields that devvm knows, as Codex 0.166.0&amp;rsquo;s login code reads them. Its API key and its tokens are placeholders, and the copy keeps &lt;code&gt;auth_mode&lt;/code&gt; and &lt;code&gt;last_refresh&lt;/code&gt;, and in &lt;code&gt;tokens&lt;/code&gt;, &lt;code&gt;account_id&lt;/code&gt;, &lt;code&gt;login_owner_id&lt;/code&gt; and the refresh token&amp;rsquo;s &lt;code&gt;oauth_provenance&lt;/code&gt;, its &lt;code&gt;issuer&lt;/code&gt; and &lt;code&gt;client_id&lt;/code&gt;, each a plain value. devvm leaves every other field out, at the top of the file or in &lt;code&gt;tokens&lt;/code&gt;, Codex&amp;rsquo;s other logins included (&lt;code&gt;agent_identity&lt;/code&gt;, &lt;code&gt;personal_access_token&lt;/code&gt;, &lt;code&gt;bedrock_api_key&lt;/code&gt; and &lt;code&gt;bedrock_access_keys&lt;/code&gt;), because the proxy has no binding for them, and warns you, naming a field in &lt;code&gt;tokens&lt;/code&gt; by its path, such as &lt;code&gt;tokens.zz&lt;/code&gt; (&lt;code&gt;login_fields_withheld&lt;/code&gt;). A unit test plants a field that no format knows in every object of each kind&amp;rsquo;s login file, as a string, an object and a list, and checks that no VM&amp;rsquo;s copy holds it (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#the-tests-behind-how-it-works"&gt;the tests behind it&lt;/a&gt;). opencode&amp;rsquo;s and pi&amp;rsquo;s logins are withheld by default, by the same rule, which each agent&amp;rsquo;s entry in devvm&amp;rsquo;s registry of the agents sets. Every entry that devvm doesn&amp;rsquo;t bind, an API key, an OAuth login or opencode&amp;rsquo;s well-known login, reaches the VM with only the fields that name its account or how it logs in, &lt;code&gt;type&lt;/code&gt;, &lt;code&gt;expires&lt;/code&gt;, &lt;code&gt;accountId&lt;/code&gt;, &lt;code&gt;enterpriseUrl&lt;/code&gt;, &lt;code&gt;projectId&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;scope&lt;/code&gt;, &lt;code&gt;scopes&lt;/code&gt; and &lt;code&gt;clientId&lt;/code&gt;, each a plain value or a list of strings, and devvm warns you (&lt;code&gt;login_withheld&lt;/code&gt;). opencode skips an entry that lacks its key or its tokens as it reads &lt;code&gt;auth.json&lt;/code&gt;, so it doesn&amp;rsquo;t use that provider in the VM. The exception is an API-key entry of a provider that &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt; lists under the agent&amp;rsquo;s name, which goes as it is, and devvm notes it (&lt;code&gt;login_passed&lt;/code&gt;). It&amp;rsquo;s never an OAuth login, whose tokens a VM never gets, and never a provider that devvm binds, whose key is always its placeholder, so binding wins over the table, and devvm notes each bound provider that the table lists (&lt;code&gt;login_pass_bound&lt;/code&gt;). The table has one key per agent, so each agent&amp;rsquo;s withheld keys are passed on their own. If devvm can&amp;rsquo;t make the VM&amp;rsquo;s copy of a login, it stops the VM&amp;rsquo;s setup (&lt;code&gt;login_copy_failed&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/using/coding-agents/"&gt;Coding agents&lt;/a&gt; lists which files each agent shares.&lt;/p&gt;
&lt;h3 data-hextra-search-id="logins-made-in-a-vm"&gt;Logins made in a VM&lt;span class="hx:absolute hx:-mt-20" id="logins-made-in-a-vm"&gt;&lt;/span&gt;
&lt;a href="#logins-made-in-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A login that an agent makes inside a VM goes to devvm&amp;rsquo;s store too, and the VM gets only placeholders for it. The VM&amp;rsquo;s proxy does this at the agent&amp;rsquo;s OAuth token endpoint, the one request of a login whose reply holds its tokens. Codex and opencode both log in to OpenAI at &lt;code&gt;auth.openai.com/oauth/token&lt;/code&gt;, whether the code comes from a browser&amp;rsquo;s redirect or from a device code typed into a browser elsewhere. For opencode 2, those are its Codex logins, the methods &lt;code&gt;chatgpt-browser&lt;/code&gt; and &lt;code&gt;chatgpt-headless&lt;/code&gt;. Its Sign in with ChatGPT, &lt;code&gt;chatgpt-token-sharing&lt;/code&gt;, registers a client of its own and gets its tokens from &lt;code&gt;auth.openai.com/api/accounts/oauth/token&lt;/code&gt;, then checks the &lt;code&gt;id_token&lt;/code&gt;&amp;rsquo;s signature against OpenAI&amp;rsquo;s keys, which a placeholder can&amp;rsquo;t pass, so devvm doesn&amp;rsquo;t capture that endpoint, and its replies get &lt;code&gt;502&lt;/code&gt;, as the next paragraph says. Every VM&amp;rsquo;s proxy config lists that endpoint in &lt;code&gt;captures&lt;/code&gt;, for Codex and for opencode, whatever the VM&amp;rsquo;s image holds, because a program in the VM could install either agent itself, and the proxy refuses that agent&amp;rsquo;s login rather than let its tokens reach the VM. The endpoint&amp;rsquo;s host joins the VM&amp;rsquo;s &lt;code&gt;secrets.policy&lt;/code&gt; on port 443 only when its image has one of them, so that agent can log in on every tier. The proxy intercepts the host&amp;rsquo;s &lt;code&gt;:443&lt;/code&gt; tunnels as it does a bound host&amp;rsquo;s, with a certificate from &lt;a href="#the-vms-ca"&gt;the VM&amp;rsquo;s CA&lt;/a&gt;, and forwards every request to it. Only a request of the endpoint&amp;rsquo;s method to its path is captured, a &lt;code&gt;POST&lt;/code&gt; for every OAuth token endpoint, and the proxy compares the path once it&amp;rsquo;s cleaned, each segment without its path parameters, a backslash read as a slash, and in any case, as a host that normalizes paths reads it, so a request for &lt;code&gt;/oauth//token&lt;/code&gt;, &lt;code&gt;/OAuth/Token/&lt;/code&gt;, &lt;code&gt;/oauth/token;x&lt;/code&gt; or &lt;code&gt;/x;/../oauth/token&lt;/code&gt; is captured too. A captured request goes to the endpoint&amp;rsquo;s own path whatever the VM&amp;rsquo;s spelling of it, and a &lt;code&gt;POST&lt;/code&gt; goes without a query. An endpoint can be a &lt;code&gt;GET&lt;/code&gt; instead, for a login that the agent polls for, whose request is its query. The proxy then refuses a query that isn&amp;rsquo;t a form or that names a field twice, which devvm and the endpoint could read apart, and a &lt;code&gt;GET&lt;/code&gt; with a body, and the query goes on in a canonical form, its fields sorted, so the endpoint reads what devvm read. Any other successful reply from that host that names an &lt;code&gt;access_token&lt;/code&gt;, a &lt;code&gt;refresh_token&lt;/code&gt; or an &lt;code&gt;id_token&lt;/code&gt; anywhere gets &lt;code&gt;502&lt;/code&gt;, whatever its type, so no other path there, such as another token endpoint&amp;rsquo;s, hands the VM a login, and so does one that names a field that the endpoint&amp;rsquo;s agent keeps its tokens in, such as &lt;code&gt;accessToken&lt;/code&gt;. The proxy passes only a web page and its parts unread, which are HTML, CSS, JavaScript, images and fonts, and it refuses a reply it can&amp;rsquo;t read for that, one that&amp;rsquo;s encoded or longer than 1 MiB, and an upgrade (&lt;code&gt;101&lt;/code&gt;). No informational reply (&lt;code&gt;1xx&lt;/code&gt;) from the host reaches the VM, because its headers could hold a cookie. When the host serves an API of its own beside the endpoint, which these checks would break, with its streamed, encoded or long replies, the endpoint names a path prefix that the endpoint is below, its guard, and the proxy checks only the replies below it. It checks the reply to any path that isn&amp;rsquo;t already clean too, such as one with path parameters, encoded characters or &lt;code&gt;..&lt;/code&gt;, because the host could read it as below the guard where devvm doesn&amp;rsquo;t. The API&amp;rsquo;s replies elsewhere pass as they are, their informational replies, upgrades and encodings included. A path there that handed out tokens would hand them to the VM, and the VM&amp;rsquo;s requests to that API carry the agent&amp;rsquo;s real login, which the proxy puts in, so the agent&amp;rsquo;s section names the paths that could.&lt;/p&gt;
&lt;p&gt;The proxy&amp;rsquo;s child judges a captured request by the VM&amp;rsquo;s rules as any other, reads its body whole, up to 64 KiB, with at most 64 KiB of headers, and hands it to the broker, which does the rest itself, so a login&amp;rsquo;s real tokens, a new login&amp;rsquo;s refresh token among them, and the store&amp;rsquo;s &lt;code&gt;id_token&lt;/code&gt; never reach the child. The broker finds the endpoint in its own config by the request&amp;rsquo;s host, path and method, and refuses a request that matches none. It names the VM itself and sends the request to the endpoint&amp;rsquo;s host from its own config, on port 443, through the company proxy when there is one, trusting the system&amp;rsquo;s roots and your CAs, as a refresh does. It refuses one that names a field twice, or a JSON body with more after its object, which devvm and the endpoint could read apart. It drops the VM&amp;rsquo;s &lt;code&gt;Accept-Encoding&lt;/code&gt; header from every request to the host, so each reply comes as it is, or as gzip that Go&amp;rsquo;s transport undoes. The request goes on unchanged, with two exceptions. After a code&amp;rsquo;s login, Codex exchanges the login&amp;rsquo;s &lt;code&gt;id_token&lt;/code&gt; for an API key, with a token-exchange grant that asks for &lt;code&gt;openai-api-key&lt;/code&gt;. The VM&amp;rsquo;s request carries the VM&amp;rsquo;s placeholder of the &lt;code&gt;id_token&lt;/code&gt;, so the proxy puts the store&amp;rsquo;s &lt;code&gt;id_token&lt;/code&gt; in its place, and only when the placeholder is that VM&amp;rsquo;s for the store&amp;rsquo;s current login. An error reply to that request reaches the VM with its OAuth error code alone, such as &lt;code&gt;{&amp;quot;error&amp;quot;:&amp;quot;invalid_grant&amp;quot;}&lt;/code&gt;, in case the endpoint&amp;rsquo;s message quotes the &lt;code&gt;id_token&lt;/code&gt;. A refresh whose refresh token is the VM&amp;rsquo;s own, &lt;code&gt;devvm-proxy-managed&lt;/code&gt;, or for opencode its access token&amp;rsquo;s placeholder, goes nowhere, and the VM gets the store&amp;rsquo;s login as placeholders again, because the host refreshes the login itself. devvm refuses any other grant than a code&amp;rsquo;s, a refresh&amp;rsquo;s or Codex&amp;rsquo;s exchange before the request leaves the host, because it couldn&amp;rsquo;t read the reply. Any other error reply reaches the VM as it is, with the few headers below, up to 1 MiB, and one that&amp;rsquo;s longer gets &lt;code&gt;502&lt;/code&gt;. The child reads at most 8 requests and replies to and from the host whole at once, and the broker runs at most 8 exchanges at once.&lt;/p&gt;
&lt;p&gt;A successful reply never reaches the VM as it is. The broker reads it whole, up to 1 MiB, and saves its tokens in the store&amp;rsquo;s login file, in the agent&amp;rsquo;s own format, under the file&amp;rsquo;s lock, so a refresh on the host never runs at the same time. Codex&amp;rsquo;s goes in &lt;code&gt;tokens&lt;/code&gt; of its &lt;code&gt;auth.json&lt;/code&gt;, with the account from the &lt;code&gt;id_token&lt;/code&gt;, and the exchange&amp;rsquo;s API key in &lt;code&gt;OPENAI_API_KEY&lt;/code&gt;. opencode&amp;rsquo;s goes in the &lt;code&gt;openai&lt;/code&gt; entry of its &lt;code&gt;auth.json&lt;/code&gt;, as an OAuth login with its expiry in milliseconds and its account. A code&amp;rsquo;s reply replaces the login, and for Codex it also replaces the API key of the login before it. A refresh&amp;rsquo;s reply adds to the login, so the store keeps only the newest refresh token. Then devvm writes the VM&amp;rsquo;s bindings again, so its proxy puts the new login into requests at once. When that write fails, the login is still saved, the VM gets its reply, its proxy&amp;rsquo;s own log says why, and the VM&amp;rsquo;s next launch writes its bindings.&lt;/p&gt;
&lt;p&gt;The VM gets a reply with placeholders in place of the tokens. Its access token&amp;rsquo;s placeholder is the one the store&amp;rsquo;s login binds, a JWT with the login&amp;rsquo;s account claims, its API key&amp;rsquo;s is the one its binding names, and its refresh token is &lt;code&gt;devvm-proxy-managed&lt;/code&gt;, which is no token. The reply keeps only the token type and scope, says that the access token lasts until 2099, and holds nothing else of the endpoint&amp;rsquo;s reply, so the agent in the VM never refreshes the login itself. Its headers are only &lt;code&gt;Content-Type&lt;/code&gt;, &lt;code&gt;Cache-Control&lt;/code&gt;, &lt;code&gt;Pragma&lt;/code&gt; and &lt;code&gt;Date&lt;/code&gt;, so no cookie of the endpoint&amp;rsquo;s reaches the VM. A reply that&amp;rsquo;s too long, encoded in another way, or not a login devvm reads, such as one without an access token, gets &lt;code&gt;502&lt;/code&gt; instead, logged as a refused block, and devvm saves nothing of it. An error reply holds no tokens, so it reaches the VM as it is, with the same headers alone. The event log gets a &lt;code&gt;login&lt;/code&gt; event for each login saved, which names the agent, and the proxy&amp;rsquo;s own log says why a capture failed, without a value.&lt;/p&gt;
&lt;p&gt;A VM captures a login only for an agent that its image has, because a capture replaces the login that every VM with that agent uses. So a login at OpenAI&amp;rsquo;s endpoint is the agent&amp;rsquo;s that the VM&amp;rsquo;s image has, of Codex and opencode, and in a VM with both, the request&amp;rsquo;s &lt;code&gt;User-Agent&lt;/code&gt; says whose login it is. Each login format that captures logins names its endpoints and the starts of its agent&amp;rsquo;s &lt;code&gt;User-Agent&lt;/code&gt;, and devvm lists every format&amp;rsquo;s endpoints in the registry&amp;rsquo;s order. opencode runs on Bun, so a request whose &lt;code&gt;User-Agent&lt;/code&gt; starts with &lt;code&gt;Bun/&lt;/code&gt; or &lt;code&gt;opencode/&lt;/code&gt; is opencode&amp;rsquo;s, and any other is Codex&amp;rsquo;s, because Codex&amp;rsquo;s format names none. When the VM&amp;rsquo;s image has neither and its tier reaches the host, its request gets &lt;code&gt;502&lt;/code&gt; before it leaves this machine, devvm saves nothing, and the proxy&amp;rsquo;s own log says why (&lt;code&gt;login_capture_refused&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Claude Code logs in at &lt;code&gt;platform.claude.com/v1/oauth/token&lt;/code&gt;, and older releases at &lt;code&gt;console.anthropic.com/v1/oauth/token&lt;/code&gt;, so every VM&amp;rsquo;s proxy config lists both in &lt;code&gt;captures&lt;/code&gt; for Claude Code, and their hosts join the &lt;code&gt;secrets.policy&lt;/code&gt; of a VM whose image has it. Anthropic doesn&amp;rsquo;t document these requests: devvm reads them from Claude Code 2.1&amp;rsquo;s bundle, so a release that changes them can break the capture, and the &lt;code&gt;network&lt;/code&gt; end-to-end section drives the real Claude Code&amp;rsquo;s login against a fake endpoint to catch that. Claude Code sends JSON with its public client ID, &lt;code&gt;9d1c250a-e61b-44d9-88ed-5944d1962f5e&lt;/code&gt;, and PKCE, without a client secret. A code&amp;rsquo;s request holds &lt;code&gt;grant_type&lt;/code&gt;, &lt;code&gt;code&lt;/code&gt;, &lt;code&gt;redirect_uri&lt;/code&gt;, &lt;code&gt;client_id&lt;/code&gt;, &lt;code&gt;code_verifier&lt;/code&gt; and &lt;code&gt;state&lt;/code&gt;, and a refresh&amp;rsquo;s &lt;code&gt;grant_type&lt;/code&gt;, &lt;code&gt;refresh_token&lt;/code&gt;, &lt;code&gt;client_id&lt;/code&gt; and &lt;code&gt;scope&lt;/code&gt;. The reply holds &lt;code&gt;access_token&lt;/code&gt;, &lt;code&gt;refresh_token&lt;/code&gt;, &lt;code&gt;expires_in&lt;/code&gt; and &lt;code&gt;scope&lt;/code&gt;, with the account and the organization.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;claude setup-token&lt;/code&gt; also sends a code&amp;rsquo;s request, with &lt;code&gt;expires_in&lt;/code&gt; of a year added, and asks only for the &lt;code&gt;user:inference&lt;/code&gt; scope, so devvm tells it apart by that field. Its reply&amp;rsquo;s access token, which must start with &lt;code&gt;sk-ant-oat01-&lt;/code&gt;, is saved as the &lt;code&gt;claude&lt;/code&gt; secret, and the VM gets the secret&amp;rsquo;s placeholder in its place, which &lt;code&gt;claude setup-token&lt;/code&gt; then prints. Any other code&amp;rsquo;s login goes in the store&amp;rsquo;s &lt;code&gt;.claude/.credentials.json&lt;/code&gt;, as Claude Code keeps it on Linux: &lt;code&gt;claudeAiOauth&lt;/code&gt; with &lt;code&gt;accessToken&lt;/code&gt;, &lt;code&gt;refreshToken&lt;/code&gt;, &lt;code&gt;expiresAt&lt;/code&gt; in Unix milliseconds and &lt;code&gt;scopes&lt;/code&gt;. A new login whose scope lacks &lt;code&gt;user:inference&lt;/code&gt; gets &lt;code&gt;502&lt;/code&gt;, because it can&amp;rsquo;t use the model. Such a login is an Anthropic Console login, which Claude Code would use to make an API key at &lt;code&gt;api.anthropic.com/api/oauth/claude_cli/create_api_key&lt;/code&gt; with the access token the VM never gets. A login or a refresh whose scope has &lt;code&gt;org:create_api_key&lt;/code&gt; also gets &lt;code&gt;502&lt;/code&gt;, whatever else it has, because the proxy puts the login into every request to &lt;code&gt;api.anthropic.com&lt;/code&gt;, so a VM could make an API key with it and get the key itself. The access token must start with &lt;code&gt;sk-ant-oat01-&lt;/code&gt; and hold no space, quote, backslash or control character, in a capture&amp;rsquo;s reply and in the host&amp;rsquo;s refresh&amp;rsquo;s. Only a VM whose image has Claude Code captures a Claude Code login, because a capture replaces the login every VM with Claude Code uses, so another VM&amp;rsquo;s gets &lt;code&gt;502&lt;/code&gt; and devvm saves nothing. The VM&amp;rsquo;s reply holds &lt;code&gt;sk-ant-oat01-devvm-proxy-managed-oauth-&amp;lt;salt&amp;gt;&lt;/code&gt; as its access token and &lt;code&gt;devvm-proxy-managed&lt;/code&gt; as its refresh token, so the Claude login in the VM&amp;rsquo;s &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, which Claude Code writes from it, holds no token. A refresh with &lt;code&gt;devvm-proxy-managed&lt;/code&gt; goes nowhere, and the VM gets the placeholders again.&lt;/p&gt;
&lt;p&gt;devvm keeps one Claude Code login. Saving the &lt;code&gt;claude&lt;/code&gt; secret, captured or with &lt;code&gt;devvm secret set claude&lt;/code&gt;, deletes the store&amp;rsquo;s &lt;code&gt;.credentials.json&lt;/code&gt;, and capturing an OAuth login deletes the saved &lt;code&gt;claude&lt;/code&gt; secret, so the newest login wins. Both happen under the lock of the store&amp;rsquo;s &lt;code&gt;logins/claude&lt;/code&gt; folder, so two at once never leave devvm with neither login, and a saved token that can&amp;rsquo;t be deleted is a warning in the proxy&amp;rsquo;s log, as the login is saved. A &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt; in devvm&amp;rsquo;s environment wins over both, as it does in Claude Code. A launch gives the VM &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt; with its placeholder when there&amp;rsquo;s a token, and otherwise the VM&amp;rsquo;s copy of &lt;code&gt;.credentials.json&lt;/code&gt;, with that placeholder, no refresh token and an expiry of 2099, never both. The copy&amp;rsquo;s &lt;code&gt;claudeAiOauth&lt;/code&gt; replaces the VM&amp;rsquo;s own in its &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, and the rest of that file, such as Claude Code&amp;rsquo;s logins to MCP servers, stays in the VM (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-login"&gt;Claude Code&amp;rsquo;s login&lt;/a&gt;). The VM&amp;rsquo;s bindings hold both logins&amp;rsquo; placeholders, the &lt;code&gt;claude&lt;/code&gt; secret&amp;rsquo;s and &lt;code&gt;claude-oauth&lt;/code&gt;, whenever devvm keeps either login, and the store&amp;rsquo;s lookup gives each the login devvm keeps now. So a VM that started with the login that the newest replaced keeps working until its next launch gives it the new one. Both put their value into &lt;code&gt;Authorization&lt;/code&gt; for &lt;code&gt;api.anthropic.com&lt;/code&gt;. Claude Code lists the connectors of the claude.ai account at &lt;code&gt;api.anthropic.com/v1/mcp_servers&lt;/code&gt;, which needs the login&amp;rsquo;s &lt;code&gt;user:mcp_servers&lt;/code&gt; scope, and then reaches each connector at &lt;code&gt;mcp-proxy.anthropic.com/v1/mcp/&amp;lt;id&amp;gt;&lt;/code&gt;, with the login&amp;rsquo;s access token too. So the VM gets a third binding, &lt;code&gt;claude-connectors&lt;/code&gt;, with &lt;code&gt;claude-oauth&lt;/code&gt;&amp;rsquo;s placeholder, which puts the login into &lt;code&gt;Authorization&lt;/code&gt; for &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; below &lt;code&gt;/v1/mcp/&lt;/code&gt; alone. It&amp;rsquo;s a binding of its own because the proxy looks a value up by its binding&amp;rsquo;s name, and the store&amp;rsquo;s lookup gives &lt;code&gt;claude-connectors&lt;/code&gt; only the OAuth login, never a token. While devvm keeps a token, saved or in its environment, that binding&amp;rsquo;s lookup fails and puts nothing in. A token in devvm&amp;rsquo;s environment isn&amp;rsquo;t checked for its scope, so it could hold the connectors&amp;rsquo; scope, and that&amp;rsquo;s why a token goes to &lt;code&gt;api.anthropic.com&lt;/code&gt; alone. Claude Code sends the &lt;code&gt;anthropic-beta&lt;/code&gt; header that names &lt;code&gt;oauth-2025-04-20&lt;/code&gt; itself, so the proxy only swaps the placeholder.&lt;/p&gt;
&lt;p&gt;The host refreshes the OAuth login when its access token is due, as Codex&amp;rsquo;s is: a JSON refresh to &lt;code&gt;platform.claude.com/v1/oauth/token&lt;/code&gt; with Claude Code&amp;rsquo;s client ID and the login&amp;rsquo;s scopes, through the company proxy the VM&amp;rsquo;s proxy goes through, written back under the file&amp;rsquo;s lock. When the refresh fails, the proxy&amp;rsquo;s log says to run &lt;code&gt;devvm agent login claude&lt;/code&gt; again (&lt;code&gt;agent_refresh_failed&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm agent login claude&lt;/code&gt; runs &lt;code&gt;claude auth login --claudeai&lt;/code&gt; in the VM, or &lt;code&gt;claude setup-token&lt;/code&gt; with &lt;code&gt;--setup-token&lt;/code&gt;, without the VM&amp;rsquo;s &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt;. Claude Code shows the address that comes back to &lt;code&gt;platform.claude.com/oauth/code/callback&lt;/code&gt;, which shows the code to paste, so devvm forwards no port. The login runs on your terminal. When devvm&amp;rsquo;s input and output are both terminals, devvm gives the login its output and errors as the files they are, so Lima&amp;rsquo;s &lt;code&gt;limactl shell&lt;/code&gt; gives it a terminal in the VM with &lt;code&gt;ssh -t&lt;/code&gt;, as it does devvm&amp;rsquo;s shell. &lt;code&gt;claude setup-token&lt;/code&gt; draws full-screen, so without that terminal it draws nothing and waits. Without a terminal, such as in a script or most end-to-end checks, the login gets pipes to devvm&amp;rsquo;s output, and with &lt;code&gt;--setup-token&lt;/code&gt; devvm warns first (&lt;code&gt;setup_token_no_terminal&lt;/code&gt;). Every agent&amp;rsquo;s login runs the same way, and either way, the login&amp;rsquo;s output goes to devvm&amp;rsquo;s output and never to the run log. On a terminal, ssh holds it in raw mode, so Ctrl-C goes to the login in the VM, which ends, and devvm then says that the login ended or saved nothing, rather than stopping as interrupted. A signal sent to devvm alone, such as &lt;code&gt;kill&lt;/code&gt;, ends the login in the VM within 10 seconds, for a VM that ends its login when told, and until then ssh may hold the terminal in raw mode and write the VM&amp;rsquo;s output to it. devvm saves the terminal&amp;rsquo;s state before the login starts, and puts it back once the login and its end are done, or in a cleanup if the run ends first, so an ssh that a signal killed in raw mode doesn&amp;rsquo;t leave your terminal that way. Once the store has a new login of the kind asked for, which devvm tells by the logins&amp;rsquo; checksums before and after, devvm sets the VM up again, so its environment and files hold the login devvm keeps now.&lt;/p&gt;
&lt;p&gt;Cursor&amp;rsquo;s CLI logs in by polling: &lt;code&gt;cursor-agent login&lt;/code&gt; shows &lt;code&gt;cursor.com/loginDeepControl&lt;/code&gt; with a PKCE challenge and a uuid, and asks &lt;code&gt;GET api2.cursor.sh/auth/poll?uuid=…&amp;amp;verifier=…&lt;/code&gt; until it answers &lt;code&gt;200&lt;/code&gt; with &lt;code&gt;accessToken&lt;/code&gt; and &lt;code&gt;refreshToken&lt;/code&gt;, or gives up. Its endpoint in &lt;code&gt;captures&lt;/code&gt; is that &lt;code&gt;GET&lt;/code&gt;, as devvm&amp;rsquo;s format for Cursor&amp;rsquo;s login names it, checked against the CLI&amp;rsquo;s Linux package 2026.11.17-f532c45, read but not run). The store&amp;rsquo;s poll is the request&amp;rsquo;s query, as a form, with its &lt;code&gt;uuid&lt;/code&gt; and its &lt;code&gt;verifier&lt;/code&gt;, and nothing else. A pending login&amp;rsquo;s &lt;code&gt;404&lt;/code&gt; passes as it is, and the success replaces the store&amp;rsquo;s &lt;code&gt;~/.config/cursor/auth.json&lt;/code&gt; with the two tokens. The VM gets &lt;code&gt;accessToken&lt;/code&gt; as a JWT-shaped placeholder that lasts until 2099, because the CLI reads its &lt;code&gt;exp&lt;/code&gt;, with the token&amp;rsquo;s &lt;code&gt;sub&lt;/code&gt;, which the CLI names the repos it indexes by, and &lt;code&gt;refreshToken&lt;/code&gt; as &lt;code&gt;devvm-proxy-managed&lt;/code&gt;, with the team that the reply chose. A reply without both tokens, such as an xAI sign-in&amp;rsquo;s, is refused and saves nothing.&lt;/p&gt;
&lt;p&gt;The login&amp;rsquo;s bindings put the token in &lt;code&gt;Authorization&lt;/code&gt; only for the methods that the CLI&amp;rsquo;s package calls, each one by its whole path, &lt;code&gt;/package.Service/Method&lt;/code&gt;: on &lt;code&gt;api2.cursor.sh&lt;/code&gt;, those of its API&amp;rsquo;s services, such as &lt;code&gt;DashboardService&lt;/code&gt;&amp;rsquo;s &lt;code&gt;GetMe&lt;/code&gt;, never its methods that make API keys, and its traces at &lt;code&gt;/v1/traces&lt;/code&gt;. On the agent&amp;rsquo;s hosts, &lt;code&gt;api5.cursor.sh&lt;/code&gt; and &lt;code&gt;*.api5.cursor.sh&lt;/code&gt;, which &lt;code&gt;api2.cursor.sh&lt;/code&gt;&amp;rsquo;s server config names, and on &lt;code&gt;api2.cursor.sh&lt;/code&gt;, where HTTP/1.1 takes it, only the agent&amp;rsquo;s stream, &lt;code&gt;Run&lt;/code&gt; and &lt;code&gt;RunSSE&lt;/code&gt;, and &lt;code&gt;BidiAppend&lt;/code&gt;. On &lt;code&gt;repo42.cursor.sh&lt;/code&gt;, its indexing, only its five indexing methods. The package checks the agent&amp;rsquo;s hosts only for being URLs and names none of them, so devvm takes every host below &lt;code&gt;api5.cursor.sh&lt;/code&gt;, the one Cursor&amp;rsquo;s network docs name. On every one of those hosts the proxy refuses, with &lt;code&gt;403&lt;/code&gt;, any request below &lt;code&gt;/auth/&lt;/code&gt; other than the poll it captures, so no other login endpoint there hands the VM tokens. It also refuses the API&amp;rsquo;s other methods that make, show or exchange a credential, which are the ones that the package defines by name and, in any service, any method whose name has a key, a secret, a token, a login, a session, auth, a cookie, a password, a JWT, an invitation or a link in it. It refuses the methods that change the account in a way that outlasts the VM and acts outside it, as the proxy refuses GitHub&amp;rsquo;s keys and webhooks, though the CLI calls them on the host: installing, updating and removing plugins and marketplaces, applying, deleting, testing and changing automations, setting and deleting cloud agents&amp;rsquo; environments, starting a cloud agent, and checking Bedrock keys, which devvm doesn&amp;rsquo;t keep. It refuses every method of the agent store&amp;rsquo;s service, &lt;code&gt;AgentStoreService&lt;/code&gt;, and of any service of any package whose name starts with &lt;code&gt;AgentStore&lt;/code&gt;, in any case, because the agent store isn&amp;rsquo;t the VM&amp;rsquo;s alone. The account&amp;rsquo;s CLIs on every machine and its cloud agents mount its user store read-write, its cloud agents load the skills in that store as instructions, every member of a team mounts the team&amp;rsquo;s store, and a path in a store can be shared with the team or the public. The store&amp;rsquo;s methods also take a token of its own, which &lt;code&gt;MintAgentStoreToken&lt;/code&gt; makes and which a VM could send out and use from elsewhere until it expires, so the VM gets neither the token nor the store, and the CLI keeps its sessions in a local database without them. In the services that hold the account&amp;rsquo;s and its teams&amp;rsquo; own state, &lt;code&gt;DashboardService&lt;/code&gt;, &lt;code&gt;AutomationsService&lt;/code&gt; and &lt;code&gt;BackgroundComposerService&lt;/code&gt;, it refuses any method whose name starts with a verb that changes something, such as &lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;Install&lt;/code&gt;, &lt;code&gt;Start&lt;/code&gt;, &lt;code&gt;Commit&lt;/code&gt;, &lt;code&gt;Merge&lt;/code&gt;, &lt;code&gt;Fork&lt;/code&gt;, &lt;code&gt;Write&lt;/code&gt; or &lt;code&gt;Pin&lt;/code&gt;, as those services define many more. Each verb was checked against every method of those services in the pinned release, and none matches a method the CLI calls. A verb such as &lt;code&gt;Submit&lt;/code&gt;, whose &lt;code&gt;SubmitFeedback&lt;/code&gt; the CLI calls, or &lt;code&gt;Check&lt;/code&gt; or &lt;code&gt;Generate&lt;/code&gt;, whose methods also only read, isn&amp;rsquo;t on the list, so &lt;code&gt;GenerateGrokCollectionDescription&lt;/code&gt;, which drafts a description and only returns it, passes. &lt;code&gt;Test&lt;/code&gt; matches one method that only reads, &lt;code&gt;TestAutomationFilter&lt;/code&gt;, a dry run of an automation&amp;rsquo;s filter, and stays on the list for &lt;code&gt;TestTeamCustomerTelemetryDestinationConnection&lt;/code&gt;, which has Cursor&amp;rsquo;s servers send a request with any headers to any address. It also refuses every path below &lt;code&gt;/cloud-agent/&lt;/code&gt;, where &lt;code&gt;cursor-agent worker&lt;/code&gt;, which makes the machine a worker for your cloud agents, gets its identity tokens. That worker connects to &lt;code&gt;api2direct.cursor.sh&lt;/code&gt;, which has no bindings, with &lt;code&gt;Host: api2.cursor.sh&lt;/code&gt;, so the proxy doesn&amp;rsquo;t open its tunnel and the login never goes in, and on the allowlist tier the host isn&amp;rsquo;t allowed either. The list of verbs is defence in depth, because the bindings put the login only into the methods the CLI calls. A changing method whose name starts with a verb that the list doesn&amp;rsquo;t have, such as &lt;code&gt;ResolveReviewThread&lt;/code&gt;, whose verb also starts methods that only read, isn&amp;rsquo;t refused by the list, but it gets no login from the proxy either. So in a VM, Cursor&amp;rsquo;s CLI can&amp;rsquo;t do those, and you do them from Cursor on your machine. It also refuses any path it can&amp;rsquo;t read as those hosts do, with an escape, path parameters, a backslash, a byte past ASCII&amp;rsquo;s printable ones, a segment that ends in a dot or a space, or one that cleaning changes, and any request for a part of a reply (&lt;code&gt;Range&lt;/code&gt;), as the proxy could then see no more than a part of a token.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;api2.cursor.sh&lt;/code&gt; also serves the CLI&amp;rsquo;s API, whose agent replies stream, so the endpoint&amp;rsquo;s guard is &lt;code&gt;/auth/&lt;/code&gt;, with the CLI&amp;rsquo;s own token fields, such as &lt;code&gt;accessToken&lt;/code&gt;, &lt;code&gt;sessionToken&lt;/code&gt; and &lt;code&gt;apiKey&lt;/code&gt;, and any JWT added to what guard refuses there, and any cookie dropped. The bindings and those refusals are the real control. The rest is a defence in depth. On every one of Cursor&amp;rsquo;s hosts, the proxy drops the VM&amp;rsquo;s &lt;code&gt;Accept-Encoding&lt;/code&gt;, &lt;code&gt;Connect-Accept-Encoding&lt;/code&gt; and &lt;code&gt;Grpc-Accept-Encoding&lt;/code&gt; from each request, so each reply comes as it is, or as gzip that Go&amp;rsquo;s transport undoes. A Connect or gRPC server still compresses a stream&amp;rsquo;s messages with gzip when the request&amp;rsquo;s are, as the CLI&amp;rsquo;s agent stream&amp;rsquo;s are. It drops any &lt;code&gt;Set-Cookie&lt;/code&gt; from the reply, because the CLI keeps no cookies, and it refuses a reply that comes encoded anyway, by HTTP, or by Connect or gRPC in any way but a stream&amp;rsquo;s gzip, a part of a reply (&lt;code&gt;206&lt;/code&gt;), and a reply with a JWT&amp;rsquo;s start in any header, its name or its value. A Connect or gRPC stream, which its &lt;code&gt;Content-Type&lt;/code&gt; names, passes message by message: the proxy reads each message whole, at most 16 MiB as it comes and as it decompresses, gunzips it when its flag says it&amp;rsquo;s compressed, and checks it for a JWT&amp;rsquo;s start before any of it passes, as it came. Connect&amp;rsquo;s end of stream is JSON, and so is every message of a stream whose &lt;code&gt;Content-Type&lt;/code&gt; says JSON, so the proxy checks those messages&amp;rsquo; strings as they decode, escapes undone. It refuses gRPC-Web&amp;rsquo;s text variant, a whole body in base64, outright. A token in base64, such as in a &lt;code&gt;-bin&lt;/code&gt; header or a protobuf &lt;code&gt;bytes&lt;/code&gt; field of a JSON stream, isn&amp;rsquo;t found, as before. A message with a token, a flag the proxy doesn&amp;rsquo;t know, a compressed message that isn&amp;rsquo;t gzip, one over the limit or an envelope cut off ends the stream there, before that message. Every other reply&amp;rsquo;s body, of any status, length or type, passes through a reader that keeps the last 4 KiB that passed and fails at the read that would complete a JWT&amp;rsquo;s start, a header and the start of its claims, passing none of that read. The reply then ends there, so the token&amp;rsquo;s claims and signature never reach the VM, though its header may. At the body&amp;rsquo;s end the reader checks the reply&amp;rsquo;s trailers, which HTTP/2 and gRPC send after it, in the same way, and fails before the proxy sends them. Upgrades and informational replies are refused on every path, because the CLI uses neither. A token in another shape, such as an opaque one or one that the reply encodes in a way of its own, could still reach the VM. So could a presigned address that isn&amp;rsquo;t a JWT, such as one for cloud storage, in the reply of a method the login goes to, and the VM could then use it from anywhere until it expires. Refusing a path stops only the requests the VM makes, so a write that Cursor&amp;rsquo;s server makes on its own, as a side effect of a method the login goes to, such as one to the agent store, isn&amp;rsquo;t stopped either. devvm checked the CLI&amp;rsquo;s behaviour against one release of it by reading its code, not against Cursor&amp;rsquo;s servers. devvm doesn&amp;rsquo;t guard Cursor&amp;rsquo;s other hosts either: if one of them also answered &lt;code&gt;/auth/poll&lt;/code&gt;, a VM could finish a login there and keep its tokens, though none is known to. Unauthenticated requests for &lt;code&gt;/auth/poll&lt;/code&gt; with an unknown login got &lt;code&gt;404 Not found&lt;/code&gt; from &lt;code&gt;api2.cursor.sh&lt;/code&gt;, as a pending login does, and a route-not-found &lt;code&gt;404&lt;/code&gt; from &lt;code&gt;agent.api5.cursor.sh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The CLI never refreshes a login with its refresh token: only an API key is exchanged for a token, at &lt;code&gt;/auth/exchange_user_api_key&lt;/code&gt;, which the proxy refuses, as devvm keeps no Cursor API key. So the host doesn&amp;rsquo;t refresh it either, and once the access token&amp;rsquo;s &lt;code&gt;exp&lt;/code&gt; has passed, the lookup fails with &lt;code&gt;agent_refresh_failed&lt;/code&gt;, which says to log in again.&lt;/p&gt;
&lt;p&gt;Any VM with the agent can replace the store&amp;rsquo;s login, because the store keeps one login for each agent. A VM you don&amp;rsquo;t trust can log your other VMs in to an account of its choosing, and their requests then go to that account. Claude Code&amp;rsquo;s long-lived tokens have the same shape whatever asks for one, so a token that Claude Code mints in a VM for another use, such as &lt;code&gt;claude /install-github-app&lt;/code&gt;&amp;rsquo;s, becomes devvm&amp;rsquo;s Claude Code login too, and what the VM gets is its placeholder, which works only through its proxy. A VM with Claude Code can also use the login, through its proxy, for whatever else its scopes allow at &lt;code&gt;api.anthropic.com&lt;/code&gt;, beyond the model, such as reading the account&amp;rsquo;s profile, and devvm doesn&amp;rsquo;t limit the paths it goes to there. At &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt;, below &lt;code&gt;/v1/mcp/&lt;/code&gt;, it can call any of the account&amp;rsquo;s claude.ai connectors with any method, as Claude Code can, and each connector acts in the service it connects to with the access you gave it, so the VM can read what you connected, such as mail or documents, and send through a connector that sends. A deny of &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; in your rules, on every tier but open, keeps connectors from a VM (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;your claude.ai connectors&lt;/a&gt;). devvm doesn&amp;rsquo;t guard Anthropic&amp;rsquo;s other hosts either. If one of them also answered &lt;code&gt;/v1/oauth/token&lt;/code&gt;, a VM could exchange its code there and keep the login&amp;rsquo;s tokens, though none is known to. On the open tier, a program in the VM can go around its proxy, and then it gets the login&amp;rsquo;s tokens itself and devvm saves nothing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tests:&lt;/strong&gt; the unit tests check what goes out and what the VM gets, its headers included, which paths are captured and the one they go to, that tokens from another path are refused, that no &lt;code&gt;1xx&lt;/code&gt; reaches the VM, an answered request and a login saved without its bindings, that an error passes, with its code alone after a real value went out, and that what can&amp;rsquo;t be read is refused. They check each agent&amp;rsquo;s file, the VM&amp;rsquo;s placeholders and copies, the exchange, the VM&amp;rsquo;s own refresh, a Console login refused, setup-token&amp;rsquo;s request told apart, the host&amp;rsquo;s refresh of Claude Code&amp;rsquo;s login and repeated fields, and that the newest Claude Code login replaces the other, the environment&amp;rsquo;s token wins, both logins&amp;rsquo; bindings get the login devvm keeps while the connectors&amp;rsquo; binding gets the OAuth login alone, never a saved token or the environment&amp;rsquo;s, and the VM&amp;rsquo;s copy holds placeholders. They also check that every VM&amp;rsquo;s config has the endpoints on every tier, which agent a capture is, that a VM captures no login for an agent its image doesn&amp;rsquo;t have, that a capture writes the VM&amp;rsquo;s bindings, and that an agent&amp;rsquo;s login gets the terminal&amp;rsquo;s files only when devvm&amp;rsquo;s input and output are both terminals, and pipes otherwise (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#the-tests-behind-how-it-works"&gt;the tests behind it&lt;/a&gt;). &lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;network&lt;/code&gt;): a fake token endpoint behind a company proxy of the run&amp;rsquo;s own, which the VM reaches through its proxy; the store gets the real tokens and the API key, the VM&amp;rsquo;s replies hold placeholders and no refresh token, no log holds a value, and the VM&amp;rsquo;s next launch gets the login as placeholders. For Claude Code, the same company proxy fakes Claude&amp;rsquo;s token endpoint and Anthropic&amp;rsquo;s API: &lt;code&gt;claude setup-token&lt;/code&gt;&amp;rsquo;s request makes the &lt;code&gt;claude&lt;/code&gt; secret and the VM gets its placeholder, the real Claude Code&amp;rsquo;s &lt;code&gt;claude auth login&lt;/code&gt; through &lt;code&gt;devvm agent login claude&lt;/code&gt; saves the login in the store and leaves placeholders alone in the VM, &lt;code&gt;devvm agent login claude --setup-token&lt;/code&gt;, run in a terminal of its own, shows Claude Code&amp;rsquo;s address, the API gets the store&amp;rsquo;s token for the VM&amp;rsquo;s placeholders, &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; gets only placeholders while devvm keeps the &lt;code&gt;claude&lt;/code&gt; secret, whichever of the two the VM sends, and a login that&amp;rsquo;s due makes the host refresh it at Claude&amp;rsquo;s endpoint through the company proxy, after which both the API and &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; get the refreshed access token.&lt;/p&gt;
&lt;h3 data-hextra-search-id="mcp-servers"&gt;MCP servers&lt;span class="hx:absolute hx:-mt-20" id="mcp-servers"&gt;&lt;/span&gt;
&lt;a href="#mcp-servers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On each launch, devvm merges the settings and MCP servers from the store&amp;rsquo;s &lt;code&gt;.claude.json&lt;/code&gt;, &lt;code&gt;~/.local/share/devvm/logins/claude/.claude.json&lt;/code&gt;, into the VM&amp;rsquo;s own &lt;code&gt;~/.claude.json&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each of your servers replaces the VM&amp;rsquo;s server of that name whole.&lt;/li&gt;
&lt;li&gt;devvm removes the servers it copied before that you no longer have.&lt;/li&gt;
&lt;li&gt;Servers added in the VM stay.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The copy holds only your settings, onboarding and account state, and MCP servers. Everything else stays out, such as &lt;code&gt;primaryApiKey&lt;/code&gt;, &lt;code&gt;customApiKeyResponses&lt;/code&gt; and your per-project entries, which &lt;code&gt;devvm agent import&lt;/code&gt; already leaves out of the store, and the VM keeps its own value of each. So the VM keeps its own per-project entries, such as trust and allowed tools, and yours never go in. Your account state, &lt;code&gt;oauthAccount&lt;/code&gt;, keeps only the fields that Claude Code 2.1.319 writes there: its profile (&lt;code&gt;accountUuid&lt;/code&gt;, &lt;code&gt;emailAddress&lt;/code&gt;, &lt;code&gt;organizationUuid&lt;/code&gt;, &lt;code&gt;hasExtraUsageEnabled&lt;/code&gt;, &lt;code&gt;billingType&lt;/code&gt;, &lt;code&gt;accountCreatedAt&lt;/code&gt;, &lt;code&gt;subscriptionCreatedAt&lt;/code&gt;, &lt;code&gt;claudeCodeTrialEndsAt&lt;/code&gt;, &lt;code&gt;claudeCodeTrialDurationDays&lt;/code&gt;, &lt;code&gt;seatTier&lt;/code&gt;, &lt;code&gt;planDisplayName&lt;/code&gt;, &lt;code&gt;displayName&lt;/code&gt;, &lt;code&gt;fullName&lt;/code&gt; and &lt;code&gt;profileFetchedAt&lt;/code&gt;), its roles (&lt;code&gt;organizationRole&lt;/code&gt;, &lt;code&gt;workspaceRole&lt;/code&gt; and &lt;code&gt;organizationName&lt;/code&gt;) and its rate-limit tiers (&lt;code&gt;organizationType&lt;/code&gt;, &lt;code&gt;organizationRateLimitTier&lt;/code&gt; and &lt;code&gt;userRateLimitTier&lt;/code&gt;), each a plain value. Its &lt;code&gt;ccOnboardingFlags&lt;/code&gt; stays as an empty object, because Claude Code fetches your profile again while that field is missing, and the flags in it stay out. devvm leaves every other field of &lt;code&gt;oauthAccount&lt;/code&gt; out of the VM&amp;rsquo;s copy and warns you, naming each by its path, such as &lt;code&gt;oauthAccount.zz&lt;/code&gt; (&lt;code&gt;login_fields_withheld&lt;/code&gt;), and the unit test that plants unknown fields checks &lt;code&gt;~/.claude.json&lt;/code&gt; as it checks the other login files. If devvm can&amp;rsquo;t read the store&amp;rsquo;s &lt;code&gt;.claude.json&lt;/code&gt;, it stops the VM&amp;rsquo;s setup (&lt;code&gt;login_copy_failed&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;On every tier, an HTTPS server&amp;rsquo;s headers become bindings for its host, which must be a DNS name on port 443. devvm replaces these with &lt;code&gt;devvm-redacted&lt;/code&gt;: env values, plain-HTTP servers&amp;rsquo; headers, user info and secret-looking values in URLs, and secret-named or key-shaped arguments. A server&amp;rsquo;s &lt;code&gt;command&lt;/code&gt; and &lt;code&gt;headersHelper&lt;/code&gt;, which are shell commands, lose the same words as other text in settings files (&lt;a href="#keys-in-settings-files"&gt;keys in settings files&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="keys-in-settings-files"&gt;Keys in settings files&lt;span class="hx:absolute hx:-mt-20" id="keys-in-settings-files"&gt;&lt;/span&gt;
&lt;a href="#keys-in-settings-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm also takes the keys out of the VM&amp;rsquo;s copies of the agents&amp;rsquo; settings files, which are &lt;code&gt;~/.claude/settings.json&lt;/code&gt;, &lt;code&gt;~/.codex/config.toml&lt;/code&gt;, opencode&amp;rsquo;s &lt;code&gt;.json&lt;/code&gt;, &lt;code&gt;.jsonc&lt;/code&gt; and &lt;code&gt;.toml&lt;/code&gt; files and pi&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt;, &lt;code&gt;models.json&lt;/code&gt; and &lt;code&gt;mcp.json&lt;/code&gt;. Those are JSON, JSONC or TOML, and devvm parses each file whole and writes the VM&amp;rsquo;s copy from what it parsed, so a JSONC file&amp;rsquo;s copy is JSON and a TOML file&amp;rsquo;s copy has no comments. devvm replaces these with &lt;code&gt;devvm-redacted&lt;/code&gt;, and names what it replaced (&lt;code&gt;config_redacted&lt;/code&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every value under a key that looks like a secret&amp;rsquo;s (&lt;code&gt;*key*&lt;/code&gt;, &lt;code&gt;*token*&lt;/code&gt;, &lt;code&gt;*secret*&lt;/code&gt;, &lt;code&gt;*password*&lt;/code&gt;, &lt;code&gt;Authorization&lt;/code&gt;), and every string in a list or a table under such a key, but key bindings, such as opencode&amp;rsquo;s &lt;code&gt;keybinds&lt;/code&gt;. A name you choose isn&amp;rsquo;t judged that way, so an MCP server, a plugin or a marketplace named &lt;code&gt;secret-scanner&lt;/code&gt; or &lt;code&gt;token-saver&lt;/code&gt; keeps its settings, while its own fields, such as its &lt;code&gt;env&lt;/code&gt; or an &lt;code&gt;apiKey&lt;/code&gt;, are judged as anywhere else. devvm knows the agents&amp;rsquo; tables of names from their docs, and reads every agent&amp;rsquo;s settings files with all of them: Claude Code&amp;rsquo;s &lt;code&gt;mcpServers&lt;/code&gt;, &lt;code&gt;extraKnownMarketplaces&lt;/code&gt;, &lt;code&gt;pluginConfigs&lt;/code&gt;, &lt;code&gt;enabledPlugins&lt;/code&gt; and &lt;code&gt;skillOverrides&lt;/code&gt; among them, Codex&amp;rsquo;s &lt;code&gt;mcp_servers&lt;/code&gt;, &lt;code&gt;model_providers&lt;/code&gt;, &lt;code&gt;marketplaces&lt;/code&gt;, &lt;code&gt;plugins&lt;/code&gt;, &lt;code&gt;projects&lt;/code&gt; and &lt;code&gt;hooks.state&lt;/code&gt;, opencode&amp;rsquo;s &lt;code&gt;mcp&lt;/code&gt;, &lt;code&gt;provider&lt;/code&gt;, &lt;code&gt;agent&lt;/code&gt; and &lt;code&gt;command&lt;/code&gt;, with their 2.x names, and pi&amp;rsquo;s &lt;code&gt;providers&lt;/code&gt; and &lt;code&gt;mcpServers&lt;/code&gt;. In most of those tables, only a table under a name escapes the check, so a string right under &lt;code&gt;mcpServers&lt;/code&gt; with a secret-looking key is still replaced. In tables of settings, such as Claude Code&amp;rsquo;s &lt;code&gt;enabledPlugins&lt;/code&gt; and &lt;code&gt;skillOverrides&lt;/code&gt;, a table and a setting&amp;rsquo;s word, such as &lt;code&gt;off&lt;/code&gt; or &lt;code&gt;name-only&lt;/code&gt;, which has only lower-case letters and dashes, aren&amp;rsquo;t judged by their name either, while any other value is. A name that&amp;rsquo;s an env or headers table&amp;rsquo;s key, such as a server named &lt;code&gt;env&lt;/code&gt;, still gets its values replaced.&lt;/li&gt;
&lt;li&gt;Any string that starts like a known key or token, such as &lt;code&gt;sk-&lt;/code&gt;, &lt;code&gt;ghp_&lt;/code&gt; or &lt;code&gt;eyJ&lt;/code&gt;, wherever it is.&lt;/li&gt;
&lt;li&gt;Every value in an env or headers table, whatever its name: &lt;code&gt;env&lt;/code&gt;, &lt;code&gt;environment&lt;/code&gt;, &lt;code&gt;headers&lt;/code&gt;, &lt;code&gt;http_headers&lt;/code&gt;, and Codex&amp;rsquo;s &lt;code&gt;shell_environment_policy.set&lt;/code&gt;. A number of up to five digits, &lt;code&gt;true&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt; stay, because they&amp;rsquo;re switches and ports. In Claude Code&amp;rsquo;s own &lt;code&gt;env&lt;/code&gt;, the top-level one of &lt;code&gt;settings.json&lt;/code&gt;, its &lt;a href="https://code.claude.com/docs/en/env-vars" target="_blank" rel="noopener"&gt;configuration variables&lt;/a&gt; stay too: &lt;code&gt;ANTHROPIC_MODEL&lt;/code&gt;, &lt;code&gt;ANTHROPIC_SMALL_FAST_MODEL&lt;/code&gt;, the &lt;code&gt;ANTHROPIC_DEFAULT_*_MODEL&lt;/code&gt; and &lt;code&gt;ANTHROPIC_CUSTOM_MODEL_OPTION&lt;/code&gt; families, &lt;code&gt;CLAUDE_CODE_*&lt;/code&gt;, &lt;code&gt;DISABLE_*&lt;/code&gt;, &lt;code&gt;MAX_*&lt;/code&gt; and &lt;code&gt;*_TIMEOUT_MS&lt;/code&gt;. A variable whose name has &lt;code&gt;KEY&lt;/code&gt;, &lt;code&gt;TOKEN&lt;/code&gt; as a word, &lt;code&gt;SECRET&lt;/code&gt;, &lt;code&gt;PASS&lt;/code&gt;, &lt;code&gt;AUTH&lt;/code&gt;, &lt;code&gt;CREDENTIAL&lt;/code&gt;, &lt;code&gt;COOKIE&lt;/code&gt; or &lt;code&gt;HEADER&lt;/code&gt; in it is redacted all the same, such as &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt;, and so is its value when it&amp;rsquo;s a URL.&lt;/li&gt;
&lt;li&gt;In a URL anywhere in the file, a string&amp;rsquo;s whole value or a part of other text, its user info and its secret-looking query values and path segments.&lt;/li&gt;
&lt;li&gt;In every list, the arguments that MCP servers&amp;rsquo; arguments in &lt;code&gt;~/.claude.json&lt;/code&gt; lose: the value after a secret-named flag, such as &lt;code&gt;--api-key X&lt;/code&gt;, the value of &lt;code&gt;--token=X&lt;/code&gt;, and any that looks like a key.&lt;/li&gt;
&lt;li&gt;In any other string, such as a hook&amp;rsquo;s command or an argument that holds a header, each word that starts like a known key, and the credential after &lt;code&gt;Bearer&lt;/code&gt; or &lt;code&gt;Basic&lt;/code&gt;, quoted or not, when it has 16 or more characters, with a digit, &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt; or &lt;code&gt;=&lt;/code&gt; among them, which words don&amp;rsquo;t have, and isn&amp;rsquo;t a path. devvm replaces only those words, so &lt;code&gt;curl -H 'x-api-key: sk-…' URL&lt;/code&gt; becomes &lt;code&gt;curl -H 'x-api-key: devvm-redacted' URL&lt;/code&gt;, and a reference such as &lt;code&gt;Bearer ${GITHUB_TOKEN}&lt;/code&gt; stays. MCP servers&amp;rsquo; arguments, &lt;code&gt;command&lt;/code&gt; and &lt;code&gt;headersHelper&lt;/code&gt; in &lt;code&gt;~/.claude.json&lt;/code&gt; lose the same words.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Values that only name where a secret is stay as they are. Those are an environment variable&amp;rsquo;s name (&lt;code&gt;env_key = &amp;quot;OPENAI_API_KEY&amp;quot;&lt;/code&gt;), &lt;code&gt;{env:X}&lt;/code&gt;, &lt;code&gt;${X}&lt;/code&gt; and a path. devvm refuses a file that doesn&amp;rsquo;t parse as its format, instead of copying any of it unread, so the VM doesn&amp;rsquo;t get that file (&lt;code&gt;config_not_copied&lt;/code&gt;). The VM doesn&amp;rsquo;t get opencode&amp;rsquo;s other files in &lt;code&gt;~/.config/opencode&lt;/code&gt; either, such as a &lt;code&gt;.env&lt;/code&gt;, because devvm can&amp;rsquo;t take secrets out of them, apart from its Markdown files, such as &lt;code&gt;AGENTS.md&lt;/code&gt;, which hold instructions for the agent (&lt;code&gt;config_not_copied&lt;/code&gt;). An MCP server or a provider that needs one of those keys in the VM has to get it another way.&lt;/p&gt;
&lt;h3 data-hextra-search-id="saving-the-copies-back"&gt;Saving the copies back&lt;span class="hx:absolute hx:-mt-20" id="saving-the-copies-back"&gt;&lt;/span&gt;
&lt;a href="#saving-the-copies-back" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent save&lt;/code&gt; reads the VM&amp;rsquo;s copies back, and they hold &lt;code&gt;devvm-redacted&lt;/code&gt; and the proxy&amp;rsquo;s placeholders where devvm&amp;rsquo;s agent store has your secrets (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;). devvm parses the VM&amp;rsquo;s file whole, and when it holds a placeholder, devvm also makes the copy the VM got from the store&amp;rsquo;s file again: the same redaction for a settings file, and for &lt;code&gt;~/.claude.json&lt;/code&gt; the copy with the VM&amp;rsquo;s own salted placeholders. Each placeholder gets the store&amp;rsquo;s value at the same path, but only when the copy had the same placeholder there, and when the table the placeholder is in and the table above that one, below the file&amp;rsquo;s top level, are the same as in the copy. Those tables say where the secret goes, such as an MCP server&amp;rsquo;s &lt;code&gt;url&lt;/code&gt; beside its &lt;code&gt;headers&lt;/code&gt;, a provider&amp;rsquo;s &lt;code&gt;baseURL&lt;/code&gt; beside its &lt;code&gt;apiKey&lt;/code&gt; and an &lt;code&gt;env&lt;/code&gt; table&amp;rsquo;s base URL beside its key, so a VM can&amp;rsquo;t keep a placeholder and point it at another host. A placeholder that fails the check leaves the whole file out of the save (&lt;code&gt;agent_save_placeholder&lt;/code&gt;), and so does a placeholder in a file without a format devvm parses, such as a skill. A file with placeholders put back is written as devvm writes the VM&amp;rsquo;s copies, as JSON or as TOML without comments, and a file without placeholders is saved as the VM has it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-stays-in-the-vms-copies"&gt;What stays in the VM&amp;rsquo;s copies&lt;span class="hx:absolute hx:-mt-20" id="what-stays-in-the-vms-copies"&gt;&lt;/span&gt;
&lt;a href="#what-stays-in-the-vms-copies" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Taking secrets out of a file works only where devvm can tell a secret from the rest, so some go into the VM on every tier, and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#secrets-and-keys-the-vm-may-use"&gt;keys devvm can&amp;rsquo;t tell apart&lt;/a&gt; lists them among what devvm leaves open:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The agents&amp;rsquo; mounted folders.&lt;/strong&gt; devvm mounts Claude Code&amp;rsquo;s &lt;code&gt;skills&lt;/code&gt;, &lt;code&gt;agents&lt;/code&gt;, &lt;code&gt;commands&lt;/code&gt;, &lt;code&gt;output-styles&lt;/code&gt; and &lt;code&gt;plugins&lt;/code&gt;, Codex&amp;rsquo;s &lt;code&gt;prompts&lt;/code&gt; and &lt;code&gt;skills&lt;/code&gt;, opencode&amp;rsquo;s subfolders, and pi&amp;rsquo;s &lt;code&gt;extensions&lt;/code&gt;, &lt;code&gt;skills&lt;/code&gt;, &lt;code&gt;prompts&lt;/code&gt; and &lt;code&gt;themes&lt;/code&gt; whole and read-only, so every file in them reaches the VM, a &lt;code&gt;.env&lt;/code&gt; in &lt;code&gt;~/.config/opencode/plugin&lt;/code&gt; included. So does a plugin marketplace&amp;rsquo;s git config in &lt;code&gt;~/.claude/plugins/marketplaces&lt;/code&gt;, which holds a password or a token when you added a private marketplace with one in its URL. These folders hold code that the agent runs, such as plugins, hooks and the scripts that skills call, so a copy with only settings and Markdown, as opencode&amp;rsquo;s config folder&amp;rsquo;s files get, would break them. A copy without files whose names look secret, such as &lt;code&gt;.env&lt;/code&gt; or &lt;code&gt;*.pem&lt;/code&gt;, would miss a key in any other file, and it would need a copy of each folder, which can be large, on every launch, while a mount shows the changes to devvm&amp;rsquo;s agent store at once. So devvm mounts them as they are, and the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;coding agents page&lt;/a&gt; says to keep secrets out of them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free text of an unknown shape.&lt;/strong&gt; A key in other text, such as a hook&amp;rsquo;s command, stays when it neither starts like a known key nor follows &lt;code&gt;Bearer&lt;/code&gt; or &lt;code&gt;Basic&lt;/code&gt;, because devvm can&amp;rsquo;t tell it from a word.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logins devvm can&amp;rsquo;t bind.&lt;/strong&gt; opencode&amp;rsquo;s and pi&amp;rsquo;s keys that devvm can&amp;rsquo;t bind, a local model server&amp;rsquo;s among them, are withheld unless &lt;code&gt;[pass-keys]&lt;/code&gt; lists their provider, and then they go as they are (&lt;code&gt;login_passed&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pi&amp;rsquo;s settings that undo devvm&amp;rsquo;s.&lt;/strong&gt; The VM&amp;rsquo;s copy of pi&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt; leaves out &lt;code&gt;httpProxy&lt;/code&gt;, &lt;code&gt;sessionDir&lt;/code&gt; and &lt;code&gt;selfUpdateCommand&lt;/code&gt; (&lt;code&gt;pi_settings_dropped&lt;/code&gt;), and devvm warns when it sets &lt;code&gt;defaultProjectTrust&lt;/code&gt; to &lt;code&gt;always&lt;/code&gt; (&lt;code&gt;pi_trusts_all&lt;/code&gt;). Its other settings stay, with their keys taken out as above.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-self-check"&gt;The self-check&lt;span class="hx:absolute hx:-mt-20" id="the-self-check"&gt;&lt;/span&gt;
&lt;a href="#the-self-check" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A confined tier holds only while the VM runs on the process that devvm started confined. A process can&amp;rsquo;t leave its sandbox, but &lt;code&gt;limactl start&lt;/code&gt; starts a new Lima process, unconfined. So on every launch, and whenever an export or &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s check of a &lt;code&gt;--clone&lt;/code&gt; VM needs the VM running, whether devvm started the VM or found it running, devvm checks two things, from the host:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;That the VM still runs on the process devvm started. The VM can&amp;rsquo;t fake this check.&lt;/li&gt;
&lt;li&gt;That a direct connection from the VM to the internet fails. The VM answers this check, so it catches only the honest case.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;devvm records the result in the VM&amp;rsquo;s state, as &lt;code&gt;ok&lt;/code&gt; or &lt;code&gt;unenforced&lt;/code&gt; in the &lt;code&gt;net&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;made.check&lt;/code&gt;. When the check fails, what devvm does depends on why:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The VM wasn&amp;rsquo;t started confined,&lt;/strong&gt; because it was started outside devvm or has been running since before &lt;code&gt;devvm network&lt;/code&gt; moved it from open to a confined tier. In a terminal, devvm offers to restart the VM confined (&lt;code&gt;net_unenforced_restart&lt;/code&gt;), and if you decline, it warns you and goes on (&lt;code&gt;net_unenforced&lt;/code&gt;). Without a terminal, or if the VM is still unenforced after the restart, devvm stops the VM and ends without opening a shell (&lt;code&gt;net_unenforced_stop&lt;/code&gt;). The next &lt;code&gt;devvm&lt;/code&gt; starts the VM confined.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM was started confined, yet it gets out,&lt;/strong&gt; because it reaches the internet through something devvm didn&amp;rsquo;t set up, such as a second network. A restart wouldn&amp;rsquo;t help, so devvm stops the VM and ends (&lt;code&gt;net_direct_route&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is the check, and what devvm does when it fails:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 1086px; --devvm-diagram-width: 643px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 643 1086" width="643" height="1086" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="dc7b02a0e328ce16f--title" aria-describedby="dc7b02a0e328ce16f--desc"&gt;&lt;title id="dc7b02a0e328ce16f--title"&gt;The self-check on every launch&lt;/title&gt;&lt;desc id="dc7b02a0e328ce16f--desc"&gt;On every launch, devvm checks that the VM runs on the process devvm started and that a direct connection from it fails. If either isn't so, the check is unenforced. A VM started confined is then stopped, because it has another way out. Otherwise, without a terminal, devvm stops the VM without a shell, and the next devvm starts it confined. In a terminal, devvm offers to restart it confined, and warns and goes on if you say no, or stops it if the check still fails after the restart.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_launch_proc_0"&gt;&lt;path d="M191.91,53L191.91,91"/&gt;&lt;path class="pele-marker" d="M191.91,98L188.55,90L195.27,90Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_proc_direct_0"&gt;&lt;path d="M163.55,158L163.55,164Q163.55,176 151.55,176L122.64,176Q110.64,176 110.64,188L110.64,231.5"/&gt;&lt;path class="pele-marker" d="M110.64,238.5L107.28,230.5L114,230.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_direct_ok_0"&gt;&lt;path d="M85.5,298.5L85.5,372"/&gt;&lt;path class="pele-marker" d="M85.5,379L82.14,371L88.86,371Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_proc_un_0"&gt;&lt;path d="M220.27,158L220.27,164Q220.27,176 232.27,176L278.32,176Q290.32,176 290.32,188L290.32,372"/&gt;&lt;path class="pele-marker" d="M290.32,379L286.96,371L293.68,371Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_direct_un_0"&gt;&lt;path d="M161.27,298.5L161.27,304.5Q161.27,316.5 173.27,316.5L255.41,316.5Q267.41,316.5 267.41,328.5L267.41,372"/&gt;&lt;path class="pele-marker" d="M267.41,379L264.05,371L270.77,371Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_un_confined_0"&gt;&lt;path d="M282.32,424L282.32,462"/&gt;&lt;path class="pele-marker" d="M282.32,469L278.96,461L285.68,461Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_confined_route_0"&gt;&lt;path d="M240.59,514L240.59,520Q240.59,532 228.59,532L202.59,532Q190.59,532 190.59,544L190.59,601.5"/&gt;&lt;path class="pele-marker" d="M190.59,608.5L187.23,600.5L193.95,600.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_confined_term_0"&gt;&lt;path d="M324.05,514L324.05,520Q324.05,532 336.05,532L362.05,532Q374.05,532 374.05,544L374.05,609"/&gt;&lt;path class="pele-marker" d="M374.05,616L370.69,608L377.41,608Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_term_stop_0"&gt;&lt;path d="M359.05,661L359.05,674.5Q359.05,686.5 347.05,686.5L241.43,686.5Q229.43,686.5 229.43,698.5L229.43,993"/&gt;&lt;path class="pele-marker" d="M229.43,1000L226.07,992L232.79,992Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_term_offer_0"&gt;&lt;path d="M389.05,661L389.05,674.5Q389.05,686.5 401.05,686.5L438.3,686.5Q450.3,686.5 450.3,698.5L450.3,742"/&gt;&lt;path class="pele-marker" d="M450.3,749L446.94,741L453.66,741Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_offer_warn_0"&gt;&lt;path d="M395.2,794L395.2,800Q395.2,812 383.2,812L361.66,812Q349.66,812 349.66,824L349.66,867.5"/&gt;&lt;path class="pele-marker" d="M349.66,874.5L346.3,866.5L353.02,866.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_offer_again_0"&gt;&lt;path d="M505.39,794L505.39,800Q505.39,812 517.39,812L538.93,812Q550.93,812 550.93,824L550.93,867.5"/&gt;&lt;path class="pele-marker" d="M550.93,874.5L547.57,866.5L554.29,866.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_again_ok2_0"&gt;&lt;path d="M576.07,919.5L576.07,993"/&gt;&lt;path class="pele-marker" d="M576.07,1000L572.71,992L579.43,992Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_again_stop_0"&gt;&lt;path d="M525.8,919.5L525.8,970Q525.8,982 513.8,982L314.14,982Q305.89,982 305.89,990.25L305.89,993"/&gt;&lt;path class="pele-marker" d="M305.89,1000L302.53,992L309.25,992Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_proc_direct_0"&gt;&lt;rect x="93.27" y="196" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="110.64" y="209.2" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_direct_ok_0"&gt;&lt;rect x="68.14" y="336.5" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="85.5" y="349.7" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_proc_un_0"&gt;&lt;rect x="277.41" y="259.5" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="290.32" y="272.7" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_direct_un_0"&gt;&lt;rect x="254.5" y="336.5" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="267.41" y="349.7" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_confined_route_0"&gt;&lt;rect x="133.14" y="552" width="114.91" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="190.59" y="564.2"&gt;yes: another&lt;/tspan&gt;&lt;tspan x="190.59" y="580.2"&gt;way out&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_confined_term_0"&gt;&lt;rect x="361.14" y="559" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="374.05" y="572.2" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_term_stop_0"&gt;&lt;rect x="216.52" y="762.5" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="229.43" y="775.7" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_term_offer_0"&gt;&lt;rect x="432.93" y="706.5" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="450.3" y="719.7" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_offer_warn_0"&gt;&lt;rect x="336.75" y="832" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="349.66" y="845.2" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_offer_again_0"&gt;&lt;rect x="533.57" y="832" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="550.93" y="845.2" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_again_ok2_0"&gt;&lt;rect x="558.7" y="944" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="576.07" y="957.2" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_again_stop_0"&gt;&lt;rect x="512.89" y="944" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="525.8" y="957.2" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="launch" transform="translate(191.91,30.5)"&gt;&lt;rect x="-71.45" y="-22.5" width="142.91" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;every launch&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="proc" transform="translate(191.91,128)"&gt;&lt;rect x="-80.36" y="-30" width="160.73" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;on the process&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;devvm started?&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="direct" transform="translate(110.64,268.5)"&gt;&lt;rect x="-102.64" y="-30" width="205.27" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;a direct connection&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;from the VM fails?&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="ok" transform="translate(85.5,401.5)"&gt;&lt;rect x="-58.09" y="-22.5" width="116.18" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;check: ok&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="un" transform="translate(282.32,401.5)"&gt;&lt;rect x="-93.73" y="-22.5" width="187.45" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;check: unenforced&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="confined" transform="translate(282.32,491.5)"&gt;&lt;rect x="-93.73" y="-22.5" width="187.45" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;started confined?&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="route" transform="translate(190.59,638.5)"&gt;&lt;rect x="-71.45" y="-30" width="142.91" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;stops the VM&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;and ends&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="term" transform="translate(374.05,638.5)"&gt;&lt;rect x="-67" y="-22.5" width="134" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;a terminal?&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="stop" transform="translate(237.43,1039)"&gt;&lt;rect x="-120.45" y="-39" width="240.91" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;stops the VM, no shell;&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;the next devvm starts&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;it confined&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="offer" transform="translate(450.3,771.5)"&gt;&lt;rect x="-107.09" y="-22.5" width="214.18" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;restart it confined?&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="warn" transform="translate(349.66,897)"&gt;&lt;rect x="-80.36" y="-22.5" width="160.73" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;warns, goes on&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="again" transform="translate(550.93,897)"&gt;&lt;rect x="-75.91" y="-22.5" width="151.82" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;enforced now?&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="ok2" transform="translate(576.07,1022.5)"&gt;&lt;rect x="-58.09" y="-22.5" width="116.18" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;check: ok&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;An open VM isn&amp;rsquo;t confined, so its self-check is another one: a command in the VM asks its proxy for &lt;code&gt;http://devvm.proxy/blocked&lt;/code&gt; through the proxy that the VM&amp;rsquo;s &lt;code&gt;/etc/environment&lt;/code&gt; names, the variable&amp;rsquo;s name in the command and never the password. When the proxy doesn&amp;rsquo;t answer, devvm warns you (&lt;code&gt;net_proxy_unreachable&lt;/code&gt;) and goes on, records no result, and the VM keeps running.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm ls&lt;/code&gt; and &lt;code&gt;devvm network&lt;/code&gt; show such a VM&amp;rsquo;s tier as &lt;code&gt;unenforced&lt;/code&gt;. That&amp;rsquo;s a VM whose last self-check failed, or a running VM that isn&amp;rsquo;t on the process devvm started confined, which devvm checks on the host each time.&lt;/p&gt;
&lt;p&gt;On Lima, &amp;ldquo;the process devvm started&amp;rdquo; is the VM&amp;rsquo;s Lima process, which devvm starts &lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confined&lt;/a&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="log-files"&gt;Log files&lt;span class="hx:absolute hx:-mt-20" id="log-files"&gt;&lt;/span&gt;
&lt;a href="#log-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The proxy writes every decision (&lt;code&gt;tunnel&lt;/code&gt;, &lt;code&gt;intercept&lt;/code&gt;, &lt;code&gt;forward&lt;/code&gt;, &lt;code&gt;blocked&lt;/code&gt;, or &lt;code&gt;nix-cache&lt;/code&gt; for a request to the &lt;a href="#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt;) as a JSON line in &lt;code&gt;network.jsonl&lt;/code&gt; in the VM&amp;rsquo;s logs folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;. A line holds the time, the VM, the host and port, the method and path when the proxy sees them, the rule or the reason, and the names of the secrets it put in, never their values. A connection that &lt;a href="#tools-that-skip-the-proxy"&gt;transparent mode&lt;/a&gt; sent to the proxy, and each request on it, has &lt;code&gt;&amp;quot;via&amp;quot;: &amp;quot;dns&amp;quot;&lt;/code&gt;, which &lt;code&gt;devvm network log&lt;/code&gt; shows as &lt;code&gt;, without proxy settings&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The proxy&amp;rsquo;s own lines, such as what it loaded and what failed upstream, go to &lt;code&gt;proxy.log&lt;/code&gt; next to it. An upstream error stays there, because it can name addresses that the VM shouldn&amp;rsquo;t learn. So when a name doesn&amp;rsquo;t resolve, or a tunnel can&amp;rsquo;t connect, the VM&amp;rsquo;s &lt;code&gt;403&lt;/code&gt;, its &lt;code&gt;http://devvm.proxy/blocked&lt;/code&gt; and the event log give only the reason. For a name, that&amp;rsquo;s &lt;code&gt;this machine's DNS has no address for it&lt;/code&gt; when the DNS server says the name has none, with &lt;code&gt;and names resolve without its search domain; use the full name, such as jenkins.corp.example.com&lt;/code&gt; after it for a name without a dot, &lt;code&gt;this machine's DNS didn't answer in time; see proxy.log on the host&lt;/code&gt; when it doesn&amp;rsquo;t answer, and &lt;code&gt;can't resolve it; see proxy.log on the host&lt;/code&gt; for any other failure. A rule allows the name already, so each of these blocks is marked &lt;code&gt;refused&lt;/code&gt;, and neither the &lt;code&gt;403&lt;/code&gt;, nor &lt;code&gt;http://devvm.proxy/blocked/new&lt;/code&gt;, nor &lt;code&gt;devvm network log --blocked&lt;/code&gt; suggests a &lt;code&gt;devvm network allow&lt;/code&gt; command for it. For a tunnel, it&amp;rsquo;s &lt;code&gt;connect failed; see proxy.log on the host&lt;/code&gt;. The error itself, which can name this machine&amp;rsquo;s DNS server or the company proxy&amp;rsquo;s address and what it answered, goes to &lt;code&gt;proxy.log&lt;/code&gt; alone. After a timeout or another failure that may pass, the proxy asks the DNS server once more before it blocks the name. When the client goes away while its name is still resolving, nothing was refused, so the event log and &lt;code&gt;http://devvm.proxy/blocked&lt;/code&gt; record no block. The lookup still went out, though, and a name can carry data, so &lt;code&gt;proxy.log&lt;/code&gt; names the host and port with &lt;code&gt;the client went away while its name resolved&lt;/code&gt;, for at most 20 such lookups a minute, and then says that it stops until the minute is up. The broker&amp;rsquo;s own line for each of the child&amp;rsquo;s lookups and connections that failed, such as one to an address that no rule names, is held the same way, to 20 a minute. A name that resolves to an internal address gets the reason &lt;code&gt;it resolves to an internal address; allow the address itself to reach it&lt;/code&gt;, which tells the VM that much and not the address (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;attack vectors&lt;/a&gt;). Only you can read the VM&amp;rsquo;s logs folder and its run folder, and devvm&amp;rsquo;s run logs never hold a VM&amp;rsquo;s password. The VM chose the hosts and paths, so &lt;code&gt;devvm network log&lt;/code&gt; drops control characters in them.&lt;/p&gt;
&lt;p&gt;The event log also holds the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;links&lt;/a&gt;&amp;rsquo; connections, which &lt;code&gt;devvm _links&lt;/code&gt; writes in the same format: &lt;code&gt;link&lt;/code&gt; for a connection it carried, and &lt;code&gt;link_refused&lt;/code&gt;, &lt;code&gt;link_target_stopped&lt;/code&gt; or &lt;code&gt;link_limit&lt;/code&gt; for one it refused, with the link&amp;rsquo;s name as the host and the target VM in &lt;code&gt;target&lt;/code&gt;. An open VM&amp;rsquo;s event log holds its proxy&amp;rsquo;s events and its links&amp;rsquo;, but nothing it reached directly.&lt;/p&gt;
&lt;p&gt;The proxy&amp;rsquo;s broker and its child are the only programs that write &lt;code&gt;proxy.log&lt;/code&gt;, which is the output of both, each line&amp;rsquo;s prefix saying whether the broker or the child wrote it. Either may rotate it, through the file devvm opened for them and never by its path. It takes the file&amp;rsquo;s lock, checks the file&amp;rsquo;s size again, copies the file to &lt;code&gt;proxy.log.1&lt;/code&gt; and empties it, so the two rotate it once. The event log has the child and &lt;code&gt;devvm _links&lt;/code&gt; as its writers.&lt;/p&gt;
&lt;p&gt;The child writes the VM&amp;rsquo;s logs folder, so devvm, &lt;code&gt;devvm _links&lt;/code&gt;, &lt;code&gt;devvm network log&lt;/code&gt;, &lt;code&gt;devvm network lock&lt;/code&gt; and the proxy never open the logs there through a link at their end, and they take only a regular file with one link that&amp;rsquo;s yours. A start that finds a link, a FIFO or another file&amp;rsquo;s hard link where a log should be removes that name, never what it leads to, and starts a new log there, and &lt;code&gt;devvm network log&lt;/code&gt; refuses such a file without waiting on it. The proxy rotates each log before a line would take it past 10 MiB, and &lt;code&gt;devvm _links&lt;/code&gt; writes the event log with the proxy&amp;rsquo;s own code, so it rotates the log by the same rule and a VM that runs for months keeps at most about 20 MiB of each. A line never spans two files, and lines from the proxy&amp;rsquo;s connections at the same time are written one after another, so a rotation loses none and splits none. Before each line, each writer checks that the file it has open is still &lt;code&gt;network.jsonl&lt;/code&gt;, and when the other writer has rotated it, the writer opens the new &lt;code&gt;network.jsonl&lt;/code&gt; and writes there, so its lines go on reaching the file that &lt;code&gt;devvm network log --follow&lt;/code&gt; follows. Each writer takes the log&amp;rsquo;s size from the file, so it counts the other writer&amp;rsquo;s lines too. A writer rotates the log while it holds a lock on the file and checks the name again first, so when both reach the limit at once, only one renames the file and the other writes to the new one. A rotation renames &lt;code&gt;network.jsonl&lt;/code&gt; to &lt;code&gt;network.jsonl.1&lt;/code&gt;, which replaces the one that was there, and starts a new &lt;code&gt;network.jsonl&lt;/code&gt;. &lt;code&gt;proxy.log&lt;/code&gt; is also the proxy process&amp;rsquo;s output, where its last error goes when it stops, so the proxy copies it to &lt;code&gt;proxy.log.1&lt;/code&gt; and empties it instead, and that error still reaches the current file. The proxy takes &lt;code&gt;proxy.log&lt;/code&gt;&amp;rsquo;s size from the file before each line, so what reached it as the processes&amp;rsquo; output counts too, and its HTTP server&amp;rsquo;s errors, such as a handler&amp;rsquo;s panic, go through the child&amp;rsquo;s own lines rather than straight to that output. Every log file and its &lt;code&gt;.1&lt;/code&gt; file is readable only by you (mode 600).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm network log&lt;/code&gt; reads &lt;code&gt;network.jsonl.1&lt;/code&gt; before &lt;code&gt;network.jsonl&lt;/code&gt;, so the history it shows and the blocks that &lt;code&gt;devvm network log --blocked&lt;/code&gt; counts carry on across a rotation. &lt;code&gt;devvm network log --follow&lt;/code&gt; reads the renamed file to its end and then follows the new one from its start. &lt;code&gt;devvm rm&lt;/code&gt; deletes the &lt;code&gt;.1&lt;/code&gt; files with the rest of the VM&amp;rsquo;s logs.&lt;/p&gt;
&lt;h3 data-hextra-search-id="learning-from-the-log"&gt;Learning from the log&lt;span class="hx:absolute hx:-mt-20" id="learning-from-the-log"&gt;&lt;/span&gt;
&lt;a href="#learning-from-the-log" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM that &lt;a href="https://next.devvm.dev/docs/safety/network/#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt; is on the internet tier, and its state&amp;rsquo;s &lt;code&gt;net&lt;/code&gt; section has &lt;code&gt;learning.since&lt;/code&gt;, the time it started, which any tier set later clears. Its proxy runs as any internet VM&amp;rsquo;s does, so nothing else records what it reaches: &lt;code&gt;devvm network lock&lt;/code&gt; and each launch&amp;rsquo;s reminder read the event log, both files. They take each &lt;code&gt;tunnel&lt;/code&gt;, &lt;code&gt;intercept&lt;/code&gt; and &lt;code&gt;forward&lt;/code&gt; event since that time, one row for each host and port, its rule the exact one for that host, which always writes the port, counting its events and the first word of the &lt;code&gt;User-Agent&lt;/code&gt; its requests sent most, which a CONNECT&amp;rsquo;s event records too, when that word is at most 32 of &lt;code&gt;[A-Za-z0-9._/+-]&lt;/code&gt;. The proxy caps an event&amp;rsquo;s path and &lt;code&gt;User-Agent&lt;/code&gt; at 512 bytes as it records them, and takes no request headers past 64 KiB, so a VM can&amp;rsquo;t bloat the log. An address that isn&amp;rsquo;t public, by the proxy&amp;rsquo;s one judge of that, and a host the policy doesn&amp;rsquo;t take are left out. Each host and port is judged once with the policies the VM would have on the allowlist tier, read as the proxy reads them, its built-in policies from the binary included, and with the proxy&amp;rsquo;s own decisions by its rules, so a host that the allowlist already allows, or that a rule denies, never shows. A host starts ticked when, on port 443, it&amp;rsquo;s one of devvm&amp;rsquo;s reviewed registry and vendor names, or under one, each with its reason beside it, and it isn&amp;rsquo;t risky. Nothing of the VM&amp;rsquo;s rules, secrets or own policy file makes a host tickable, so a host one lock added never makes its neighbours tick later, and a unit test checks that no name on the list is a shared-hosting domain or under one. The risky hosts, which are marked and start unticked, are an address, a punycode label, a host on its lists of paste and drop sites, storage, tunnels, webhook and OAST services, free hosting and chat endpoints, or under one of them, and the patterns of OAST domains, S3 and API Gateway. Past 30 hosts none starts ticked. The picker reads the terminal&amp;rsquo;s size, cuts each row to its width and a long name from the left, and scrolls in a window that keeps the same number of lines, so a redraw moves back over exactly what it drew. It refuses a terminal too short for a row and its two &amp;ldquo;more&amp;rdquo; lines (&lt;code&gt;pick_too_small&lt;/code&gt;), takes a terminal of unknown size as 80 by 24, and on a read that fails, such as the EIO of a terminal that hung up, returns &lt;code&gt;pick_failed&lt;/code&gt; and confirms nothing, while the end of the input confirms, as Enter does. The risky hosts are a section of their own under a heading, so their mark never depends on a row&amp;rsquo;s width, and so are the hosts that only events with &lt;code&gt;&amp;quot;via&amp;quot;: &amp;quot;dns&amp;quot;&lt;/code&gt; reached, between the others and the risky ones. The lock re-reads the VM&amp;rsquo;s state under the VM&amp;rsquo;s lock, in the one update of a VM&amp;rsquo;s state, before it adds a rule, and changes nothing when its context ended meanwhile or the VM no longer learns since the same time, and it says what it added only once the proxy has the new tier. &lt;code&gt;devvm network learn&lt;/code&gt; and &lt;code&gt;devvm group join&lt;/code&gt; each check the other&amp;rsquo;s change under the VM&amp;rsquo;s lock too, so a learning VM never ends up in a group. A launch&amp;rsquo;s reminder counts only while both files hold at most 2 MiB. devvm keeps no record of its own beside the log, so a log that rotated twice since the VM started learning has lost its first hosts. As a VM starts learning, devvm writes a &lt;code&gt;learn&lt;/code&gt; event into its log with the proxy&amp;rsquo;s own writer, which &lt;code&gt;devvm network log&lt;/code&gt; doesn&amp;rsquo;t show, and &lt;code&gt;devvm network lock&lt;/code&gt; warns when that mark is gone.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-_proxy"&gt;devvm _proxy&lt;span class="hx:absolute hx:-mt-20" id="devvm-_proxy"&gt;&lt;/span&gt;
&lt;a href="#devvm-_proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm runs the proxy as itself, &lt;code&gt;devvm _proxy -config FILE&lt;/code&gt;, and nothing else is in its arguments. That&amp;rsquo;s the broker, which runs its child as &lt;code&gt;devvm _proxy-child -for FILE&lt;/code&gt;, with the same config&amp;rsquo;s path, which the child never opens. The path is there so devvm can tell each VM&amp;rsquo;s child apart, by &lt;code&gt;run/proxy-child.pid&lt;/code&gt; and those arguments, and stop one that outlived its broker. Their flags take one dash or two, and their errors end in one line, &lt;code&gt;The VM's proxy failed: …&lt;/code&gt; (&lt;code&gt;proxy_failed&lt;/code&gt;). &lt;a href="https://next.devvm.dev/docs/internals/processes/#a-vms-proxy"&gt;Processes&lt;/a&gt; has what a VM&amp;rsquo;s proxy holds, what it reads from the VM and its bounds, and &lt;a href="https://next.devvm.dev/docs/internals/processes/#a-builds-proxy"&gt;a build&amp;rsquo;s proxy&lt;/a&gt; has the build&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;The config is one JSON file, which a VM&amp;rsquo;s proxy and a build&amp;rsquo;s proxy both run with. For a VM it&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, and for a build it&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt; in the build proxy&amp;rsquo;s folder. devvm writes it whole, mode 600, before each start. It holds the VM&amp;rsquo;s password and the company proxy&amp;rsquo;s credentials from the environment, though never &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s password, which the proxy looks up itself, so it&amp;rsquo;s never in a process&amp;rsquo;s arguments, which other users can see. The proxy reads it once, as it starts, and refuses to start unless it&amp;rsquo;s a regular file, not a symbolic link, owned by the user the proxy runs as and readable and writable by nobody else, at most 1 MiB, of &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt;, with no field the proxy doesn&amp;rsquo;t know. It also refuses a config without a password, one whose &lt;code&gt;listen&lt;/code&gt; isn&amp;rsquo;t a loopback address and port, one with &lt;code&gt;ca&lt;/code&gt; and no &lt;code&gt;ca_key&lt;/code&gt; or the other way around, and one with a &lt;code&gt;nix_cache_max&lt;/code&gt; below 0. A config of another version is never read, so a proxy and the devvm that started it always agree on what each field means.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;listen&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the loopback address and port to listen on, port 0 for any free one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s name, for the log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;password&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s password, which every request carries in &lt;code&gt;Proxy-Authorization&lt;/code&gt; with the user &lt;code&gt;devvm&lt;/code&gt;; required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;builtin_policies&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the built-in policies, paths in devvm&amp;rsquo;s own files, read from the binary once as the proxy starts, ahead of &lt;code&gt;policies&lt;/code&gt;; a missing one refuses to start&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;policies&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your policy files, in order, each read again when it changes; a missing one has no rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the JSON-lines event log (none: standard output), &lt;a href="#log-files"&gt;rotated&lt;/a&gt; past 10 MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;proxy_log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the file that the proxy&amp;rsquo;s output goes to, which is its own log, rotated past 10 MiB by copying&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lifeline&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the hostagent&amp;rsquo;s pid file: exit once it no longer holds what it held when the proxy first saw its process running, or that process is gone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ca&lt;/code&gt;, &lt;code&gt;ca_key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="#the-vms-ca"&gt;VM&amp;rsquo;s own CA&lt;/a&gt;, for interception: its certificate and key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ca_next&lt;/code&gt;, &lt;code&gt;ca_next_key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;ca&lt;/code&gt;: the VM&amp;rsquo;s next CA, which signs from an hour after its start&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;secrets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s bindings file, read again when it changes, and the broker looks each binding&amp;rsquo;s value up in its own process, for the child&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;upstream_cas&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="#a-companys-ca"&gt;CAs in your CA folder&lt;/a&gt; (PEM), which the proxy&amp;rsquo;s own TLS connections trust besides the system&amp;rsquo;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;upstream&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="#through-a-company-proxy"&gt;company proxy&lt;/a&gt;: &lt;code&gt;https&lt;/code&gt;, &lt;code&gt;http&lt;/code&gt; and &lt;code&gt;no_proxy&lt;/code&gt;, as &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt; or &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; had them, and &lt;code&gt;secret&lt;/code&gt;, the secret the proxy looks up as the password of a URL that names a user and none of its own; allowed hosts are reached through it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;upstream_unresolved&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;upstream&lt;/code&gt;: names this machine can&amp;rsquo;t resolve go there even when only &lt;code&gt;**&lt;/code&gt; allows them, which builds&amp;rsquo; proxies get&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nix_cache&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;serve the &lt;a href="#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt; at &lt;code&gt;http://devvm.proxy/nix/&lt;/code&gt; from this folder, which it makes, only yours (mode 700)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nix_cache_max&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;nix_cache&lt;/code&gt;: the cache&amp;rsquo;s cap, in bytes (none: 10 GiB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;links&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s links&amp;rsquo; list, which &lt;code&gt;devvm _links&lt;/code&gt; writes: reach each link through its socket, before any rule (&lt;a href="#links-through-the-proxy"&gt;links through the proxy&lt;/a&gt;); a missing list has no links&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;link_sockets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;links&lt;/code&gt;: the folder of the links&amp;rsquo; sockets, devvm&amp;rsquo;s run folder; without it, no link is reached&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vm_logs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the logs that the VM&amp;rsquo;s backend writes as the VM runs and the VM can drive, such as its serial console&amp;rsquo;s, which the proxy holds to their cap for as long as it runs (&lt;a href="https://next.devvm.dev/docs/internals/processes/#limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent&lt;/code&gt;, &lt;code&gt;agent_socket&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;together, as absolute paths: the SSH agent that the VM&amp;rsquo;s start forwards, your own or devvm&amp;rsquo;s, and the VM&amp;rsquo;s own socket in devvm&amp;rsquo;s run folder, &lt;code&gt;agent-&amp;lt;hash&amp;gt;.sock&lt;/code&gt;, on which the proxy relays it and which the VM&amp;rsquo;s backend forwards instead (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;). devvm keeps a running VM&amp;rsquo;s as its start set them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm_sha256&lt;/code&gt;, &lt;code&gt;ca_sha256&lt;/code&gt;, &lt;code&gt;ca_next_sha256&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the SHA-256 of devvm&amp;rsquo;s binary, of the VM&amp;rsquo;s CA certificate and of its next CA&amp;rsquo;s that the proxy started with; the proxy doesn&amp;rsquo;t read them, and they&amp;rsquo;re there so that a new binary or a new CA makes another config (&lt;a href="#how-long-a-proxy-runs"&gt;how long a proxy runs&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;-config&lt;/code&gt; is the proxy&amp;rsquo;s only flag, and running the proxy is its only mode. What only this machine does for a VM&amp;rsquo;s proxy runs inside devvm itself, never through the proxy&amp;rsquo;s arguments. devvm makes each VM&amp;rsquo;s CAs, and the VM&amp;rsquo;s copies of agents&amp;rsquo; logins and settings files, their bindings and their values, in its own process (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>The CLI and its messages</title><link>https://next.devvm.dev/docs/contributing/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/cli/</guid><description>
&lt;h2 data-hextra-search-id="cli-conventions"&gt;CLI conventions&lt;span class="hx:absolute hx:-mt-20" id="cli-conventions"&gt;&lt;/span&gt;
&lt;a href="#cli-conventions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s commands follow one set of rules, so that a user who knows a few of them can guess the rest. A bare verb acts on this folder&amp;rsquo;s VM, anything else goes under its noun, and a bare noun shows or lists. A setting shows bare, changes with a value and takes &lt;code&gt;-g&lt;/code&gt; for what new VMs get. The &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/cli/SKILL.md" target="_blank" rel="noopener"&gt;cli skill&lt;/a&gt; holds every rule, with a checklist for adding a command and a review for changing one, and its &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/cli/judgment.md" target="_blank" rel="noopener"&gt;judgment.md&lt;/a&gt; explains, with examples, the rules that only a reviewer can check. The reasoning behind most of them is in the &lt;a href="https://clig.dev/" target="_blank" rel="noopener"&gt;Command Line Interface Guidelines&lt;/a&gt;, and Cobra&amp;rsquo;s own mechanics are in &lt;a href="https://cobra.dev/docs/" target="_blank" rel="noopener"&gt;Cobra&amp;rsquo;s docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The tests check every rule that a machine can, and &lt;code&gt;mise run test&lt;/code&gt; runs them. The cli skill says which test checks each rule and which rules a reviewer checks by hand, and &lt;a href="#the-cli-rule-tests"&gt;The CLI rule tests&lt;/a&gt; says what each test checks. After changing a command&amp;rsquo;s &lt;code&gt;Use&lt;/code&gt;, &lt;code&gt;Short&lt;/code&gt;, &lt;code&gt;Long&lt;/code&gt;, &lt;code&gt;Example&lt;/code&gt; or flags, run &lt;code&gt;mise run cli-docs&lt;/code&gt; and commit the &lt;a href="https://next.devvm.dev/docs/contributing/docs/#the-cli-reference"&gt;CLI reference&lt;/a&gt; it writes.&lt;/p&gt;
&lt;p&gt;Each command gets the run&amp;rsquo;s services from one &lt;code&gt;app&lt;/code&gt;, in &lt;code&gt;internal/cli/app.go&lt;/code&gt;, which &lt;code&gt;NewRoot&lt;/code&gt; makes for the run&amp;rsquo;s UI and hands to every command&amp;rsquo;s constructor. The app holds devvm&amp;rsquo;s folders (&lt;code&gt;dirs&lt;/code&gt;), a test build&amp;rsquo;s overrides, the secrets store, the backends&amp;rsquo; registry, the shared tools, the environment of the commands on this folder&amp;rsquo;s VM (&lt;code&gt;vmEnv&lt;/code&gt;) and the image builder of the backend new VMs get (&lt;code&gt;builder&lt;/code&gt;, the VM environment&amp;rsquo;s &lt;code&gt;Builder&lt;/code&gt;). It makes each one the first time a command asks for it and keeps that one, or its error, for the rest of the run, so the retention that runs before a command and the command itself share them. A command on this folder&amp;rsquo;s VM runs in &lt;code&gt;a.env&lt;/code&gt;, which returns the command&amp;rsquo;s failure with its message for an error that isn&amp;rsquo;t one. A new command takes its services from the app rather than making its own.&lt;/p&gt;
&lt;p&gt;A command fails by returning its error from &lt;code&gt;RunE&lt;/code&gt;, as &lt;code&gt;failed(err, what)&lt;/code&gt; when the error may not be a message: &lt;code&gt;what&lt;/code&gt; makes the message from the error&amp;rsquo;s text, such as &lt;code&gt;msg.LsFailed&lt;/code&gt;. &lt;code&gt;execute&lt;/code&gt; shows what the command returned in &lt;code&gt;showFailure&lt;/code&gt;, and it&amp;rsquo;s the one place a failure is printed. A &lt;code&gt;backend.LoggedError&lt;/code&gt; shows the end of the run log, then its message (&lt;code&gt;ErrorLogged&lt;/code&gt;). A message, or an error that carries one, shows as it is, and any other error shows in &lt;code&gt;what&lt;/code&gt;&amp;rsquo;s message, or in &lt;code&gt;output_failed&lt;/code&gt; when the command didn&amp;rsquo;t say what failed. The run then exits with 1, and &lt;code&gt;ui.Main&lt;/code&gt; runs the cleanups. Once the run is interrupted, a failure prints nothing, because the interrupt is the reason. The root&amp;rsquo;s layout check (&lt;code&gt;checkLayout&lt;/code&gt;) returns its failure the same way, from &lt;code&gt;PersistentPreRunE&lt;/code&gt;. Only the UI ends a run itself, in &lt;code&gt;die&lt;/code&gt;, where no command can return: a question that gets no answer, and a run log that can&amp;rsquo;t be opened.&lt;/p&gt;
&lt;p&gt;INT, TERM and HUP cancel the run&amp;rsquo;s context in &lt;code&gt;ui.Main&lt;/code&gt;, which then waits for the logged command that&amp;rsquo;s running to end. When there are cleanups to run, it also waits for the command&amp;rsquo;s own code to return, for up to 2 seconds (&lt;code&gt;returnGrace&lt;/code&gt;), before it runs them and exits with 130. So a cleanup never undoes a command&amp;rsquo;s work while that command still runs, and a command that can&amp;rsquo;t stop delays the exit by no more than those 2 seconds. A question waiting for its answer isn&amp;rsquo;t waited for at all, because reading its answer doesn&amp;rsquo;t end at Ctrl+C, and an answer read once the run is interrupted is refused, so nothing goes ahead after it. A run with no cleanups exits at once, because nothing could undo its work, so the proxy and devvm&amp;rsquo;s other background processes stop as soon as they&amp;rsquo;re told to. A second signal during the cleanups is ignored, so they aren&amp;rsquo;t stopped halfway.&lt;/p&gt;
&lt;p&gt;Ctrl+C reaches every process in the terminal&amp;rsquo;s group, so it can end a command that devvm runs before devvm itself sees the interrupt. When a command ends by a signal, or exits with a code of 128 or more, devvm waits up to 1 second for its own interrupt (&lt;code&gt;interruptGrace&lt;/code&gt;), so that the run ends as interrupted, printing nothing, instead of showing the command&amp;rsquo;s failure.&lt;/p&gt;
&lt;p&gt;Whatever a failure would leave behind, such as a build VM or a temporary file, registers a cleanup with the UI&amp;rsquo;s &lt;code&gt;AddCleanup&lt;/code&gt; and removes it, with the function &lt;code&gt;AddCleanup&lt;/code&gt; returns, once there&amp;rsquo;s nothing left to clean up. The cleanups run when the run ends, last added first, whether it ended normally, failed or was interrupted. They run after the command returned and the run&amp;rsquo;s context is canceled, so each one gets a fresh context of its own. A cleanup that only undoes unfinished work after an interrupt checks &lt;code&gt;Interrupted()&lt;/code&gt;, and the command leaves it registered once the run is interrupted, because the cleanups run only after the command returns.&lt;/p&gt;
&lt;p&gt;devvm runs every external command through the UI&amp;rsquo;s &lt;code&gt;LoggedCmd(ctx, step, cmd)&lt;/code&gt;, which a backend gets as its &lt;code&gt;Runner&lt;/code&gt;. The command&amp;rsquo;s output goes to the run log, a terminal&amp;rsquo;s status line shows &lt;code&gt;step&lt;/code&gt;, and a failure after it is returned as &lt;code&gt;backend.Logged(m)&lt;/code&gt;, which shows the end of the log with the message. &lt;code&gt;WithSteps(ctx, n)&lt;/code&gt; starts a phase of &lt;code&gt;n&lt;/code&gt; steps, and each &lt;code&gt;LoggedCmd&lt;/code&gt; with the context it returns is numbered, as &lt;code&gt;[2/5] running base.sh&lt;/code&gt;, on its status line and in the log.&lt;/p&gt;
&lt;h3 data-hextra-search-id="status-lines"&gt;Status lines&lt;span class="hx:absolute hx:-mt-20" id="status-lines"&gt;&lt;/span&gt;
&lt;a href="#status-lines" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Any work that can take noticeable time runs under a status line, so that the user sees what devvm is waiting for. Such work is a host command, host git, a command in a VM, a backend&amp;rsquo;s own commands, such as &lt;code&gt;limactl list&lt;/code&gt;, a request over the network, a walk of a folder the user owns, a lookup of a folder&amp;rsquo;s disk with macOS&amp;rsquo;s &lt;code&gt;diskutil&lt;/code&gt;, and a wait for a lock, a timeout or another process. A logged command shows its step on its own. Other slow work shows one with the Reporter&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt;, whose label is a message in &lt;code&gt;locales/en.toml&lt;/code&gt;: a lowercase phrase in &lt;code&gt;-ing&lt;/code&gt;, such as &lt;code&gt;reading_vms&lt;/code&gt;, with a &lt;code&gt;description&lt;/code&gt; that says what runs under it. For example:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;ListAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;Env&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="nx"&gt;Listed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="nx"&gt;Known&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;defer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadingVMs&lt;/span&gt;&lt;span class="p"&gt;())()&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;ReadInventory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Dirs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Registry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;AllBackends&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The status line shows only in a terminal, without &lt;code&gt;-v&lt;/code&gt; and until the run is interrupted, because nothing would clear one started after that. The UI keeps status lines as a stack. A logged command or a &lt;code&gt;Status&lt;/code&gt; inside another shows its own line until it ends, and then the UI draws the outer one again, so a phase can show one line around steps that show their own. A message said under a status line, whether &lt;code&gt;Info&lt;/code&gt;, &lt;code&gt;Warn&lt;/code&gt;, &lt;code&gt;Note&lt;/code&gt; or data on &lt;code&gt;Stdout()&lt;/code&gt;, clears the line, prints, and draws the line again below it, so a warning never lands on the status line. A question, the picker and &lt;code&gt;ui.Terminal&lt;/code&gt;, which a command in the VM that draws on the terminal gets, hold the status line until they&amp;rsquo;re done, so its redraw never goes over a prompt or what the user types.&lt;/p&gt;
&lt;p&gt;A wait for a lock that another devvm holds shows a status line only while it waits, never when the lock is free. &lt;code&gt;platform.LockFile&lt;/code&gt;, &lt;code&gt;platform.LockFileShared&lt;/code&gt; and &lt;code&gt;platform.LockDir&lt;/code&gt; take a &lt;code&gt;platform.Waiting&lt;/code&gt;, which they call once they find the lock held, and they call its end once the wait ends. &lt;code&gt;msg.Waiting(status, label)&lt;/code&gt; makes one from a Reporter&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt; and a label, such as &lt;code&gt;vm_state_waiting&lt;/code&gt;. &lt;code&gt;internal/state&lt;/code&gt;, for a VM&amp;rsquo;s lock or the layout&amp;rsquo;s, and &lt;code&gt;internal/trust&lt;/code&gt; take no Reporter, so they alone take the run&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt; from the context (&lt;code&gt;msg.StatusOf&lt;/code&gt;), which the run&amp;rsquo;s root sets (&lt;code&gt;msg.WithStatus&lt;/code&gt;), and forbidigo keeps it to them. The layout&amp;rsquo;s migration shows &lt;code&gt;layout_migrating&lt;/code&gt; while it runs. An agent&amp;rsquo;s login file is locked by its folder&amp;rsquo;s lock (&lt;code&gt;platform.LockDir&lt;/code&gt;), which the proxy holds while it refreshes the login, so it takes its wait as &lt;code&gt;agentlogin.File&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Waiting&lt;/code&gt; (&lt;code&gt;agent_login_waiting&lt;/code&gt;), and its wait ends with the caller&amp;rsquo;s context, as every lock&amp;rsquo;s does. Only a lock that never waits, such as one on a file just made, passes &lt;code&gt;platform.NoWait&lt;/code&gt;, which shows nothing, and the structure test&amp;rsquo;s &lt;code&gt;status-lines&lt;/code&gt; rule holds it to &lt;code&gt;statusSites&lt;/code&gt;, as it does a &lt;code&gt;nil&lt;/code&gt;. &lt;code&gt;msg.Waiting&lt;/code&gt; with no status, as in a process with no UI, gives a wait that shows nothing, never &lt;code&gt;nil&lt;/code&gt;. A test build&amp;rsquo;s locks panic on a &lt;code&gt;nil&lt;/code&gt; one (&lt;code&gt;platform.CheckWaiting&lt;/code&gt;, which the root&amp;rsquo;s run calls in every test build), so the CLI tests and the end-to-end tests catch one that the rule can&amp;rsquo;t see, such as a zero &lt;code&gt;agentlogin.File&lt;/code&gt;&amp;rsquo;s. They don&amp;rsquo;t catch a &lt;code&gt;msg.Waiting&lt;/code&gt; given a nil status, which only a review finds. A forbidigo rule refuses &lt;code&gt;syscall.Flock&lt;/code&gt; and &lt;code&gt;unix.Flock&lt;/code&gt; outside &lt;code&gt;internal/platform&lt;/code&gt;, the proxy&amp;rsquo;s log rotation, the stubs and tests, so every lock goes through &lt;code&gt;internal/platform&lt;/code&gt;&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;Work that takes the terminal never runs under a status line, because its redraw would go over what the work shows. That work is a VM&amp;rsquo;s shell, &lt;code&gt;ssh-add&lt;/code&gt; asking for a key&amp;rsquo;s passphrase (&lt;code&gt;checkAgent&lt;/code&gt;, &lt;code&gt;Agent.Ensure&lt;/code&gt;) and an agent&amp;rsquo;s login in the VM. A launch shows its status lines around those steps rather than across them. A background process, such as the proxy, a forwarder or a link session, has no terminal and shows none.&lt;/p&gt;
&lt;p&gt;Tests check the label rather than a terminal. A &lt;code&gt;msg.Fake&lt;/code&gt; gives each status line&amp;rsquo;s label, and each logged command&amp;rsquo;s step, to its &lt;code&gt;OnStatus&lt;/code&gt;, and &lt;code&gt;Showing&lt;/code&gt; returns the one showing. So a seam that the slow work goes through records what showed meanwhile, as &lt;code&gt;TestAgentImportStatus&lt;/code&gt; does with the &lt;code&gt;Opencode&lt;/code&gt; and &lt;code&gt;ExcludeFromBackup&lt;/code&gt; seams, and a &lt;code&gt;backendtest.Fake&lt;/code&gt; gives each call to its &lt;code&gt;OnCall&lt;/code&gt;. &lt;code&gt;TestLaunchStatusLines&lt;/code&gt; runs a new, a running and a stopped VM&amp;rsquo;s launch and fails on any backend call made with no status line showing, except the shell&amp;rsquo;s, which takes the terminal, and &lt;code&gt;Running&lt;/code&gt;&amp;rsquo;s, which reads the VM&amp;rsquo;s pid files. &lt;code&gt;TestCommandStatusLines&lt;/code&gt; does the same for the commands that show, list, change, export, stop and delete a running or a stopped VM, including devvm network lock&amp;rsquo;s picker, devvm restart, the restart that devvm mount-cache asks for, links, and a group with a second VM that runs, stops and goes. It answers their questions in a terminal through the &lt;code&gt;msg.Fake&lt;/code&gt;, checks that the picker and the restart are asked, and fails on a question asked under a status line, or a proxy or link session started with none. &lt;code&gt;testProxy&lt;/code&gt; runs each link session as a sleep that says each of its links is carried, as its links change. &lt;code&gt;TestVMLockWaits&lt;/code&gt;, &lt;code&gt;TestCheckLayoutWaits&lt;/code&gt; and each lock&amp;rsquo;s own test check a wait&amp;rsquo;s status line. &lt;code&gt;TestSSHAddOffStatusLine&lt;/code&gt; fails on an &lt;code&gt;ssh-add&lt;/code&gt; that runs under one, on the user&amp;rsquo;s agent or devvm&amp;rsquo;s own, and &lt;code&gt;chflagsCalls&lt;/code&gt; fails a clone test on a lock or unlock of &lt;code&gt;.git&lt;/code&gt; with none. The structure test&amp;rsquo;s &lt;code&gt;status-lines&lt;/code&gt; rule fails on a function that does slow work it knows by name and shows no status line of its own. That slow work is a host command, host git, a walk of a folder, a volume&amp;rsquo;s lookup, a request through &lt;code&gt;internal/fetch&lt;/code&gt;, a wait for a lock that shows nothing, or a backend&amp;rsquo;s command outside a step. The rule passes a function when &lt;code&gt;statusSites&lt;/code&gt; lists it with why, such as the status line of the caller it runs under (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-structure-test"&gt;The structure test&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="command-arguments"&gt;Command arguments&lt;span class="hx:absolute hx:-mt-20" id="command-arguments"&gt;&lt;/span&gt;
&lt;a href="#command-arguments" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each command checks its arguments and flags before it does anything else, so a usage error never looks for a VM, applies the retention settings or changes a file. &lt;code&gt;internal/cli/args.go&lt;/code&gt; holds the checks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A command&amp;rsquo;s &lt;code&gt;Args&lt;/code&gt;&lt;/strong&gt; is one of &lt;code&gt;noArgs&lt;/code&gt;, &lt;code&gt;exactArgs(n)&lt;/code&gt;, &lt;code&gt;maxArgs(n)&lt;/code&gt; and &lt;code&gt;minArgs(n)&lt;/code&gt;, never Cobra&amp;rsquo;s own validators, whose errors are in English. Each one names the arguments the command&amp;rsquo;s &lt;code&gt;Use&lt;/code&gt; shows (&lt;code&gt;KEY_FILE&lt;/code&gt;, &lt;code&gt;[all|none|LIST]&lt;/code&gt;), and with &lt;code&gt;ValidArgs&lt;/code&gt; set, it refuses any other value. &lt;code&gt;noArgs&lt;/code&gt; on a command with commands of its own says the word isn&amp;rsquo;t one of them and lists them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Values are checked in &lt;code&gt;Args&lt;/code&gt; too.&lt;/strong&gt; A command adds its own check with &lt;code&gt;cobra.MatchAll&lt;/code&gt;, such as &lt;code&gt;settings.ParsePorts&lt;/code&gt; for devvm ports or &lt;code&gt;netpolicy.Rule&lt;/code&gt; for devvm network allow, returning the same message the command would fail with later.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flag values are checked by name&lt;/strong&gt; in &lt;code&gt;checkFlagValue&lt;/code&gt;, because one flag name has one meaning: &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt;, &lt;code&gt;--disk&lt;/code&gt;, &lt;code&gt;--ports&lt;/code&gt;, &lt;code&gt;--lifetime&lt;/code&gt;, &lt;code&gt;--older-than&lt;/code&gt;, &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt;. Flags that can&amp;rsquo;t be given together are marked with &lt;code&gt;exclusive(cmd, a, b)&lt;/code&gt;, which &lt;code&gt;checkFlags&lt;/code&gt; checks first, in place of Cobra&amp;rsquo;s &lt;code&gt;MarkFlagsMutuallyExclusive&lt;/code&gt; alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The parser&amp;rsquo;s own flag errors&lt;/strong&gt; (an unknown flag, one without its value, a value its type refuses) become messages in &lt;code&gt;flagError&lt;/code&gt;, set as the root&amp;rsquo;s &lt;code&gt;SetFlagErrorFunc&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;checkCommands&lt;/code&gt; wraps every command&amp;rsquo;s &lt;code&gt;Args&lt;/code&gt; in these checks when &lt;code&gt;NewRoot&lt;/code&gt; builds the tree. A message one of them returns is a usage error: &lt;code&gt;Execute&lt;/code&gt; prints it, then &lt;code&gt;usage_help&lt;/code&gt; naming the command&amp;rsquo;s own &lt;code&gt;--help&lt;/code&gt;, and exits with 2. &lt;code&gt;usage_error&lt;/code&gt; is only the fallback for a parser error devvm doesn&amp;rsquo;t know. What a command&amp;rsquo;s &lt;code&gt;RunE&lt;/code&gt; returns once it ran is a failure, which &lt;code&gt;execute&lt;/code&gt; shows and exits with 1. &lt;code&gt;TestUsageErrorsEveryCommand&lt;/code&gt; runs every command with an unknown flag, without the argument it needs, with too many and with each flag&amp;rsquo;s value blank, and checks that each is a usage error and nothing runs.&lt;/p&gt;
&lt;p&gt;devvm itself takes no arguments, so a layer may have a command&amp;rsquo;s name. The root&amp;rsquo;s &lt;code&gt;Args&lt;/code&gt; is &lt;code&gt;noArgs&lt;/code&gt;, which for the root runs &lt;code&gt;checkWord&lt;/code&gt; (&lt;code&gt;internal/cli/word.go&lt;/code&gt;): a word that isn&amp;rsquo;t a command is a usage error. When the word, or each name in it joined with &lt;code&gt;+&lt;/code&gt; or a comma, is a part&amp;rsquo;s name, from the same &lt;code&gt;partNames&lt;/code&gt; that &lt;code&gt;checkPartFlag&lt;/code&gt; reads (&lt;code&gt;image.Toolchains&lt;/code&gt;, &lt;code&gt;image.Agents&lt;/code&gt; and the build env&amp;rsquo;s layers), the error is &lt;code&gt;no_command_part&lt;/code&gt;, with the flags that choose them. Any other word gets the closest command, from Cobra&amp;rsquo;s &lt;code&gt;SuggestionsFor&lt;/code&gt; with &lt;code&gt;SuggestionsMinimumDistance&lt;/code&gt; 2 (&lt;code&gt;msg.SuggestDistance&lt;/code&gt;, which &lt;code&gt;msg.Closest&lt;/code&gt; also uses). devvm&amp;rsquo;s own help command and the root&amp;rsquo;s help func run the same check, so &lt;code&gt;devvm help WORD&lt;/code&gt; and &lt;code&gt;devvm WORD --help&lt;/code&gt; fail as &lt;code&gt;devvm WORD&lt;/code&gt; does. The help func can&amp;rsquo;t return an error, so it panics with a &lt;code&gt;wordPanic&lt;/code&gt; that &lt;code&gt;execute&lt;/code&gt; recovers. &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; are checked in &lt;code&gt;checkFlagValue&lt;/code&gt; through &lt;code&gt;checkPartFlag&lt;/code&gt;: &lt;code&gt;none&lt;/code&gt; alone, or a list of the part&amp;rsquo;s names. A name of another part&amp;rsquo;s is refused with that part&amp;rsquo;s flag (&lt;code&gt;part_other_flag&lt;/code&gt;), and any other name it doesn&amp;rsquo;t know with the closest name (&lt;code&gt;vm.CheckPart&lt;/code&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-cli-rule-tests"&gt;The CLI rule tests&lt;span class="hx:absolute hx:-mt-20" id="the-cli-rule-tests"&gt;&lt;/span&gt;
&lt;a href="#the-cli-rule-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Go tests in &lt;code&gt;internal/cli&lt;/code&gt; walk the command tree, so a command that breaks one of the command line&amp;rsquo;s rules fails &lt;code&gt;mise run test&lt;/code&gt;, whether it&amp;rsquo;s new or changed. Each exception says why, in its test&amp;rsquo;s list or in the command&amp;rsquo;s own &lt;code&gt;about&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestEveryCommandsHelp&lt;/code&gt;&lt;/strong&gt; checks that every command users see has a &lt;code&gt;Short&lt;/code&gt; in sentence case without a full stop, a &lt;code&gt;Long&lt;/code&gt; of one to three sentences, an &lt;code&gt;Example&lt;/code&gt; and a docs page in its &lt;code&gt;about&lt;/code&gt;, and that each of the root&amp;rsquo;s commands is in a group. devvm help is the exception, as Cobra lists it apart and the CLI reference leaves it out. &lt;code&gt;TestAboutGroupsAreHelpGroups&lt;/code&gt; checks that each group a command names is one of &lt;code&gt;helpGroups&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestPersistentFlags&lt;/code&gt;&lt;/strong&gt; checks that every command takes &lt;code&gt;-h/--help&lt;/code&gt;, &lt;code&gt;--no-input&lt;/code&gt; and &lt;code&gt;-v/--verbose&lt;/code&gt; and has no other persistent flag. &lt;strong&gt;&lt;code&gt;TestFlagNames&lt;/code&gt;&lt;/strong&gt; checks that each shorthand is in its list, &lt;code&gt;-h&lt;/code&gt;, &lt;code&gt;-v&lt;/code&gt;, &lt;code&gt;-f&lt;/code&gt;, &lt;code&gt;-g&lt;/code&gt; and &lt;code&gt;-n&lt;/code&gt;, for one flag only, that no command takes &lt;code&gt;--yes&lt;/code&gt;, and that a flag has one help text wherever it appears, except the names in &lt;code&gt;manyUses&lt;/code&gt;. &lt;code&gt;TestFlagNamesHaveOneMeaning&lt;/code&gt; checks that a flag name has the same shorthand, type and value everywhere. &lt;strong&gt;&lt;code&gt;TestDurationFlags&lt;/code&gt;&lt;/strong&gt; checks that a flag whose value is a &lt;code&gt;DURATION&lt;/code&gt; is read with &lt;code&gt;state.ParseDuration&lt;/code&gt; in &lt;code&gt;checkFlagValue&lt;/code&gt;, and that no flag is a Go &lt;code&gt;time.Duration&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestShowCommandsTakeJSON&lt;/code&gt;&lt;/strong&gt; checks that every command users see takes &lt;code&gt;--json&lt;/code&gt; or says why not in its &lt;code&gt;about&lt;/code&gt;&amp;rsquo;s &lt;code&gt;noJSON&lt;/code&gt;, and &lt;code&gt;TestJSONShapes&lt;/code&gt; checks that every command with &lt;code&gt;--json&lt;/code&gt; has a shape.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestCommandNames&lt;/code&gt;&lt;/strong&gt; checks that command names are lower case without aliases, that no command is named &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;show&lt;/code&gt;, &lt;code&gt;get&lt;/code&gt;, &lt;code&gt;delete&lt;/code&gt;, &lt;code&gt;remove&lt;/code&gt; or &lt;code&gt;ls&lt;/code&gt; but devvm ls, that a command named unX has a sibling X, and that each argument in a &lt;code&gt;Use&lt;/code&gt; is a &lt;code&gt;PLACEHOLDER&lt;/code&gt; or a word, with &lt;code&gt;|&lt;/code&gt;, &lt;code&gt;[]&lt;/code&gt; and &lt;code&gt;...&lt;/code&gt; only. &lt;strong&gt;&lt;code&gt;TestUseMatchesArgs&lt;/code&gt;&lt;/strong&gt; runs every command with the arguments its &lt;code&gt;Use&lt;/code&gt; shows, from &lt;code&gt;argSamples&lt;/code&gt;, and with none when they&amp;rsquo;re optional, and checks that it runs, so its &lt;code&gt;Args&lt;/code&gt; takes what its help shows. &lt;code&gt;TestUnknownWord&lt;/code&gt; checks that &lt;code&gt;devvm WORD&lt;/code&gt;, &lt;code&gt;devvm WORD --help&lt;/code&gt; and &lt;code&gt;devvm help WORD&lt;/code&gt; fail alike for a word that isn&amp;rsquo;t a command, and that a toolchain&amp;rsquo;s, an agent&amp;rsquo;s or a layer&amp;rsquo;s name, alone or joined with others, points to its flag while any other word gets the closest command.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestCommandLines&lt;/code&gt;&lt;/strong&gt; reads every devvm command line in the repo: the docs, the generated CLI reference among them, the README, AGENTS.md, &lt;code&gt;locales/en.toml&lt;/code&gt;, Go&amp;rsquo;s comments and strings, &lt;code&gt;assets/&lt;/code&gt;, &lt;code&gt;install.sh&lt;/code&gt;, the CLI tests and their stubs, the scripts, the workflows and the skills. It checks that each one&amp;rsquo;s command exists, that each flag is one that command takes, that a placeholder is one its &lt;code&gt;Use&lt;/code&gt; shows and a flag&amp;rsquo;s value the one its help shows, such as &lt;code&gt;DURATION&lt;/code&gt;, and that a word after a command with commands of its own isn&amp;rsquo;t a command from elsewhere in the tree. A command line written to be typed, in a code block, a code span or a CLI test&amp;rsquo;s &lt;code&gt;exec&lt;/code&gt;, also has its values checked with &lt;code&gt;checkFlagValue&lt;/code&gt;, and when it has nothing to fill in, it runs in a tree whose commands do nothing, where it mustn&amp;rsquo;t be a usage error. Prose has only its command and its flags checked, because its words after the command are English. The lines written to show a refusal are in &lt;code&gt;refused&lt;/code&gt;, each with why, and a CLI test&amp;rsquo;s &lt;code&gt;! exec&lt;/code&gt; lines are left out, as they&amp;rsquo;re meant to fail. &lt;code&gt;mise run lint:docs&lt;/code&gt; runs it too, so a docs change that names a command that doesn&amp;rsquo;t exist fails there. &lt;code&gt;TestCheckCommandLine&lt;/code&gt; checks that it finds each kind of stale line.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestQuestionsDeclareAnswers&lt;/code&gt;&lt;/strong&gt; in &lt;code&gt;internal/cli&lt;/code&gt; finds every question the code makes, outside tests. A question is a &lt;code&gt;msg.Question&lt;/code&gt;, which &lt;code&gt;Ask&lt;/code&gt;, &lt;code&gt;Confirm&lt;/code&gt;, &lt;code&gt;Answer&lt;/code&gt; and &lt;code&gt;Secret&lt;/code&gt; take, and only two methods of a message make one: &lt;code&gt;AnsweredBy(&amp;quot;--force&amp;quot;)&lt;/code&gt; names the flag or command that answers it, and &lt;code&gt;RefusedWith(msg.X(...))&lt;/code&gt; gives a question that no flag answers the refusal that says what to do instead. The test checks that each &lt;code&gt;AnsweredBy&lt;/code&gt; names a string, that each flag in it is one its command takes and each command one devvm has, and that each &lt;code&gt;RefusedWith&lt;/code&gt; gives a message, so no question is asked without its answer declared. &lt;code&gt;TestCheckAnswer&lt;/code&gt; checks that it finds each kind of wrong answer.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="messages"&gt;Messages&lt;span class="hx:absolute hx:-mt-20" id="messages"&gt;&lt;/span&gt;
&lt;a href="#messages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every message devvm prints is a table in &lt;code&gt;locales/en.toml&lt;/code&gt;, and Go code calls it through a function generated from it. &lt;code&gt;internal/msg&lt;/code&gt; renders messages but never prints them; the run&amp;rsquo;s &lt;code&gt;ui.UI&lt;/code&gt; does. Only &lt;code&gt;cmd/devvm&lt;/code&gt; and &lt;code&gt;internal/cli&lt;/code&gt; hold it. Every other package prints and asks through the one &lt;code&gt;msg.Reporter&lt;/code&gt; interface, which &lt;code&gt;ui.UI&lt;/code&gt; implements: a package&amp;rsquo;s type embeds it, its constructor takes it, and cli gives it the run&amp;rsquo;s UI. A package that takes no Reporter gets the answer instead, because cli asks the question first and passes the answer in. Where a package&amp;rsquo;s warnings also say where the run log is, as Lima&amp;rsquo;s and the shared tools&amp;rsquo; do, its type has its own &lt;code&gt;Warn&lt;/code&gt; method over the Reporter&amp;rsquo;s. A Go test gives a package a &lt;code&gt;msg.Fake&lt;/code&gt; instead, a Reporter that prints nothing and refuses every question unless the test sets its fields, and records what it says with a &lt;code&gt;msg.Recorder&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Prose is never built with &lt;code&gt;fmt&lt;/code&gt;: every sentence devvm shows the user is a message. A message made from an error carries that error with &lt;code&gt;.Because(err)&lt;/code&gt;, rather than only its text from &lt;code&gt;err.Error()&lt;/code&gt;. Data output, such as a table or &lt;code&gt;--json&lt;/code&gt;, isn&amp;rsquo;t a message, and neither is text in a script that runs somewhere else. Data goes to the UI&amp;rsquo;s &lt;code&gt;Stdout()&lt;/code&gt;, and a log line that isn&amp;rsquo;t a message goes to its &lt;code&gt;Stderr()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The locale files are in &lt;a href="https://github.com/nicksnyder/go-i18n" target="_blank" rel="noopener"&gt;go-i18n&lt;/a&gt;&amp;rsquo;s TOML format, with only go-i18n&amp;rsquo;s own message fields, so go-i18n&amp;rsquo;s loader reads them as they are and its &lt;code&gt;goi18n&lt;/code&gt; tools work on them:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;no_vm&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;other&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;There&amp;#39;s no VM for {{.dir}}. Run devvm to make one.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;gc_tools&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} shared tool image is unused ({{.size}}).&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;other&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} shared tool images are unused ({{.size}}).&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;gc_tools_no_vm&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;tools lists the tool images, as \&amp;#34;node 24.21.0, claude 2.1.295\&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} current shared tool image no VM has ({{.size}}): {{.tools}}.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;other&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} current shared tool images no VM has ({{.size}}): {{.tools}}.&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The ID&lt;/strong&gt; is the table&amp;rsquo;s name, in snake_case.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;other&lt;/code&gt;&lt;/strong&gt; is the text: a Go template whose fields are snake_case (&lt;code&gt;{{.vm_name}}&lt;/code&gt;). Only plain fields are allowed, no logic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fields&amp;rsquo; types:&lt;/strong&gt; the generator makes each field a &lt;code&gt;string&lt;/code&gt; parameter of the message&amp;rsquo;s function, except &lt;code&gt;count&lt;/code&gt;, which is an &lt;code&gt;int&lt;/code&gt;, and &lt;code&gt;vm&lt;/code&gt; and &lt;code&gt;vm_name&lt;/code&gt;, which are &lt;code&gt;vmname.VM&lt;/code&gt;. A field that may hold something other than a VM&amp;rsquo;s name, such as an image&amp;rsquo;s name or a VM&amp;rsquo;s name as the user typed it, is named &lt;code&gt;what&lt;/code&gt; or &lt;code&gt;name&lt;/code&gt; instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;one&lt;/code&gt;&lt;/strong&gt; is the text for a count of 1, when the wording changes with the count. Both texts then take &lt;code&gt;{{.count}}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;description&lt;/code&gt;&lt;/strong&gt; is an optional note for translators.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nothing else:&lt;/strong&gt; the generator refuses keys go-i18n doesn&amp;rsquo;t know, nested tables, plural forms English doesn&amp;rsquo;t use (&lt;code&gt;zero&lt;/code&gt;, &lt;code&gt;two&lt;/code&gt;, &lt;code&gt;few&lt;/code&gt;, &lt;code&gt;many&lt;/code&gt;) and &lt;code&gt;leftDelim&lt;/code&gt;/&lt;code&gt;rightDelim&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Voice:&lt;/strong&gt; a message&amp;rsquo;s text follows the docs-voice skill&amp;rsquo;s &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/docs-voice/SKILL.md#messages" target="_blank" rel="noopener"&gt;Messages&lt;/a&gt; rules, which set its length (an error or a warning has at most two sentences, and a prompt at most two lines of context), and the mechanism goes in its doc link rather than its text.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One line:&lt;/strong&gt; a value renders on one line without control, bidi or invisible characters, because &lt;code&gt;msg.OneLine&lt;/code&gt; cleans every value as the message renders. Text from a VM that devvm shows as data goes through &lt;code&gt;msg.Printable&lt;/code&gt; instead, which keeps its newlines and tabs. &lt;a href="#colors"&gt;Colors&lt;/a&gt; says what the two drop.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="doc-links"&gt;Doc links&lt;span class="hx:absolute hx:-mt-20" id="doc-links"&gt;&lt;/span&gt;
&lt;a href="#doc-links" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A message links a docs page through the &lt;code&gt;docs&lt;/code&gt; map in &lt;code&gt;internal/msg/docs.go&lt;/code&gt;, from message ID to a page in &lt;code&gt;docs/content/docs&lt;/code&gt; and a heading on it. The page is its path without &lt;code&gt;.md&lt;/code&gt;, and a section&amp;rsquo;s own page, its &lt;code&gt;_index.md&lt;/code&gt;, is the section&amp;rsquo;s folder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;docs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;vm_outdated&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;using/images#outdated-vms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;backend_lacks&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;backends#when-a-backend-lacks-something&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm prints the page&amp;rsquo;s address on the docs site on the line after the text.&lt;/p&gt;
&lt;p&gt;After editing &lt;code&gt;en.toml&lt;/code&gt;, run:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise &lt;span class="nb"&gt;exec&lt;/span&gt; -- go generate ./internal/msg&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It writes &lt;code&gt;internal/msg/messages_gen.go&lt;/code&gt;, with one function per message. The parameters are the template&amp;rsquo;s fields in sorted order, in camelCase, and &lt;code&gt;count int&lt;/code&gt; for plural messages: &lt;code&gt;[no_vm]&lt;/code&gt; becomes &lt;code&gt;msg.NoVM(dir string) msg.M&lt;/code&gt;, and a value that&amp;rsquo;s missing or extra is a compile error. &lt;code&gt;msg.M&lt;/code&gt; is also an &lt;code&gt;error&lt;/code&gt;: one made from another error carries it with &lt;code&gt;.Because(err)&lt;/code&gt;, so &lt;code&gt;errors.Is&lt;/code&gt; and &lt;code&gt;errors.As&lt;/code&gt; see through it, while the text stays the message&amp;rsquo;s own.&lt;/p&gt;
&lt;p&gt;The tests fail when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;messages_gen.go&lt;/code&gt; is stale;&lt;/li&gt;
&lt;li&gt;a message doesn&amp;rsquo;t render with sample values, or shows &lt;code&gt;&amp;lt;no value&amp;gt;&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;a generated function is never called outside the generated file and the tests;&lt;/li&gt;
&lt;li&gt;a doc link names a message that isn&amp;rsquo;t in &lt;code&gt;en.toml&lt;/code&gt;, or a page or heading that doesn&amp;rsquo;t exist. &lt;code&gt;mise run lint&lt;/code&gt; runs this check too.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="questions"&gt;Questions&lt;span class="hx:absolute hx:-mt-20" id="questions"&gt;&lt;/span&gt;
&lt;a href="#questions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A prompt asks a &lt;code&gt;msg.Question&lt;/code&gt;, never a bare message, so every question declares what answers it where devvm can&amp;rsquo;t ask: without a terminal, with &lt;code&gt;--no-input&lt;/code&gt;, or once the input ends. A message becomes a question in one of two ways. &lt;code&gt;msg.X(...).AnsweredBy(&amp;quot;--force&amp;quot;)&lt;/code&gt; names the flag or command that answers it, and its refusal is &lt;code&gt;no_input&lt;/code&gt;, which names that answer and shows the question first when the prompt wasn&amp;rsquo;t printed. &lt;code&gt;RefusedWith(msg.Y(...))&lt;/code&gt; makes a question that no flag answers, and its refusal is the message given, which says what to do instead. &lt;code&gt;About(...)&lt;/code&gt; adds the messages said before the question, which devvm shows only when it asks.&lt;/p&gt;
&lt;p&gt;The Reporter&amp;rsquo;s &lt;code&gt;Ask&lt;/code&gt;, &lt;code&gt;Confirm&lt;/code&gt;, &lt;code&gt;Answer&lt;/code&gt; and &lt;code&gt;Secret&lt;/code&gt; take the question and, where devvm can&amp;rsquo;t ask it, return its &lt;code&gt;*msg.Refusal&lt;/code&gt;, an error whose &lt;code&gt;Msg&lt;/code&gt; is the refusal&amp;rsquo;s message. A command returns it as it would any failure, and a caller with something to fall back on does that instead, so no caller checks for a terminal itself. &lt;code&gt;TestQuestionsDeclareAnswers&lt;/code&gt; checks every question in the code, as &lt;a href="#the-cli-rule-tests"&gt;The CLI rule tests&lt;/a&gt; says, and a CLI test answers one with &lt;code&gt;ttyin&lt;/code&gt; or &lt;code&gt;DEVVM_PIPED_ANSWERS=1&lt;/code&gt;, as &lt;a href="https://next.devvm.dev/docs/contributing/tests/#cli-tests"&gt;CLI tests&lt;/a&gt; says.&lt;/p&gt;
&lt;h3 data-hextra-search-id="names-mode"&gt;Names mode&lt;span class="hx:absolute hx:-mt-20" id="names-mode"&gt;&lt;/span&gt;
&lt;a href="#names-mode" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;With &lt;code&gt;DEVVM_MESSAGES=names&lt;/code&gt;, a message prints as its ID and its values in sorted key order, so tests check which message devvm printed and with what, never its wording or language:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;! exec devvm _msg nope
stderr &amp;#39;msg_unknown name=nope$&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Every CLI test runs in names mode unless it sets &lt;code&gt;env DEVVM_MESSAGES=&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Names mode belongs to &lt;code&gt;internal/ui&lt;/code&gt;, which reads it once, with the rest of a stream&amp;rsquo;s style, in &lt;code&gt;New&lt;/code&gt;: a &lt;code&gt;msg.M&lt;/code&gt; itself always renders as its text, so its &lt;code&gt;String&lt;/code&gt; and &lt;code&gt;Error&lt;/code&gt; are the same whatever the environment says. Whatever shows a message as data, a table&amp;rsquo;s cell or a &lt;code&gt;--json&lt;/code&gt; field, goes through the UI&amp;rsquo;s &lt;code&gt;Text&lt;/code&gt;, or a &lt;code&gt;Table&lt;/code&gt;&amp;rsquo;s, to get the names in names mode. &lt;code&gt;New&lt;/code&gt; takes the function it reads the environment with, &lt;code&gt;os.Getenv&lt;/code&gt; for devvm&amp;rsquo;s own UI, so a Go test makes a UI in names mode without setting the environment and can run in parallel; cli&amp;rsquo;s &lt;code&gt;testUI&lt;/code&gt; does. A Go test that checks a message without a UI compares &lt;code&gt;Names&lt;/code&gt;, &lt;code&gt;msg.IDOf&lt;/code&gt; or &lt;code&gt;msg.NamesOf&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm _msg NAME key=value…&lt;/code&gt; prints a message&amp;rsquo;s text (never its names), for end-to-end tests that look for it in a VM&amp;rsquo;s output. It&amp;rsquo;s hidden from the help.&lt;/p&gt;
&lt;h3 data-hextra-search-id="colors"&gt;Colors&lt;span class="hx:absolute hx:-mt-20" id="colors"&gt;&lt;/span&gt;
&lt;a href="#colors" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Only &lt;code&gt;internal/ui&lt;/code&gt; adds color, through a &lt;code&gt;style&lt;/code&gt; for each stream that &lt;code&gt;onTerminal&lt;/code&gt; makes, and &lt;code&gt;colorOn&lt;/code&gt; decides each one: &lt;code&gt;NO_COLOR&lt;/code&gt; or &lt;code&gt;DEVVM_MESSAGES=names&lt;/code&gt; turns it off, then &lt;code&gt;FORCE_COLOR&lt;/code&gt; or &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt; (but &lt;code&gt;0&lt;/code&gt;) turns it on, then &lt;code&gt;TERM=dumb&lt;/code&gt; turns it off, and otherwise the stream gets color only when it&amp;rsquo;s a terminal. Names mode stays plain in a terminal too, so end-to-end checks that run devvm under &lt;code&gt;script&lt;/code&gt; read the names as they are. A &lt;code&gt;UI&lt;/code&gt; from &lt;code&gt;New&lt;/code&gt;, as tests make, has no terminal, so it&amp;rsquo;s plain unless the environment it reads sets &lt;code&gt;FORCE_COLOR&lt;/code&gt; or &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt;, which is how cli&amp;rsquo;s tests get a colored one.&lt;/p&gt;
&lt;p&gt;The colors are SGR codes from the 16 base colors only, which the theme maps to its own shades. devvm uses no bright colors (90–97), because Solarized maps them to greys and bright black is Solarized Dark&amp;rsquo;s background, and it uses no backgrounds, 256 colors or truecolor. The codes go on labels, links, log text and a message&amp;rsquo;s values, never on the template&amp;rsquo;s own words:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A message&amp;rsquo;s values are bold (&lt;code&gt;1&lt;/code&gt;), on the status line and in prompts too. &lt;code&gt;msg.M.Segments&lt;/code&gt; renders the template with each value between two private-use runes, &lt;code&gt;U+E000&lt;/code&gt; and &lt;code&gt;U+E001&lt;/code&gt;, after dropping those runes from the values, so a value can&amp;rsquo;t start or end a marking of its own. It returns the text cut into segments, each one the template&amp;rsquo;s words or a value, beside the doc link. Joined, the segments are &lt;code&gt;Text&lt;/code&gt;, and &lt;code&gt;String&lt;/code&gt; and names mode don&amp;rsquo;t change. Every value goes through &lt;code&gt;msg.OneLine&lt;/code&gt; as the message renders, in &lt;code&gt;Text&lt;/code&gt;, &lt;code&gt;Segments&lt;/code&gt; and &lt;code&gt;Names&lt;/code&gt; alike, so a value has no newline or other control character, whoever made it, bold or not. The log end that &lt;code&gt;ErrorLogged&lt;/code&gt; prints is the message on one line without bold, because bold inside dim would cancel it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Error&lt;/code&gt;&amp;rsquo;s &lt;code&gt;devvm:&lt;/code&gt; label is bold red (&lt;code&gt;1;31&lt;/code&gt;), and &lt;code&gt;Warn&lt;/code&gt;&amp;rsquo;s is bold yellow (&lt;code&gt;1;33&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A doc link is underlined blue (&lt;code&gt;4;34&lt;/code&gt;). &lt;code&gt;msg.M.Segments&lt;/code&gt; gives the doc link apart from the text, so &lt;code&gt;ui&lt;/code&gt; colors the link alone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Info&lt;/code&gt;&amp;rsquo;s &lt;code&gt;==&amp;gt;&lt;/code&gt; is bold (&lt;code&gt;1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The run log&amp;rsquo;s end that &lt;code&gt;ErrorLogged&lt;/code&gt; prints, with its &lt;code&gt;---&lt;/code&gt; lines, the log text on the status line, and the log&amp;rsquo;s lines that &lt;code&gt;-v&lt;/code&gt; streams (&lt;code&gt;SetVerbose&lt;/code&gt;: &lt;code&gt;LoggedCmd&lt;/code&gt; and &lt;code&gt;LogWriter&lt;/code&gt; copy the log to stderr through &lt;code&gt;msg.Printable&lt;/code&gt;, with no status line) are dim (&lt;code&gt;2&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The done mark that a slow step leaves is green (&lt;code&gt;32&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The codes are added after &lt;code&gt;msg.Printable&lt;/code&gt; and &lt;code&gt;msg.OneLine&lt;/code&gt;, so they&amp;rsquo;re the only ones devvm prints. Those two are devvm&amp;rsquo;s one cleaner, and &lt;code&gt;msg.Safe&lt;/code&gt; is its one rule for which characters reach the terminal. They drop every character that &lt;code&gt;msg.Safe&lt;/code&gt; refuses but newline and tab (which &lt;code&gt;OneLine&lt;/code&gt; drops too), and a lone C1 byte. &lt;code&gt;msg.Safe&lt;/code&gt; takes a graphic character in any script, such as an accented letter, a CJK character or an emoji, so a VM&amp;rsquo;s file names still read as they are. It refuses the control characters (C0, DEL and C1), the bidi controls such as U+202E, which reorder the text after them so a name could read as another, the format characters, such as the zero-width space and joiners, the word joiner, the soft hyphen and the tag characters, the variation selectors, and the fillers that show as nothing, such as U+3164 and the braille blank U+2800, which could hide or fake text in a prompt. The diff of devvm agent save writes each character that &lt;code&gt;msg.Safe&lt;/code&gt; refuses as its code instead, and the names of the files it saves must hold none. The status line, the run log&amp;rsquo;s end, &lt;code&gt;Pick&lt;/code&gt;, &lt;code&gt;devvm network log&lt;/code&gt; and the port forwarder&amp;rsquo;s log use them as well. The status line cuts and counts its plain text with &lt;code&gt;style.fit&lt;/code&gt; before painting it, so it still fits the terminal&amp;rsquo;s width and clears the right number of rows. The run log is never colored.&lt;/p&gt;
&lt;p&gt;Tables on &lt;code&gt;Stdout()&lt;/code&gt; are colored as stdout is. A command gets a &lt;code&gt;ui.Table&lt;/code&gt; from &lt;code&gt;u.Table()&lt;/code&gt; and adds a header, rows of &lt;code&gt;ui.Cell&lt;/code&gt;s and a totals row, and cli never reads the environment itself. Each cell has a &lt;code&gt;ui.Role&lt;/code&gt;: &lt;code&gt;Good&lt;/code&gt; is green (&lt;code&gt;32&lt;/code&gt;), &lt;code&gt;Attention&lt;/code&gt; yellow (&lt;code&gt;33&lt;/code&gt;), &lt;code&gt;Bad&lt;/code&gt; red (&lt;code&gt;31&lt;/code&gt;), &lt;code&gt;Secondary&lt;/code&gt; dim (&lt;code&gt;2&lt;/code&gt;), and &lt;code&gt;Plain&lt;/code&gt; stays in the default color, while the header and totals rows are bold. &lt;code&gt;Table&lt;/code&gt; pads each cell on its plain text before painting it, because &lt;code&gt;text/tabwriter&lt;/code&gt; counts the codes&amp;rsquo; bytes as width, and a plain table is byte for byte what &lt;code&gt;text/tabwriter&lt;/code&gt; writes with a padding of 2 (&lt;code&gt;TestTableLikeTabwriter&lt;/code&gt;). The roles for each table&amp;rsquo;s values are next to the code that writes it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;devvm images: &lt;code&gt;current&lt;/code&gt; is good, &lt;code&gt;stale&lt;/code&gt;, &lt;code&gt;unfinished&lt;/code&gt;, &lt;code&gt;unused&lt;/code&gt; and &lt;code&gt;not built&lt;/code&gt; need attention, and digests and keys are secondary.&lt;/li&gt;
&lt;li&gt;devvm ls: &lt;code&gt;Running&lt;/code&gt; and the &lt;code&gt;.git&lt;/code&gt; protections &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;clone&lt;/code&gt; are good, &lt;code&gt;Stopped&lt;/code&gt; needs attention, and any other status, such as &lt;code&gt;Broken&lt;/code&gt;, is bad, as is the tier &lt;code&gt;unenforced&lt;/code&gt;, while a confined tier, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;, is good and &lt;code&gt;open&lt;/code&gt; stays plain.&lt;/li&gt;
&lt;li&gt;devvm space: &lt;code&gt;only copy&lt;/code&gt; and &lt;code&gt;leftover&lt;/code&gt; in KEPT need attention.&lt;/li&gt;
&lt;li&gt;devvm doctor: &lt;code&gt;native&lt;/code&gt; is good, &lt;code&gt;emulated&lt;/code&gt; needs attention, and &lt;code&gt;unreviewed&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt; are bad.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every command&amp;rsquo;s &lt;code&gt;--json&lt;/code&gt; output is for scripts and stays plain.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mise run test&lt;/code&gt; unsets &lt;code&gt;NO_COLOR&lt;/code&gt;, &lt;code&gt;FORCE_COLOR&lt;/code&gt; and &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt;, and the end-to-end tests unset the last two, so your own settings never change what they check.&lt;/p&gt;
&lt;h3 data-hextra-search-id="translations"&gt;Translations&lt;span class="hx:absolute hx:-mt-20" id="translations"&gt;&lt;/span&gt;
&lt;a href="#translations" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A translation is &lt;code&gt;locales/&amp;lt;language&amp;gt;.toml&lt;/code&gt; (&lt;code&gt;de.toml&lt;/code&gt;) with the same tables, &lt;code&gt;one&lt;/code&gt; and &lt;code&gt;other&lt;/code&gt; translated (and the language&amp;rsquo;s other plural forms, such as &lt;code&gt;few&lt;/code&gt;), loaded by go-i18n the same way. Doc links are the same in every language: the docs site is English. devvm picks the language from the first of &lt;code&gt;LC_ALL&lt;/code&gt;, &lt;code&gt;LC_MESSAGES&lt;/code&gt; and &lt;code&gt;LANG&lt;/code&gt; that is set (&lt;code&gt;de_DE.UTF-8&lt;/code&gt; is German); &lt;code&gt;C&lt;/code&gt; and &lt;code&gt;POSIX&lt;/code&gt; are English. A message missing from a translation is shown in English.&lt;/p&gt;
&lt;h2 data-hextra-search-id="json-output"&gt;JSON output&lt;span class="hx:absolute hx:-mt-20" id="json-output"&gt;&lt;/span&gt;
&lt;a href="#json-output" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every command that shows or lists something takes &lt;code&gt;--json&lt;/code&gt;, which &lt;code&gt;jsonFlag&lt;/code&gt; in &lt;code&gt;internal/cli/json.go&lt;/code&gt; adds. The command builds a struct of its own with snake_case &lt;code&gt;json&lt;/code&gt; tags, next to the code that writes its table, and writes it with &lt;code&gt;printJSON&lt;/code&gt;, which puts &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt; (&lt;code&gt;jsonVersion&lt;/code&gt;) first, writes HTML characters as they are and refuses anything but an object. A list it prints is never &lt;code&gt;nil&lt;/code&gt;, so it&amp;rsquo;s &lt;code&gt;[]&lt;/code&gt; rather than &lt;code&gt;null&lt;/code&gt;, and a field that doesn&amp;rsquo;t apply is &lt;code&gt;omitempty&lt;/code&gt;. Sizes are bytes unless the field&amp;rsquo;s name gives the unit, as in &lt;code&gt;memory_gib&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The root command&amp;rsquo;s &lt;code&gt;PersistentPreRun&lt;/code&gt; calls &lt;code&gt;u.DataOnly()&lt;/code&gt; for any command given &lt;code&gt;--json&lt;/code&gt;, so &lt;code&gt;Say&lt;/code&gt;, &lt;code&gt;Info&lt;/code&gt; and &lt;code&gt;LogNote&lt;/code&gt; print to stderr from then on, and stdout gets only the JSON. A settings command that also changes its setting with a value wraps its &lt;code&gt;Args&lt;/code&gt; in &lt;code&gt;showsOnly&lt;/code&gt;, which refuses the value with &lt;code&gt;--json&lt;/code&gt; (&lt;code&gt;json_shows_only&lt;/code&gt;) before anything else runs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TestJSONShapes&lt;/code&gt; in &lt;code&gt;internal/cli/json_test.go&lt;/code&gt; holds each command&amp;rsquo;s shape, a &lt;code&gt;path: type&lt;/code&gt; line for each field of a sample with every field set. A field renamed, removed or given another type fails it. Shapes only gain fields, so a new field goes into the sample and the test, and any other change raises &lt;code&gt;jsonVersion&lt;/code&gt;. A new command that shows or lists something gets &lt;code&gt;--json&lt;/code&gt;, a row in that test, a CLI test and a section on its page with an example, which &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; links to.&lt;/p&gt;</description></item><item><title>.git protection</title><link>https://next.devvm.dev/docs/internals/git-protection/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/git-protection/</guid><description>
&lt;p&gt;This page explains what devvm locks in a project&amp;rsquo;s git folder, when it locks and checks the locks again, and what the locks can&amp;rsquo;t stop. &lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;.git protection&lt;/a&gt; covers what still works, turning protection on or off, VMs that were strict, and what isn&amp;rsquo;t covered.&lt;/p&gt;
&lt;p&gt;On macOS devvm locks with the user-immutable flag (&lt;code&gt;chflags uchg&lt;/code&gt;), which even root in the VM can&amp;rsquo;t clear. A read-only mount wouldn&amp;rsquo;t hold, because root in the VM can unmount it.&lt;/p&gt;
&lt;p&gt;On Linux devvm makes the same paths read-only in the user and mount namespace it runs the VM&amp;rsquo;s QEMU in (&lt;a href="#on-linux-hosts"&gt;on Linux hosts&lt;/a&gt;), so the VM, which reaches the folder only through QEMU, can&amp;rsquo;t change them.&lt;/p&gt;
&lt;p&gt;Each check reads each repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; once, the folder&amp;rsquo;s own and those nested in it, finding its git folders, submodules, what it would lock, what the locked files hand over and what points git elsewhere, and then locks, unlocks, watches and reports from what it found. The host&amp;rsquo;s locker does the locking: the flag on macOS, and on Linux nothing at the check itself, because the VM&amp;rsquo;s next start makes the paths read-only. A Linux host whose kernel refuses devvm the namespace locks nothing, and devvm &lt;a href="#the-watch"&gt;watches&lt;/a&gt; &lt;code&gt;.git&lt;/code&gt; there instead.&lt;/p&gt;
&lt;h2 data-hextra-search-id="whats-locked"&gt;What&amp;rsquo;s locked&lt;span class="hx:absolute hx:-mt-20" id="whats-locked"&gt;&lt;/span&gt;
&lt;a href="#whats-locked" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm locks these paths, of the folder&amp;rsquo;s own repo and of each &lt;a href="#nested-repos"&gt;nested repo&lt;/a&gt; it protects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.git/hooks&lt;/code&gt; and &lt;code&gt;.git/config&lt;/code&gt;. A repo without a &lt;code&gt;hooks&lt;/code&gt; folder gets an empty one, locked, so the VM can&amp;rsquo;t make one.&lt;/li&gt;
&lt;li&gt;The same paths for each submodule devvm finds, submodules of submodules included. Those are the git folders under &lt;code&gt;.git/modules&lt;/code&gt;, and those in the working tree, which are &lt;code&gt;sub/.git&lt;/code&gt; or the folder that a &lt;code&gt;sub/.git&lt;/code&gt; file points to. devvm finds the submodules from the index, which it reads with &lt;code&gt;core.fsmonitor&lt;/code&gt; off. It takes a folder for a git folder only when it has what git looks for in one, which is a &lt;code&gt;HEAD&lt;/code&gt;, and &lt;code&gt;objects&lt;/code&gt; and &lt;code&gt;refs&lt;/code&gt; in the folder or in the folder its &lt;code&gt;commondir&lt;/code&gt; names, as git&amp;rsquo;s own test has it. The VM can point a &lt;code&gt;sub/.git&lt;/code&gt; file at any folder in the project, such as &lt;code&gt;src&lt;/code&gt;, and locking that folder&amp;rsquo;s &lt;code&gt;hooks&lt;/code&gt; and &lt;code&gt;config&lt;/code&gt; would lock your own files, so devvm locks and creates nothing in a folder that fails the check and reports it instead.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.git/config.worktree&lt;/code&gt;, when &lt;code&gt;extensions.worktreeConfig&lt;/code&gt; is on. devvm creates it empty if it&amp;rsquo;s missing.&lt;/li&gt;
&lt;li&gt;What linked worktrees elsewhere on your machine read from here, which is &lt;code&gt;.git/worktrees/&amp;lt;name&amp;gt;/commondir&lt;/code&gt; and &lt;code&gt;config.worktree&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The project folder&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; file, if the project folder is itself a linked worktree. The repo it points to is outside the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="when-devvm-locks"&gt;When devvm locks&lt;span class="hx:absolute hx:-mt-20" id="when-devvm-locks"&gt;&lt;/span&gt;
&lt;a href="#when-devvm-locks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm records a new VM&amp;rsquo;s mode in its state before its backend makes the VM, so the mode is never unset: on with locks (macOS, and Linux where the kernel lets devvm use a user namespace), off when you pass &lt;code&gt;--no-git-protect&lt;/code&gt; or on hosts without locks, and &lt;code&gt;clone&lt;/code&gt; for a &lt;code&gt;--clone&lt;/code&gt; VM, which mounts no &lt;code&gt;.git&lt;/code&gt;. devvm locks once the backend has made the VM, and again on each launch that finds the VM stopped and on &lt;code&gt;devvm stop&lt;/code&gt;, so nothing in the VM can race the locks. A VM whose creation stopped before its first locks, or that &lt;code&gt;devvm adopt&lt;/code&gt; moved to this folder, is locked on its next launch as a new VM is, without reports. A running VM keeps the locks it had, and &lt;code&gt;devvm stop&lt;/code&gt; or the next launch that finds the VM stopped, such as &lt;code&gt;devvm restart&lt;/code&gt;, sets new ones. &lt;code&gt;devvm git-protect&lt;/code&gt; on a running VM saves the mode in the VM&amp;rsquo;s state (the &lt;code&gt;git&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;next&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Each time it locks, devvm records in the VM&amp;rsquo;s state what it locked and found: the identity of &lt;code&gt;.git&lt;/code&gt; (its device and inode, and its birth time where the file system keeps one), every git folder it locked besides &lt;code&gt;.git&lt;/code&gt; (those under &lt;code&gt;.git/modules&lt;/code&gt; and the submodules&amp;rsquo; in the working tree, in one list), and a hash of what the locked files hand over to the project folder. The next check compares with those, so it reports what changed since. When only the device of &lt;code&gt;.git&lt;/code&gt; differs, and it&amp;rsquo;s at the same path with no link on it and has the same inode and birth time, it&amp;rsquo;s the &lt;code&gt;.git&lt;/code&gt; that devvm locked, on a disk that macOS numbered anew at boot, as for &lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;. The check then records its identity as it is now and doesn&amp;rsquo;t report a replaced &lt;code&gt;.git&lt;/code&gt;. The same places first check &lt;code&gt;.git&lt;/code&gt; under the mode the VM ran with, so a &lt;code&gt;.git&lt;/code&gt; that the VM replaced meanwhile is still named (&lt;code&gt;git_replaced&lt;/code&gt;), and then set the new mode, which locks &lt;code&gt;.git&lt;/code&gt; as it is then.&lt;/p&gt;
&lt;p&gt;A new VM that&amp;rsquo;s interrupted before its first shell is deleted, and devvm takes its locks off. When &lt;code&gt;devvm rm&lt;/code&gt; deletes a VM, devvm also takes its locks off. It unlocks what it would lock now and every git folder the VM&amp;rsquo;s state records locking, so a submodule whose entry the VM dropped from the index since is unlocked too.&lt;/p&gt;
&lt;h3 data-hextra-search-id="symlinks"&gt;Symlinks&lt;span class="hx:absolute hx:-mt-20" id="symlinks"&gt;&lt;/span&gt;
&lt;a href="#symlinks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm never locks or creates anything through a symlink, because the VM could plant one under &lt;code&gt;.git&lt;/code&gt; so that devvm would lock a file elsewhere. devvm reports a path that is a symlink, or is under one, instead of locking it (&lt;code&gt;git_not_locked&lt;/code&gt;). devvm also checks each lock again once it&amp;rsquo;s set. If the path moved in the meantime, devvm unlocks it where it landed and reports it (&lt;code&gt;git_lock_raced&lt;/code&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="on-each-launch"&gt;On each launch&lt;span class="hx:absolute hx:-mt-20" id="on-each-launch"&gt;&lt;/span&gt;
&lt;a href="#on-each-launch" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every launch of an existing VM, every export of its agents&amp;rsquo; history, and &lt;code&gt;devvm stop&lt;/code&gt; check &lt;code&gt;.git&lt;/code&gt; again. devvm reports each of these once:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;.git&lt;/code&gt; that was replaced since devvm locked it (&lt;code&gt;git_replaced&lt;/code&gt;). devvm then does nothing else, so check the new &lt;code&gt;.git&lt;/code&gt;, and look for the old one, renamed.&lt;/li&gt;
&lt;li&gt;A repo that appeared in the folder after the VM was made (&lt;code&gt;git_appeared&lt;/code&gt;), which devvm then locks, and a nested repo that appeared since the last check (&lt;code&gt;git_nested_appeared&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A nested repo devvm protected that&amp;rsquo;s gone (&lt;code&gt;git_nested_gone&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A submodule git folder that appeared, in the working tree or under &lt;code&gt;.git/modules&lt;/code&gt; (&lt;code&gt;git_embedded_new&lt;/code&gt;), which devvm then locks. devvm compares with the git folders it recorded last time, so &lt;code&gt;devvm git-protect on&lt;/code&gt; after a VM was made without protection names none: it locks &lt;code&gt;.git&lt;/code&gt; as it is then, as trusted.&lt;/li&gt;
&lt;li&gt;Hooks in a hooks folder that wasn&amp;rsquo;t locked, because it wasn&amp;rsquo;t there to lock or belongs to a new submodule (&lt;code&gt;git_hooks_unlocked&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm also reports these, the first two on every launch and the last two when they change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;commondir&lt;/code&gt; (&lt;code&gt;git_commondir&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Linked worktrees whose &lt;code&gt;commondir&lt;/code&gt; leads elsewhere (&lt;code&gt;git_worktree_stray&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Includes and hook links into the project folder (&lt;code&gt;git_include_inside&lt;/code&gt;, &lt;code&gt;git_hook_link_inside&lt;/code&gt;), which &lt;a href="https://next.devvm.dev/docs/safety/git-protection/#not-covered"&gt;not covered&lt;/a&gt; describes.&lt;/li&gt;
&lt;li&gt;Submodules whose git folder, in the working tree, isn&amp;rsquo;t a git folder (&lt;code&gt;git_gitdir_not_git&lt;/code&gt;), which devvm doesn&amp;rsquo;t lock.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="nested-repos"&gt;Nested repos&lt;span class="hx:absolute hx:-mt-20" id="nested-repos"&gt;&lt;/span&gt;
&lt;a href="#nested-repos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm protects each git repo nested in the project folder as it protects the folder&amp;rsquo;s own: it locks the same paths of each, checks each at every launch, pins each on Linux and watches each where the host can&amp;rsquo;t lock (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#nested-repos"&gt;nested repos&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-walk"&gt;The walk&lt;span class="hx:absolute hx:-mt-20" id="the-walk"&gt;&lt;/span&gt;
&lt;a href="#the-walk" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm finds the nested repos by walking the project folder when it creates the VM, at each launch that finds the VM stopped and at &lt;code&gt;devvm stop&lt;/code&gt;, at &lt;code&gt;devvm git-protect&lt;/code&gt; on a stopped VM, and when &lt;code&gt;devvm clone off&lt;/code&gt; mounts the folder again. It&amp;rsquo;s one walk that also finds the set-id files on a Linux host, which only the start runs (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;), and a launch into a running VM never walks. The walk stays on the project folder&amp;rsquo;s file system, follows no symlink and never enters a &lt;code&gt;.git&lt;/code&gt; folder, so it never finds the repos of &lt;code&gt;.git/modules&lt;/code&gt;, which are the folder&amp;rsquo;s own repo&amp;rsquo;s to protect. It takes a folder for a repo when the folder has anything named &lt;code&gt;.git&lt;/code&gt;, a folder, a file, which a linked worktree or a repo with its git folder elsewhere has, a symlink or anything else, whether git takes it for a repo&amp;rsquo;s now or not, because the VM can make it one at any time. On macOS, whose file systems fold case, &lt;code&gt;.GIT&lt;/code&gt; is &lt;code&gt;.git&lt;/code&gt; to git, so the walk takes any case of the name there. It looks for repos at most four folders below the project folder, and not in &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;vendor&lt;/code&gt;, &lt;code&gt;.venv&lt;/code&gt;, &lt;code&gt;__pycache__&lt;/code&gt; or &lt;code&gt;.terraform&lt;/code&gt;, which package managers and build tools fill with what they fetch, so on macOS, where there are no set-id files to look for, the walk doesn&amp;rsquo;t enter those folders at all. On Linux it walks them for set-id files anyway, and counts the &lt;code&gt;.git&lt;/code&gt; it sees there and below four folders (&lt;code&gt;git_nested_skipped&lt;/code&gt;). It counts the folders it doesn&amp;rsquo;t enter because they&amp;rsquo;re on another file system (&lt;code&gt;git_nested_devices&lt;/code&gt;). It keeps the first 100 repos it finds, in the walk&amp;rsquo;s order, and counts the rest, keeping the names of the first ten of those (&lt;code&gt;git_nested_past_bound&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;The walk also names each folder up to four folders down that git could take for a bare repo (&lt;code&gt;git_nested_bare&lt;/code&gt;), one shaped like a git folder by git&amp;rsquo;s own test: a &lt;code&gt;HEAD&lt;/code&gt;, and &lt;code&gt;objects&lt;/code&gt; and &lt;code&gt;refs&lt;/code&gt;, files or folders, in the folder or in the folder its &lt;code&gt;commondir&lt;/code&gt; names. A git folder that a repo&amp;rsquo;s scan locks, or that a nested repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; file names, isn&amp;rsquo;t named. &lt;code&gt;devvm doctor&lt;/code&gt; reads &lt;code&gt;safe.bareRepository&lt;/code&gt; from git&amp;rsquo;s global and system config, the files that &lt;code&gt;GIT_CONFIG_GLOBAL&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_SYSTEM&lt;/code&gt; name included, which it reads by name because devvm&amp;rsquo;s host git ignores every &lt;code&gt;GIT_*&lt;/code&gt; variable, and it gives a tip unless the setting is &lt;code&gt;explicit&lt;/code&gt; (&lt;code&gt;doctor_git_bare&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;A check takes the repos the walk found, the ones the VM&amp;rsquo;s state records first. A recorded repo stays protected, whether the walk found it or not, while its folder is a real folder of the project with anything at its &lt;code&gt;.git&lt;/code&gt;, because the VM can make a &lt;code&gt;.git&lt;/code&gt; that the walk or git&amp;rsquo;s own test passes over while git still takes it: objects and refs renamed with a &lt;code&gt;commondir&lt;/code&gt; that leads to a git folder of its own, a &lt;code&gt;.GIT&lt;/code&gt;, or a &lt;code&gt;.git&lt;/code&gt; it can&amp;rsquo;t read, which devvm can&amp;rsquo;t lock and names (&lt;code&gt;git_not_locked&lt;/code&gt;). A check without a walk, such as &lt;code&gt;devvm rm&lt;/code&gt; and the start that pins, takes the repos the state records. A launch into a running VM checks the folder&amp;rsquo;s own repo alone and keeps the nested repos&amp;rsquo; records as they are, because it locks nothing and the VM can change them until it stops, so it never pays for scanning them, and the check of a running VM&amp;rsquo;s pins goes by those records without scanning them. devvm scans each repo as it scans the folder&amp;rsquo;s own, eight at once, because each scan runs a few host git commands: a check of a stopped VM with 50 nested repos, the walk and the locks included, takes under a second on an M3 Max.&lt;/p&gt;
&lt;h3 data-hextra-search-id="two-bounds"&gt;Two bounds&lt;span class="hx:absolute hx:-mt-20" id="two-bounds"&gt;&lt;/span&gt;
&lt;a href="#two-bounds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each repo has two bounds. Its own top folder is where its &lt;code&gt;.git&lt;/code&gt; is, where &lt;code&gt;.git/modules&lt;/code&gt; and a relative &lt;code&gt;core.hooksPath&lt;/code&gt; are read from, and where its submodules&amp;rsquo; folders are. The project folder, which the VM mounts, is what the VM can write, so it&amp;rsquo;s the bound for everything else: devvm locks only a real path in the project folder, through no symlink, an include or a hooks path leads inside when it leads into the project folder, and a submodule&amp;rsquo;s git folder outside the project folder is one devvm can&amp;rsquo;t lock (&lt;code&gt;git_gitdir_outside&lt;/code&gt;). A nested repo&amp;rsquo;s hooks path that leads into a sibling repo is inside, because the VM can write it.&lt;/p&gt;
&lt;p&gt;A nested repo is left to another repo only when that repo&amp;rsquo;s scan locks its git folder whole: the git folder is that repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt;, one under its &lt;code&gt;.git/modules&lt;/code&gt; that reads its config from itself, with no &lt;code&gt;commondir&lt;/code&gt; that leads elsewhere, or one of its linked worktrees under &lt;code&gt;.git/worktrees&lt;/code&gt; whose &lt;code&gt;commondir&lt;/code&gt; leads back. Anything else below a &lt;code&gt;.git&lt;/code&gt;, such as a &lt;code&gt;.git/evil&lt;/code&gt; the VM made for a &lt;code&gt;src/.git&lt;/code&gt; file to name, isn&amp;rsquo;t locked by anything, so the repo is scanned on its own, and named as one that appeared and as one devvm doesn&amp;rsquo;t protect. A submodule in the working tree is scanned as a repo of its own as well as its parent&amp;rsquo;s submodule, because the index that names it is the VM&amp;rsquo;s to write: a gitlink the VM adds, whose &lt;code&gt;.git&lt;/code&gt; file names a nested repo&amp;rsquo;s git folder, would otherwise hide that repo&amp;rsquo;s own submodules and worktrees behind a scan from the wrong folder. Locking a path twice changes nothing, and unlocking goes by path once. A nested repo whose &lt;code&gt;.git&lt;/code&gt; is a file is locked as the folder&amp;rsquo;s own is when it&amp;rsquo;s a linked worktree, by its &lt;code&gt;.git&lt;/code&gt; file. When the git folder that file names is in the project folder and no repo&amp;rsquo;s scan locks it, devvm names the repo as one it doesn&amp;rsquo;t protect, and when it&amp;rsquo;s outside the project folder, it names the repo as one whose git folder it can&amp;rsquo;t lock (&lt;code&gt;git_nested_gitdir_outside&lt;/code&gt;), as it does a submodule&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;A scan follows each submodule git folder once, by its resolved path, and one check&amp;rsquo;s scans follow at most 1,000 of them across every repo, so gitlinks that the VM points back at a git folder already followed, or through a symlinked folder at the repo itself, or many repos full of submodules, can&amp;rsquo;t make a check run git without end. A repo whose scan stopped there is named at every check (&lt;code&gt;git_scan_bounded&lt;/code&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="whats-recorded"&gt;What&amp;rsquo;s recorded&lt;span class="hx:absolute hx:-mt-20" id="whats-recorded"&gt;&lt;/span&gt;
&lt;a href="#whats-recorded" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The VM&amp;rsquo;s state records each protected nested repo in the &lt;code&gt;git&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;made.repos&lt;/code&gt;, by its folder relative to the project folder, with the same fields as the folder&amp;rsquo;s own repo: &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s identity, the git folders locked besides &lt;code&gt;.git&lt;/code&gt;, and a hash of what its locked files hand over. &lt;code&gt;made.nested&lt;/code&gt; is set once the VM protects its nested repos, which a new VM does, and so do &lt;code&gt;devvm git-protect on&lt;/code&gt; and the watch on a Linux host that can&amp;rsquo;t lock. A nested repo without a record is scanned for the first time, which records it as a new VM&amp;rsquo;s repo is recorded, without reporting its git folders. At a check of a VM whose &lt;code&gt;made.nested&lt;/code&gt; is set, devvm also reports it as one that appeared, such as a repo the VM cloned while it ran, naming each key of its config that runs a program or reads another config (&lt;code&gt;core.fsmonitor&lt;/code&gt;, &lt;code&gt;core.hooksPath&lt;/code&gt;, &lt;code&gt;core.sshCommand&lt;/code&gt;, &lt;code&gt;core.pager&lt;/code&gt;, filters, aliases that start with &lt;code&gt;!&lt;/code&gt;, includes and the like) and each hook that isn&amp;rsquo;t one of git&amp;rsquo;s samples (&lt;code&gt;git_nested_appeared_runs&lt;/code&gt;, else &lt;code&gt;git_nested_appeared&lt;/code&gt;), because it locks the repo as it is. A recorded repo with nothing at its &lt;code&gt;.git&lt;/code&gt;, or whose folder isn&amp;rsquo;t a real folder of the project any more, is reported (&lt;code&gt;git_nested_gone&lt;/code&gt;), and a recorded repo whose &lt;code&gt;.git&lt;/code&gt; is another one is reported as the folder&amp;rsquo;s own is (&lt;code&gt;git_replaced&lt;/code&gt;). The record of a repo devvm stops protecting, as it&amp;rsquo;s gone or another repo&amp;rsquo;s protection covers it, moves to &lt;code&gt;made.left&lt;/code&gt;, so &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm git-protect off&lt;/code&gt; take its locks off with the rest, and name one that isn&amp;rsquo;t in the folder any more (&lt;code&gt;git_locks_left&lt;/code&gt;), whose locks only &lt;code&gt;chflags&lt;/code&gt; can take off.&lt;/p&gt;
&lt;p&gt;A VM an earlier devvm made has no &lt;code&gt;made.nested&lt;/code&gt;, so it protects only the folder&amp;rsquo;s own repo. The first check of it that finds nested repos names them once (&lt;code&gt;git_nested_protectable&lt;/code&gt;, recorded as &lt;code&gt;nested_noticed&lt;/code&gt;), and &lt;code&gt;devvm git-protect on&lt;/code&gt; protects them. The nested repos that a check finds and the protection doesn&amp;rsquo;t cover are recorded in &lt;code&gt;nested&lt;/code&gt;, with &lt;code&gt;nested_more&lt;/code&gt; for how many more the walk counted, and named (&lt;code&gt;git_nested_unprotected&lt;/code&gt;, &lt;code&gt;git_nested_past_bound&lt;/code&gt;): on a host that locks, all of them when devvm creates the VM and at &lt;code&gt;devvm git-protect on&lt;/code&gt;, and at a check of a stopped VM those it hadn&amp;rsquo;t recorded, and how many are past the bound at every check, because the VM could keep their count and change which they are. On a Linux host that can&amp;rsquo;t lock, each launch names those the last walk recorded, after &lt;code&gt;git_unprotected&lt;/code&gt;, which a folder without a &lt;code&gt;.git&lt;/code&gt; of its own gets too when it has nested repos, and &lt;code&gt;devvm git-protect off&lt;/code&gt; quiets both.&lt;/p&gt;
&lt;p&gt;A VM that devvm 0.1.0 or 0.1.1-rc.1 made strict has &lt;code&gt;strict&lt;/code&gt; as its &lt;code&gt;mode&lt;/code&gt;, and its repos&amp;rsquo; configs have the &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; that strict set. devvm reads that mode as &lt;code&gt;on&lt;/code&gt;: it locks, pins and keeps the VM&amp;rsquo;s paths as it does for &lt;code&gt;on&lt;/code&gt;, and &lt;code&gt;devvm git-protect&lt;/code&gt;, its &lt;code&gt;--json&lt;/code&gt; and &lt;code&gt;devvm ls&lt;/code&gt; show &lt;code&gt;on&lt;/code&gt;. The first check that finds the VM stopped, at a launch, &lt;code&gt;devvm stop&lt;/code&gt;, &lt;code&gt;devvm clone on&lt;/code&gt; or the undo of a &lt;code&gt;devvm clone off&lt;/code&gt;, runs as an &lt;code&gt;on&lt;/code&gt; VM&amp;rsquo;s does, and then converts the VM. Under the host&amp;rsquo;s lock of &lt;code&gt;.git&lt;/code&gt; protection, it takes the value &lt;code&gt;all&lt;/code&gt; out of the &lt;code&gt;.git/config&lt;/code&gt; of each repo that the VM&amp;rsquo;s state recorded protecting before that check, the folder&amp;rsquo;s own and the nested ones, with &lt;code&gt;git config --unset-all diff.ignoreSubmodules '^all$'&lt;/code&gt;, and leaves any other value. It acts only on a repo whose &lt;code&gt;.git&lt;/code&gt; has the identity the state recorded (&lt;code&gt;git_id&lt;/code&gt;), so a &lt;code&gt;.git&lt;/code&gt; the VM replaced, which the check names and locks nothing in, and a VM with no record, as after &lt;code&gt;devvm adopt&lt;/code&gt;, keep their setting, which devvm names once when it&amp;rsquo;s &lt;code&gt;all&lt;/code&gt; (&lt;code&gt;git_strict_unknown&lt;/code&gt;). It reads the config through devvm&amp;rsquo;s reader of files a VM can write first, so a FIFO or a symlink there is never read, and after git writes it, it checks that the config is still a regular file in that &lt;code&gt;.git&lt;/code&gt;, else it names the path (&lt;code&gt;git_lock_raced&lt;/code&gt;). On a host that watches as well as locks, it leaves a config whose sum isn&amp;rsquo;t the one the check just recorded, and puts the new sum of each config it changed into the watch&amp;rsquo;s, so the next check doesn&amp;rsquo;t name devvm&amp;rsquo;s own change. It locks each config again even after an interrupt, on a context the interrupt doesn&amp;rsquo;t cancel, and an interrupt records nothing, so the next check goes again. Then it records &lt;code&gt;on&lt;/code&gt; in &lt;code&gt;mode&lt;/code&gt;, and in &lt;code&gt;next&lt;/code&gt; when an earlier devvm saved &lt;code&gt;strict&lt;/code&gt; there for the VM&amp;rsquo;s next stop, and warns once (&lt;code&gt;git_strict_converted&lt;/code&gt;), unless &lt;code&gt;next&lt;/code&gt; is &lt;code&gt;off&lt;/code&gt;. A config that git can&amp;rsquo;t change keeps the setting, and devvm names it (&lt;code&gt;git_strict_left&lt;/code&gt;). &lt;code&gt;devvm git-protect on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt; and the unlock at &lt;code&gt;devvm rm&lt;/code&gt; take the setting out the same way, without the warning (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt; names the code).&lt;/p&gt;
&lt;h3 data-hextra-search-id="two-vms-one-repo"&gt;Two VMs, one repo&lt;span class="hx:absolute hx:-mt-20" id="two-vms-one-repo"&gt;&lt;/span&gt;
&lt;a href="#two-vms-one-repo" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A nested repo with a VM of its own is protected by two VMs, the parent folder&amp;rsquo;s and its own. On macOS both set the same flag on the same files, so when one VM&amp;rsquo;s protection comes off, at &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm git-protect off&lt;/code&gt;, devvm leaves locked every path that another VM&amp;rsquo;s protection still covers, which is a git folder that VM recorded locking, of its own repo or of a nested one, and names that VM (&lt;code&gt;git_kept_locked&lt;/code&gt;). The inventory reads every VM&amp;rsquo;s state for that. It fails closed: a state it can&amp;rsquo;t read keeps locked every path in the folder whose hash names that state&amp;rsquo;s folder, and when it can&amp;rsquo;t read the VMs&amp;rsquo; folder at all, everything stays locked, each named with the state to fix (&lt;code&gt;git_kept_unread&lt;/code&gt;). Locking a VM&amp;rsquo;s repos and recording them, and unlocking another&amp;rsquo;s, take the host&amp;rsquo;s lock of &lt;code&gt;.git&lt;/code&gt; protection first, before any VM&amp;rsquo;s own lock, so one VM&amp;rsquo;s unlock never runs between another&amp;rsquo;s locks and their record. Taking a strict VM&amp;rsquo;s &lt;code&gt;diff.ignoreSubmodules&lt;/code&gt; out never unlocks a config another VM keeps locked, because that VM, running, could race the unlocked file, so the setting stays there, and devvm names the file, that VM and how to take it out by hand (&lt;code&gt;git_strict_kept&lt;/code&gt;). The repo goes in the state&amp;rsquo;s &lt;code&gt;strict_left&lt;/code&gt;, as does one whose config changed since the check, and each later check that finds the VM stopped tries again, until none is left. When git can&amp;rsquo;t change a config, devvm locks it again all the same. On Linux each VM&amp;rsquo;s pins are in its own QEMU&amp;rsquo;s namespace, and the watch locks nothing, so neither needs this.&lt;/p&gt;
&lt;h2 data-hextra-search-id="on-linux-hosts"&gt;On Linux hosts&lt;span class="hx:absolute hx:-mt-20" id="on-linux-hosts"&gt;&lt;/span&gt;
&lt;a href="#on-linux-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Linux hosts have no immutable flag that a user can set, so devvm makes what it locks read-only where the VM sees it, in the VM&amp;rsquo;s QEMU process, which serves the project folder to the guest over 9p. Lima starts QEMU through devvm&amp;rsquo;s wrapper (&lt;code&gt;devvm _qemu exec&lt;/code&gt;), and a start of a VM that&amp;rsquo;s on gives the wrapper what to pin in a file of its own, &lt;code&gt;run/git-pins.json&lt;/code&gt; in the VM&amp;rsquo;s folder, written private, which &lt;code&gt;DEVVM_QEMU_PINS&lt;/code&gt; names, because a VM with many nested repos has more pins than one environment variable holds. The wrapper reads the file through no symlink, and it pins, for the folder&amp;rsquo;s own repo and each nested repo the VM&amp;rsquo;s state records protecting, &lt;code&gt;.git&lt;/code&gt; and each git folder it locks besides, which stay writable, and every path of &lt;a href="#whats-locked"&gt;what&amp;rsquo;s locked&lt;/a&gt; that&amp;rsquo;s there, which become read-only. They&amp;rsquo;re the paths the check before the start found and checked, each a real path in the project folder with no symlink, and the check made a missing hooks folder and &lt;code&gt;config.worktree&lt;/code&gt; first, so each has a place to pin. devvm then starts &lt;code&gt;devvm _qemu pinned&lt;/code&gt; in a user and mount namespace of its own, as you, with only &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt;, and only in that namespace. It makes the namespace&amp;rsquo;s mounts private, so nothing it mounts reaches this machine&amp;rsquo;s, and pins each path in order, a folder before what&amp;rsquo;s under it. It opens each path once, by the kernel, below the project folder and through no symlink (&lt;code&gt;openat2&lt;/code&gt; with &lt;code&gt;RESOLVE_BENEATH&lt;/code&gt; and &lt;code&gt;RESOLVE_NO_SYMLINKS&lt;/code&gt;), refuses anything but a file or a folder, and refuses a file with another name, or a folder holding a regular file with one, because a bind covers one name and macOS&amp;rsquo;s flag covers the file itself (&lt;code&gt;git_pin_linked&lt;/code&gt;, which the check before the start names first). Then it binds what it opened over itself with &lt;code&gt;open_tree&lt;/code&gt;, &lt;code&gt;mount_setattr&lt;/code&gt; and &lt;code&gt;move_mount&lt;/code&gt;, which act on that file descriptor and never on a path again, because &lt;code&gt;mount(2)&lt;/code&gt; would follow a symlink that the VM planted. A path it can&amp;rsquo;t pin, or folders it can&amp;rsquo;t watch, stop the start (&lt;code&gt;qemu_pins_failed&lt;/code&gt;), so the VM never runs unlocked. Then it starts &lt;code&gt;devvm _qemu drop&lt;/code&gt; as its child, which clears every capability it has, ambient, permitted, effective and inheritable, sets no-new-privileges and replaces itself with QEMU, which runs as you with no capability at all. Its bounding set stays whole, which only &lt;code&gt;CAP_SETPCAP&lt;/code&gt; could change, and gives nothing with no new privileges. QEMU is killed if &lt;code&gt;devvm _qemu pinned&lt;/code&gt; ends (&lt;code&gt;PR_SET_PDEATHSIG&lt;/code&gt;), which runs as long as QEMU does, keeping the pins, so QEMU never outlives what keeps them. &lt;code&gt;devvm _qemu exec&lt;/code&gt; waits for both and passes them the signals Lima sends, and if it&amp;rsquo;s killed, QEMU is killed with it, an unclean stop for the guest, as if its power went.&lt;/p&gt;
&lt;p&gt;The guest reaches the project folder only through QEMU, so a write to a pinned path gets &lt;code&gt;EROFS&lt;/code&gt;, and a rename or a removal of one, &lt;code&gt;.git&lt;/code&gt; itself included, gets &lt;code&gt;EBUSY&lt;/code&gt;, because it&amp;rsquo;s a mount point. A mount can&amp;rsquo;t be undone from the guest, and QEMU, which has no capability, can&amp;rsquo;t undo it either. A bind mount over a folder is a file system of its own to the guest, so a rename between the working tree and &lt;code&gt;.git&lt;/code&gt; gets &lt;code&gt;EXDEV&lt;/code&gt;. The namespace ends with QEMU, so nothing persists once the VM stops, and nothing changes on this machine&amp;rsquo;s side, where git works as usual.&lt;/p&gt;
&lt;p&gt;A git command on this machine that writes &lt;code&gt;.git/config&lt;/code&gt; writes a new file and renames it over the old one, and the new file isn&amp;rsquo;t pinned in the namespace. &lt;code&gt;devvm _qemu pinned&lt;/code&gt; watches each pinned path&amp;rsquo;s folder with inotify, a few folders for each repo, so the 100 nested repos devvm protects at most stay far below the kernel&amp;rsquo;s limit of watches, and it pins again whatever lost its pin as soon as one changes, and every two seconds besides. A pin can race the rename, because the kernel takes the old file&amp;rsquo;s mount away before the new file has its name, so the pin may open the old file and find it gone by the time it binds (&lt;code&gt;move_mount&lt;/code&gt;&amp;rsquo;s &lt;code&gt;ENOENT&lt;/code&gt;). &lt;code&gt;devvm _qemu pinned&lt;/code&gt; then opens the path again and pins what the rename left, up to 50 times, so on a busy host it never mistakes a rename for a lost pin. Until then the guest can write the new file, rename it away and put its own in its place, which then gets the pin, open it for writing, a handle the pin doesn&amp;rsquo;t take back, or give it another name. So each pin it makes again, and each it can&amp;rsquo;t, it records in the VM&amp;rsquo;s run folder (&lt;code&gt;run/git-pins.jsonl&lt;/code&gt;), a JSON object a line, after a first line that says it keeps the pins from then on, which it writes before QEMU starts and without which QEMU doesn&amp;rsquo;t start (&lt;code&gt;qemu_pins_failed&lt;/code&gt;). The next check of the stopped VM, at &lt;code&gt;devvm stop&lt;/code&gt; or at the next launch, names them before anything else, one line for each path and kind however often it happened (&lt;code&gt;git_pin_again&lt;/code&gt;, &lt;code&gt;git_pin_linked_run&lt;/code&gt;, &lt;code&gt;git_pin_lost&lt;/code&gt;), then removes the file. An event &lt;code&gt;devvm _qemu pinned&lt;/code&gt; can&amp;rsquo;t add goes to Lima&amp;rsquo;s log, with a warning, and to the file as a mark if it still takes one. A record the check can&amp;rsquo;t trust is named (&lt;code&gt;git_pins_unrecorded&lt;/code&gt;): one it can&amp;rsquo;t read, which it keeps, a line that isn&amp;rsquo;t an event, a mark, or a file that doesn&amp;rsquo;t start with a run&amp;rsquo;s first line, as when it was removed while the VM ran and made again. The check also sums what a lock covers, as the &lt;a href="#the-watch"&gt;watch&lt;/a&gt; does, and names what changed since the VM&amp;rsquo;s last check, so a file the guest changed in that window, or through a handle it kept, is named too. macOS&amp;rsquo;s flag has no window, because a locked config can&amp;rsquo;t be replaced on the host either.&lt;/p&gt;
&lt;p&gt;Each launch of a running VM that&amp;rsquo;s on, and &lt;code&gt;devvm stop&lt;/code&gt; before it stops it, read QEMU&amp;rsquo;s mounts (&lt;code&gt;/proc/&amp;lt;pid&amp;gt;/mountinfo&lt;/code&gt;, QEMU&amp;rsquo;s pid from Lima&amp;rsquo;s &lt;code&gt;qemu.pid&lt;/code&gt;) and name what of &lt;code&gt;.git&lt;/code&gt; and of the git folders it locked QEMU lacks (&lt;code&gt;git_pins_missing&lt;/code&gt;): &lt;code&gt;.git&lt;/code&gt; and each git folder that isn&amp;rsquo;t a mount point of its own, and each read-only path that QEMU doesn&amp;rsquo;t see read-only,, such as all of them for a VM that &lt;code&gt;limactl start&lt;/code&gt; started. A VM that&amp;rsquo;s on whose &lt;code&gt;.git&lt;/code&gt; has nothing devvm can pin, such as one whose &lt;code&gt;.git&lt;/code&gt; is a symlink, is named at its start (&lt;code&gt;git_pins_none&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;devvm checks that the host can pin by doing it: it pins a file in a namespace of its own, with its own binary, and checks that writing it fails (&lt;code&gt;devvm _qemu probe&lt;/code&gt;). Lima&amp;rsquo;s &lt;code&gt;read-only-paths&lt;/code&gt; feature is native where that works and none elsewhere, and a VM that&amp;rsquo;s on needs it to start, so where the kernel stops letting devvm in, the start is refused (&lt;code&gt;backend_lacks&lt;/code&gt;) and never goes on unlocked. Where the probe fails, new VMs get &lt;code&gt;off&lt;/code&gt;, devvm watches &lt;code&gt;.git&lt;/code&gt; instead, and &lt;code&gt;devvm doctor&lt;/code&gt; says why: Ubuntu&amp;rsquo;s &lt;code&gt;kernel.apparmor_restrict_unprivileged_userns&lt;/code&gt;, &lt;code&gt;kernel.unprivileged_userns_clone&lt;/code&gt; or &lt;code&gt;user.max_user_namespaces&lt;/code&gt; at 0, or the probe&amp;rsquo;s own error. devvm offers no AppArmor profile for Ubuntu, because a profile for a binary in a folder you can write gives any program running as you what Ubuntu&amp;rsquo;s restriction holds back (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#ubuntu"&gt;Ubuntu&lt;/a&gt;). devvm makes the namespace itself rather than through &lt;code&gt;unshare(1)&lt;/code&gt;, so the program that asks for it is devvm.&lt;/p&gt;
&lt;p&gt;devvm doesn&amp;rsquo;t pin &lt;code&gt;.git/commondir&lt;/code&gt; against the VM making one, which would point git on this machine at another config: a file has to be there to be pinned, and devvm puts no file in &lt;code&gt;.git&lt;/code&gt; that git doesn&amp;rsquo;t, so it reports a &lt;code&gt;commondir&lt;/code&gt; at each check, as on macOS.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-watch"&gt;The watch&lt;span class="hx:absolute hx:-mt-20" id="the-watch"&gt;&lt;/span&gt;
&lt;a href="#the-watch" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Where the host can&amp;rsquo;t pin, devvm locks nothing, and every VM that mounts its folder gets &lt;code&gt;off&lt;/code&gt; as its mode. devvm watches the paths it would lock instead, and names what changed after the fact (&lt;code&gt;git_changed&lt;/code&gt;), which &lt;a href="https://next.devvm.dev/docs/safety/git-protection/#when-devvm-names-a-change"&gt;Linux hosts&lt;/a&gt; tells the user how to check.&lt;/p&gt;
&lt;p&gt;devvm hashes the same paths that &lt;a href="#whats-locked"&gt;what&amp;rsquo;s locked&lt;/a&gt; lists, found in the same way, and &lt;code&gt;.git/commondir&lt;/code&gt;, there or not, the files that &lt;code&gt;include.path&lt;/code&gt; and &lt;code&gt;includeIf.*.path&lt;/code&gt; lead to in the project folder, and the folder that &lt;code&gt;core.hooksPath&lt;/code&gt; names in it. For a hooks folder, it hashes each entry below it, except git&amp;rsquo;s &lt;code&gt;.sample&lt;/code&gt; files, which git never runs, starting with the entries at its top that have a hook&amp;rsquo;s name (githooks(5)), which git runs, and then the rest. It hashes a regular file&amp;rsquo;s contents with SHA-256, opened with &lt;code&gt;O_NOFOLLOW&lt;/code&gt; and &lt;code&gt;O_NONBLOCK&lt;/code&gt; and checked to be a regular file once it&amp;rsquo;s open, as devvm reads every file a VM can write. It records a symlink by where it points, and a path under a symlink, such as &lt;code&gt;.git/config&lt;/code&gt; when &lt;code&gt;.git&lt;/code&gt; is a symlink, by that fact. When the link resolves to a file or folder inside the project folder, it adds that file&amp;rsquo;s hash, or a hash of that folder&amp;rsquo;s hashes, and it never follows a link out of the project folder. Anything else, such as a FIFO, is recorded by its type. The work is bounded: past 1,000 entries, a hooks folder is recorded by that count, its inode and its change time, a file larger than 16 MiB by its size, inode and change time, and a watch keeps at most 2,000 hashes of the folder&amp;rsquo;s own repo and 200 of each nested repo, so a folder with many nested repos never overflows it. The VM can&amp;rsquo;t set a change time back over 9p, so a change that keeps a large file&amp;rsquo;s size is still named. Each check names, in its own warning (&lt;code&gt;git_watch_blind&lt;/code&gt;), every path that is a symlink or under one, past a bound, or past the 2,000, because the watch can&amp;rsquo;t see every change there.&lt;/p&gt;
&lt;p&gt;The same checks first run what a lock&amp;rsquo;s check reports, without locking (&lt;code&gt;protect&lt;/code&gt; with &lt;code&gt;watching&lt;/code&gt;): a &lt;code&gt;.git&lt;/code&gt; replaced since the last check (&lt;code&gt;git_replaced&lt;/code&gt;), after which the next check compares with the new one, a &lt;code&gt;commondir&lt;/code&gt; (&lt;code&gt;git_commondir&lt;/code&gt;), linked worktrees whose &lt;code&gt;commondir&lt;/code&gt; leads elsewhere, a repo or submodule git folder that appeared, a submodule&amp;rsquo;s folder that isn&amp;rsquo;t a git folder (&lt;code&gt;git_gitdir_not_git&lt;/code&gt;), which the watch doesn&amp;rsquo;t hash as one and where devvm creates nothing, and includes, hook links and &lt;code&gt;core.hooksPath&lt;/code&gt; into the project folder. They don&amp;rsquo;t report hooks in folders that aren&amp;rsquo;t locked, because nothing is, and the watch names their changes. &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s identity and the git folders and delegations found are recorded in the &lt;code&gt;git&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;made&lt;/code&gt;, as a lock&amp;rsquo;s check records them. A VM whose &lt;code&gt;made&lt;/code&gt; isn&amp;rsquo;t set yet reports as a new VM does.&lt;/p&gt;
&lt;p&gt;The watch reads &lt;code&gt;.git&lt;/code&gt; only when the VM is stopped, so it misses a change the VM made and undid before it stopped. It&amp;rsquo;s a report, not a security boundary.&lt;/p&gt;
&lt;p&gt;The hashes go in the VM&amp;rsquo;s state, in the &lt;code&gt;git&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;watched&lt;/code&gt;, by each path relative to the project folder, with &lt;code&gt;scanned&lt;/code&gt; set once a check has recorded them. devvm records them when it creates the VM, and checks them again on each launch that finds the VM stopped and on &lt;code&gt;devvm stop&lt;/code&gt;, the same places that check the locks on macOS. Each check names every path whose hash changed, appeared or went since the last one, in one warning, at most ten of them and then how many more (&lt;code&gt;git_changed_more&lt;/code&gt;), and then records the new hashes. A launch of a running VM checks nothing. A VM whose state has no &lt;code&gt;watched&lt;/code&gt; yet, such as one an older devvm made, or one that &lt;code&gt;devvm adopt&lt;/code&gt; gave this folder, records its first hashes without naming anything.&lt;/p&gt;
&lt;p&gt;Each launch also warns that the VM can change &lt;code&gt;.git&lt;/code&gt; (&lt;code&gt;git_unprotected&lt;/code&gt;), unless the folder has no &lt;code&gt;.git&lt;/code&gt; or the VM is a &lt;code&gt;--clone&lt;/code&gt; VM. The warning stops once the user has chosen the mode, which devvm records as the &lt;code&gt;git&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;chosen&lt;/code&gt;: &lt;code&gt;devvm git-protect off&lt;/code&gt; sets it, and so does &lt;code&gt;--no-git-protect&lt;/code&gt; when devvm creates the VM.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-a-lock-cant-stop"&gt;What a lock can&amp;rsquo;t stop&lt;span class="hx:absolute hx:-mt-20" id="what-a-lock-cant-stop"&gt;&lt;/span&gt;
&lt;a href="#what-a-lock-cant-stop" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The VM can rename &lt;code&gt;.git&lt;/code&gt; and put a new one in its place, add &lt;code&gt;.git/commondir&lt;/code&gt; to point git at another config, or do the same with a linked worktree&amp;rsquo;s folder in &lt;code&gt;.git/worktrees&lt;/code&gt;. When devvm creates the VM, and &lt;a href="#on-each-launch"&gt;on each launch&lt;/a&gt;, it reports a &lt;code&gt;commondir&lt;/code&gt; that&amp;rsquo;s there, linked worktrees whose &lt;code&gt;commondir&lt;/code&gt; leads somewhere else, and paths it couldn&amp;rsquo;t lock because they&amp;rsquo;re symlinks. devvm reads git&amp;rsquo;s own small files, a &lt;code&gt;.git&lt;/code&gt; file, a &lt;code&gt;commondir&lt;/code&gt; and a linked worktree&amp;rsquo;s &lt;code&gt;gitdir&lt;/code&gt;, through a symbolic link as git does, but only when each is a regular file of at most 16 MiB, opened without blocking, so a FIFO the VM leaves there can&amp;rsquo;t hang devvm. devvm doesn&amp;rsquo;t repair anything, so check what it names before you run git in the folder. When you don&amp;rsquo;t trust what runs in the VM, use &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt;, which mounts no &lt;code&gt;.git&lt;/code&gt; at all.&lt;/p&gt;
&lt;p&gt;The VM writes &lt;code&gt;.git/index&lt;/code&gt;, because it has to in order to commit, so it can also add a submodule with its own config, which &lt;code&gt;git status&lt;/code&gt; on the host reads. A submodule&amp;rsquo;s &lt;code&gt;core.fsmonitor&lt;/code&gt; therefore also runs on the host. devvm names a new submodule at the next check that finds the VM stopped, but git on the host reads it before that. No setting in the locked config keeps git on the host out of it. The VM writes &lt;code&gt;.gitmodules&lt;/code&gt;, whose &lt;code&gt;ignore&lt;/code&gt; line for a submodule beats &lt;code&gt;diff.ignoreSubmodules&lt;/code&gt;, and git falls back to the index&amp;rsquo;s and &lt;code&gt;HEAD&lt;/code&gt;&amp;rsquo;s copies of the file when the working tree has none. &lt;code&gt;git add -A&lt;/code&gt;, &lt;code&gt;-u&lt;/code&gt; and &lt;code&gt;.&lt;/code&gt; enter a submodule whatever any setting says, and &lt;code&gt;git diff-index&lt;/code&gt;, &lt;code&gt;git diff-files&lt;/code&gt; and &lt;code&gt;git describe --dirty&lt;/code&gt; enter one that &lt;code&gt;.gitmodules&lt;/code&gt; doesn&amp;rsquo;t name. A setting for a submodule&amp;rsquo;s name in &lt;code&gt;.git/config&lt;/code&gt; holds only for the name the VM chooses in &lt;code&gt;.gitmodules&lt;/code&gt;. Only &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; keeps the VM&amp;rsquo;s code away from git on the host.&lt;/p&gt;
&lt;p&gt;devvm&amp;rsquo;s own git commands on the host run no program that a repo&amp;rsquo;s config or &lt;code&gt;.git&lt;/code&gt; names, a submodule&amp;rsquo;s included, whatever the VM wrote there. devvm runs each one with these settings, given as &lt;code&gt;GIT_CONFIG_COUNT&lt;/code&gt; pairs, which git takes over any config file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;core.fsmonitor=false&lt;/code&gt;, &lt;code&gt;core.hooksPath=/dev/null&lt;/code&gt; and &lt;code&gt;core.alternateRefsCommand=true&lt;/code&gt;, so git runs no fsmonitor, no hook from a hooks folder and no command for an alternate object store&amp;rsquo;s refs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hook.EVENT.enabled=false&lt;/code&gt; for every event githooks(5) lists, and &lt;code&gt;hook.NAME.enabled=false&lt;/code&gt; for each hook the repo&amp;rsquo;s config names, so git 2.54 and newer run no hook that a config defines.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;filter.NAME.clean&lt;/code&gt;, &lt;code&gt;smudge&lt;/code&gt; and &lt;code&gt;process&lt;/code&gt; emptied, and &lt;code&gt;filter.NAME.required=false&lt;/code&gt;, for each filter driver the repo&amp;rsquo;s config names, so git hashes files without running a filter and doesn&amp;rsquo;t fail on a required one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;protocol.allow=never&lt;/code&gt; and &lt;code&gt;protocol.ssh.allow=always&lt;/code&gt;, so git reaches nothing but ssh, not a path, &lt;code&gt;file://&lt;/code&gt;, &lt;code&gt;ext::&lt;/code&gt;, &lt;code&gt;git://&lt;/code&gt; or &lt;code&gt;http&lt;/code&gt;. A repo&amp;rsquo;s config could still allow one protocol by its own key, such as &lt;code&gt;protocol.ext.allow=always&lt;/code&gt;, which git takes over &lt;code&gt;protocol.allow&lt;/code&gt;, so devvm also sets &lt;code&gt;GIT_ALLOW_PROTOCOL=ssh&lt;/code&gt;, which git takes over every &lt;code&gt;protocol&lt;/code&gt; setting.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;maintenance.auto=false&lt;/code&gt; and &lt;code&gt;gc.auto=0&lt;/code&gt;, so a fetch starts no maintenance or gc.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;log.showSignature=false&lt;/code&gt;, and &lt;code&gt;gpg.program&lt;/code&gt;, &lt;code&gt;gpg.ssh.program&lt;/code&gt; and &lt;code&gt;gpg.x509.program&lt;/code&gt; all &lt;code&gt;false&lt;/code&gt;, so no log or reflog command runs the signing program a repo&amp;rsquo;s config names to check a signed commit.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;advice.graftFileDeprecated=false&lt;/code&gt;, so git doesn&amp;rsquo;t warn about the grafts file that the next paragraph sets.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Its ssh is &lt;code&gt;false&lt;/code&gt;, which reaches nothing, in place of a repo&amp;rsquo;s &lt;code&gt;core.sshCommand&lt;/code&gt; (&lt;code&gt;GIT_SSH_COMMAND=false&lt;/code&gt;, with &lt;code&gt;GIT_SSH_VARIANT=ssh&lt;/code&gt; over a repo&amp;rsquo;s &lt;code&gt;ssh.variant&lt;/code&gt;), unless the command is a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s fetch, and it fetches nothing lazily (&lt;code&gt;GIT_NO_LAZY_FETCH=1&lt;/code&gt;), so a repo that says it&amp;rsquo;s a partial clone can&amp;rsquo;t make &lt;code&gt;git rev-list&lt;/code&gt; or &lt;code&gt;git status&lt;/code&gt; connect anywhere for an object it lacks. It sees a repo&amp;rsquo;s real objects and history, not what its replace refs (&lt;code&gt;GIT_NO_REPLACE_OBJECTS=1&lt;/code&gt;) or a grafts file (&lt;code&gt;GIT_GRAFT_FILE=/dev/null&lt;/code&gt;) would show, so what it walks, packs or looks up is what the repo holds.&lt;/p&gt;
&lt;p&gt;It runs without any &lt;code&gt;GIT_*&lt;/code&gt; variable of devvm&amp;rsquo;s own environment, such as &lt;code&gt;GIT_DIR&lt;/code&gt;, &lt;code&gt;GIT_WORK_TREE&lt;/code&gt; or &lt;code&gt;GIT_CONFIG_GLOBAL&lt;/code&gt;, so a hook or a rebase you run devvm from can&amp;rsquo;t point it at another repo or config, and it reads your global config from its usual place. It keeps only the absolute folders of &lt;code&gt;PATH&lt;/code&gt;, because git looks programs up, ssh among them, from the repo&amp;rsquo;s folder, and it runs with &lt;code&gt;GIT_TERMINAL_PROMPT=0&lt;/code&gt;. Its &lt;code&gt;git status&lt;/code&gt; adds &lt;code&gt;--no-optional-locks&lt;/code&gt;, so it writes no index, and &lt;code&gt;--ignore-submodules=all&lt;/code&gt;, so it never enters a submodule, whose own config could name filters of its own.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s fetch adds &lt;code&gt;--no-recurse-submodules&lt;/code&gt; and an empty &lt;code&gt;--refmap=&lt;/code&gt;, so it updates only the branches its own refspecs name, never those of a remote that the repo&amp;rsquo;s config names after the clone&amp;rsquo;s address. It runs git with devvm&amp;rsquo;s own &lt;code&gt;GIT_SSH_COMMAND&lt;/code&gt;, which ignores the host, port and options git passes to ssh. It always connects to the VM&amp;rsquo;s own address and port, the host&amp;rsquo;s loopback port that the VM&amp;rsquo;s backend gives, as the VM&amp;rsquo;s user with the VM&amp;rsquo;s own key, and it reads no ssh config (&lt;code&gt;-F none&lt;/code&gt;). It checks the host keys devvm pinned for the VM&amp;rsquo;s current start, with the VM&amp;rsquo;s own known hosts file and no global one, &lt;code&gt;-o HostKeyAlias=&lt;/code&gt; the VM&amp;rsquo;s name and &lt;code&gt;-o StrictHostKeyChecking=yes&lt;/code&gt;, and it runs with &lt;code&gt;-o BatchMode=yes&lt;/code&gt;, &lt;code&gt;-o ForwardAgent=no&lt;/code&gt; and &lt;code&gt;-o ClearAllForwardings=yes&lt;/code&gt;. In the VM it runs only &lt;code&gt;git-receive-pack&lt;/code&gt; or &lt;code&gt;git-upload-pack&lt;/code&gt;, whichever git asks for, on the clone&amp;rsquo;s path, and it refuses any other command. So no &lt;code&gt;url.*.insteadOf&lt;/code&gt; or remote URL in the repo&amp;rsquo;s config can send the fetch to another host or to another path, and it forwards neither your agent nor any port. devvm&amp;rsquo;s own copy into the VM uses no git transport at all (&lt;a href="#the-copy-into-a-clone-vm"&gt;the copy into a clone VM&lt;/a&gt;). A repo&amp;rsquo;s &lt;code&gt;core.sshCommand&lt;/code&gt; doesn&amp;rsquo;t apply, because devvm sets &lt;code&gt;GIT_SSH_COMMAND&lt;/code&gt;, and its &lt;code&gt;diff.external&lt;/code&gt;, textconv drivers and pager never run, because none of devvm&amp;rsquo;s commands shows a diff or writes to a terminal.&lt;/p&gt;
&lt;p&gt;Before a &lt;code&gt;--clone&lt;/code&gt; VM is made, and again before its copy, devvm checks that what git reads in the folder is the repo&amp;rsquo;s own, so the copy can&amp;rsquo;t take another repo into the VM. The folder&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; is a folder with no &lt;code&gt;commondir&lt;/code&gt;, or it&amp;rsquo;s the &lt;code&gt;.git&lt;/code&gt; file of a linked worktree whose link git made both ways. That &lt;code&gt;.git&lt;/code&gt; file names &lt;code&gt;&amp;lt;repo&amp;gt;/.git/worktrees/&amp;lt;name&amp;gt;&lt;/code&gt;, that entry&amp;rsquo;s &lt;code&gt;gitdir&lt;/code&gt; file names the folder&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; back, and its &lt;code&gt;commondir&lt;/code&gt; leads to that &lt;code&gt;&amp;lt;repo&amp;gt;/.git&lt;/code&gt;, which has no &lt;code&gt;commondir&lt;/code&gt; of its own. Or it&amp;rsquo;s the &lt;code&gt;.git&lt;/code&gt; file of a submodule, whose git dir is below its parent repo&amp;rsquo;s: the parent is the nearest folder above with a &lt;code&gt;.git&lt;/code&gt;, itself its own repo by these same checks, and the &lt;code&gt;.git&lt;/code&gt; file names a folder &lt;code&gt;modules/&amp;lt;name&amp;gt;&lt;/code&gt; below the parent&amp;rsquo;s git dir, a nested submodule&amp;rsquo;s below its parent submodule&amp;rsquo;s, where it resolves, so no symbolic link leads it out of that git dir, with no &lt;code&gt;commondir&lt;/code&gt;, and whose config&amp;rsquo;s one &lt;code&gt;core.worktree&lt;/code&gt;, in a file that includes no other, leads back to the folder. Neither the git dir nor the common dir has &lt;code&gt;objects/info/alternates&lt;/code&gt;, or a &lt;code&gt;packed-refs&lt;/code&gt; or &lt;code&gt;reftable&lt;/code&gt; that&amp;rsquo;s a symlink, or anything in &lt;code&gt;objects&lt;/code&gt; or &lt;code&gt;refs&lt;/code&gt; that&amp;rsquo;s a symlink, such as a pack folder or a loose object&amp;rsquo;s folder that leads to another repo&amp;rsquo;s objects. Then &lt;code&gt;git rev-parse --absolute-git-dir --git-common-dir&lt;/code&gt; must name the same two folders. The common dir has no &lt;code&gt;info/grafts&lt;/code&gt;, because the copy carries each commit with its own parents. A partial clone&amp;rsquo;s copy carries every object the repo has that its tips reach, and leaves the rest to its promisor remote (&lt;a href="#the-copy-into-a-clone-vm"&gt;below&lt;/a&gt;). A worktree&amp;rsquo;s copy sends its branch, that branch&amp;rsquo;s upstream when the upstream is one ref, the repo&amp;rsquo;s default branch, the remote-tracking branches and the tags, so the repo&amp;rsquo;s other local branches stay on this machine. A &lt;code&gt;branch.&amp;lt;name&amp;gt;.merge&lt;/code&gt; that&amp;rsquo;s a pattern, such as &lt;code&gt;refs/heads/*&lt;/code&gt;, would make the upstream every branch, so devvm then copies no upstream.&lt;/p&gt;
&lt;p&gt;devvm finds the hook and filter names to turn off with one &lt;code&gt;git config&lt;/code&gt; before each command, so a VM that keeps swapping the repo&amp;rsquo;s config could show that &lt;code&gt;git config&lt;/code&gt; one config and the command another. Every hook event is turned off by its name as well, which covers config hooks on git that has the event setting, so the gap is a filter that the swap hides, which &lt;code&gt;git status&lt;/code&gt; could then run on a file whose stat changed. It needs a VM that writes the repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt;, so on macOS, where &lt;code&gt;.git/config&lt;/code&gt; is locked, it needs a repo devvm doesn&amp;rsquo;t lock, such as a nested repo past the walk&amp;rsquo;s bounds (&lt;a href="#nested-repos"&gt;nested repos&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Two things a repo&amp;rsquo;s config can still do, and neither runs code. An &lt;code&gt;include.path&lt;/code&gt; can make devvm&amp;rsquo;s &lt;code&gt;git config --get user.name&lt;/code&gt; read your name and email from another file in git&amp;rsquo;s config format, which then go into the VM as its git identity. A config file or included file that is a FIFO makes git, and so devvm, wait until you press Ctrl+C.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-copy-into-a-clone-vm"&gt;The copy into a clone VM&lt;span class="hx:absolute hx:-mt-20" id="the-copy-into-a-clone-vm"&gt;&lt;/span&gt;
&lt;a href="#the-copy-into-a-clone-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm copies a repo into a &lt;code&gt;--clone&lt;/code&gt; VM without &lt;code&gt;git push&lt;/code&gt;, because &lt;code&gt;git receive-pack&lt;/code&gt; in the VM refuses repos that users have: a shallow clone&amp;rsquo;s push fails with &lt;code&gt;shallow update not allowed&lt;/code&gt;, and a SHA-256 repo&amp;rsquo;s push into a SHA-1 repo fails with &lt;code&gt;the receiving end does not support this repository's hash algorithm&lt;/code&gt;. The copy is a snapshot instead, made by devvm&amp;rsquo;s own git on this machine and applied by plain git in the VM, through the backend&amp;rsquo;s command channel, which also carries the VM&amp;rsquo;s agent. The structure test keeps git push out of devvm&amp;rsquo;s code, so the copy can&amp;rsquo;t drift back to a second transport (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;where the code is&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The copy takes three commands in the VM:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;One script makes every repo&lt;/strong&gt; the clone has. For each repo, it gets the repo&amp;rsquo;s path and the host repo&amp;rsquo;s object format. A repo that&amp;rsquo;s copied already is printed as landed and left alone. That&amp;rsquo;s a repo whose &lt;code&gt;.git/devvm-seeded&lt;/code&gt; says &lt;code&gt;done&lt;/code&gt;, or one with no such file whose &lt;code&gt;HEAD&lt;/code&gt; resolves, which an older devvm&amp;rsquo;s push made. A repo that isn&amp;rsquo;t there yet is made with &lt;code&gt;git init&lt;/code&gt;, with &lt;code&gt;--object-format=sha256&lt;/code&gt; only for a SHA-256 repo, because git before 2.29 doesn&amp;rsquo;t know the option. One that&amp;rsquo;s there, from a copy that didn&amp;rsquo;t finish, isn&amp;rsquo;t made again, because git 2.54&amp;rsquo;s &lt;code&gt;git init&lt;/code&gt; in a reftable repo drops its &lt;code&gt;extensions.refStorage&lt;/code&gt; setting and breaks the repo. It takes &lt;code&gt;receive.denyCurrentBranch=updateInstead&lt;/code&gt; and &lt;code&gt;receive.shallowUpdate=true&lt;/code&gt;, for your own &lt;code&gt;git push devvm BRANCH&lt;/code&gt; later, and &lt;code&gt;.git/devvm-seeded&lt;/code&gt; says &lt;code&gt;pending&lt;/code&gt;. A &lt;code&gt;git init&lt;/code&gt; that fails for a SHA-256 repo prints the VM&amp;rsquo;s &lt;code&gt;git --version&lt;/code&gt;, and devvm stops before it sends anything (&lt;code&gt;clone_vm_git_old&lt;/code&gt;), showing the version only when it reads as git prints one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A tar of small files&lt;/strong&gt; goes into &lt;code&gt;.git/devvm-seed&lt;/code&gt; in the VM&amp;rsquo;s repo, never &lt;code&gt;/tmp&lt;/code&gt;, which is in memory on some systems. It holds the refs to set, each an object and its name, the symbolic refs, such as &lt;code&gt;refs/remotes/origin/HEAD&lt;/code&gt;, each with the ref it points to, what to check out, a branch&amp;rsquo;s name or, for a detached HEAD, its commit, and the host repo&amp;rsquo;s &lt;code&gt;shallow&lt;/code&gt; file, read from the repo&amp;rsquo;s common dir as a regular file only, never through a link, so a link there can&amp;rsquo;t send another file. It also holds the working tree (&lt;a href="#the-working-tree-in-the-copy"&gt;the working tree&lt;/a&gt;): the repo&amp;rsquo;s index, normalised, the paths to check out from it, and the working copies of the tracked files that differ from it. And it holds the repo&amp;rsquo;s state (&lt;a href="#the-state-in-the-copy"&gt;the state in the copy&lt;/a&gt;): an operation in progress, the stash, and the &lt;code&gt;info&lt;/code&gt; files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The pack&lt;/strong&gt; of the objects those refs and a detached HEAD reach, with the index&amp;rsquo;s blobs and the commits the state names, from &lt;code&gt;git pack-objects --revs --stdout&lt;/code&gt;, goes straight into &lt;code&gt;git index-pack --stdin&lt;/code&gt; in the VM, which checks every object it writes, so devvm doesn&amp;rsquo;t run &lt;code&gt;git fsck&lt;/code&gt; as well. &lt;code&gt;pack-objects --revs&lt;/code&gt; walks with the repo&amp;rsquo;s commit-graph and bitmaps when it has them, so a VM that once wrote this repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt;, through a mount before &lt;code&gt;.git&lt;/code&gt; protection, could have forged one to put objects in the pack that the refs don&amp;rsquo;t reach, which are this repo&amp;rsquo;s own objects, never another repo&amp;rsquo;s or a file&amp;rsquo;s. Neither end holds the whole pack in memory, and when the command in the VM ends early, devvm closes the pipe so &lt;code&gt;pack-objects&lt;/code&gt; stops. The same command then copies the &lt;code&gt;shallow&lt;/code&gt; file and sets the refs with &lt;code&gt;git update-ref --stdin&lt;/code&gt;, and each symbolic ref with &lt;code&gt;git symbolic-ref&lt;/code&gt;, unless a ref of that name is there already. It points &lt;code&gt;HEAD&lt;/code&gt; at the branch, with &lt;code&gt;git symbolic-ref&lt;/code&gt;, or detaches it at the commit, with &lt;code&gt;git update-ref --no-deref&lt;/code&gt;, and puts the host&amp;rsquo;s index in place, with the working copies sent where the VM has no file. It does that only when &lt;code&gt;HEAD&lt;/code&gt; was unborn, is on the branch the copy just set, or is detached at the commit or at one an earlier try set, so a VM that checked out a branch of its own keeps it, and one that moved its detached &lt;code&gt;HEAD&lt;/code&gt; keeps it too. A &lt;code&gt;HEAD&lt;/code&gt; left where the VM put it, away from this machine&amp;rsquo;s, is named (&lt;code&gt;clone_kept_head&lt;/code&gt;), which covers a repo here switched between a branch and a detached &lt;code&gt;HEAD&lt;/code&gt; since the copy that didn&amp;rsquo;t finish. It checks out the listed paths with &lt;code&gt;git checkout-index -u -z --stdin&lt;/code&gt;, or every path with &lt;code&gt;-a&lt;/code&gt; when it kept the VM&amp;rsquo;s &lt;code&gt;HEAD&lt;/code&gt;, without &lt;code&gt;-f&lt;/code&gt;, so it writes only the files that aren&amp;rsquo;t there. It removes &lt;code&gt;.git/devvm-seed&lt;/code&gt; and writes &lt;code&gt;done&lt;/code&gt; to &lt;code&gt;.git/devvm-seeded&lt;/code&gt; last.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The refs are those of &lt;code&gt;refs/heads&lt;/code&gt;, &lt;code&gt;refs/tags&lt;/code&gt;, &lt;code&gt;refs/notes&lt;/code&gt;, &lt;code&gt;refs/replace&lt;/code&gt; and &lt;code&gt;refs/remotes&lt;/code&gt;, read in one &lt;code&gt;git for-each-ref&lt;/code&gt;, less the remote-tracking branches of each remote any of whose URLs, as git resolves them (&lt;code&gt;git remote get-url --all&lt;/code&gt;), reaches a devvm VM by its full name or its shorter one, in any URL form or case, and less a branch that&amp;rsquo;s no commit, which git won&amp;rsquo;t set. A linked worktree&amp;rsquo;s copy takes the smaller set above, and its upstream and default branch pass the same rules, so neither can be another VM&amp;rsquo;s remote-tracking branch or a ref outside the namespaces, such as &lt;code&gt;refs/stash&lt;/code&gt; through &lt;code&gt;branch.&amp;lt;name&amp;gt;.remote=.&lt;/code&gt;. A symbolic ref goes only when the ref it points to goes. Nothing outside those namespaces goes, such as &lt;code&gt;refs/original&lt;/code&gt;, &lt;code&gt;refs/prefetch&lt;/code&gt; or &lt;code&gt;refs/stash&lt;/code&gt;. The pack carries what a push of the same refs would: the commits, trees, blobs and tags they reach, and nothing unreachable. devvm&amp;rsquo;s git runs &lt;code&gt;pack-objects&lt;/code&gt; with replace refs and grafts off, so each commit goes with its own parents, and a repo with a grafts file is refused before the VM is made (&lt;code&gt;clone_grafts&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;A partial clone, one whose config names a promisor remote (&lt;code&gt;remote.&amp;lt;name&amp;gt;.promisor&lt;/code&gt;, or an older git&amp;rsquo;s &lt;code&gt;extensions.partialClone&lt;/code&gt;), lacks objects its remote has, and &lt;code&gt;pack-objects --revs&lt;/code&gt; would want them in its walk, which fails with &lt;code&gt;GIT_NO_LAZY_FETCH=1&lt;/code&gt;, missing trees and all. Its pack is made from a list instead: &lt;code&gt;git rev-list --objects --missing=allow-promisor --stdin&lt;/code&gt; of the tips the repo has, which &lt;code&gt;git cat-file --batch-check&lt;/code&gt; picks, as a sparse checkout&amp;rsquo;s index can name blobs the repo never fetched, piped into &lt;code&gt;git pack-objects --stdout&lt;/code&gt; through a pipe of their own, whose ends devvm closes once both have started, so when pack-objects ends early, rev-list&amp;rsquo;s next write fails and it ends too. devvm holds back the pack&amp;rsquo;s last 64 bytes, more than its trailing hash, until the pack ends, then waits for rev-list, and when rev-list failed, it ends the pack there, so the VM&amp;rsquo;s &lt;code&gt;git index-pack&lt;/code&gt; gets a pack cut short and refuses it, and the copy fails with rev-list&amp;rsquo;s error, never with a pack that lacks objects and says nothing. The VM reads the pack with &lt;code&gt;git index-pack --promisor&lt;/code&gt;, so it&amp;rsquo;s a promisor pack, and the settings give the VM&amp;rsquo;s clone the promisor remote, with its filter, and &lt;code&gt;promisor&lt;/code&gt; as git reads it, so &lt;code&gt;yes&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt; or no value at all goes as &lt;code&gt;true&lt;/code&gt;. Its git then fetches a missing object from that remote when a command needs one. That fetch goes through the VM&amp;rsquo;s own network policy, with no credential of this machine&amp;rsquo;s, as the remote&amp;rsquo;s URL has none, so a private remote needs the VM&amp;rsquo;s own login.&lt;/p&gt;
&lt;p&gt;devvm reads each ref&amp;rsquo;s object type with &lt;code&gt;git cat-file --batch-check&lt;/code&gt; after listing the refs, because &lt;code&gt;git for-each-ref&lt;/code&gt;&amp;rsquo;s &lt;code&gt;%(objecttype)&lt;/code&gt; fails on a ref whose object the repo lacks, such as a partial clone&amp;rsquo;s tag of a blob it never fetched. Such a ref stays out of the copy, named (&lt;code&gt;clone_partial_refs_kept&lt;/code&gt;), and in a repo that isn&amp;rsquo;t partial, it fails the copy, as that repo is broken (&lt;code&gt;clone_ref_no_object&lt;/code&gt;). devvm reads the promisor remotes as git here reads them, includes followed, each &lt;code&gt;remote.&amp;lt;name&amp;gt;.promisor&lt;/code&gt; on its own, so one value git can&amp;rsquo;t read as a boolean drops only its own remote, and a remote&amp;rsquo;s last value wins. It names those whose settings don&amp;rsquo;t go, as their URL is of a kind that stays or reaches a devvm VM (&lt;code&gt;clone_partial_promisor_kept&lt;/code&gt;), and copies the repo anyway, as the VM&amp;rsquo;s clone works with what it has. For each promisor remote that goes, in name order, it compares the remote&amp;rsquo;s host and port with the VM&amp;rsquo;s tier: on the none tier it names the host with how to reach it (&lt;code&gt;clone_partial_blocked_none&lt;/code&gt;), on the allowlist tier one the allowlist doesn&amp;rsquo;t allow (&lt;code&gt;clone_partial_blocked&lt;/code&gt;), and on the internet tier one a deny rule blocks or an address that isn&amp;rsquo;t public, which that tier never reaches (&lt;code&gt;clone_partial_denied&lt;/code&gt;). A host it names on a port other than 80 or 443, such as an ssh remote&amp;rsquo;s 22, is named as the rule that allows that port alone, such as &lt;code&gt;github.com:22&lt;/code&gt;, which &lt;code&gt;devvm network allow&lt;/code&gt; takes. When devvm can&amp;rsquo;t read the VM&amp;rsquo;s policies, it judges nothing against them, and names only the none tier&amp;rsquo;s hosts and private addresses. A name that resolves to a private address isn&amp;rsquo;t reached either, which devvm can&amp;rsquo;t tell before the VM looks it up. It also names a remote on this machine, a &lt;code&gt;file://&lt;/code&gt; URL or a path, which the VM can&amp;rsquo;t reach (&lt;code&gt;clone_partial_unreachable&lt;/code&gt;). A scp-like URL&amp;rsquo;s host is read as git reads it, up to its first colon, past a bracketed one such as &lt;code&gt;[::1]&lt;/code&gt;, and a URL whose port isn&amp;rsquo;t a number names no host.&lt;/p&gt;
&lt;p&gt;devvm&amp;rsquo;s own fetch from the VM keeps &lt;code&gt;GIT_NO_LAZY_FETCH=1&lt;/code&gt;, so a VM can&amp;rsquo;t make this machine&amp;rsquo;s git fetch anything, and the VM&amp;rsquo;s &lt;code&gt;git upload-pack&lt;/code&gt; fetches no missing object to send it, as git 2.45.1 and newer turn that off. So when the VM&amp;rsquo;s work names an object its partial clone lacks, such as a blob restored from an old commit, the fetch fails, and devvm says to have git in the VM read the work&amp;rsquo;s objects first, which fetches them, then fetch again (&lt;code&gt;clone_fetch_partial&lt;/code&gt;). devvm doesn&amp;rsquo;t turn lazy fetching on in the VM&amp;rsquo;s upload-pack.&lt;/p&gt;
&lt;p&gt;A copy that fails before its end leaves &lt;code&gt;pending&lt;/code&gt;, so the next launch copies again in full. &lt;code&gt;git index-pack&lt;/code&gt; of a pack the repo has, &lt;code&gt;git symbolic-ref&lt;/code&gt; and the checkout are all safe to run again. The refs follow one rule, so a copy never moves a branch the VM moved: before it sets a ref, the script records its name and the commit in &lt;code&gt;.git/devvm-seeded-refs&lt;/code&gt;, and it then sets a ref that&amp;rsquo;s missing, at the host&amp;rsquo;s commit already, or at a commit an earlier try recorded. It leaves any other as it is and prints it, and devvm names those branches (&lt;code&gt;clone_kept_branches&lt;/code&gt;). After the checkout, &lt;code&gt;git update-index --refresh&lt;/code&gt; and &lt;code&gt;git diff-files -z&lt;/code&gt; list the files whose content isn&amp;rsquo;t the index&amp;rsquo;s. devvm leaves out the paths that the copy itself sent or deleted, adds the VM&amp;rsquo;s own files at those paths, and names what&amp;rsquo;s left as the files the VM wrote (&lt;code&gt;clone_kept_files&lt;/code&gt;). What the VM prints is untrusted, so devvm reads at most 1 MiB of it, shows at most 20 names, each cut to 200 bytes and quoted, and acts on none of it. &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; check a clone whose copy didn&amp;rsquo;t finish as any other, so the VM&amp;rsquo;s work there is offered for fetching too.&lt;/p&gt;
&lt;p&gt;An older devvm made each VM&amp;rsquo;s repo with plain &lt;code&gt;git init&lt;/code&gt;, so with SHA-1 object names. In such a VM whose copy failed, a SHA-256 repo&amp;rsquo;s empty repo has the wrong object format, which the script prints. devvm then asks whether to make that repo again (&lt;code&gt;clone_repo_format&lt;/code&gt;). The repo has no commit, but it may hold the VM&amp;rsquo;s own hooks or config, so only you can say, and no flag answers the question. Without a terminal devvm refuses, saying what to run (&lt;code&gt;clone_repo_format_kept&lt;/code&gt;). On yes, the script deletes that &lt;code&gt;.git&lt;/code&gt; only when it still has no &lt;code&gt;HEAD&lt;/code&gt; and no ref, and makes it again.&lt;/p&gt;
&lt;h3 data-hextra-search-id="submodules-in-the-copy"&gt;Submodules in the copy&lt;span class="hx:absolute hx:-mt-20" id="submodules-in-the-copy"&gt;&lt;/span&gt;
&lt;a href="#submodules-in-the-copy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Once a repo&amp;rsquo;s copy is in, and before devvm records it as copied, each of its initialised submodules gets a clone of its own in the VM, nested ones after their parent, so a copy that didn&amp;rsquo;t finish copies the rest on the next launch. devvm takes the list from this machine&amp;rsquo;s repo alone, never from the VM or &lt;code&gt;.gitmodules&lt;/code&gt;: a submodule is one whose name the repo&amp;rsquo;s own config gives a URL (&lt;code&gt;submodule.&amp;lt;name&amp;gt;.url&lt;/code&gt;, as &lt;code&gt;git submodule init&lt;/code&gt; sets it), whose git dir is &lt;code&gt;modules/&amp;lt;name&amp;gt;&lt;/code&gt; in the repo&amp;rsquo;s common dir, whose &lt;code&gt;core.worktree&lt;/code&gt; there leads to a folder below the repo where its index has a submodule (a gitlink), and which is its own repo there by &lt;a href="#the-copy-into-a-clone-vm"&gt;the checks above&lt;/a&gt;, at a path a terminal can show. An uninitialised submodule has no such git dir, so its folder stays as the parent&amp;rsquo;s copy left it, empty, and so does one initialised after the copy, or in a VM made before devvm copied submodules. One that&amp;rsquo;s initialised but fails a check stays on this machine, named (&lt;code&gt;clone_submodule_kept&lt;/code&gt;), and so does each of a linked worktree&amp;rsquo;s, whose submodules&amp;rsquo; git dirs are in the common dir, which devvm doesn&amp;rsquo;t read for them. Each submodule&amp;rsquo;s copy is a repo&amp;rsquo;s, checked again just before, as a folder of repos&amp;rsquo; repo is: still its own repo&amp;rsquo;s top, with no grafts and a &lt;code&gt;HEAD&lt;/code&gt;, and no other VM mounting it. One that fails that, or any step of its copy, such as a VM that refuses it, is named (&lt;code&gt;clone_submodule_kept&lt;/code&gt;), with its own submodules left out, and the repo&amp;rsquo;s copy goes on without it and is recorded as done, so it&amp;rsquo;s tried again only on a launch before that, when the repo&amp;rsquo;s copy didn&amp;rsquo;t finish. Its record is taken out only when nothing of it can be in the VM: it failed before this launch recorded it, with no record from an earlier launch. Otherwise its record stays, not copied, so whatever of it the VM has is still fetched from and checked by &lt;code&gt;devvm rm&lt;/code&gt;, which checks a repo that wasn&amp;rsquo;t copied when the VM has it, and &lt;code&gt;devvm clone fetch&lt;/code&gt; adds its remote. Its remote is chosen as a repo&amp;rsquo;s is, recorded with its path in the VM&amp;rsquo;s state before its copy (&lt;code&gt;submodules&lt;/code&gt;, in its repo&amp;rsquo;s entry, nested ones in theirs). The submodule is then made in the VM, in the folder the parent&amp;rsquo;s checkout left empty, as a repo with a &lt;code&gt;.git&lt;/code&gt; folder of its own, which &lt;code&gt;git submodule status&lt;/code&gt; reads as a submodule&amp;rsquo;s, and copied, so its &lt;code&gt;HEAD&lt;/code&gt; is detached at the commit the submodule has checked out here, with its refs, its changes, its state and its settings; then its remote added in its repo here, which is its git dir&amp;rsquo;s config, and the copy recorded. The parent&amp;rsquo;s settings give it &lt;code&gt;submodule.&amp;lt;name&amp;gt;.url&lt;/code&gt; and &lt;code&gt;active&lt;/code&gt; (&lt;a href="#the-settings-in-the-copy"&gt;the settings in the copy&lt;/a&gt;), so git in the VM takes it for initialised.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm clone fetch&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s and &lt;code&gt;devvm clone off&lt;/code&gt;&amp;rsquo;s check and the remotes&amp;rsquo; removal go over each submodule the state records, each named by its path in the folder, as a folder of repos&amp;rsquo; repos are, so a submodule you remove or deinitialise here later isn&amp;rsquo;t passed over: as one another VM mounts, it&amp;rsquo;s named as one devvm can&amp;rsquo;t check (&lt;code&gt;clone_submodule_unchecked&lt;/code&gt;), and &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; ask before the VM goes, while &lt;code&gt;devvm clone fetch&lt;/code&gt; names it and leaves it. &lt;code&gt;devvm clone add&lt;/code&gt; of a recorded submodule says it&amp;rsquo;s the clone&amp;rsquo;s already. An older devvm ignores the record, so its &lt;code&gt;devvm rm&lt;/code&gt; wouldn&amp;rsquo;t check a submodule, which matters only after a downgrade. A folder of repos&amp;rsquo; walk passes over a repo that&amp;rsquo;s a submodule of a repo in the folder, among that repo&amp;rsquo;s initialised submodules, which its clone has.&lt;/p&gt;
&lt;p&gt;A submodule&amp;rsquo;s own folder isn&amp;rsquo;t a repo that &lt;code&gt;--clone&lt;/code&gt; takes by itself: its &lt;code&gt;.git&lt;/code&gt; file leads into the parent&amp;rsquo;s &lt;code&gt;.git/modules&lt;/code&gt;, or for a parent that&amp;rsquo;s a linked worktree, into the main repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt;, and a VM that mounts the folder of either could swap that git dir under host git, which the check for a VM mounting the repo, looking at the folder and a worktree&amp;rsquo;s common dir, wouldn&amp;rsquo;t see. So &lt;code&gt;devvm --clone&lt;/code&gt; there, and a folder of repos&amp;rsquo; copy of one, refuses it as a &lt;code&gt;.git&lt;/code&gt; that points into another repo (&lt;code&gt;clone_git_elsewhere&lt;/code&gt;). Only as a submodule of a &lt;code&gt;--clone&lt;/code&gt; repo is it copied, and every check of it as one, before its copy, before a fetch and in the clone check, takes that shape.&lt;/p&gt;
&lt;h3 data-hextra-search-id="git-lfs-in-the-copy"&gt;Git LFS in the copy&lt;span class="hx:absolute hx:-mt-20" id="git-lfs-in-the-copy"&gt;&lt;/span&gt;
&lt;a href="#git-lfs-in-the-copy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Base&amp;rsquo;s image has &lt;code&gt;git-lfs&lt;/code&gt;, pinned like every other download, but nothing in the image sets its filter, so a VM that mounts its folder sees each LFS file as the pointer git stores. The copy sets the filter in each clone repo it makes, submodules included, with &lt;code&gt;git lfs install --local --skip-repo&lt;/code&gt;, which writes the repo&amp;rsquo;s own config and no hooks, and when that fails, devvm says the clone&amp;rsquo;s LFS files may be pointers there (&lt;code&gt;clone_lfs_setup_failed&lt;/code&gt;). No &lt;code&gt;git-lfs&lt;/code&gt; runs on this machine for the copy or for what comes back, and when the repo&amp;rsquo;s &lt;code&gt;lfs.storage&lt;/code&gt; puts its objects outside &lt;code&gt;.git&lt;/code&gt;, devvm copies none either way and says so (&lt;code&gt;clone_lfs_storage&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Every object file devvm reads or writes on this machine is opened beneath the repo&amp;rsquo;s common dir through a root that no path can leave, and before that, each folder on the way, &lt;code&gt;lfs&lt;/code&gt;, &lt;code&gt;lfs/objects&lt;/code&gt;, both two-character folders and &lt;code&gt;lfs/tmp&lt;/code&gt;, must be a folder, never a link, as such a root still follows a link that stays inside it. So a link planted in &lt;code&gt;.git/lfs&lt;/code&gt; can&amp;rsquo;t make devvm send a file from elsewhere on this machine or write the VM&amp;rsquo;s content anywhere else.&lt;/p&gt;
&lt;p&gt;On the way in, devvm reads the pointers among the index&amp;rsquo;s blobs: those of at most 1,024 bytes, &lt;code&gt;git cat-file --batch-check&lt;/code&gt; says, which, read with &lt;code&gt;git cat-file --batch&lt;/code&gt;, are a pointer as git-lfs&amp;rsquo;s spec has it, with its version line first, an &lt;code&gt;oid sha256:&lt;/code&gt; of 64 lowercase hex characters and a &lt;code&gt;size&lt;/code&gt;, each once, and a newline at its end. Both outputs are read as they come, and at most 200,000 blobs are taken as maybe pointers. Each object the repo has, at &lt;code&gt;lfs/objects/&amp;lt;oid[0:2]&amp;gt;/&amp;lt;oid[2:4]&amp;gt;/&amp;lt;oid&amp;gt;&lt;/code&gt; in its common dir, a regular file of its pointer&amp;rsquo;s size, is hashed before anything is sent, and one whose SHA-256 isn&amp;rsquo;t its oid stays on this machine, named (&lt;code&gt;clone_lfs_bad&lt;/code&gt;), while the copy goes on. The rest go in the tar as &lt;code&gt;lfs/&amp;lt;oid&amp;gt;&lt;/code&gt;, hashed again as they&amp;rsquo;re sent, so one that changed in between fails the copy, its tar cut short. The VM moves each into its repo&amp;rsquo;s &lt;code&gt;lfs/objects&lt;/code&gt;, where it has no file of that name, before the checkout. The checkout runs with &lt;code&gt;GIT_LFS_SKIP_SMUDGE=1&lt;/code&gt;, so &lt;code&gt;git-lfs&lt;/code&gt; never fetches during the copy, then &lt;code&gt;git lfs checkout&lt;/code&gt;, which reads only the objects the repo has, writes each file&amp;rsquo;s content; a file whose object isn&amp;rsquo;t there stays a pointer.&lt;/p&gt;
&lt;p&gt;On the way back, once each fetch from the VM is in, &lt;code&gt;devvm clone fetch&lt;/code&gt;&amp;rsquo;s and &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s and &lt;code&gt;devvm clone off&lt;/code&gt;&amp;rsquo;s, devvm lists the objects that what it fetched (&lt;code&gt;FETCH_HEAD&lt;/code&gt;) reaches past this repo&amp;rsquo;s own refs, with &lt;code&gt;git rev-list --objects --missing=allow-promisor&lt;/code&gt;, and reads the pointers among them as above. Its own refs are every ref but the &lt;code&gt;saved/&lt;/code&gt; branches and the remote-tracking branches of a devvm VM&amp;rsquo;s remote, so a commit that a plain &lt;code&gt;git fetch devvm&lt;/code&gt; brought earlier, without its LFS objects, still has them looked for. Once that work is merged into a branch of this repo, though, its commits are past that branch, so devvm also has the script in the VM list the files in the clone&amp;rsquo;s &lt;code&gt;lfs/objects&lt;/code&gt;, by name and size, none followed through a link, and takes those this repo lacks whose pointer the history of what it fetched names since the copy. That walk stops at what the copy set the clone&amp;rsquo;s refs to, which the VM keeps in &lt;code&gt;.git/devvm-seed-tips&lt;/code&gt;, so an object the VM fetched for the history it was given isn&amp;rsquo;t taken for its work, and a long history never has every blob read, or, for a clone an older devvm made, at this repo&amp;rsquo;s own refs, as above. When the objects this repo lacks come to more than 2 GiB in all, a total that can&amp;rsquo;t overflow, devvm asks first (&lt;code&gt;clone_lfs_large&lt;/code&gt;), and refuses without a terminal. A script in the VM then writes all of them in one stream, its connection carrying no SSH agent: for each, a line with the oid and its size and then the clone&amp;rsquo;s own &lt;code&gt;.git/lfs/objects/…/&amp;lt;oid&amp;gt;&lt;/code&gt;, a regular file that isn&amp;rsquo;t a link, or a line that says the clone lacks it or has it at another size. devvm reads exactly the pointer&amp;rsquo;s size of each into a new file in this repo&amp;rsquo;s &lt;code&gt;lfs/tmp&lt;/code&gt; and moves it into &lt;code&gt;lfs/objects&lt;/code&gt; only when its SHA-256 is the oid. One that the VM lacks, or that isn&amp;rsquo;t what its pointer names, stays out, named (&lt;code&gt;clone_lfs_kept&lt;/code&gt;), and its file is a pointer here until &lt;code&gt;git lfs pull&lt;/code&gt; fetches it. A failure is named too (&lt;code&gt;clone_lfs_failed&lt;/code&gt;), with its reason in the run log.&lt;/p&gt;
&lt;p&gt;An object that the VM&amp;rsquo;s clone has and that didn&amp;rsquo;t come back, for a reason other than its content, such as a link in &lt;code&gt;.git/lfs&lt;/code&gt; or a stream cut short, would go with the VM, so &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; keep the VM then, as for a commit they couldn&amp;rsquo;t fetch. Their check also looks for the objects that only the VM&amp;rsquo;s clone has, of commits this repo has already: it lists them as above from the clone&amp;rsquo;s refs, merged ones included, asks the script in the VM which it has, sizes only, stopping the script once it writes more than a line for each, or more than 64 MiB of the list, and names them (&lt;code&gt;clone_lfs_unfetched&lt;/code&gt;), then asks before the VM goes, which &lt;code&gt;devvm clone fetch&lt;/code&gt; answers by bringing them here.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-working-tree-in-the-copy"&gt;The working tree in the copy&lt;span class="hx:absolute hx:-mt-20" id="the-working-tree-in-the-copy"&gt;&lt;/span&gt;
&lt;a href="#the-working-tree-in-the-copy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The copy sends your uncommitted changes as git&amp;rsquo;s own index and the working copies of the files that differ from it, so &lt;code&gt;git status&lt;/code&gt; in the VM shows what it shows here. devvm reads the repo&amp;rsquo;s index, at the path &lt;code&gt;git rev-parse --git-path index&lt;/code&gt; gives, as a regular file only, never through a link, into a temporary file of its own, registered for removal before any git command runs, so it goes however the copy ends. The copy keeps the index&amp;rsquo;s modification time, so git tells a file changed in the second the index was written from one that wasn&amp;rsquo;t, as it would with the repo&amp;rsquo;s own index. devvm&amp;rsquo;s git then refreshes the copy, so a file whose stat changed but not its content isn&amp;rsquo;t sent, without entering any submodule (&lt;code&gt;--ignore-submodules&lt;/code&gt;), and rewrites it as version 3, even when it&amp;rsquo;s that already (&lt;code&gt;--force-write-index&lt;/code&gt;), with no split index, no sparse directories, no untracked cache, no fsmonitor data, no resolve-undo and a real trailing hash. The untracked cache names untracked files and the repo&amp;rsquo;s path on this machine, so none of that goes, and any git since 1.7 reads the result. Resolve-undo, which &lt;code&gt;git checkout -m&lt;/code&gt; uses to bring back a conflict you resolved, can name blobs that no ref reaches and that the pack doesn&amp;rsquo;t carry, so the VM&amp;rsquo;s repo would fail &lt;code&gt;git fsck&lt;/code&gt; with it. What&amp;rsquo;s staged is staged in the VM, conflicts, intent-to-add entries and skip-worktree bits included, and the pack carries every blob the index names, but no gitlink&amp;rsquo;s commit, which isn&amp;rsquo;t this repo&amp;rsquo;s. An index with a path that git never checks out, one with a &lt;code&gt;.git&lt;/code&gt; part in any case, as macOS and Windows also read one, or with an empty, &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;..&lt;/code&gt; part, fails the copy.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;git ls-files -s -z&lt;/code&gt; on the copy lists the paths, and &lt;code&gt;git diff-files --ignore-submodules=all --name-only -z&lt;/code&gt; on it lists those whose working copy differs. Without &lt;code&gt;--ignore-submodules&lt;/code&gt;, git diff-files runs &lt;code&gt;git status&lt;/code&gt; in each submodule and embedded repo, where that repo&amp;rsquo;s own config can name a filter that devvm&amp;rsquo;s git hasn&amp;rsquo;t turned off, so devvm runs diff-files only through the helper that adds it. Each path that differs is sorted out through a root opened at the repo, and each folder on the way to it is opened from its parent, refusing a symbolic link, so neither a link out of the repo nor one inside it, such as a tracked folder replaced by a link to an ignored folder or to &lt;code&gt;.git&lt;/code&gt;, sends another file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A regular file or a symbolic link, where the index has one of those, goes as it is, under &lt;code&gt;changed/&lt;/code&gt; in the tar, with its permissions and modification time, read without following a link. A file that&amp;rsquo;s a link now goes as the link, so &lt;code&gt;git status&lt;/code&gt; in the VM shows the same type change.&lt;/li&gt;
&lt;li&gt;A path that&amp;rsquo;s gone, or whose folder is a symbolic link here, which git takes for a deletion, goes as gone: the VM doesn&amp;rsquo;t check it out, so it&amp;rsquo;s deleted there too.&lt;/li&gt;
&lt;li&gt;Anything else, such as a tracked file that&amp;rsquo;s a folder now, goes as gone, and devvm names it (&lt;code&gt;clone_typechange_kept&lt;/code&gt;), so nothing inside that folder goes.&lt;/li&gt;
&lt;li&gt;A gitlink, a submodule&amp;rsquo;s or an embedded repo&amp;rsquo;s, is checked out as git does, as an empty folder, without its &lt;code&gt;.git&lt;/code&gt; or anything in it.&lt;/li&gt;
&lt;li&gt;A path that a &lt;code&gt;filter&lt;/code&gt; attribute names a filter for, in the working tree&amp;rsquo;s attributes or the index&amp;rsquo;s, such as git-crypt&amp;rsquo;s or Git LFS&amp;rsquo;s, is checked out from the index, as git stores it, and named as one that may differ (&lt;code&gt;clone_filtered_kept&lt;/code&gt;). devvm&amp;rsquo;s git runs no filter, so it can&amp;rsquo;t tell a real change from the filter&amp;rsquo;s own. Such a file that&amp;rsquo;s gone goes as gone.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the VM, when the copy sets &lt;code&gt;HEAD&lt;/code&gt;, it puts the index in place, notes which of the paths sent or gone it already has a file at, copies each working copy sent where the VM has no file, with &lt;code&gt;cp -P -p&lt;/code&gt;, and checks out the other paths from the index, without &lt;code&gt;-f&lt;/code&gt;, except a conflict&amp;rsquo;s, which has no entry to check out, and a path with the skip-worktree bit that the working tree doesn&amp;rsquo;t have, which a sparse checkout leaves out, in the VM as here. A skip-worktree path that the working tree has, marked by hand with &lt;code&gt;git update-index --skip-worktree&lt;/code&gt; or left by a git older than 2.37 outside a sparse checkout, is checked out from the index, never sent as it is here, because git hides its edits, which are often local settings or secrets: the VM turns the bit off for those paths (&lt;code&gt;skip.list&lt;/code&gt;), checks them out and turns it on again, and devvm names them (&lt;code&gt;clone_skip_worktree_kept&lt;/code&gt;). An assume-unchanged file&amp;rsquo;s edits are hidden from &lt;code&gt;git diff-files&lt;/code&gt; too, so it goes as the index has it. The VM&amp;rsquo;s files that the copy didn&amp;rsquo;t write over are named (&lt;code&gt;clone_kept_files&lt;/code&gt;): those at a path you changed or deleted here, and those elsewhere that differ from the index. When the copy keeps the VM&amp;rsquo;s &lt;code&gt;HEAD&lt;/code&gt;, the VM&amp;rsquo;s index stays, nothing of the working tree is applied, because your changes would apply to something else, and devvm says so (&lt;code&gt;clone_uncommitted_kept&lt;/code&gt;) instead of naming the files it would have left out.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-state-in-the-copy"&gt;The state in the copy&lt;span class="hx:absolute hx:-mt-20" id="the-state-in-the-copy"&gt;&lt;/span&gt;
&lt;a href="#the-state-in-the-copy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The copy sends what git keeps beside the refs and the index that you&amp;rsquo;d miss in the VM. Every file is read from the repo&amp;rsquo;s git dir, at the path &lt;code&gt;git rev-parse --git-path&lt;/code&gt; gives, so a linked worktree&amp;rsquo;s own are read, as a regular file only, never through a link, at most 16 MiB each and 64 MiB in all, and a folder is opened from its parent, refusing a link. &lt;code&gt;info/sparse-checkout&lt;/code&gt; and &lt;code&gt;info/attributes&lt;/code&gt; always go. &lt;code&gt;info/exclude&lt;/code&gt; goes too, added below the VM&amp;rsquo;s own, which holds the lines that keep a folder of repos&amp;rsquo; other repos out of each one&amp;rsquo;s &lt;code&gt;git status&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;An operation&amp;rsquo;s files go only while it&amp;rsquo;s in progress, and an operation is never told by a file that a reftable repo keeps as a ref:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A rebase, by its folder, &lt;code&gt;rebase-merge&lt;/code&gt; or &lt;code&gt;rebase-apply&lt;/code&gt;: the folder&amp;rsquo;s files, the pseudo-refs &lt;code&gt;REBASE_HEAD&lt;/code&gt; and &lt;code&gt;AUTO_MERGE&lt;/code&gt;, and the refs below &lt;code&gt;refs/rewritten/&lt;/code&gt;, with &lt;code&gt;ORIG_HEAD&lt;/code&gt; only during &lt;code&gt;git am&lt;/code&gt; (&lt;code&gt;rebase-apply/applying&lt;/code&gt;), whose &lt;code&gt;--abort&lt;/code&gt; needs it.&lt;/li&gt;
&lt;li&gt;A merge, by its &lt;code&gt;MERGE_HEAD&lt;/code&gt; file: &lt;code&gt;MERGE_HEAD&lt;/code&gt;, &lt;code&gt;MERGE_MSG&lt;/code&gt;, &lt;code&gt;MERGE_MODE&lt;/code&gt;, &lt;code&gt;MERGE_AUTOSTASH&lt;/code&gt; and &lt;code&gt;SQUASH_MSG&lt;/code&gt;, and the pseudo-ref &lt;code&gt;AUTO_MERGE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A cherry-pick or a revert, by the pseudo-ref &lt;code&gt;CHERRY_PICK_HEAD&lt;/code&gt; or &lt;code&gt;REVERT_HEAD&lt;/code&gt;, or by the &lt;code&gt;sequencer&lt;/code&gt; folder: &lt;code&gt;MERGE_MSG&lt;/code&gt;, the folder&amp;rsquo;s files, and the pseudo-refs &lt;code&gt;CHERRY_PICK_HEAD&lt;/code&gt;, &lt;code&gt;REVERT_HEAD&lt;/code&gt; and &lt;code&gt;AUTO_MERGE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Bisect, by its &lt;code&gt;BISECT_START&lt;/code&gt; file: the &lt;code&gt;BISECT_*&lt;/code&gt; files, &lt;code&gt;BISECT_FIRST_PARENT&lt;/code&gt; included, the pseudo-ref &lt;code&gt;BISECT_HEAD&lt;/code&gt;, and the refs below &lt;code&gt;refs/bisect/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A pseudo-ref is read with &lt;code&gt;git rev-parse -q --verify&lt;/code&gt;, and only when &lt;code&gt;--symbolic-full-name&lt;/code&gt; gives its own name back, so a branch or tag named &lt;code&gt;CHERRY_PICK_HEAD&lt;/code&gt; isn&amp;rsquo;t taken for one. It&amp;rsquo;s set in the VM with &lt;code&gt;git update-ref&lt;/code&gt;, never copied as a file, so a reftable repo, which keeps &lt;code&gt;CHERRY_PICK_HEAD&lt;/code&gt; and the rest as refs, works as a files one does. &lt;code&gt;ORIG_HEAD&lt;/code&gt; never goes otherwise, not even while an operation is in progress, because a reset made meanwhile points it at what it took back, such as a commit that held a secret, and a stopped rebase or a &lt;code&gt;sequencer&lt;/code&gt; folder left behind would carry it along.&lt;/p&gt;
&lt;p&gt;The pack carries the commits the operation needs, and only those that its files hold as object ids: the first word of &lt;code&gt;rebase-merge&lt;/code&gt;&amp;rsquo;s &lt;code&gt;onto&lt;/code&gt;, &lt;code&gt;orig-head&lt;/code&gt;, &lt;code&gt;stopped-sha&lt;/code&gt;, &lt;code&gt;amend&lt;/code&gt;, &lt;code&gt;autostash&lt;/code&gt; and &lt;code&gt;squash-onto&lt;/code&gt;, every id in its &lt;code&gt;update-refs&lt;/code&gt;, the first two of each line of its &lt;code&gt;rewritten-list&lt;/code&gt; and &lt;code&gt;rewritten-pending&lt;/code&gt;, &lt;code&gt;rebase-apply&lt;/code&gt;&amp;rsquo;s &lt;code&gt;onto&lt;/code&gt;, &lt;code&gt;orig-head&lt;/code&gt; and &lt;code&gt;abort-safety&lt;/code&gt;, each line of &lt;code&gt;MERGE_HEAD&lt;/code&gt;, &lt;code&gt;MERGE_AUTOSTASH&lt;/code&gt;, &lt;code&gt;sequencer&lt;/code&gt;&amp;rsquo;s &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;abort-safety&lt;/code&gt;, &lt;code&gt;BISECT_EXPECTED_REV&lt;/code&gt;, and the ids on &lt;code&gt;BISECT_LOG&lt;/code&gt;&amp;rsquo;s lines that mark a commit good, bad, skipped, or with the terms &lt;code&gt;BISECT_TERMS&lt;/code&gt; names. Each must be an object the repo has, which &lt;code&gt;git cat-file --batch-check&lt;/code&gt; says. Free text never counts, so a commit that only a merge message or a revert&amp;rsquo;s message names stays on this machine. A new state file that holds object ids needs its entry in that list. The commits the todo lists still have to pick, &lt;code&gt;rebase-merge/git-rebase-todo&lt;/code&gt; and &lt;code&gt;sequencer/todo&lt;/code&gt;, are never scanned into the pack: devvm resolves each and names those that the copy&amp;rsquo;s refs and the ids above don&amp;rsquo;t reach (&lt;code&gt;clone_todo_missing&lt;/code&gt;), as that step will fail in the VM.&lt;/p&gt;
&lt;p&gt;The stash goes as its entries, oldest first, each with its message, read with &lt;code&gt;git reflog show --format='%H %gs' refs/stash&lt;/code&gt;, the newest 1,000, the rest named (&lt;code&gt;clone_stash_over_kept&lt;/code&gt;), and the VM stores each with &lt;code&gt;git stash store -m&lt;/code&gt;, the commits it was made on with it. An entry with untracked files, a third parent, is taken for one of &lt;code&gt;git stash --all&lt;/code&gt; and stays, named (&lt;code&gt;clone_stash_all_kept&lt;/code&gt;), because it may hold ignored files, such as &lt;code&gt;.env&lt;/code&gt;, when any of those files is a &lt;code&gt;.gitignore&lt;/code&gt;, when the entry changes a &lt;code&gt;.gitignore&lt;/code&gt; (&lt;code&gt;git stash --all&lt;/code&gt; takes back an uncommitted edit of one, so the rules that ignored a file are gone from the working tree), or when the ignore rules ignore any of its untracked files (&lt;code&gt;git check-ignore --no-index&lt;/code&gt;), as they are now or as the entry&amp;rsquo;s own &lt;code&gt;.gitignore&lt;/code&gt; files had them, which devvm writes into a folder of their own to check against. The check errs toward keeping an entry back. A linked worktree&amp;rsquo;s copy sends no stash, which is the whole repo&amp;rsquo;s. The VM records each entry it stores in &lt;code&gt;.git/devvm-seeded-stash&lt;/code&gt;, so a copy that runs again skips as many as the record has, an entry that the stash holds twice is stored twice, and the clone check leaves those entries out of the VM&amp;rsquo;s own.&lt;/p&gt;
&lt;p&gt;The script that reads the clone&amp;rsquo;s state prints every other entry as &lt;code&gt;SHA stash@{N}&lt;/code&gt;, devvm names it as &lt;code&gt;stash-N&lt;/code&gt; when this repo doesn&amp;rsquo;t have its commit, and fetches it by that commit. &lt;code&gt;devvm clone fetch&lt;/code&gt; does the same, with a script of its own whose lines devvm takes only for a detached &lt;code&gt;HEAD&lt;/code&gt;&amp;rsquo;s commit and stash entries, so the VM can&amp;rsquo;t have it save a branch of another name, and an entry it can&amp;rsquo;t fetch is named, the others saved. For rm and &lt;code&gt;clone off&lt;/code&gt;, an entry that can&amp;rsquo;t be fetched keeps the VM. A stash entry is never saved with its untracked files, because &lt;code&gt;git stash apply&lt;/code&gt; writes them, ignored ones too, such as a virtualenv&amp;rsquo;s &lt;code&gt;sitecustomize.py&lt;/code&gt; that Python runs on its own, while &lt;code&gt;git stash show&lt;/code&gt; doesn&amp;rsquo;t list them. devvm makes the entry again with &lt;code&gt;git commit-tree&lt;/code&gt;, from its tree and its first two parents, with its own message, author and committer, so the same entry is always the same commit, and saves that as &lt;code&gt;saved/devvm/stash-N&lt;/code&gt;. The untracked files go to &lt;code&gt;saved/devvm/stash-N-untracked&lt;/code&gt;, and devvm names them, and those that git on this machine ignores (&lt;code&gt;clone_stash_untracked&lt;/code&gt;, &lt;code&gt;clone_stash_untracked_ignored&lt;/code&gt;). Every fetch from a VM checks each object it receives (&lt;code&gt;transfer.fsckObjects&lt;/code&gt;). No ref names an older entry, and devvm&amp;rsquo;s ssh passes no &lt;code&gt;GIT_PROTOCOL&lt;/code&gt; to the VM, so its &lt;code&gt;git upload-pack&lt;/code&gt; speaks protocol v0, which refuses a commit no ref names unless the fetch runs it with &lt;code&gt;uploadpack.allowAnySHA1InWant&lt;/code&gt;, as devvm&amp;rsquo;s does. That only lets the host ask the VM for its own objects. The stubs drop &lt;code&gt;GIT_PROTOCOL&lt;/code&gt; too, so the tests fetch over v0.&lt;/p&gt;
&lt;p&gt;The state goes in only when the copy sets &lt;code&gt;HEAD&lt;/code&gt;, as the working tree does, since an operation applies to the commit it started from, and so do the refs of an operation, below &lt;code&gt;refs/rewritten/&lt;/code&gt; and &lt;code&gt;refs/bisect/&lt;/code&gt;. The stash goes in either way.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-settings-in-the-copy"&gt;The settings in the copy&lt;span class="hx:absolute hx:-mt-20" id="the-settings-in-the-copy"&gt;&lt;/span&gt;
&lt;a href="#the-settings-in-the-copy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The copy reads the repo&amp;rsquo;s own config with &lt;code&gt;git config --local --no-includes --null --list&lt;/code&gt;, and, when &lt;code&gt;extensions.worktreeConfig&lt;/code&gt; is on, the worktree&amp;rsquo;s &lt;code&gt;config.worktree&lt;/code&gt; after it with &lt;code&gt;--worktree&lt;/code&gt;, where &lt;code&gt;git sparse-checkout&lt;/code&gt; writes its settings, so neither your global config nor an included file goes. It sends only the keys of an allowlist, each value checked, never the config as a file, and a key written with no value, which git reads as true, goes as &lt;code&gt;true&lt;/code&gt;. The VM sets them with &lt;code&gt;git config --add&lt;/code&gt;, each key unset first, then writes &lt;code&gt;.git/devvm-seeded-config&lt;/code&gt;, so a copy that runs again sets nothing over what the VM changed since:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;remote.&amp;lt;name&amp;gt;.url&lt;/code&gt;, as &lt;code&gt;git remote get-url --all&lt;/code&gt; gives them, with &lt;code&gt;insteadOf&lt;/code&gt; applied, and &lt;code&gt;pushurl&lt;/code&gt;, when &lt;code&gt;git remote get-url --push --all&lt;/code&gt; gives other URLs, as it does with a push URL or a &lt;code&gt;pushInsteadOf&lt;/code&gt;. Each URL is cleaned: an &lt;code&gt;http&lt;/code&gt; or &lt;code&gt;https&lt;/code&gt; URL without its user name, password, query or fragment, any of which can be a token; an &lt;code&gt;ssh://&lt;/code&gt;, &lt;code&gt;git+ssh://&lt;/code&gt; or &lt;code&gt;ssh+git://&lt;/code&gt; URL without its password, query or fragment, its user kept, as &lt;code&gt;git@&lt;/code&gt; is a name, not a secret; a scp-like &lt;code&gt;[user@]host:path&lt;/code&gt; as it is; and a &lt;code&gt;file://&lt;/code&gt; URL or a path as it is. git reads a scp-like URL&amp;rsquo;s host up to its first colon, past a bracketed host such as &lt;code&gt;[::1]&lt;/code&gt;, so its user, before an &lt;code&gt;@&lt;/code&gt; there, holds no colon, and one whose path has an &lt;code&gt;@&lt;/code&gt; and then a colon, as in &lt;code&gt;user:token@host:path&lt;/code&gt;, which git reads as the host &lt;code&gt;user&lt;/code&gt; and a path holding the token, stays. Any other kind, such as &lt;code&gt;git://&lt;/code&gt; or a transport helper&amp;rsquo;s &lt;code&gt;ext::&lt;/code&gt;, stays, named (&lt;code&gt;clone_urls_kept&lt;/code&gt;), and a remote with no URL that goes stays with the rest of its settings. A remote that reaches a devvm VM stays, as its refs do, and so does a push URL that reaches one. A remote whose push URLs all stay goes without them, so &lt;code&gt;git push&lt;/code&gt; in the VM pushes to its URL, named (&lt;code&gt;clone_push_urls_kept&lt;/code&gt;). A remote whose URLs &lt;code&gt;git remote get-url&lt;/code&gt; can&amp;rsquo;t give stays, named (&lt;code&gt;clone_urls_unread&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;remote.&amp;lt;name&amp;gt;.fetch&lt;/code&gt;, &lt;code&gt;promisor&lt;/code&gt;, &lt;code&gt;partialclonefilter&lt;/code&gt; and &lt;code&gt;tagOpt&lt;/code&gt;, for a remote that goes.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;branch.&amp;lt;name&amp;gt;.remote&lt;/code&gt;, &lt;code&gt;merge&lt;/code&gt;, &lt;code&gt;rebase&lt;/code&gt; and &lt;code&gt;pushRemote&lt;/code&gt;, for a branch the copy sends, so the VM of a worktree learns no other branch&amp;rsquo;s name, but an upstream on a remote that stays.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;submodule.&amp;lt;name&amp;gt;.url&lt;/code&gt;, resolved with &lt;code&gt;git ls-remote --get-url&lt;/code&gt; and cleaned as a remote&amp;rsquo;s, and its &lt;code&gt;active&lt;/code&gt;, &lt;code&gt;branch&lt;/code&gt; and &lt;code&gt;update&lt;/code&gt;, but an &lt;code&gt;update&lt;/code&gt; that runs a command (&lt;code&gt;!command&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;core.sparseCheckout&lt;/code&gt;, &lt;code&gt;core.sparseCheckoutCone&lt;/code&gt; and &lt;code&gt;index.sparse&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;core.hooksPath&lt;/code&gt;, the last one, when it&amp;rsquo;s a relative folder inside the repo, never through &lt;code&gt;..&lt;/code&gt; or a &lt;code&gt;.git&lt;/code&gt; part, and not one that git expands, as it does &lt;code&gt;~/&lt;/code&gt; and &lt;code&gt;%(prefix)/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nothing else goes, such as &lt;code&gt;credential.*&lt;/code&gt;, &lt;code&gt;http.*&lt;/code&gt; and its extra headers, &lt;code&gt;url.*.insteadOf&lt;/code&gt;, which the URLs have applied already, &lt;code&gt;core.sshCommand&lt;/code&gt;, &lt;code&gt;core.fsmonitor&lt;/code&gt;, &lt;code&gt;filter.*&lt;/code&gt;, &lt;code&gt;include*&lt;/code&gt;, &lt;code&gt;alias.*&lt;/code&gt;, or the keys that describe this machine&amp;rsquo;s filesystem, &lt;code&gt;core.ignorecase&lt;/code&gt;, &lt;code&gt;precomposeunicode&lt;/code&gt;, &lt;code&gt;filemode&lt;/code&gt; and &lt;code&gt;symlinks&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The hooks go as they are, and only as git here runs them, from the common dir&amp;rsquo;s &lt;code&gt;hooks&lt;/code&gt; folder, which &lt;code&gt;git rev-parse --git-path hooks&lt;/code&gt; can&amp;rsquo;t give, as it gives &lt;code&gt;/dev/null&lt;/code&gt; under devvm&amp;rsquo;s own git&amp;rsquo;s &lt;code&gt;core.hooksPath&lt;/code&gt;. They go when the &lt;code&gt;core.hooksPath&lt;/code&gt; git uses is none, &lt;code&gt;.git/hooks&lt;/code&gt; or that folder. It&amp;rsquo;s the last of the repo&amp;rsquo;s own config and its worktree&amp;rsquo;s, includes followed (&lt;code&gt;git config --includes --show-scope --get-all&lt;/code&gt;, its &lt;code&gt;local&lt;/code&gt; and &lt;code&gt;worktree&lt;/code&gt; ones), so an include after the repo&amp;rsquo;s own wins, as in git, else your global or system config&amp;rsquo;s, read from the files that &lt;code&gt;GIT_CONFIG_GLOBAL&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_SYSTEM&lt;/code&gt; name when they&amp;rsquo;re set. In a linked worktree, whose &lt;code&gt;.git&lt;/code&gt; is a file, a relative &lt;code&gt;.git/hooks&lt;/code&gt; names no folder, so git there runs no hook, and none goes. A &lt;code&gt;core.hooksPath&lt;/code&gt; elsewhere inside the repo goes as the setting alone: the hooks in it are files of the working tree, so the tracked ones reach the VM with the checkout, and the untracked ones, such as husky&amp;rsquo;s &lt;code&gt;_&lt;/code&gt; folder, stay, as every untracked file does. One outside the repo, or one an included file sets, stays, named (&lt;code&gt;clone_hooks_path_kept&lt;/code&gt;), and no hook goes. The &lt;code&gt;hooks&lt;/code&gt; folder is opened from the common dir, never through a link, and one that&amp;rsquo;s missing, a link or unreadable is named (&lt;code&gt;clone_hooks_dir_kept&lt;/code&gt;). Only files named as git&amp;rsquo;s hooks go, the names devvm&amp;rsquo;s own git turns off, each a regular file of at most 1 MiB and 16 MiB in all. A link, a folder or a bigger file stays, named (&lt;code&gt;clone_hooks_kept&lt;/code&gt;). In the VM, a hook goes into the git dir&amp;rsquo;s &lt;code&gt;hooks&lt;/code&gt; folder only where the VM has no file of that name, with its executable bit.&lt;/p&gt;
&lt;p&gt;The settings and hooks go in last, after the checkout, and the script&amp;rsquo;s git runs with &lt;code&gt;core.hooksPath=/dev/null&lt;/code&gt;, so neither a hook the copy brings nor one of the VM&amp;rsquo;s own runs during the copy, and none can fail it or a copy that runs again.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-record-of-what-was-copied"&gt;The record of what was copied&lt;span class="hx:absolute hx:-mt-20" id="the-record-of-what-was-copied"&gt;&lt;/span&gt;
&lt;a href="#the-record-of-what-was-copied" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;So that &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; don&amp;rsquo;t take your own uncommitted changes for the VM&amp;rsquo;s work, the copy leaves a record of them in the VM&amp;rsquo;s repo, &lt;code&gt;.git/devvm-seeded-tree&lt;/code&gt;, written with the index. It covers each path that &lt;code&gt;git status&lt;/code&gt; in the VM would list once the copy is in: those whose staged entry isn&amp;rsquo;t &lt;code&gt;HEAD&lt;/code&gt;&amp;rsquo;s, found with &lt;code&gt;git diff-index --cached&lt;/code&gt; on the normalised index, and those whose working copy differs. For each path it holds what devvm put there: the blob of the working copy, which devvm hashes as it sends the file, with a mark for an executable file, &lt;code&gt;=&lt;/code&gt; for one checked out from the index, &lt;code&gt;dir&lt;/code&gt; for a gitlink&amp;rsquo;s empty folder or &lt;code&gt;-&lt;/code&gt; for none, and the path&amp;rsquo;s index entries, each with its mode, blob and stage.&lt;/p&gt;
&lt;p&gt;The clone check reads the record back in the VM. For each path, git in the VM hashes the working copy with &lt;code&gt;git hash-object --no-filters&lt;/code&gt;, or the link&amp;rsquo;s target for a symbolic link, or, for one checked out from the index, asks &lt;code&gt;git diff-files --quiet&lt;/code&gt; after a refresh whether it&amp;rsquo;s still the index&amp;rsquo;s, so a file that &lt;code&gt;info/attributes&lt;/code&gt; converts, such as with &lt;code&gt;eol=crlf&lt;/code&gt;, matches as git checked it out, and it lists the index entries with &lt;code&gt;git ls-files --format&lt;/code&gt;, and the VM prints the paths whose state matches the record. devvm leaves the &lt;code&gt;git status&lt;/code&gt; lines that name only those paths out of what it counts and shows, so a path counts once the VM changes its content, its executable bit or what&amp;rsquo;s staged for it. A deletion that&amp;rsquo;s still deleted matches. Untracked files&amp;rsquo; lines always count, as the copy sends none.&lt;/p&gt;
&lt;p&gt;The record is the VM&amp;rsquo;s side of the copy, not a comparison with the repo here, so it stays right when your working copy changes after the copy, and it needs nothing in devvm&amp;rsquo;s own state. The VM can write the record, and it can answer for it anything it likes, but all a forged record or answer can do is make the VM&amp;rsquo;s own work look unchanged, so that &lt;code&gt;devvm rm&lt;/code&gt; deletes it without asking, which hurts only the VM&amp;rsquo;s work. A VM without the record, such as one an older devvm made, or whose git has no &lt;code&gt;ls-files --format&lt;/code&gt; (before 2.38), counts every change as before.&lt;/p&gt;</description></item><item><title>Images and tools</title><link>https://next.devvm.dev/docs/using/images/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/images/</guid><description>
&lt;p&gt;Every VM is a copy of an image. An image is &lt;code&gt;base&lt;/code&gt; with your choice of layers on it, and nothing else. A VM also gets the shared tools you chose for it, such as node or Claude Code, which are mounted into it and are never part of an image. This page covers what a new VM gets, what base brings, the layers and adding them to a VM or taking them out, how the shared tools work, rebuilding, bringing an outdated VM up to date, and how to list, delete and clean up images. &lt;a href="https://next.devvm.dev/docs/internals/images/"&gt;Images and caching&lt;/a&gt; explains how devvm builds, pins and caches them, and &lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;toolchains&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#supported-agents"&gt;coding agents&lt;/a&gt; list the shared tools.&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 498px; --devvm-diagram-width: 496px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 496 498" width="496" height="498" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d519b89d51c7bc850--title" aria-describedby="d519b89d51c7bc850--desc"&gt;&lt;title id="d519b89d51c7bc850--title"&gt;Images, VMs and the shared tools&lt;/title&gt;&lt;desc id="d519b89d51c7bc850--desc"&gt;Ubuntu's cloud image, or a --from image, is the start of base, with the features you chose, and docker is a layer on base. Each VM is a copy of one image, and the shared tools, such as node and claude, are mounted into each VM read-only.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_ubuntu_base_0"&gt;&lt;path d="M124,68L124,116.84"/&gt;&lt;path class="pele-marker" d="M124,123.84L120.64,115.84L127.36,115.84Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_base_docker_0"&gt;&lt;path d="M99.64,183.84L99.64,282.19"/&gt;&lt;path class="pele-marker" d="M99.64,289.19L96.28,281.19L103,281.19Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_base_vm1_0"&gt;&lt;path d="M188,183.84L188,200.69Q188,212.69 200,212.69L237.05,212.69Q249.05,212.69 249.05,224.69L249.05,282.19" stroke-dasharray="3 4"/&gt;&lt;path class="pele-marker" d="M249.05,289.19L245.69,281.19L252.41,281.19Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_docker_vm2_0"&gt;&lt;path d="M99.64,349.19L99.64,399.69Q99.64,411.69 111.64,411.69L206.5,411.69Q214.75,411.69 214.75,419.94L214.75,422.69" stroke-dasharray="3 4"/&gt;&lt;path class="pele-marker" d="M214.75,429.69L211.39,421.69L218.11,421.69Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_tools_vm1_0"&gt;&lt;path d="M406.11,194.66L406.11,200.69Q406.11,212.69 394.11,212.69L355.86,212.69Q343.86,212.69 343.86,224.69L343.86,282.19"/&gt;&lt;path class="pele-marker" d="M343.86,289.19L340.5,281.19L347.22,281.19Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_tools_vm2_0"&gt;&lt;path d="M440.05,193.9L440.05,399.69Q440.05,411.69 428.05,411.69L333.18,411.69Q324.93,411.69 324.93,419.94L324.93,422.69"/&gt;&lt;path class="pele-marker" d="M324.93,429.69L321.57,421.69L328.29,421.69Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_base_vm1_0"&gt;&lt;rect x="218.32" y="239.69" width="61.45" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="249.05" y="252.89" text-anchor="middle"&gt;a copy&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_docker_vm2_0"&gt;&lt;rect x="68.91" y="373.69" width="61.45" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="99.64" y="386.89" text-anchor="middle"&gt;a copy&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_tools_vm1_0"&gt;&lt;rect x="299.77" y="232.69" width="88.18" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="343.86" y="244.89"&gt;mounted&lt;/tspan&gt;&lt;tspan x="343.86" y="260.89"&gt;read-only&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_tools_vm2_0"&gt;&lt;rect x="395.95" y="303.19" width="88.18" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="440.05" y="315.39"&gt;mounted&lt;/tspan&gt;&lt;tspan x="440.05" y="331.39"&gt;read-only&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="ubuntu" transform="translate(124,38)"&gt;&lt;rect x="-111.55" y="-30" width="223.09" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;Ubuntu's cloud image,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;or a --from image&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="base" transform="translate(124,153.84)"&gt;&lt;rect x="-116" y="-30" width="232" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;base, with&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;the features you chose&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="docker" transform="translate(99.64,319.19)"&gt;&lt;rect x="-84.82" y="-30" width="169.64" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;docker, a layer&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;on base&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="vm1" transform="translate(296.45,319.19)"&gt;&lt;rect x="-67" y="-30" width="134" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;VM of base,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;with node&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="vm2" transform="translate(269.84,459.69)"&gt;&lt;rect x="-107.09" y="-30" width="214.18" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;VM of docker,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;with node and claude&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-cyl" data-id="tools" transform="translate(411.66,153.84)"&gt;&lt;path d="M-75.91,-30A75.91,10.84 0 0 1 75.91,-30V30A75.91,10.84 0 0 1 -75.91,30Z" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;path d="M-75.91,-30A75.91,10.84 0 0 0 75.91,-30" fill="none" stroke="var(--_b)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="1.32"&gt;shared tools:&lt;/tspan&gt;&lt;tspan x="0" y="19.32"&gt;node, claude…&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;h2 data-hextra-search-id="what-a-new-vm-gets"&gt;What a new VM gets&lt;span class="hx:absolute hx:-mt-20" id="what-a-new-vm-gets"&gt;&lt;/span&gt;
&lt;a href="#what-a-new-vm-gets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 875px; --devvm-diagram-width: 540px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 540 875" width="540" height="875" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d196989d9562bc717--title" aria-describedby="d196989d9562bc717--desc"&gt;&lt;title id="d196989d9562bc717--title"&gt;What a new VM gets&lt;/title&gt;&lt;desc id="d196989d9562bc717--desc"&gt;devvm starts from the defaults, the folder's toolchains and devvm setup's agents and layers, each flag given replaces its part, and the summary says what the VM gets. In a terminal, without --no-input and with something left to choose, devvm asks whether to customize it, and y opens the list, the tier, the CPUs, memory and disk. Then devvm builds the image if it isn't built and makes the VM as a copy of it, with its shared tools mounted.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_run_defaults_0"&gt;&lt;path d="M195.27,68L195.27,106"/&gt;&lt;path class="pele-marker" d="M195.27,113L191.91,105L198.63,105Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_defaults_flags_0"&gt;&lt;path d="M195.27,173L195.27,211"/&gt;&lt;path class="pele-marker" d="M195.27,218L191.91,210L198.63,210Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_flags_summary_0"&gt;&lt;path d="M195.27,296L195.27,334"/&gt;&lt;path class="pele-marker" d="M195.27,341L191.91,333L198.63,333Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_summary_term_0"&gt;&lt;path d="M195.27,386L195.27,424"/&gt;&lt;path class="pele-marker" d="M195.27,431L191.91,423L198.63,423Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_term_copy_0"&gt;&lt;path d="M115.62,491L115.62,781.5"/&gt;&lt;path class="pele-marker" d="M115.62,788.5L112.26,780.5L118.98,780.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_term_ask_0"&gt;&lt;path d="M274.92,491L274.92,551"/&gt;&lt;path class="pele-marker" d="M274.92,558L271.56,550L278.28,550Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_ask_copy_0"&gt;&lt;path d="M218.28,603L218.28,609Q218.28,621 206.28,621L181.72,621Q169.72,621 169.72,633L169.72,781.5"/&gt;&lt;path class="pele-marker" d="M169.72,788.5L166.36,780.5L173.08,780.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_ask_pick_0"&gt;&lt;path d="M331.56,603L331.56,609Q331.56,621 343.56,621L368.13,621Q380.13,621 380.13,633L380.13,676.5"/&gt;&lt;path class="pele-marker" d="M380.13,683.5L376.77,675.5L383.49,675.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_pick_copy_0"&gt;&lt;path d="M380.13,743.5L380.13,754Q380.13,766 368.13,766L306.08,766Q294.45,766 294.45,777.63L294.45,781.5"/&gt;&lt;path class="pele-marker" d="M294.45,788.5L291.09,780.5L297.81,780.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_term_copy_0"&gt;&lt;rect x="102.72" y="571.5" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="115.62" y="584.7" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_term_ask_0"&gt;&lt;rect x="257.56" y="515.5" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="274.92" y="528.7" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_ask_copy_0"&gt;&lt;rect x="143.44" y="704.5" width="52.55" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="169.72" y="717.7" text-anchor="middle"&gt;Enter&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_ask_pick_0"&gt;&lt;rect x="371.67" y="641" width="16.91" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="380.13" y="654.2" text-anchor="middle"&gt;y&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="run" transform="translate(195.27,38)"&gt;&lt;rect x="-93.73" y="-30" width="187.45" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;devvm in a folder&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;without a VM&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="defaults" transform="translate(195.27,143)"&gt;&lt;rect x="-187.27" y="-30" width="374.55" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;the defaults: the folder's toolchains,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;devvm setup's agents and layers&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="flags" transform="translate(195.27,257)"&gt;&lt;rect x="-169.45" y="-39" width="338.91" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;each flag given replaces its part:&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;--tools, --agents, --layers,&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;--network, --cpus, --memory&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="summary" transform="translate(195.27,363.5)"&gt;&lt;rect x="-165" y="-22.5" width="330" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the summary says what the VM gets&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-hex" data-id="term" transform="translate(195.27,461)"&gt;&lt;polygon points="-156.09,-30 156.09,-30 171.09,0 156.09,30 -156.09,30 -171.09,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;a terminal, without --no-input,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;and something left to choose?&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="copy" transform="translate(199.27,827.5)"&gt;&lt;rect x="-147.18" y="-39" width="294.36" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;its image built if it isn't,&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;and the VM is a copy of it,&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;with its shared tools mounted&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-hex" data-id="ask" transform="translate(274.92,580.5)"&gt;&lt;polygon points="-102.64,-22.5 102.64,-22.5 113.89,0 102.64,22.5 -102.64,22.5 -113.89,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;Customize it? [y/N]&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="pick" transform="translate(380.13,713.5)"&gt;&lt;rect x="-151.64" y="-30" width="303.27" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;the list, then the tier,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;then the CPUs, memory and disk&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;Before devvm makes a new VM, it shows a summary of what the VM gets. The summary names each toolchain, coding agent and layer with why the VM gets it, such as &lt;code&gt;for package.json&lt;/code&gt;, &lt;code&gt;from devvm setup&lt;/code&gt; or &lt;code&gt;from --tools&lt;/code&gt;, and then the VM&amp;rsquo;s size, its network tier, its ports and the folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt;, when there is one:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;==&amp;gt; This folder&amp;#39;s new VM, devvm-some-project-71a99b1076d92c, gets:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; toolchain node, for package.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; agent claude, from devvm setup
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; layers: none
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; size: 4 CPUs, 8 GiB of memory and a 100 GiB disk
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; network tier: allowlist
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ports: all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; devcontainer.json: .devcontainer/devcontainer.json, which devvm --no-devcontainer skips
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Customize it? [y/N]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In a terminal, devvm then asks whether to customize the VM, with no as the default, so confirming makes it as shown. When you customize it, devvm shows the three parts in one list under three headings, Toolchains, Coding agents and Layers, with what the summary showed already chosen (&lt;a href="#choosing-in-a-list"&gt;choosing in a list&lt;/a&gt;). The Layers heading says that a layer is extra software built into the VM&amp;rsquo;s image:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Choose what devvm-some-project-71a99b1076d92c gets. Use up and down to move, space to toggle and enter to confirm.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Toolchains
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; [x] node for package.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] python
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] rust
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] go
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Coding agents, which you start in the VM&amp;#39;s shell
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [x] claude from devvm setup
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] codex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] opencode
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] pi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Layers: extra software built into the VM&amp;#39;s image, such as docker, nix or desktop
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] desktop an Xfce desktop, which devvm desktop opens
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] docker Docker&amp;#39;s engine, CLI, BuildKit and Compose
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [ ] nix Nix, direnv and nix-direnv&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;After the list, devvm asks three more questions, in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Unless you gave &lt;code&gt;--network&lt;/code&gt;, devvm lists the four network tiers, with &lt;code&gt;learn&lt;/code&gt; after &lt;code&gt;internet&lt;/code&gt; for a VM that &lt;a href="https://next.devvm.dev/docs/safety/network/#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt;, each with what it reaches, and you choose one, starting from the tier the summary showed: allowlist, or the tier you saved for new VMs with &lt;code&gt;devvm network -g&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#choosing-a-tier"&gt;choosing a tier&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Unless you gave &lt;code&gt;--ports&lt;/code&gt;, devvm lists the ports the VM can forward: every port, none, which you add later with &lt;code&gt;devvm ports add&lt;/code&gt;, or the ports you type, which devvm checks as &lt;code&gt;--ports&lt;/code&gt; checks them and asks for again when they aren&amp;rsquo;t a list. The list starts on what the summary showed, every port unless &lt;code&gt;config.toml&lt;/code&gt; or &lt;code&gt;devvm ports -g&lt;/code&gt; set another (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;size and ports&lt;/a&gt;), and the ports you choose are this VM&amp;rsquo;s alone.&lt;/li&gt;
&lt;li&gt;Last, it asks for the VM&amp;rsquo;s CPUs, memory and disk, starting from the summary&amp;rsquo;s, and confirming keeps each one. Each question is skipped when you gave its flag, &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; or &lt;code&gt;--disk&lt;/code&gt;. Before the disk&amp;rsquo;s question, devvm says that the disk can grow later with &lt;code&gt;devvm size --disk&lt;/code&gt; but never shrinks, and that it takes up only the space the VM writes. A disk smaller than the image&amp;rsquo;s, 100 GiB for base, is refused as &lt;code&gt;--disk&lt;/code&gt; refuses it, and devvm asks again, as it does for a value that isn&amp;rsquo;t a size. The size you type is this VM&amp;rsquo;s alone, and devvm saves it for no other VM.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each part has a default:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Toolchains:&lt;/strong&gt; the ones the folder&amp;rsquo;s files call for, each naming its file in the summary and the list, such as &lt;code&gt;package.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coding agents:&lt;/strong&gt; the ones you chose with &lt;a href="https://next.devvm.dev/docs/using/settings/#coding-agents-for-new-vms"&gt;devvm setup&lt;/a&gt;, which the summary and the list say. The summary says &lt;code&gt;from config.toml&lt;/code&gt; for the ones that &lt;code&gt;config.toml&lt;/code&gt; sets. Until you choose some, there are none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Layers:&lt;/strong&gt; the ones you chose with &lt;a href="https://next.devvm.dev/docs/using/settings/#layers-for-new-vms"&gt;devvm setup&lt;/a&gt;, bottom first, which the summary and the list say in the same way. Until you choose some, there are none. A layer that a project file calls for, such as &lt;code&gt;nix&lt;/code&gt; for a &lt;code&gt;flake.nix&lt;/code&gt;, names the file in its row of the list but isn&amp;rsquo;t chosen unless devvm setup chose it, so you choose it when you want it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Three flags choose the parts on the command line. &lt;code&gt;--tools&lt;/code&gt; takes the toolchains, as in &lt;code&gt;--tools node,python&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; takes the coding agents, as in &lt;code&gt;--agents claude,codex&lt;/code&gt;, and &lt;code&gt;--layers&lt;/code&gt; takes the layers bottom first, as in &lt;code&gt;--layers docker,mine&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --tools node,python --agents claude,codex --layers docker &lt;span class="c1"&gt;# choose every part, without the list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --agents none &lt;span class="c1"&gt;# no agents, the rest as the summary shows&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Each is the exact list for its part and replaces that part&amp;rsquo;s default, and &lt;code&gt;none&lt;/code&gt; chooses none of it, as in &lt;code&gt;--agents none&lt;/code&gt;. A part whose flag you leave out takes its default. devvm checks each name before it does anything. For a name that belongs to another part, such as &lt;code&gt;--tools claude&lt;/code&gt;, it names the flag that takes it, and for a name it doesn&amp;rsquo;t know, it suggests the closest one.&lt;/p&gt;
&lt;p&gt;A part, tier or size that a flag gives is taken as given, and the summary says so. devvm still asks whether to customize the VM while anything is left to choose, because a flag answers only its own part. When you customize it, the list shows a part that a flag gave greyed out, and the cursor skips it. Each question is skipped in its own case:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Skipped when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;the list&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; give all three parts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the tier&lt;/td&gt;
&lt;td&gt;you give &lt;code&gt;--network&lt;/code&gt; or saved a tier, or the backend&amp;rsquo;s VMs can only be open&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the ports&lt;/td&gt;
&lt;td&gt;you give &lt;code&gt;--ports&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the CPUs, the memory or the disk&lt;/td&gt;
&lt;td&gt;you give &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; or &lt;code&gt;--disk&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to customize the VM&lt;/td&gt;
&lt;td&gt;the flags give every part, the ports, the CPUs, the memory and the disk, and the tier is given or saved&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, devvm asks nothing and doesn&amp;rsquo;t fail. The VM gets what the summary shows, and the summary ends with the flags that choose others.&lt;/p&gt;
&lt;p&gt;devvm looks at the folder&amp;rsquo;s top level for the files that call for a toolchain, in this order:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Toolchain&lt;/th&gt;
&lt;th&gt;Files&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;node&lt;/td&gt;
&lt;td&gt;&lt;code&gt;package.json&lt;/code&gt;, &lt;code&gt;bun.lock&lt;/code&gt;, &lt;code&gt;bun.lockb&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;python&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pyproject.toml&lt;/code&gt;, &lt;code&gt;requirements.txt&lt;/code&gt;, &lt;code&gt;uv.lock&lt;/code&gt;, &lt;code&gt;setup.py&lt;/code&gt;, &lt;code&gt;Pipfile&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rust&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Cargo.toml&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;go&lt;/td&gt;
&lt;td&gt;&lt;code&gt;go.mod&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The defaults combine this way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If more than one toolchain matches, the VM gets them all, so &lt;code&gt;package.json&lt;/code&gt; and &lt;code&gt;pyproject.toml&lt;/code&gt; give node and python. A Nix project&amp;rsquo;s files call for the &lt;a href="#nix"&gt;&lt;code&gt;nix&lt;/code&gt; layer&lt;/a&gt;, whose row names them. Those files are &lt;code&gt;flake.nix&lt;/code&gt;, &lt;code&gt;shell.nix&lt;/code&gt; and &lt;code&gt;devenv.nix&lt;/code&gt;, and a &lt;code&gt;default.nix&lt;/code&gt; that makes a shell with &lt;code&gt;mkShell&lt;/code&gt;. In a folder with none of these files, the default is no toolchains, so a VM made without a terminal or flags gets devvm setup&amp;rsquo;s layers and agents.&lt;/li&gt;
&lt;li&gt;A folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; adds what its features map to, such as toolchains or the &lt;code&gt;docker&lt;/code&gt; layer, to the defaults, each naming the file in the summary and the list (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/"&gt;&lt;code&gt;devcontainer.json&lt;/code&gt;&lt;/a&gt;). Its layers go on top of devvm setup&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;The VM&amp;rsquo;s image is base with its layers, in the order you give them, bottom first, so &lt;code&gt;--layers docker,mine&lt;/code&gt; makes the image &lt;code&gt;docker+mine&lt;/code&gt;. When you check layers in the list, devvm setup&amp;rsquo;s stay in their order at the bottom, and the ones you add go on top in the list&amp;rsquo;s order. Its shared tools are a list of their own, the toolchains first, then the agents.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the image isn&amp;rsquo;t built yet, devvm builds it first, then the shared tools the share lacks, and the VM is a copy of the image with its shared tools mounted. A VM keeps the image and tools it was made from, and the options for a new VM change nothing on a VM that exists, which ignores them with a warning. The warning names the command that changes the same on that VM:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;The command the warning names&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm tools&lt;/code&gt;, which &lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;changes its shared tools&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--layers&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm layer add&lt;/code&gt;, which &lt;a href="#adding-layers-to-a-vm"&gt;adds layers&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--cpus&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm size&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--from&lt;/code&gt;, &lt;code&gt;--no-devcontainer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Only &lt;code&gt;devvm&lt;/code&gt; takes these options, and another command given one fails as it does for any flag it doesn&amp;rsquo;t know (&lt;a href="https://next.devvm.dev/docs/using/command-line/#flags-and-values"&gt;flags and values&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="choosing-in-a-list"&gt;Choosing in a list&lt;span class="hx:absolute hx:-mt-20" id="choosing-in-a-list"&gt;&lt;/span&gt;
&lt;a href="#choosing-in-a-list" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm&amp;rsquo;s lists work the same way everywhere: the new VM&amp;rsquo;s list, its network tiers and ports, &lt;code&gt;devvm tools&lt;/code&gt;, base&amp;rsquo;s features in &lt;code&gt;devvm setup&lt;/code&gt;, and the hosts in &lt;code&gt;devvm network lock&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Up and down, or &lt;code&gt;k&lt;/code&gt; and &lt;code&gt;j&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;move the cursor, and in a list where you choose one, such as the network tiers, moving chooses it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Space&lt;/td&gt;
&lt;td&gt;in a list where you choose several, such as the toolchains, coding agents and layers, chooses or unchooses the row under the cursor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;a&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in a list where you choose several, chooses every row, or unchooses them all when they&amp;rsquo;re all chosen already&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enter&lt;/td&gt;
&lt;td&gt;confirms, and at a question with a value in brackets, such as a size, keeps that value&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A row that&amp;rsquo;s greyed out, such as a part a flag gave or a VM&amp;rsquo;s layers in &lt;code&gt;devvm tools&lt;/code&gt;, can&amp;rsquo;t change, and the cursor skips it. A list longer than the terminal scrolls with the cursor, with a line above and below that says how many more rows there are, and each row is cut to the terminal&amp;rsquo;s width.&lt;/p&gt;
&lt;h2 data-hextra-search-id="base"&gt;Base&lt;span class="hx:absolute hx:-mt-20" id="base"&gt;&lt;/span&gt;
&lt;a href="#base" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;base&lt;/code&gt; is the image that every other image is built on. It is Ubuntu 26.04&amp;rsquo;s cloud image with git, git-lfs, build-essential, ripgrep, jq, sqlite3 and mise added, followed by the optional &lt;a href="https://next.devvm.dev/docs/using/customizing/#base-image-features"&gt;features&lt;/a&gt; you chose, such as oh-my-bash and fzf. Docker comes as a &lt;a href="#built-in-layers"&gt;layer of devvm&amp;rsquo;s&lt;/a&gt;, so you choose it when you customize a new VM, or give &lt;code&gt;devvm --layers docker&lt;/code&gt;. With &lt;code&gt;--from&lt;/code&gt;, base starts from a container image instead of Ubuntu&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/using/from/"&gt;details&lt;/a&gt;). A VM made from base gets 4 CPUs, 8 GiB of memory and a 100 GiB disk unless you give it another size, and on a small machine it gets fewer CPUs and less memory (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;size and ports&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Your VMs use Ubuntu&amp;rsquo;s live archive, and base keeps no package lists, so run &lt;code&gt;sudo apt update&lt;/code&gt; in a VM before you install a package, and &lt;code&gt;apt upgrade&lt;/code&gt; then gets the current updates:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo apt install PACKAGE &lt;span class="c1"&gt;# in the VM: fetch the lists first, as base keeps none&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt upgrade &lt;span class="c1"&gt;# the current updates&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;base drops the server extras that Ubuntu&amp;rsquo;s cloud image comes with, such as snapd and apt&amp;rsquo;s background updates, which saves 0.9 GB of disk and 100 MB of memory per VM (&lt;a href="https://next.devvm.dev/docs/internals/images/#bases-size"&gt;base&amp;rsquo;s size&lt;/a&gt;). The everyday tools stay, such as htop, tmux, lsof, strace, tcpdump, rsync and nano.&lt;/p&gt;
&lt;p&gt;The first time devvm builds base on this machine, it starts from the newest release of Ubuntu&amp;rsquo;s cloud image and installs the newest packages from Ubuntu&amp;rsquo;s archive, or first from a &lt;a href="https://next.devvm.dev/docs/using/settings/#an-ubuntu-mirror"&gt;mirror you set&lt;/a&gt;. devvm keeps a copy of each package it installed, so building the same base again, such as after &lt;code&gt;devvm images rm base&lt;/code&gt;, installs exactly those packages from the copies, with no network for them. &lt;code&gt;devvm rebuild base&lt;/code&gt; starts again from the newest image and packages (&lt;a href="#rebuilding"&gt;rebuilding&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="layers"&gt;Layers&lt;span class="hx:absolute hx:-mt-20" id="layers"&gt;&lt;/span&gt;
&lt;a href="#layers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An image is base with layers on it, named bottom first and joined with &lt;code&gt;+&lt;/code&gt;, so &lt;code&gt;foo+bar&lt;/code&gt; is &lt;code&gt;bar&lt;/code&gt; on &lt;code&gt;foo&lt;/code&gt; on &lt;code&gt;base&lt;/code&gt;. You can leave &lt;code&gt;base&lt;/code&gt; itself out, which makes &lt;code&gt;base+foo&lt;/code&gt; the same as &lt;code&gt;foo&lt;/code&gt;. An image name never holds &lt;a href="#shared-tools"&gt;shared tools&lt;/a&gt;, which aren&amp;rsquo;t layers, so &lt;code&gt;devvm build&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt; and &lt;code&gt;devvm images rm&lt;/code&gt; refuse a shared tool&amp;rsquo;s name, such as &lt;code&gt;node&lt;/code&gt;, and point you to &lt;code&gt;devvm tools&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A layer is a script that bash runs in the image&amp;rsquo;s VM as the VM&amp;rsquo;s user, who has sudo. It is either one of devvm&amp;rsquo;s &lt;a href="#built-in-layers"&gt;built-in layers&lt;/a&gt; or one of yours, at &lt;code&gt;~/.config/devvm/layers/&amp;lt;name&amp;gt;.sh&lt;/code&gt;, and &lt;code&gt;devvm layer new NAME&lt;/code&gt; starts a layer of your own (&lt;a href="https://next.devvm.dev/docs/using/customizing/#your-own-layers"&gt;details&lt;/a&gt;). devvm refuses a layer whose script is missing, and it refuses any name in an image that breaks these rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A layer&amp;rsquo;s name is made of lowercase letters, digits and dashes.&lt;/li&gt;
&lt;li&gt;It starts with a letter or digit.&lt;/li&gt;
&lt;li&gt;It is neither &lt;code&gt;base&lt;/code&gt;, a built-in layer&amp;rsquo;s name nor a shared tool&amp;rsquo;s name.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm build foo+bar &lt;span class="c1"&gt;# builds base, foo and foo+bar, unless they&amp;#39;re built&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rebuild foo &lt;span class="c1"&gt;# builds foo again, and deletes the old foo and foo+bar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="built-in-layers"&gt;Built-in layers&lt;span class="hx:absolute hx:-mt-20" id="built-in-layers"&gt;&lt;/span&gt;
&lt;a href="#built-in-layers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm ships three layers, &lt;code&gt;desktop&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;nix&lt;/code&gt;. You choose them like any other layer, in the list devvm shows for a new VM or as in &lt;code&gt;devvm --layers docker&lt;/code&gt;, and you build one with &lt;code&gt;devvm build nix&lt;/code&gt;. To give every new VM one, choose it with &lt;a href="https://next.devvm.dev/docs/using/settings/#layers-for-new-vms"&gt;&lt;code&gt;devvm setup --layers&lt;/code&gt;&lt;/a&gt;, and to give a VM you have one, run &lt;code&gt;devvm layer add&lt;/code&gt; (&lt;a href="#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;). Their names are reserved, so devvm refuses &lt;code&gt;devvm layer new docker&lt;/code&gt; and never reads a &lt;code&gt;desktop.sh&lt;/code&gt;, &lt;code&gt;docker.sh&lt;/code&gt; or &lt;code&gt;nix.sh&lt;/code&gt; of yours. The hosts that each layer needs are in its own &lt;a href="https://next.devvm.dev/docs/safety/network/#allowlists"&gt;allowlist&lt;/a&gt;.&lt;/p&gt;
&lt;h4 data-hextra-search-id="desktop"&gt;desktop&lt;span class="hx:absolute hx:-mt-20" id="desktop"&gt;&lt;/span&gt;
&lt;a href="#desktop" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;desktop&lt;/code&gt; layer installs an Xfce desktop with TigerVNC&amp;rsquo;s server, which &lt;a href="https://next.devvm.dev/docs/using/desktop/"&gt;&lt;code&gt;devvm desktop&lt;/code&gt;&lt;/a&gt; opens in Screen Sharing, and adds about 370 MB to the image. Its packages come from the distribution&amp;rsquo;s archive as it is when the layer builds, which on a base made &lt;code&gt;--from alpine&lt;/code&gt; means Alpine&amp;rsquo;s own packages, and they aren&amp;rsquo;t pinned. It needs no hosts of its own on the allowlist tier, and a VM without the layer has no desktop.&lt;/p&gt;
&lt;h4 data-hextra-search-id="docker"&gt;docker&lt;span class="hx:absolute hx:-mt-20" id="docker"&gt;&lt;/span&gt;
&lt;a href="#docker" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;docker&lt;/code&gt; layer installs Docker&amp;rsquo;s engine, CLI, BuildKit and Compose from Docker&amp;rsquo;s apt repository, adds the VM&amp;rsquo;s user to the &lt;code&gt;docker&lt;/code&gt; group, and starts the daemon at each boot. On a base made &lt;code&gt;--from alpine&lt;/code&gt;, it installs Alpine&amp;rsquo;s own packages instead. A VM without the layer has no Docker.&lt;/p&gt;
&lt;p&gt;A VM with the layer can be on any network tier like any other, because its containers&amp;rsquo; connections go through the VM&amp;rsquo;s network, which devvm confines from outside the VM (&lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tiers&lt;/a&gt;). devvm gives every container the VM&amp;rsquo;s proxy settings, and on a confined tier, a container that ignores them, or was made without them through Docker&amp;rsquo;s API, reaches the hosts the VM&amp;rsquo;s rules allow by name through &lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt;, on Docker&amp;rsquo;s default bridge and on networks that &lt;code&gt;docker network create&lt;/code&gt; and Compose make. Such a container doesn&amp;rsquo;t trust the VM&amp;rsquo;s CA, so a blocked HTTPS host gives it a certificate error rather than the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt;, and the block is logged all the same. A container run with &lt;code&gt;--network none&lt;/code&gt;, or on an &lt;code&gt;--internal&lt;/code&gt; network, reaches nothing.&lt;/p&gt;
&lt;h4 data-hextra-search-id="nix"&gt;nix&lt;span class="hx:absolute hx:-mt-20" id="nix"&gt;&lt;/span&gt;
&lt;a href="#nix" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;nix&lt;/code&gt; layer installs &lt;a href="https://nixos.org" target="_blank" rel="noopener"&gt;Nix&lt;/a&gt; with flakes and the &lt;code&gt;nix&lt;/code&gt; command turned on, and &lt;a href="https://direnv.net" target="_blank" rel="noopener"&gt;direnv&lt;/a&gt; with &lt;a href="https://github.com/nix-community/nix-direnv" target="_blank" rel="noopener"&gt;nix-direnv&lt;/a&gt;, so a project&amp;rsquo;s &lt;code&gt;flake.nix&lt;/code&gt;, &lt;code&gt;shell.nix&lt;/code&gt; or &lt;code&gt;devenv.nix&lt;/code&gt; can supply its toolchain. Each VM has a Nix store and daemon of its own, which no other VM and nothing on this machine shares. VMs share their downloads from Nix&amp;rsquo;s binary cache through a cache on this machine that only devvm fills. &lt;a href="https://next.devvm.dev/docs/using/toolchains/#nix-projects"&gt;Nix projects&lt;/a&gt; explains that cache, and how a flake&amp;rsquo;s dev shell and the shared tools work together.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;nix&lt;/code&gt; layer works on a base from Ubuntu, Debian or Alpine. On a base made &lt;code&gt;--from alpine&lt;/code&gt;, it installs Alpine&amp;rsquo;s &lt;code&gt;xz&lt;/code&gt; package, which isn&amp;rsquo;t pinned, and runs Nix&amp;rsquo;s daemon as an OpenRC service.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-layers-to-a-vm"&gt;Adding layers to a VM&lt;span class="hx:absolute hx:-mt-20" id="adding-layers-to-a-vm"&gt;&lt;/span&gt;
&lt;a href="#adding-layers-to-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM keeps the layers devvm made it with, because a layer&amp;rsquo;s script changes the VM&amp;rsquo;s disk. &lt;code&gt;devvm layer add LAYER...&lt;/code&gt; gives a VM more layers by making it again. devvm builds an image with the new layers on top of the VM&amp;rsquo;s own, in the order you give them, and gives the VM a new disk, copied from that image. A VM of &lt;code&gt;docker&lt;/code&gt; with &lt;code&gt;desktop&lt;/code&gt; added is made again from &lt;code&gt;docker+desktop&lt;/code&gt;, so the images it already uses stay as they are. devvm names the layers the VM has already and leaves them where they are, and when the VM has all of them, devvm says so and changes nothing.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer add desktop &lt;span class="c1"&gt;# make this folder&amp;#39;s VM again with the desktop layer on top&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer add docker nix &lt;span class="c1"&gt;# docker, then nix on top of it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer add desktop --force &lt;span class="c1"&gt;# the same without asking, as a script must&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Everything on the VM&amp;rsquo;s disk that devvm doesn&amp;rsquo;t keep is lost, so in a terminal devvm names the image and asks first, with no as the default. Without a terminal, it refuses unless you give &lt;code&gt;--force&lt;/code&gt;. When the VM has a coding agent, devvm first exports the agents&amp;rsquo; history, as &lt;code&gt;devvm rm&lt;/code&gt; does, unless you give &lt;code&gt;--no-export&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;history&lt;/a&gt;). In a subfolder of a folder with a VM, devvm asks in a terminal whether to make that folder&amp;rsquo;s VM again, and refuses without one.&lt;/p&gt;
&lt;p&gt;devvm refuses before it changes anything in these cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A name isn&amp;rsquo;t a layer, or is a shared tool&amp;rsquo;s name, which &lt;code&gt;devvm tools add&lt;/code&gt; adds instead.&lt;/li&gt;
&lt;li&gt;The VM&amp;rsquo;s backend can&amp;rsquo;t run one of the layers.&lt;/li&gt;
&lt;li&gt;The VM&amp;rsquo;s creation didn&amp;rsquo;t finish.&lt;/li&gt;
&lt;li&gt;The VM is a &lt;code&gt;--clone&lt;/code&gt; VM, whose clone of the repo is on its disk. To give a &lt;code&gt;--clone&lt;/code&gt; VM more layers, run &lt;code&gt;devvm clone off&lt;/code&gt;, which offers to fetch the clone&amp;rsquo;s work first, then &lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm clone on&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/clone/#switching-a-vm-that-exists"&gt;switching a VM that exists&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm then works in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It builds the new image, so a build that fails leaves the VM as it was.&lt;/li&gt;
&lt;li&gt;It exports the agents&amp;rsquo; history and saves the VM&amp;rsquo;s home folder on this machine.&lt;/li&gt;
&lt;li&gt;It stops the VM and sets its old disk aside under another name.&lt;/li&gt;
&lt;li&gt;It makes the VM again from the new image, with the same name and settings, and starts it.&lt;/li&gt;
&lt;li&gt;It copies the home folder onto the new disk and deletes the old disk, then opens a shell in the VM.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Until the new VM has started with its home folder, a step that fails, or Ctrl+C, deletes the new disk and puts the old one back as it was. While one devvm makes a VM again, another devvm that would make the same VM again refuses, and so does &lt;code&gt;devvm&lt;/code&gt; in its folder, so wait for the first to finish. While devvm makes the VM again, the old disk, the new one and the saved home folder take room on this machine at the same time, and devvm checks for free space before it starts.&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-a-vm-made-again-keeps"&gt;What a VM made again keeps&lt;span class="hx:absolute hx:-mt-20" id="what-a-vm-made-again-keeps"&gt;&lt;/span&gt;
&lt;a href="#what-a-vm-made-again-keeps" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm keeps the project folder, which is on this machine, the VM&amp;rsquo;s home folder, and everything it keeps for the VM:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The VM keeps its name, its shared tools, its size, its ports, its network tier and allowlist, its secrets&amp;rsquo; bindings, its SSH agent choice and its &lt;code&gt;.git&lt;/code&gt; protection.&lt;/li&gt;
&lt;li&gt;It keeps its links, group and published ports, its desktop&amp;rsquo;s password and port, and what its &lt;code&gt;devcontainer.json&lt;/code&gt; gave it. The commands in its &lt;code&gt;devcontainer.json&lt;/code&gt; that run once, such as &lt;code&gt;postCreateCommand&lt;/code&gt;, run again on the new disk.&lt;/li&gt;
&lt;li&gt;It keeps its identity, so &lt;a href="https://next.devvm.dev/docs/using/links/#which-vm-a-link-reaches"&gt;links&lt;/a&gt; to it still reach it. It gets new SSH host keys, which devvm pins as it does for any new VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm reads the home folder as the VM&amp;rsquo;s user before it stops the VM, and copies it onto the new disk before devvm&amp;rsquo;s own setup runs there. &lt;code&gt;--clean-home&lt;/code&gt; gives the VM the new image&amp;rsquo;s home folder instead. Some of the home folder stays behind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What other shells in the VM write after devvm reads the folder is lost, so close them first.&lt;/li&gt;
&lt;li&gt;A file that the new image puts in your home itself, such as &lt;code&gt;~/.bashrc&lt;/code&gt;, stays the image&amp;rsquo;s, so put shell settings of your own in a file of yours in &lt;code&gt;~/.bashrc.d&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;devvm leaves out what the new VM gets from devvm itself: &lt;code&gt;~/.config/devvm&lt;/code&gt;, &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;, the agents&amp;rsquo; logins, and the agents&amp;rsquo; folders and files that devvm links or copies from this machine. It leaves out &lt;code&gt;~/.cache&lt;/code&gt; too. It keeps opencode&amp;rsquo;s &lt;code&gt;~/.local/state/opencode/machine&lt;/code&gt;, which an export of the VM&amp;rsquo;s history leaves out, so the machines that opencode paired still trust the VM.&lt;/li&gt;
&lt;li&gt;Claude Code&amp;rsquo;s logins to MCP servers, which it keeps in its login file, don&amp;rsquo;t come along, so you log in to those servers again in the new VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mcp-servers-logins"&gt;MCP servers&amp;rsquo; logins&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm keeps only files, folders and symlinks, without setuid bits, and nothing from a filesystem mounted inside your home.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Everything else on the VM&amp;rsquo;s disk is lost:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the packages you installed with apt&lt;/li&gt;
&lt;li&gt;programs installed outside your home&lt;/li&gt;
&lt;li&gt;Docker&amp;rsquo;s images, containers and volumes&lt;/li&gt;
&lt;li&gt;the Nix store&lt;/li&gt;
&lt;li&gt;the processes that ran in it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When saving the home folder fails, devvm keeps the VM as it was, and &lt;code&gt;--clean-home&lt;/code&gt; goes ahead without it. With &lt;code&gt;--clean-home&lt;/code&gt;, opencode&amp;rsquo;s worktrees go with the home folder, so devvm checks them for uncommitted changes first and asks before they go, as &lt;code&gt;devvm rm&lt;/code&gt; does. &lt;code&gt;--no-worktree-check&lt;/code&gt;, which works only with &lt;code&gt;--clean-home&lt;/code&gt;, skips that check (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-remake-that-stops-halfway"&gt;A remake that stops halfway&lt;span class="hx:absolute hx:-mt-20" id="a-remake-that-stops-halfway"&gt;&lt;/span&gt;
&lt;a href="#a-remake-that-stops-halfway" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If devvm itself is killed while it makes a VM again, such as when this machine loses power, the VM&amp;rsquo;s state records the remake. The next &lt;code&gt;devvm&lt;/code&gt;, &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt;, &lt;code&gt;devvm update&lt;/code&gt;, &lt;code&gt;devvm clone on&lt;/code&gt; or &lt;code&gt;devvm clone off&lt;/code&gt; in the folder finishes it without asking. When the new VM already has its home folder, devvm only deletes the old disk. When the old disk is still set aside otherwise, devvm puts it back and makes the VM again from the start, and when it&amp;rsquo;s gone, devvm makes the new VM with the home folder it saved. Until then, other commands on the VM refuse and name &lt;code&gt;devvm&lt;/code&gt;, and &lt;code&gt;devvm rm&lt;/code&gt; deletes the VM together with its old disk.&lt;/p&gt;
&lt;h2 data-hextra-search-id="taking-layers-out-of-a-vm"&gt;Taking layers out of a VM&lt;span class="hx:absolute hx:-mt-20" id="taking-layers-out-of-a-vm"&gt;&lt;/span&gt;
&lt;a href="#taking-layers-out-of-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm layer rm LAYER...&lt;/code&gt; takes layers out of a VM by making it again, in the same way that &lt;code&gt;devvm layer add&lt;/code&gt; puts them in. devvm builds an image of the VM&amp;rsquo;s other layers, in the order they had, and gives the VM a new disk, copied from that image. A VM of &lt;code&gt;docker+nix+desktop&lt;/code&gt; without &lt;code&gt;nix&lt;/code&gt; is made again from &lt;code&gt;docker+desktop&lt;/code&gt;, and a VM without any of its layers is made again from &lt;code&gt;base&lt;/code&gt;. devvm names the layers that the VM doesn&amp;rsquo;t have and leaves them out, and when the VM has none of them, devvm says so and changes nothing.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer rm desktop &lt;span class="c1"&gt;# make this folder&amp;#39;s VM again without the desktop layer&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer rm docker nix &lt;span class="c1"&gt;# take out docker and nix&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer rm desktop --force &lt;span class="c1"&gt;# the same without asking, as a script must&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The VM keeps what &lt;a href="#what-a-vm-made-again-keeps"&gt;a VM made again keeps&lt;/a&gt;, its home folder included, and everything else on its disk is lost, such as what the layers you took out installed and Docker&amp;rsquo;s images. So devvm asks first in a terminal, with no as the default, and refuses without one unless you give &lt;code&gt;--force&lt;/code&gt;. It takes the same flags as &lt;code&gt;devvm layer add&lt;/code&gt; and works in the same steps. Before it changes anything, it refuses these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It refuses the same VMs as &lt;code&gt;devvm layer add&lt;/code&gt;, which are a &lt;code&gt;--clone&lt;/code&gt; VM, one whose creation didn&amp;rsquo;t finish, and one whose backend can&amp;rsquo;t run the layers left.&lt;/li&gt;
&lt;li&gt;It refuses &lt;code&gt;base&lt;/code&gt;, and a shared tool&amp;rsquo;s name, which &lt;code&gt;devvm tools rm&lt;/code&gt; takes out instead.&lt;/li&gt;
&lt;li&gt;It refuses a name that isn&amp;rsquo;t a layer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can still take out a layer of yours whose script you deleted, and that&amp;rsquo;s the one way to make such a VM again with its home folder and settings, because &lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; need every layer&amp;rsquo;s script to build the VM&amp;rsquo;s image.&lt;/p&gt;
&lt;h2 data-hextra-search-id="shared-tools"&gt;Shared tools&lt;span class="hx:absolute hx:-mt-20" id="shared-tools"&gt;&lt;/span&gt;
&lt;a href="#shared-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The toolchains and coding agents are shared tools, not image layers. A VM of any image can have them, in any mix, such as node and Claude Code on base, or go and Codex on &lt;code&gt;foo&lt;/code&gt;. A VM&amp;rsquo;s state lists its shared tools apart from its image. &lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;Toolchains&lt;/a&gt; lists the toolchains, with what each brings, and &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#supported-agents"&gt;supported agents&lt;/a&gt; lists the coding agents.&lt;/p&gt;
&lt;p&gt;devvm builds each tool version once and mounts it read-only into every VM that has it, so any mix of tools works without building anything new, and ten VMs with node share one copy of it. The builds are in &lt;code&gt;~/.local/share/devvm/tools&lt;/code&gt;. Each C library gets a build of its own, so when an Alpine VM and an Ubuntu VM both have node 24, &lt;code&gt;devvm images&lt;/code&gt; lists two builds of that version (&lt;a href="https://next.devvm.dev/docs/using/space/#shared-tools"&gt;what devvm keeps&lt;/a&gt;). An Alpine VM&amp;rsquo;s builds are only ever shared with VMs on the same container image, as &lt;a href="https://next.devvm.dev/docs/using/from/#shared-tools-and-glibc"&gt;shared tools and glibc&lt;/a&gt; explains. &lt;a href="https://mise.jdx.dev" target="_blank" rel="noopener"&gt;mise&lt;/a&gt; runs the tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;They work as usual.&lt;/strong&gt; Each toolchain&amp;rsquo;s commands, such as &lt;code&gt;npm i -g&lt;/code&gt; (into &lt;code&gt;~/.npm-global&lt;/code&gt;) or &lt;code&gt;go install&lt;/code&gt; (into &lt;code&gt;~/go/bin&lt;/code&gt;), work from any shell, including &lt;code&gt;bash -c&lt;/code&gt; from agents and from editors over SSH. Global installs go into your home, as &lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;each toolchain&amp;rsquo;s section&lt;/a&gt; says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A project&amp;rsquo;s own version files win.&lt;/strong&gt; A toolchain&amp;rsquo;s version files, such as &lt;code&gt;.nvmrc&lt;/code&gt; for node, pick its version, which installs into the VM the first time it&amp;rsquo;s used, and &lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;each toolchain&amp;rsquo;s section&lt;/a&gt; names its files. mise also reads a &lt;code&gt;mise.toml&lt;/code&gt; in the project folder, and devvm trusts it without asking, because the folder is yours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;They&amp;rsquo;re read-only.&lt;/strong&gt; A VM can&amp;rsquo;t change the shared tools, even as root. The tools can&amp;rsquo;t update themselves, and &lt;code&gt;rustup component add&lt;/code&gt; can&amp;rsquo;t change the shared toolchain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;They&amp;rsquo;re mounted, or the launch stops.&lt;/strong&gt; When one of a VM&amp;rsquo;s tools is missing or the VM can&amp;rsquo;t mount it, devvm stops the launch and names the tool, and the VM never downloads its own copy in its place (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-shared-tool-doesnt-mount"&gt;a shared tool doesn&amp;rsquo;t mount&lt;/a&gt;). Only the versions that a project&amp;rsquo;s own version files pick install into the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm doesn&amp;rsquo;t pin the tools&amp;rsquo; versions, because agents like Claude Code release several times a week. It follows the newest release of each tool, with Node 24 for node and opencode 2 for opencode. The first time a tool is needed, devvm looks up its newest release, which needs this machine to be online once. When it makes a new VM, devvm also checks for newer releases if its last check was more than a day ago, and &lt;code&gt;DEVVM_NO_TOOL_CHECK=1&lt;/code&gt; turns that check off.&lt;/p&gt;
&lt;p&gt;A new VM gets the tools chosen for it when devvm makes it, and keeps those versions. &lt;code&gt;devvm tools&lt;/code&gt; shows them, and in a terminal lets you choose them. &lt;code&gt;devvm tools add&lt;/code&gt;, &lt;code&gt;devvm tools rm&lt;/code&gt; and &lt;code&gt;devvm tools update&lt;/code&gt; change them too, as does the first step of &lt;code&gt;devvm update&lt;/code&gt;, and changing them never changes the VM&amp;rsquo;s disk (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;adding and removing tools&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="rebuilding"&gt;Rebuilding&lt;span class="hx:absolute hx:-mt-20" id="rebuilding"&gt;&lt;/span&gt;
&lt;a href="#rebuilding" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you edit a layer&amp;rsquo;s script, devvm builds that layer again the next time it&amp;rsquo;s used, together with every layer built on it, and it reuses the layers below. A new choice of base&amp;rsquo;s features rebuilds base and everything on it in the same way. To build an image again yourself:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rebuild base &lt;span class="c1"&gt;# base again from the newest packages (on Lima, the newest cloud image too)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rebuild docker &lt;span class="c1"&gt;# the docker layer again, on base as it is now&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm rebuild IMAGE&lt;/code&gt; builds an image again from its parent as the parent is now, where IMAGE is base or a stack of layers, such as &lt;code&gt;docker&lt;/code&gt; or &lt;code&gt;foo+bar&lt;/code&gt;. That&amp;rsquo;s how you get the newest packages that a script installs without a pin. On Lima, &lt;code&gt;devvm rebuild base&lt;/code&gt; also starts base again from the newest release of Ubuntu&amp;rsquo;s cloud image, which devvm otherwise picks only the first time it builds base on this machine. devvm also builds the images on it again, on the new image, the next time they&amp;rsquo;re needed. When there are such images, devvm lists them first and, in a terminal, asks before it goes on. After the build, devvm deletes the old images that no VM uses.&lt;/p&gt;
&lt;p&gt;Shared tools aren&amp;rsquo;t images, so &lt;code&gt;devvm rebuild&lt;/code&gt; refuses a shared tool&amp;rsquo;s name, and &lt;code&gt;devvm update&lt;/code&gt; and &lt;code&gt;devvm tools update&lt;/code&gt; get their newer versions. &lt;a href="https://next.devvm.dev/docs/internals/images/#rebuilding"&gt;Rebuilding&lt;/a&gt; explains how devvm tells which images to build again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="outdated-vms"&gt;Outdated VMs&lt;span class="hx:absolute hx:-mt-20" id="outdated-vms"&gt;&lt;/span&gt;
&lt;a href="#outdated-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM keeps the image it was made from. When that image, or one it&amp;rsquo;s built on, changes after an edited script, another choice of base&amp;rsquo;s features or a &lt;a href="#rebuilding"&gt;rebuild&lt;/a&gt;, the VM is outdated. devvm then warns on each launch, names the images that changed and &lt;code&gt;devvm update&lt;/code&gt;, and leaves the VM as it is.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm update &lt;span class="c1"&gt;# move the VM to the newest shared tools, and to its image&amp;#39;s new build after asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm update --force &lt;span class="c1"&gt;# the same without asking, as a script must&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm update --clean-home &lt;span class="c1"&gt;# the same, with the new image&amp;#39;s home folder&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm update&lt;/code&gt; brings this folder&amp;rsquo;s VM up to date in two steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It moves the VM to the newest shared tools, as &lt;code&gt;devvm tools update&lt;/code&gt; does, and that needs no question, because the shared tools aren&amp;rsquo;t part of the image and nothing on the VM&amp;rsquo;s disk changes (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;adding and removing tools&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;When the VM is outdated, devvm makes it again from its own image as it builds now, with the same layers, in the same way that &lt;code&gt;devvm layer add&lt;/code&gt; makes a VM again with more layers. devvm builds the image first, then gives the VM a new disk copied from it, and keeps its home folder, the project folder and its settings (&lt;a href="#what-a-vm-made-again-keeps"&gt;what a VM made again keeps&lt;/a&gt;). Everything else on its disk is lost, such as the packages you installed with apt and Docker&amp;rsquo;s images, so in a terminal devvm names the images that changed and asks first, with no as the default.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When the folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; changed since devvm made the VM, or is gone, or has appeared, devvm also makes the VM again, after asking, as the file says now (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/#updating-a-vm-from-the-file"&gt;updating a VM from the file&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;What &lt;code&gt;devvm update&lt;/code&gt; does in each case:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When only the shared tools are newer, devvm moves the VM to them and opens a shell in it without asking, because newer tools don&amp;rsquo;t need the VM made again.&lt;/li&gt;
&lt;li&gt;When you answer no, devvm keeps the VM with any newer shared tools it moved to, and opens a shell in it if there were some.&lt;/li&gt;
&lt;li&gt;Without a terminal, devvm refuses an outdated VM unless you give &lt;code&gt;--force&lt;/code&gt;, and it refuses before it changes anything, the VM&amp;rsquo;s shared tools included.&lt;/li&gt;
&lt;li&gt;When the VM has the newest shared tools and nothing it was made from has changed, devvm says that the VM is current and changes nothing. To make a current VM again with the newest packages that a script installs without a pin, run &lt;code&gt;devvm rebuild&lt;/code&gt; on its image first, which makes the VM outdated, then &lt;code&gt;devvm update&lt;/code&gt; (&lt;a href="#rebuilding"&gt;rebuilding&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;For a VM made with &lt;code&gt;--from&lt;/code&gt;, devvm tells whether the VM is outdated from the digest it last recorded, without looking anything up, so a moved tag shows only once a build has looked it up. When devvm makes the VM again, a tag that has moved gives the VM the container image&amp;rsquo;s newer version, and a pinned digest stays as it is (&lt;a href="https://next.devvm.dev/docs/using/from/#tags-and-digests"&gt;tags and digests&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#digests"&gt;digests&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;devvm update&lt;/code&gt; takes the same flags as &lt;code&gt;devvm layer add&lt;/code&gt;, and it refuses the same VMs, before it changes anything: a &lt;code&gt;--clone&lt;/code&gt; VM, one whose creation didn&amp;rsquo;t finish, and one whose backend can&amp;rsquo;t run its layers. It exports the agents&amp;rsquo; history first unless you give &lt;code&gt;--no-export&lt;/code&gt;, and &lt;code&gt;--clean-home&lt;/code&gt; gives the VM the new image&amp;rsquo;s home folder instead of its own. In a subfolder of a folder with a VM, devvm asks in a terminal whether to make that folder&amp;rsquo;s VM again, and refuses without one. The steps, and what happens when one fails, are those of &lt;a href="#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm tools update&lt;/code&gt; moves the VM to newer shared tools alone, and it never makes the VM again, even when the VM is outdated (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;adding and removing tools&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="listing-images"&gt;Listing images&lt;span class="hx:absolute hx:-mt-20" id="listing-images"&gt;&lt;/span&gt;
&lt;a href="#listing-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm images&lt;/code&gt; prints two tables, each with a header, and it shows what a row lacks as &lt;code&gt;-&lt;/code&gt;. The first table lists the images by name, with unfinished builds last:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;IMAGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its name, such as &lt;code&gt;base&lt;/code&gt; or &lt;code&gt;foo+bar&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FROM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what its base started from: the &lt;code&gt;--from&lt;/code&gt; image, or Ubuntu&amp;rsquo;s cloud image with its release&amp;rsquo;s date, &lt;code&gt;ubuntu 26.04 (20261001)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DIGEST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the first 12 hex digits of that image&amp;rsquo;s SHA-256&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;KEY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its key, which &lt;code&gt;devvm images rm&lt;/code&gt; also takes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STATE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;current&lt;/code&gt;, &lt;code&gt;stale&lt;/code&gt; when what it&amp;rsquo;s built from has changed since it was built, &lt;code&gt;unfinished&lt;/code&gt; for a build that didn&amp;rsquo;t finish, or &lt;code&gt;building&lt;/code&gt; while another devvm builds it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SIZE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the disk it takes, in powers of 1024 (&lt;code&gt;2.1G&lt;/code&gt;). On macOS an image is a clone of its parent&amp;rsquo;s disk, and the blocks they share count for both&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The second table lists the &lt;a href="#shared-tools"&gt;shared tools&lt;/a&gt; that devvm has built, by the name you choose them by, such as &lt;code&gt;node&lt;/code&gt; for node, pnpm and bun. The toolchains come first, then the agents, with each tool&amp;rsquo;s versions newest first:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a &lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;toolchain&lt;/a&gt;&amp;rsquo;s name, such as &lt;code&gt;node&lt;/code&gt;, or an agent&amp;rsquo;s, such as &lt;code&gt;claude&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TOOL&lt;/code&gt;, &lt;code&gt;VERSION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the tool and its version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LIBC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the C library (&lt;code&gt;gnu&lt;/code&gt;, or &lt;code&gt;musl&lt;/code&gt; for an Alpine base) that this build is for, because each gets a build of its own, or &lt;code&gt;-&lt;/code&gt; when devvm can&amp;rsquo;t tell&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SIZE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the disk it takes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;VMS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;how many VMs have it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STATE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;current&lt;/code&gt; for the version new VMs get, &lt;code&gt;in use&lt;/code&gt; for another version a VM has, &lt;code&gt;unused&lt;/code&gt; for neither, &lt;code&gt;not built&lt;/code&gt; for the current version of a tool devvm has other versions of, and &lt;code&gt;not installed&lt;/code&gt; when devvm has no version of it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;After the tables, devvm says on stderr how many images are stale or unfinished and how much disk the unused tools take, when there are any. It ends with the disk that the images and shared tools take together, and when the &lt;a href="https://next.devvm.dev/docs/using/toolchains/#nix-projects"&gt;shared Nix cache&lt;/a&gt; holds anything, the disk it takes of its cap. &lt;code&gt;devvm space&lt;/code&gt; shows the rest of what devvm keeps (&lt;a href="https://next.devvm.dev/docs/using/space/#devvm-space"&gt;what devvm keeps&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-images-json"&gt;devvm images &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-images-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-images-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm images --json&lt;/code&gt; prints the same as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes, and devvm still says the same on stderr. &lt;code&gt;images&lt;/code&gt; and &lt;code&gt;tools&lt;/code&gt; have the tables&amp;rsquo; columns as fields, with sizes in bytes, and a value an image lacks, such as an unfinished build&amp;rsquo;s name, is &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;. These fields go beyond the tables:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/backends/"&gt;backend&lt;/a&gt; that has the image or built the tool, &lt;code&gt;lima&lt;/code&gt;. Only a built tool has it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;digest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an image&amp;rsquo;s full SHA-256 of what its base started from&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sized&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether devvm knows an image&amp;rsquo;s size&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;built&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether devvm has built a tool image. Only a built one has &lt;code&gt;backend&lt;/code&gt; and &lt;code&gt;libc&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;total&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the disk the images and shared tools take together&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;unused_tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the part the unused tool images take&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nix_cache&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the shared Nix cache&amp;rsquo;s files, the disk they take and its cap&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;images&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;base&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;from&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;ubuntu 26.04 (20261001)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;digest&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;sha256:8eb876c2ccc4b6ff89e4a65d511815923b285e04503ba465809bf587f763da24&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;key&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;7a76021c46ef&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;state&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;current&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2254857830&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sized&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tools&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;node&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tool&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;node&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;24.11.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;built&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;libc&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;gnu&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;125829120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;vms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;state&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;current&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;total&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2380686950&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;unused_tools&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;nix_cache&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;files&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;cap&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10737418240&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="deleting-images"&gt;Deleting images&lt;span class="hx:absolute hx:-mt-20" id="deleting-images"&gt;&lt;/span&gt;
&lt;a href="#deleting-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm images rm IMAGE|KEY...&lt;/code&gt; deletes images. You name each one by its name or by the key that &lt;code&gt;devvm images&lt;/code&gt; shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A name means its image as it is now, on base from &lt;code&gt;--from&lt;/code&gt; when you give it. A stale or unfinished image has only its key.&lt;/li&gt;
&lt;li&gt;Each image must be built, or devvm deletes nothing. Shared tools aren&amp;rsquo;t images, so devvm refuses a name that has one, such as &lt;code&gt;node+foo&lt;/code&gt;, and &lt;code&gt;devvm gc&lt;/code&gt; deletes the shared tools no VM has.&lt;/li&gt;
&lt;li&gt;devvm also deletes nothing while another devvm is building one of the images, so run the command again once that build ends. &lt;code&gt;devvm gc&lt;/code&gt; and &lt;code&gt;devvm rebuild&lt;/code&gt; leave such an image alone too.&lt;/li&gt;
&lt;li&gt;A deleted image is built again the next time it&amp;rsquo;s needed. VMs made from it keep working, because on macOS they&amp;rsquo;re clones of its disk. On Linux hosts, devvm refuses to delete an image whose disk VMs are overlays of, and names those VMs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="cleaning-up"&gt;Cleaning up&lt;span class="hx:absolute hx:-mt-20" id="cleaning-up"&gt;&lt;/span&gt;
&lt;a href="#cleaning-up" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc &lt;span class="c1"&gt;# stale and unfinished images, unused tools, old mise, the Nix cache over its cap&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --tool-images node &lt;span class="c1"&gt;# also node&amp;#39;s current builds that no VM has&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --history --older-than 30d &lt;span class="c1"&gt;# also the history exports written 30 days ago or more&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --orphans &lt;span class="c1"&gt;# also what&amp;#39;s left of VMs deleted outside devvm&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --caches &lt;span class="c1"&gt;# also devvm&amp;#39;s share of Lima&amp;#39;s caches&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm gc&lt;/code&gt; deletes four things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;what &lt;code&gt;devvm images&lt;/code&gt; lists as stale or unfinished&lt;/li&gt;
&lt;li&gt;the shared tools it lists as &lt;code&gt;unused&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;the older versions of the mise that devvm runs on this machine to look up the tools&amp;rsquo; versions, which an upgrade of devvm leaves behind, except one that changed in the last hour, because another devvm may be downloading it&lt;/li&gt;
&lt;li&gt;the &lt;a href="https://next.devvm.dev/docs/using/toolchains/#nix-projects"&gt;shared Nix cache&lt;/a&gt;&amp;rsquo;s least recently used files, while it takes more than its cap, the &lt;code&gt;nix-cache.size&lt;/code&gt; &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention setting&lt;/a&gt;, which is 10 GiB when it&amp;rsquo;s off&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;devvm&amp;rsquo;s mise and the shared Nix cache are both in &lt;code&gt;cache/&lt;/code&gt; in &lt;a href="https://next.devvm.dev/docs/using/space/#devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;/a&gt;, which holds only what devvm makes again when it needs it, so you can also delete that folder yourself at any time. gc lists them all first and, in a terminal, asks. Without a terminal, it deletes nothing unless you give &lt;code&gt;--force&lt;/code&gt;, which deletes without asking, in a terminal too. Its flags do more:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm gc --tool-images&lt;/code&gt; also deletes the current shared tools that no VM has, such as a toolchain you tried once, for every C library. &lt;code&gt;devvm gc --tool-images node claude&lt;/code&gt; deletes only those tools&amp;rsquo; builds, by the names you choose them by, so &lt;code&gt;node&lt;/code&gt; also covers pnpm and bun. A tool that a VM&amp;rsquo;s state lists stays, including a stopped VM&amp;rsquo;s, and a tool that no VM has goes however recently it was built.&lt;/li&gt;
&lt;li&gt;While devvm is making a VM, or giving one new shared tools through &lt;code&gt;devvm tools add&lt;/code&gt; or &lt;code&gt;devvm tools update&lt;/code&gt;, gc keeps every current shared tool that no VM has, names them, and deletes the rest of what it would, so run it again once that&amp;rsquo;s done. A devvm that starts to make a VM meanwhile waits for gc and says so, and in a terminal, gc makes it wait while gc asks you, so answer it first (&lt;a href="https://next.devvm.dev/docs/internals/images/#listing-and-cleaning-up"&gt;listing and cleaning up&lt;/a&gt;). A VM that has a deleted tool builds it again when it needs it.&lt;/li&gt;
&lt;li&gt;When a shared tool that a new VM&amp;rsquo;s state lists is gone before the VM&amp;rsquo;s first shell, for example because you deleted it by hand, devvm names the tools it couldn&amp;rsquo;t mount and stops, and the VM stays. Run &lt;code&gt;devvm tools update&lt;/code&gt; in the folder, which builds the missing tools again and opens the VM (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-shared-tool-doesnt-mount"&gt;a shared tool doesn&amp;rsquo;t mount&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm gc --history&lt;/code&gt; also deletes the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;exports&lt;/a&gt; of agents&amp;rsquo; history that &lt;code&gt;devvm history export&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; saved, which are the only copy of a deleted VM&amp;rsquo;s history, and &lt;code&gt;--older-than DURATION&lt;/code&gt; keeps those newer than that &lt;a href="https://next.devvm.dev/docs/using/command-line/#flags-and-values"&gt;duration&lt;/a&gt;, such as &lt;code&gt;12h&lt;/code&gt;, &lt;code&gt;30d&lt;/code&gt; or &lt;code&gt;2w&lt;/code&gt;. gc never deletes exports without &lt;code&gt;--history&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm gc --nix-cache&lt;/code&gt; also deletes the rest of the shared Nix cache. VMs download its packages again when they need them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm gc --orphans&lt;/code&gt; also deletes what devvm keeps for VMs that their backend no longer has, such as one you deleted with &lt;code&gt;limactl delete&lt;/code&gt; instead of &lt;code&gt;devvm rm&lt;/code&gt;, and with it the hold their state has on their shared tools (&lt;a href="https://next.devvm.dev/docs/using/space/#leftovers-of-a-vm-deleted-outside-devvm"&gt;leftovers&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm gc --caches&lt;/code&gt; then frees devvm&amp;rsquo;s share of Lima&amp;rsquo;s own caches, such as its downloads of Ubuntu&amp;rsquo;s cloud image, after asking, or without asking with &lt;code&gt;--force&lt;/code&gt;, which it needs without a terminal (&lt;a href="https://next.devvm.dev/docs/using/space/#limas-caches"&gt;Lima&amp;rsquo;s caches&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm gc --retention&lt;/code&gt; then applies the &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention settings&lt;/a&gt; at once, which devvm otherwise applies at most once a day. They&amp;rsquo;re all off until you set them.&lt;/li&gt;
&lt;li&gt;When Lima can&amp;rsquo;t list its images while one of your VMs uses it, for example because Lima isn&amp;rsquo;t installed, gc warns and leaves Lima&amp;rsquo;s images, shared tools, VM leftovers and caches alone. It also leaves the shared tools whose record doesn&amp;rsquo;t name the backend that built them, because they may be Lima&amp;rsquo;s. gc still succeeds, so run &lt;code&gt;devvm doctor&lt;/code&gt; to see what&amp;rsquo;s wrong with Lima, then run gc again once it answers. &lt;code&gt;devvm images&lt;/code&gt; fails instead, because it lists all the images or none.&lt;/li&gt;
&lt;li&gt;gc never deletes your VMs, and it keeps current images, which &lt;code&gt;devvm images rm&lt;/code&gt; deletes (&lt;a href="#deleting-images"&gt;deleting images&lt;/a&gt;). It does delete, without asking, the build VMs that a killed or failed tools build left, which hold nothing of yours, and it names each one (&lt;a href="https://next.devvm.dev/docs/using/space/#vms-devvm-has-no-state-for"&gt;VMs devvm has no state for&lt;/a&gt;). Without &lt;code&gt;--tool-images&lt;/code&gt; it keeps the current shared tools. It always keeps every shared tool that any VM has, including a stopped VM&amp;rsquo;s and that of a VM deleted outside devvm whose state is left, until &lt;code&gt;--orphans&lt;/code&gt; deletes that state.&lt;/li&gt;
&lt;li&gt;On Linux hosts, a stale image whose disk VMs are overlays of stays, and devvm says which VMs use it.&lt;/li&gt;
&lt;li&gt;After an Alpine VM is gone, the shared tools built for Alpine are unused, unless you give gc that &lt;code&gt;--from&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/internals/images/#listing-and-cleaning-up"&gt;Images and caching&lt;/a&gt; has the details of what counts as current and unused. To see what gc would free before you run it, and what takes the rest of the space, run &lt;code&gt;devvm space&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/space/#devvm-space"&gt;what devvm keeps&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Tests</title><link>https://next.devvm.dev/docs/contributing/tests/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/tests/</guid><description>
&lt;h2 data-hextra-search-id="go-test-helpers"&gt;Go test helpers&lt;span class="hx:absolute hx:-mt-20" id="go-test-helpers"&gt;&lt;/span&gt;
&lt;a href="#go-test-helpers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every change to devvm&amp;rsquo;s logic comes with a test, and Go tests are table tests next to the code they test. Neither the Go tests nor the &lt;a href="#cli-tests"&gt;CLI tests&lt;/a&gt; touch the Keychain, real VMs or your own folders. A Go test that writes state points the XDG folders at &lt;code&gt;t.TempDir()&lt;/code&gt;, and a Go test makes VMs only on the fake backend, &lt;code&gt;backendtest&lt;/code&gt;. The CLI tests run the built devvm against the &lt;a href="#stubs"&gt;stubs&lt;/a&gt;, so only the &lt;a href="#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt; make real VMs. The Go tests share a few helpers, so each one reads the same way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;stubtest.New(t)&lt;/code&gt;&lt;/strong&gt; puts the &lt;a href="#stubs"&gt;stubs&lt;/a&gt; first on &lt;code&gt;PATH&lt;/code&gt; for one test, as the CLI tests have them, with a new folder under &lt;code&gt;/tmp&lt;/code&gt; as their &lt;code&gt;STUB_DIR&lt;/code&gt; and its &lt;code&gt;calls&lt;/code&gt; file as their &lt;code&gt;STUB_LOG&lt;/code&gt;. The folder goes when the test ends. &lt;code&gt;stubtest.New(t, &amp;quot;ssh&amp;quot;)&lt;/code&gt; puts only the stubs it names on &lt;code&gt;PATH&lt;/code&gt;, so the host&amp;rsquo;s other commands, such as git, stay. Its &lt;code&gt;Calls&lt;/code&gt; returns the calls the stubs logged, &lt;code&gt;Reset&lt;/code&gt; forgets them, and &lt;code&gt;Touch&lt;/code&gt;, &lt;code&gt;Write&lt;/code&gt; and &lt;code&gt;Read&lt;/code&gt; work on the files the stubs read, such as a switch, a file whose presence makes a stub fail. &lt;code&gt;VM&lt;/code&gt;, &lt;code&gt;Size&lt;/code&gt; and &lt;code&gt;VMs&lt;/code&gt; set and read Lima&amp;rsquo;s instances in the stubs&amp;rsquo; state, and &lt;code&gt;Keychain&lt;/code&gt; and &lt;code&gt;SetKeychain&lt;/code&gt; the Keychain&amp;rsquo;s items. &lt;code&gt;stubtest.Command(t, &amp;quot;mise&amp;quot;)&lt;/code&gt; returns the path of one stub, for a test that runs it by its path, as &lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt; does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;stubtest.Git(ctx, args...)&lt;/code&gt;&lt;/strong&gt; is plain git for a test&amp;rsquo;s own repo, and a test runs git only through it, which the structure test checks. Its environment is the test&amp;rsquo;s without git&amp;rsquo;s variables that pick a repo, its files or its config, such as &lt;code&gt;GIT_DIR&lt;/code&gt;, &lt;code&gt;GIT_WORK_TREE&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_PARAMETERS&lt;/code&gt; (&lt;code&gt;stubtest.GitEnv&lt;/code&gt;), and it reads no global or system config. A git that runs the tests, such as a hook&amp;rsquo;s or &lt;code&gt;git rebase --exec&lt;/code&gt;&amp;rsquo;s, sets some of those variables, and a test&amp;rsquo;s git that kept them would work on the checkout itself, writing its config and commits there. A test that runs something else that runs git, such as a script or a stub, calls &lt;code&gt;stubtest.NoGitRepo(t)&lt;/code&gt; first, which takes the same variables out of the test&amp;rsquo;s environment until it ends, and &lt;code&gt;stubtest.New&lt;/code&gt; calls it for the stubs. The CLI tests&amp;rsquo; environment leaves them out too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;stubtest.ExecRunner&lt;/code&gt;&lt;/strong&gt; is a backend&amp;rsquo;s runner that runs each command as it is, with no run log, so a backend under test runs the stubs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;msg.IDOf(err)&lt;/code&gt;&lt;/strong&gt; returns the ID of the message an error carries, or &amp;quot;&amp;quot; when it carries none, and &lt;strong&gt;&lt;code&gt;msg.NamesOf(err)&lt;/code&gt;&lt;/strong&gt; returns the message&amp;rsquo;s names, as names mode prints them, or the error&amp;rsquo;s own text when it isn&amp;rsquo;t a message. A test compares either with what it expects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;msg.Fake&lt;/code&gt;&lt;/strong&gt; is the &lt;code&gt;msg.Reporter&lt;/code&gt; a package under test prints and asks through. Its zero value is quiet: it prints nothing, has no terminal, so it refuses every question as the UI does where it can&amp;rsquo;t ask, and runs a logged command as it is. Its fields change that: &lt;code&gt;OnInfo&lt;/code&gt;, &lt;code&gt;OnWarn&lt;/code&gt; and the other &lt;code&gt;On&lt;/code&gt; funcs are given each message or question of their kind, with a question&amp;rsquo;s context going to &lt;code&gt;OnNote&lt;/code&gt; first, &lt;code&gt;OnAny&lt;/code&gt; every message, and &lt;code&gt;Terminal&lt;/code&gt;, &lt;code&gt;Picks&lt;/code&gt;, &lt;code&gt;Interrupt&lt;/code&gt; and the writers stand for the terminal, the picker, an interrupt and the output. &lt;code&gt;OnStatus&lt;/code&gt; is given each status line&amp;rsquo;s label and each logged command&amp;rsquo;s step, and &lt;code&gt;Showing&lt;/code&gt; returns the one showing now, for a test that checks slow work runs under its status line (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#status-lines"&gt;status lines&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;msg.Recorder&lt;/code&gt;&lt;/strong&gt; keeps the messages it&amp;rsquo;s given. Set a &lt;code&gt;msg.Fake&lt;/code&gt;&amp;rsquo;s &lt;code&gt;OnInfo&lt;/code&gt; or &lt;code&gt;OnWarn&lt;/code&gt; to the recorder&amp;rsquo;s &lt;code&gt;Add&lt;/code&gt;, then compare its &lt;code&gt;Names&lt;/code&gt; or its &lt;code&gt;IDs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;backendtest.Stored&lt;/code&gt;&lt;/strong&gt; is the fake backend with its disks on the host, for the free-space checks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s child in a test&amp;rsquo;s process&lt;/strong&gt; gets &lt;code&gt;IO&lt;/code&gt;&amp;rsquo;s &lt;code&gt;confine&lt;/code&gt;, a confinement that confines nothing (&lt;code&gt;noConfine&lt;/code&gt;), because &lt;code&gt;confineChild&lt;/code&gt; would confine the test&amp;rsquo;s whole process on Linux. &lt;code&gt;ChildMain&lt;/code&gt; uses &lt;code&gt;confineChild&lt;/code&gt; only when the field is nil, and &lt;code&gt;runChildOn&lt;/code&gt; refuses to start without one. A test of &lt;code&gt;confineChild&lt;/code&gt;&amp;rsquo;s own logic calls &lt;code&gt;confineWith&lt;/code&gt; with a confinement of its own. A test&amp;rsquo;s server made with &lt;code&gt;newServer&lt;/code&gt; looks up its names and connects in the test&amp;rsquo;s process, because &lt;code&gt;newChildServer&lt;/code&gt; gives it the broker itself. The tests that run the child over a real socketpair (&lt;code&gt;inProcess&lt;/code&gt;) send every lookup and connection through the broker instead, and a broker in a test connects through a seam of its own (&lt;code&gt;broker.net&lt;/code&gt;&amp;rsquo;s &lt;code&gt;connect&lt;/code&gt;) wherever it could reach the internet. &lt;code&gt;internal/landlock&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TestSelf&lt;/code&gt; runs the test binary again as a child that confines itself and logs what it could still do. It runs only without cgo (&lt;code&gt;CGO_ENABLED=0&lt;/code&gt;), as CI&amp;rsquo;s &lt;code&gt;nocgo&lt;/code&gt; job and a hand run on a Linux host do, and skips under the race detector, whose cgo keeps Go from reaching every thread. The CLI tests&amp;rsquo; devvm is built without cgo, so on Linux their VMs&amp;rsquo; proxies&amp;rsquo; children run confined too.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="goroutine-leaks"&gt;Goroutine leaks&lt;span class="hx:absolute hx:-mt-20" id="goroutine-leaks"&gt;&lt;/span&gt;
&lt;a href="#goroutine-leaks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A goroutine that outlives its test is one that would outlive its command in devvm, such as a tunnel the proxy carries after it has closed, or a goroutine that passes signals on after its child has ended. &lt;code&gt;internal/leaktest&lt;/code&gt; finds them in every package that starts goroutines: &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;vmssh&lt;/code&gt;, &lt;code&gt;daemon&lt;/code&gt;, &lt;code&gt;desktop&lt;/code&gt;, &lt;code&gt;ui&lt;/code&gt;, &lt;code&gt;vm&lt;/code&gt;, &lt;code&gt;backend/lima&lt;/code&gt;, &lt;code&gt;platform&lt;/code&gt;, &lt;code&gt;cli&lt;/code&gt;, &lt;code&gt;gitprotect&lt;/code&gt;, &lt;code&gt;vmlog&lt;/code&gt; and &lt;code&gt;memnet&lt;/code&gt;. It imports only the standard library, so the proxy&amp;rsquo;s and the daemon&amp;rsquo;s tests use it too.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;leaktest.Main(m)&lt;/code&gt;&lt;/strong&gt;, in a package&amp;rsquo;s &lt;code&gt;TestMain&lt;/code&gt;, runs the tests and, once they&amp;rsquo;ve passed, reads every goroutine&amp;rsquo;s stack. It gives the goroutines that are still ending, such as a closed listener&amp;rsquo;s accept loop, five seconds, then fails the test binary with the stacks of any still running. It leaves out the standard library&amp;rsquo;s own goroutines that outlive every test and that no test can end, which &lt;code&gt;allowed&lt;/code&gt; lists with why: &lt;code&gt;signal.Notify&lt;/code&gt;&amp;rsquo;s loop and an HTTP client&amp;rsquo;s idle connections. It then reads Go&amp;rsquo;s &lt;code&gt;goroutineleak&lt;/code&gt; profile, which names each goroutine blocked for good on a channel, a lock or a wait group that nothing still running can reach, and fails on any it names. A &lt;code&gt;TestMain&lt;/code&gt; that makes the test binary a helper process runs the helper first and calls &lt;code&gt;leaktest.Main&lt;/code&gt; last.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;leaktest.Check(t)&lt;/code&gt;&lt;/strong&gt;, called first in a test, fails that test when a goroutine started while it ran is still running once it has ended, its context cancelled and its cleanups run, after the same five seconds. It counts the goroutines the test started, and theirs, followed through those still running, so a test running in parallel doesn&amp;rsquo;t count. Nor does a goroutine that a server shared between tests starts for the test, such as a server that &lt;code&gt;TestMain&lt;/code&gt; or a &lt;code&gt;sync.Once&lt;/code&gt; started. That goroutine leads back to the server&amp;rsquo;s own goroutine, which ran before the test, and &lt;code&gt;Main&lt;/code&gt; finds such goroutines at the end. &lt;code&gt;Check&lt;/code&gt;&amp;rsquo;s failure names the test, where &lt;code&gt;Main&lt;/code&gt;&amp;rsquo;s names only the binary, so a test of something that starts and stops goroutines, such as a link session, the port forwarder or the desktop&amp;rsquo;s relay, calls it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Anything &lt;code&gt;Main&lt;/code&gt; or &lt;code&gt;Check&lt;/code&gt; finds is a leak to fix, with a test that fails without the fix. Only a goroutine that the standard library starts and that outlives every test goes in &lt;code&gt;allowed&lt;/code&gt;. A new package that starts goroutines gets a &lt;code&gt;main_test.go&lt;/code&gt; that calls &lt;code&gt;leaktest.Main&lt;/code&gt;, which the structure test checks, and the structure test also lists every goroutine devvm&amp;rsquo;s code starts, with what waits for it to end (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-structure-test"&gt;&lt;code&gt;goroutineSites&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="time-and-lifecycles"&gt;Time and lifecycles&lt;span class="hx:absolute hx:-mt-20" id="time-and-lifecycles"&gt;&lt;/span&gt;
&lt;a href="#time-and-lifecycles" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A test of a timeout, a grace or a close, such as the relay&amp;rsquo;s grace, the forwarder&amp;rsquo;s close or the proxy&amp;rsquo;s ClientHello deadline, runs in a &lt;a href="https://pkg.go.dev/testing/synctest" target="_blank" rel="noopener"&gt;&lt;code&gt;testing/synctest&lt;/code&gt;&lt;/a&gt; bubble, &lt;code&gt;synctest.Test(t, func(t *testing.T) { … })&lt;/code&gt;, rather than sleeping on the real clock. Inside the bubble, time is fake and moves only when every goroutine of the test is blocked, so &lt;code&gt;time.Sleep(30 * time.Second)&lt;/code&gt; returns at once, and &lt;code&gt;synctest.Wait()&lt;/code&gt; returns once every other goroutine has done what it can. Such a test takes no time, and a loaded CI machine can&amp;rsquo;t make it fail, so it never needs the margins a real-clock test does.&lt;/p&gt;
&lt;p&gt;A test checks that something happens at the moment it&amp;rsquo;s due and not a nanosecond before. It sleeps to just short of the moment, calls &lt;code&gt;synctest.Wait()&lt;/code&gt; and checks, then sleeps the last nanosecond and checks again. A goroutine that never ends fails the bubble as a deadlock, and a test of something that starts and stops goroutines calls &lt;a href="#goroutine-leaks"&gt;&lt;code&gt;leaktest.Check(t)&lt;/code&gt;&lt;/a&gt; before the bubble as well.&lt;/p&gt;
&lt;p&gt;Time moves only while each goroutine waits on something inside the bubble: a channel, a timer, &lt;code&gt;time.Sleep&lt;/code&gt;, a &lt;code&gt;sync.Cond&lt;/code&gt; or a wait group. A socket&amp;rsquo;s read, a process&amp;rsquo;s wait or any system call that blocks keeps it from moving, so the code under test gets seams. Like every test seam, each one is a field that a test sets to a stand-in in memory:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;internal/memnet&lt;/code&gt;&lt;/strong&gt; is a network in memory for tests. &lt;code&gt;memnet.Pipe()&lt;/code&gt; makes a connection, and a &lt;code&gt;memnet.Network&lt;/code&gt; holds listeners by address, whose &lt;code&gt;Listen&lt;/code&gt;, &lt;code&gt;Dial&lt;/code&gt; and &lt;code&gt;DialContext&lt;/code&gt; stand in for a socket&amp;rsquo;s. Its connections close their writing side alone (&lt;code&gt;CloseWrite&lt;/code&gt;), as TCP&amp;rsquo;s do and &lt;code&gt;net.Pipe&lt;/code&gt;&amp;rsquo;s don&amp;rsquo;t. They hold up to 64 KiB that the other end hasn&amp;rsquo;t read before a write waits, as a socket&amp;rsquo;s buffer does. They have deadlines on the bubble&amp;rsquo;s clock, and so do its listeners, through &lt;code&gt;SetDeadline&lt;/code&gt;. It uses only the standard library, so the proxy&amp;rsquo;s tests use it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The forwarder and the link sessions&lt;/strong&gt; take their listeners from their &lt;code&gt;Listen&lt;/code&gt; fields, so a test gives them a &lt;code&gt;memnet.Network&lt;/code&gt;&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The relays&lt;/strong&gt; carry each connection through an &lt;code&gt;sshRelay&lt;/code&gt;, whose &lt;code&gt;start&lt;/code&gt; field starts its &lt;code&gt;ssh -W&lt;/code&gt;. In production it&amp;rsquo;s &lt;code&gt;execSSH&lt;/code&gt;, and a test&amp;rsquo;s stand-in, &lt;code&gt;memSSH&lt;/code&gt;, is a VM in memory that sends what the test tells it and ends only when its context does, as &lt;code&gt;exec.CommandContext&lt;/code&gt; kills ssh.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&lt;/strong&gt; connects to the far ends through its egress&amp;rsquo;s &lt;code&gt;connect&lt;/code&gt; field, which &lt;code&gt;memServe&lt;/code&gt; points at a &lt;code&gt;memnet.Network&lt;/code&gt; while it serves the proxy on a listener in memory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;daemon.Proc&lt;/code&gt;&lt;/strong&gt; asks its &lt;code&gt;Alive&lt;/code&gt;, &lt;code&gt;Args&lt;/code&gt; and &lt;code&gt;Signal&lt;/code&gt; fields about its process, so a test of &lt;code&gt;Stop&lt;/code&gt; gives it a process table of its own (&lt;code&gt;fakeProc&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A test&amp;rsquo;s own HTTP server&lt;/strong&gt;, when the test sends the requests itself, is &lt;code&gt;httptest.NewTestServer&lt;/code&gt;&amp;rsquo;s, which serves in memory, and the test sends through its &lt;code&gt;Client()&lt;/code&gt;, which reaches it whatever the request&amp;rsquo;s host.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A stand-in can&amp;rsquo;t show what the real thing does with a kernel&amp;rsquo;s buffers, a real ssh or a real process, so each kind of lifecycle keeps one test that runs the real one, on the real clock: &lt;code&gt;TestPipeSSHGrace&lt;/code&gt;, &lt;code&gt;TestPipeSSHGraceSlowClient&lt;/code&gt; and &lt;code&gt;TestPipeSSHGraceWriteError&lt;/code&gt; run the relay with an ssh stand-in on &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;TestForwarderEndsStuckRelay&lt;/code&gt; closes a forward whose relay&amp;rsquo;s ssh never ends, &lt;code&gt;TestLinksBurst&lt;/code&gt; fills a link&amp;rsquo;s real Unix socket, &lt;code&gt;TestSpliceKeepsAnEarlyAnswer&lt;/code&gt; splices over TCP and &lt;code&gt;TestProcStop&lt;/code&gt; stops real processes. A new seam keeps the real test of its kind.&lt;/p&gt;
&lt;p&gt;The proxy&amp;rsquo;s tests that start a whole proxy, such as &lt;code&gt;TestMainRuns&lt;/code&gt; and &lt;code&gt;TestAgentRelay&lt;/code&gt;, run its child in the test&amp;rsquo;s process (&lt;code&gt;inProcess&lt;/code&gt;), on real sockets, so they can&amp;rsquo;t run in a bubble. Their broker waits &lt;code&gt;testStartWait&lt;/code&gt;, 30 seconds, for the child to say it&amp;rsquo;s ready, through &lt;code&gt;IO&lt;/code&gt;&amp;rsquo;s &lt;code&gt;startWait&lt;/code&gt; field, where devvm&amp;rsquo;s own proxy waits 4 seconds, and each test waits as long for the proxy to listen (&lt;code&gt;retryFor&lt;/code&gt;). Under the race detector on a loaded Linux host, those starts can take more than 4 seconds, most of it spent hashing the test&amp;rsquo;s executable, which each broker does as it starts, so a wait of 4 seconds would fail them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="cli-tests"&gt;CLI tests&lt;span class="hx:absolute hx:-mt-20" id="cli-tests"&gt;&lt;/span&gt;
&lt;a href="#cli-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;CLI tests are &lt;a href="https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript" target="_blank" rel="noopener"&gt;testscript&lt;/a&gt; scripts in &lt;code&gt;testdata/script/*.txtar&lt;/code&gt;, run by &lt;code&gt;internal/cli/script_test.go&lt;/code&gt; against a freshly built &lt;code&gt;devvm&lt;/code&gt;. Call it with &lt;code&gt;exec devvm …&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;# An unknown flag fails.
! exec devvm --nope
stderr &amp;#39;^devvm: flag_unknown command=devvm flag=--nope$&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Scripts see messages by their &lt;a href="https://next.devvm.dev/docs/contributing/cli/#names-mode"&gt;names&lt;/a&gt;, so the example checks which message devvm printed, not its wording. A script that checks a message&amp;rsquo;s text sets &lt;code&gt;env DEVVM_MESSAGES=&lt;/code&gt; first.&lt;/p&gt;
&lt;p&gt;Run one script with &lt;code&gt;mise exec -- go test ./internal/cli -run TestScript/&amp;lt;name&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Each script runs in a sandbox under &lt;code&gt;/tmp&lt;/code&gt;, never the real folders:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Points to&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;home/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;XDG_DATA_HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;data/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;config/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;LIMA_HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lima/&lt;/code&gt; (short, for Lima&amp;rsquo;s socket paths)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DATA&lt;/code&gt;, &lt;code&gt;VMS&lt;/code&gt;, &lt;code&gt;RUN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s data folder, &lt;code&gt;data/devvm/&lt;/code&gt;, and its &lt;code&gt;vms/&lt;/code&gt; and &lt;code&gt;run/&lt;/code&gt; folders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CFG&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s config folder, &lt;code&gt;config/devvm/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_MESSAGES&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;names&lt;/code&gt;, so messages print as their &lt;a href="https://next.devvm.dev/docs/contributing/cli/#names-mode"&gt;names&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_DIR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;stub/&lt;/code&gt;, for stubs&amp;rsquo; state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_LOG&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;stub/calls&lt;/code&gt;, the stubs&amp;rsquo; call log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm-test&lt;/code&gt;, the Keychain service name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UBUNTU_URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ubuntu/&lt;/code&gt;, with a dated release as Ubuntu signed it. Its cloud image is a gigabyte, so the sandbox has a stand-in for this host&amp;rsquo;s in &lt;code&gt;data/devvm/images/ubuntu/&lt;/code&gt;, named for its SHA-256 in the release&amp;rsquo;s checksums, as if devvm had downloaded it, and a script that tests the download or the import from Lima&amp;rsquo;s cache removes it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TOOL_SLOTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1, so tool images build one at a time and the stubs&amp;rsquo; calls keep their order, and &lt;code&gt;tools_side_by_side.txtar&lt;/code&gt; sets 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_KVM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;stub/kvm&lt;/code&gt;, a file standing in for Linux&amp;rsquo;s &lt;code&gt;/dev/kvm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_CPUS&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_MEMORY_GIB&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_FREE_GIB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;8, 16 and 500: a large host, whatever runs the tests (&lt;a href="https://next.devvm.dev/docs/contributing/testing/#a-host-of-any-size"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;mise&lt;/code&gt; stub, which resolves the shared tools in place of devvm&amp;rsquo;s own mise&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the stubs&amp;rsquo; folder, so devvm paste runs the clipboard stubs in place of the system&amp;rsquo;s tools, such as macOS&amp;rsquo;s &lt;code&gt;/usr/bin/osascript&lt;/code&gt;, and no script reaches the real clipboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MISE_STUB_LOCK&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;testdata/mise.lock&lt;/code&gt;, the lock the &lt;code&gt;mise&lt;/code&gt; stub writes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TOOLCHAINS&lt;/code&gt;, &lt;code&gt;AGENTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the toolchains&amp;rsquo; and the coding agents&amp;rsquo; names, in the registries&amp;rsquo; order and joined with spaces, as devvm&amp;rsquo;s messages list them, so a script that checks a list names no toolchain or agent itself (&lt;code&gt;stderr 'names='$TOOLCHAINS'$'&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_CHOICES&lt;/code&gt;, &lt;code&gt;LOGIN_AGENTS&lt;/code&gt;, &lt;code&gt;KEY_AGENTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every agent&amp;rsquo;s name, those that &lt;code&gt;devvm agent login&lt;/code&gt; logs in, and those with a key for each provider, in the registry&amp;rsquo;s order and joined with a comma and a space, as a message of choices lists them (&lt;code&gt;stderr 'choices='$AGENT_CHOICES' command='&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_BIN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder of the built &lt;code&gt;devvm&lt;/code&gt;, alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_REPO&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the checkout, for the scripts in &lt;code&gt;scripts/&lt;/code&gt;, which tests copy into a throwaway repo before running, and the scripts in &lt;code&gt;assets/&lt;/code&gt;, which tests source to check their pieces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_SSH_PORTS&lt;/code&gt;, &lt;code&gt;SANDBOX_PORT_NEXT&lt;/code&gt;, &lt;code&gt;SANDBOX_PORT_END&lt;/code&gt;, &lt;code&gt;DEVVM_PORT_RANGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the sandbox&amp;rsquo;s own ports, as the next paragraph says&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Each sandbox has a block of 160 ports of its own, between 10000 and 19999, below both the range devvm chooses ports from and the system&amp;rsquo;s ephemeral range, so neither a devvm that a script runs nor an outgoing connection takes one. The sandbox holds the block&amp;rsquo;s lock file in &lt;code&gt;/tmp/devvm-test-ports-&amp;lt;uid&amp;gt;/&lt;/code&gt;, a folder of your user&amp;rsquo;s alone, while it lasts, so no other sandbox has the same block, whether it&amp;rsquo;s in the same test process or in another one running at once, such as a second worktree&amp;rsquo;s gate. While every block is held, a new sandbox waits for one, up to 5 minutes. The block&amp;rsquo;s first 60 ports are for the scripts. The VMs&amp;rsquo; ssh ports (&lt;code&gt;DEVVM_SSH_PORTS&lt;/code&gt;) come first, and then the ports for &lt;code&gt;free_port VAR…&lt;/code&gt; and the fixtures. Each of those is taken in turn from &lt;code&gt;SANDBOX_PORT_NEXT&lt;/code&gt; up to &lt;code&gt;SANDBOX_PORT_END&lt;/code&gt;, and it&amp;rsquo;s free on every address, &lt;code&gt;127.0.0.1&lt;/code&gt; included, when it&amp;rsquo;s taken (&lt;code&gt;free_port -range FIRST LAST&lt;/code&gt; takes two in a row). The other 100 are the range the sandbox&amp;rsquo;s devvm chooses its VMs&amp;rsquo; proxy and desktop ports from (&lt;code&gt;DEVVM_PORT_RANGE&lt;/code&gt;, which only a test build reads), so two sandboxes&amp;rsquo; devvms never choose the same port.&lt;/p&gt;
&lt;p&gt;The built &lt;code&gt;devvm&lt;/code&gt; is a &lt;a href="https://next.devvm.dev/docs/contributing/testing/#test-builds"&gt;test build&lt;/a&gt;, so it reads the stand-ins above that a release ignores, such as &lt;code&gt;DEVVM_KVM&lt;/code&gt; and &lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt;. A script answers a question in one of two ways: &lt;code&gt;ttyin -stdin FILE&lt;/code&gt; gives the next &lt;code&gt;exec&lt;/code&gt; a terminal whose input is the file, so devvm asks as it does in yours, and &lt;code&gt;env DEVVM_PIPED_ANSWERS=1&lt;/code&gt; with &lt;code&gt;stdin FILE&lt;/code&gt; has each question read its answer as a line of the file instead, without its prompt. Without either, devvm has no terminal, so it refuses every question, as a script&amp;rsquo;s devvm does. It has the checkout&amp;rsquo;s &lt;code&gt;assets/&lt;/code&gt; embedded, as a release has, and no test build reads them from elsewhere: a script that needs other files for devvm (layers, features, policies) puts them in the user&amp;rsquo;s folders in the sandbox, as a user would.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$WORK&lt;/code&gt;, the script&amp;rsquo;s own folder, is the current folder. &lt;code&gt;project NAME&lt;/code&gt; makes the folder &lt;code&gt;$WORK/NAME&lt;/code&gt; and goes to it, as a project&amp;rsquo;s folder, and &lt;code&gt;project NAME git&lt;/code&gt; makes it a git repo too. Once devvm has made the folder&amp;rsquo;s VM, &lt;code&gt;vm_name VAR NAME&lt;/code&gt; finds it among the states in &lt;code&gt;$VMS&lt;/code&gt; and sets &lt;code&gt;$VAR&lt;/code&gt; to the VM&amp;rsquo;s name, which ends in an ID the test can&amp;rsquo;t know, so a script can pass it to a stub (&lt;code&gt;exec limactl stop $WEB&lt;/code&gt;). It also sets &lt;code&gt;$VAR_dir&lt;/code&gt; to the VM&amp;rsquo;s folder, &lt;code&gt;$VMS/&amp;lt;hash&amp;gt;&lt;/code&gt;, so a script reads the VM&amp;rsquo;s state as &lt;code&gt;$WEB_dir/vm.json&lt;/code&gt; and its network log as &lt;code&gt;$WEB_dir/logs/network.jsonl&lt;/code&gt;. &lt;code&gt;catg GLOB&lt;/code&gt; prints the one file a glob matches, and fails when the glob matches none or more than one, so a check never reads two files by mistake. &lt;code&gt;vm_state GLOB&lt;/code&gt; prints the one VM state a glob matches as sorted &lt;code&gt;KEY=VALUE&lt;/code&gt; lines for &lt;code&gt;stdout&lt;/code&gt; to match: a section&amp;rsquo;s fields are dotted (&lt;code&gt;net.on=true&lt;/code&gt;, &lt;code&gt;ports.host.ssh=23456&lt;/code&gt;), a list of strings is joined with spaces (&lt;code&gt;tools.names=node claude&lt;/code&gt;), a list of objects is indexed (&lt;code&gt;links.links.0.name=db&lt;/code&gt;), and anything but a string is JSON. Negated, &lt;code&gt;! catg GLOB&lt;/code&gt; and &lt;code&gt;! vm_name VAR NAME&lt;/code&gt; pass when there isn&amp;rsquo;t exactly one. &lt;code&gt;json_set GLOB KEY=VALUE…&lt;/code&gt; sets string fields in each JSON file the glob matches and keeps the rest, or makes the file when a glob without wildcards matches none. &lt;code&gt;KEY:=JSON&lt;/code&gt; sets any JSON value, and a dotted key sets a field of an object, which it makes when it&amp;rsquo;s missing. Scripts write devvm&amp;rsquo;s JSON records with it, such as a tool image&amp;rsquo;s record (&lt;code&gt;json_set $SHARE/node-*.json built=2020-01-01T00:00:00Z&lt;/code&gt;), because a record&amp;rsquo;s times are in the file, where &lt;code&gt;touch&lt;/code&gt; can&amp;rsquo;t change them. &lt;code&gt;renumber FILE&lt;/code&gt; changes a VM&amp;rsquo;s state as a boot that numbered the disks&amp;rsquo; devices anew leaves it, as macOS does. The folder&amp;rsquo;s identity and each &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s &lt;code&gt;git_id&lt;/code&gt; get another device, with their inodes and birth times as they were, and &lt;code&gt;$FOLDER_ID&lt;/code&gt; and &lt;code&gt;$GIT_ID&lt;/code&gt; hold the folder&amp;rsquo;s and its own &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s identities from before the change. &lt;code&gt;fixture VERSION&lt;/code&gt; puts a release&amp;rsquo;s state into the sandbox, and &lt;code&gt;json_superset [-shape] [-changes PATH] WANT GOT&lt;/code&gt; checks that one JSON file has everything another has, as &lt;a href="https://next.devvm.dev/docs/contributing/structure/#released-state"&gt;Released state&lt;/a&gt; says. A VM state a script writes as a fixture needs &lt;code&gt;version&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt;, &lt;code&gt;dir&lt;/code&gt; and &lt;code&gt;backend&lt;/code&gt;, &lt;code&gt;created&lt;/code&gt; for a VM whose creation finished, and a hash of its own for its folder (&lt;code&gt;json_set $VMS/12345612345601/vm.json version:=1 id=x name=devvm-live-12345612345601 image=base dir=/p/live backend=lima created=2020-01-01T00:00:00Z net.on:=false&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Tests never touch the network. Downloads are served from a test server (&lt;code&gt;net/http/httptest&lt;/code&gt;) or read from a &lt;code&gt;file://&lt;/code&gt; folder. &lt;code&gt;DEVVM_UBUNTU_URL&lt;/code&gt; replaces &lt;code&gt;https://cloud-images.ubuntu.com/releases/resolute&lt;/code&gt;, where devvm finds Ubuntu&amp;rsquo;s dated releases: point it at a folder of &lt;code&gt;release-YYYYMMDD/&lt;/code&gt; folders, each with its &lt;code&gt;SHA256SUMS&lt;/code&gt; and &lt;code&gt;SHA256SUMS.gpg&lt;/code&gt;, as &lt;code&gt;file:///path/to/folder&lt;/code&gt;. The CLI tests serve &lt;code&gt;internal/ubuntu/testdata/resolute&lt;/code&gt;, a release as Ubuntu published and signed it, and Go tests sign their own releases with a key they make (&lt;code&gt;internal/ubuntu/pgp_test.go&lt;/code&gt;). devvm&amp;rsquo;s own releases, which &lt;code&gt;devvm upgrade&lt;/code&gt; installs, come from &lt;code&gt;internal/upgrade/upgradetest&lt;/code&gt;: a TLS test server laid out as GitHub&amp;rsquo;s releases, with keys of the test&amp;rsquo;s own (&lt;code&gt;Signers&lt;/code&gt;, which &lt;code&gt;internal/minisign/minisigntest&lt;/code&gt; makes) that sign each release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; as minisign does, as a release is signed while releases bridge from the old release key: by CI&amp;rsquo;s and the co-signer&amp;rsquo;s keys, and by the old key. A script starts one with &lt;code&gt;release_server [-badsig] [-legacy|-keys] LATEST [VERSION...]&lt;/code&gt;, which serves a release of each version, the first the newest, each devvm in it a script that prints its version. &lt;code&gt;-legacy&lt;/code&gt; has only the old key sign them, as 0.1 and 0.2&amp;rsquo;s releases are, &lt;code&gt;-keys&lt;/code&gt; only the release keys, and &lt;code&gt;-badsig&lt;/code&gt; other keys. It points a test build at the server with &lt;code&gt;DEVVM_REPO_URL&lt;/code&gt;, at the release keys with &lt;code&gt;DEVVM_RELEASE_KEYS&lt;/code&gt;, as &lt;code&gt;ci=KEY cosign=KEY recovery=KEY&lt;/code&gt;, at the old key with &lt;code&gt;DEVVM_RELEASE_KEY&lt;/code&gt; and at its certificate with &lt;code&gt;DEVVM_RELEASE_CA&lt;/code&gt;, and &lt;code&gt;DEVVM_TEST_VERSION&lt;/code&gt; gives the test build a release&amp;rsquo;s version. Container registries (&lt;code&gt;--from&lt;/code&gt;) are a TLS test server in Go tests; scripts use pinned digests, which need no lookup, or set &lt;code&gt;HTTPS_PROXY&lt;/code&gt; to a closed port, so lookups fail as offline ones do.&lt;/p&gt;
&lt;p&gt;A command left running in the background (&lt;code&gt;exec devvm … &amp;amp;name&amp;amp;&lt;/code&gt;) can be interrupted with &lt;code&gt;kill -INT name&lt;/code&gt;. &lt;code&gt;wait_file FILE&lt;/code&gt; waits up to 60 seconds for a file to appear, such as one a stub writes when it gets somewhere, and fails at once when every background command has ended. For anything else, &lt;code&gt;wait_until SCRIPT&lt;/code&gt; runs &lt;code&gt;sh -c SCRIPT&lt;/code&gt; every 100 ms until it succeeds, for up to 90 seconds. It fails at once when every background command has ended, or when SCRIPT exits 100, which is how a check that can no longer succeed says so, as when it waits on a session that ended. Wait with these two rather than a loop of your own. A script that runs a copy of devvm makes it with &lt;code&gt;cp_exe SRC DST&lt;/code&gt;, not &lt;code&gt;cp&lt;/code&gt;: on Linux, a command another script starts while the copy is being written keeps the file open for writing until it runs, so running the copy then fails with &amp;ldquo;text file busy&amp;rdquo;, and &lt;code&gt;cp_exe&lt;/code&gt; writes the file while no command can start.&lt;/p&gt;
&lt;h3 data-hextra-search-id="stubs"&gt;Stubs&lt;span class="hx:absolute hx:-mt-20" id="stubs"&gt;&lt;/span&gt;
&lt;a href="#stubs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The stubs stand in for every host command devvm runs, so tests never run the real tools: &lt;code&gt;limactl&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;security&lt;/code&gt;, &lt;code&gt;ssh&lt;/code&gt;, &lt;code&gt;ssh-add&lt;/code&gt;, &lt;code&gt;ssh-agent&lt;/code&gt;, &lt;code&gt;ssh-keygen&lt;/code&gt;, &lt;code&gt;qemu-img&lt;/code&gt;, &lt;code&gt;qemu-system-aarch64&lt;/code&gt;, &lt;code&gt;qemu-system-x86_64&lt;/code&gt;, &lt;code&gt;chflags&lt;/code&gt;, &lt;code&gt;tmutil&lt;/code&gt;, &lt;code&gt;sw_vers&lt;/code&gt;, &lt;code&gt;uname&lt;/code&gt;, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;code&lt;/code&gt;, &lt;code&gt;mise&lt;/code&gt;, and the clipboard tools &lt;code&gt;wl-paste&lt;/code&gt;, &lt;code&gt;wl-copy&lt;/code&gt;, &lt;code&gt;xclip&lt;/code&gt;, &lt;code&gt;osascript&lt;/code&gt; and &lt;code&gt;pbcopy&lt;/code&gt;, which read a clipboard the test lays out in &lt;code&gt;$STUB_DIR&lt;/code&gt; (&lt;code&gt;clip-types&lt;/code&gt;, &lt;code&gt;clip&lt;/code&gt;, &lt;code&gt;clip-file&lt;/code&gt;) and write what&amp;rsquo;s copied to &lt;code&gt;$STUB_DIR/copied&lt;/code&gt;. They are one Go program, &lt;code&gt;internal/stubtest/stub&lt;/code&gt;, which does what the command it&amp;rsquo;s run as would do: the binary is named &lt;code&gt;stub&lt;/code&gt;, each command&amp;rsquo;s name is a link to it, and it reads its name from its &lt;code&gt;argv[0]&lt;/code&gt;. &lt;code&gt;internal/stubtest&lt;/code&gt; builds it once, into &lt;code&gt;$TMPDIR/devvm-stubs-&amp;lt;hash&amp;gt;&lt;/code&gt; with its links, where the hash covers the stub&amp;rsquo;s sources and Go&amp;rsquo;s version. Every test process, and every later run until the sources change, finds that folder and uses it, so the binary builds only once, and a folder of an older build is removed once it&amp;rsquo;s a day old. &lt;code&gt;TestScript&lt;/code&gt; puts that folder on &lt;code&gt;PATH&lt;/code&gt; right after &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s, ahead of the real commands.&lt;/p&gt;
&lt;p&gt;Each stub logs its call to &lt;code&gt;$STUB_LOG&lt;/code&gt; as one line, its name and its arguments joined by spaces. The stub writes the line itself, in one write to the log opened for appending, so lines from stubs running at once never mix, and its arguments never go to another process&amp;rsquo;s command line. That matters because endpoint security tools such as CrowdStrike Falcon kill a process whose arguments look like an ssh option next to a proxy URL with a password, which is what a start&amp;rsquo;s &lt;code&gt;limactl edit&lt;/code&gt; passes. &lt;code&gt;stub_calls&lt;/code&gt; prints the log for &lt;code&gt;stdout&lt;/code&gt; or &lt;code&gt;cmp&lt;/code&gt; to check, &lt;code&gt;! stub_calls&lt;/code&gt; fails if anything was logged, and &lt;code&gt;stub_reset&lt;/code&gt; empties the log, so the next check sees only the calls after it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;exec devvm …
stub_calls
cmp stdout calls
-- calls --
limactl list&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;uname&lt;/code&gt; and &lt;code&gt;sw_vers&lt;/code&gt; pretend to be another host when these are set, and run the real command otherwise:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Printed by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_UNAME_S&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;uname -s&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_UNAME_M&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;uname -m&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_SW_VERS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sw_vers -productVersion&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;What the stubs keep between their calls is their state, &lt;code&gt;$STUB_DIR/state.json&lt;/code&gt;, which &lt;code&gt;internal/stubtest/stubstate&lt;/code&gt; reads and writes as typed JSON under a file lock, so stubs running at once never lose each other&amp;rsquo;s changes. It holds Lima&amp;rsquo;s instances, each with its status, size and config, the Keychain&amp;rsquo;s items, the SSH agent and its keys, and Time Machine&amp;rsquo;s exclusions. Scripts read and change it with the &lt;code&gt;stub&lt;/code&gt; command, and Go tests with the &lt;code&gt;stubtest.Stubs&lt;/code&gt; methods &lt;code&gt;VM&lt;/code&gt;, &lt;code&gt;Size&lt;/code&gt;, &lt;code&gt;VMs&lt;/code&gt;, &lt;code&gt;Keychain&lt;/code&gt; and &lt;code&gt;SetKeychain&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub vm NAME STATUS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lima lists the instance &lt;code&gt;NAME&lt;/code&gt; in &lt;code&gt;STATUS&lt;/code&gt;, such as &lt;code&gt;Stopped&lt;/code&gt;, &lt;code&gt;Running&lt;/code&gt; or &lt;code&gt;Broken&lt;/code&gt;, with Lima&amp;rsquo;s default size when it&amp;rsquo;s new&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub vms&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints Lima&amp;rsquo;s instances, one &lt;code&gt;NAME STATUS&lt;/code&gt; line each, sorted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub size NAME CPUS MEMORY DISK&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gives an instance its size, with the memory and disk in bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub keychain ACCOUNT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints the Keychain&amp;rsquo;s item for &lt;code&gt;ACCOUNT&lt;/code&gt;, and fails when there&amp;rsquo;s none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub keychain-set ACCOUNT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;saves the item for &lt;code&gt;ACCOUNT&lt;/code&gt; from its input, so the value is in no process&amp;rsquo;s arguments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints the SSH agent&amp;rsquo;s keys as &lt;code&gt;ssh-add -l&lt;/code&gt; lists them, and fails when no agent runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub agent-stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stops the SSH agent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub names&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints every stub&amp;rsquo;s name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A switch is a file a test makes in &lt;code&gt;$STUB_DIR&lt;/code&gt; to change what a stub does, such as &lt;code&gt;start-fails&lt;/code&gt;, which makes &lt;code&gt;limactl start&lt;/code&gt; fail. The comment above each stub&amp;rsquo;s function lists its switches, and every switch is named for the command and what happens to it: &lt;code&gt;-fails&lt;/code&gt;, &lt;code&gt;-hangs&lt;/code&gt;, &lt;code&gt;-fails-on&lt;/code&gt; and &lt;code&gt;-waits-on&lt;/code&gt;, where an &lt;code&gt;-on&lt;/code&gt; switch holds the text that a call&amp;rsquo;s arguments must contain. A stub that hangs touches &lt;code&gt;$STUB_DIR/hanging&lt;/code&gt; first, so &lt;code&gt;wait_file&lt;/code&gt; can wait for it. The files a stub writes in &lt;code&gt;$STUB_DIR&lt;/code&gt; are what a test checks, such as &lt;code&gt;$STUB_DIR/sync.tar&lt;/code&gt;, what a VM&amp;rsquo;s setup was sent.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;limactl&lt;/code&gt; keeps its instances in the state and fails or hangs on request. It keeps each instance&amp;rsquo;s size and config as &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;clone&lt;/code&gt; and &lt;code&gt;edit&lt;/code&gt; set them, and a &lt;a href="https://next.devvm.dev/docs/contributing/testing/#tests-on-real-lima"&gt;contract test&lt;/a&gt; checks that it does so as real Lima does. Its &lt;code&gt;shell&lt;/code&gt; reaches the guest, the VM the stubs make believe in, which &lt;code&gt;ssh&lt;/code&gt; reaches too. One module, &lt;code&gt;guest.go&lt;/code&gt;, answers whatever devvm runs in a VM, with one set of switches whichever way devvm gets there. &lt;code&gt;limactl shell&lt;/code&gt; is also the shell devvm opens in a VM, which then ends, so a script sees it as devvm&amp;rsquo;s last call. In the shared tools&amp;rsquo; build VM, its &lt;code&gt;shell&lt;/code&gt; writes the images &lt;code&gt;build.sh&lt;/code&gt; is asked for into the build&amp;rsquo;s folder (or, on request, a symlink instead), and it keeps what a VM&amp;rsquo;s setup is sent as &lt;code&gt;$STUB_DIR/sync.tar&lt;/code&gt;. A base build&amp;rsquo;s packages go in as &lt;code&gt;$STUB_DIR/packages-in.tar&lt;/code&gt;, and what the build gives back is &lt;code&gt;$STUB_DIR/packages-out.tar&lt;/code&gt;, or no packages. In the &lt;code&gt;--from&lt;/code&gt; build VM, its &lt;code&gt;shell&lt;/code&gt; writes what &lt;code&gt;oci/build.sh&lt;/code&gt; would (or, on request, a hostile disk, command line, C library or symlink), and a call naming &lt;code&gt;$STUB_DIR/interrupt-on&lt;/code&gt;&amp;rsquo;s text interrupts devvm, as Ctrl+C would. The VM&amp;rsquo;s ssh host keys are one made-up key for each VM, unless &lt;code&gt;$STUB_DIR/hostkeys-fails&lt;/code&gt; exists.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;docker&lt;/code&gt; stands in only for what &lt;code&gt;--from&lt;/code&gt; asks of it. It has an image only when &lt;code&gt;$STUB_DIR/docker-image&lt;/code&gt; holds its ID, its &lt;code&gt;save&lt;/code&gt; writes a tarball naming that image (or &lt;code&gt;$STUB_DIR/docker-saved&lt;/code&gt;&amp;rsquo;s, a tag that moved), and it isn&amp;rsquo;t running when &lt;code&gt;$STUB_DIR/docker-down&lt;/code&gt; exists. &lt;code&gt;ssh&lt;/code&gt; answers a port forwarder&amp;rsquo;s master with &lt;code&gt;$STUB_DIR/guest-ports&lt;/code&gt;, and a link session&amp;rsquo;s master listens on its control socket. Either master outlives the process that started it, as ssh&amp;rsquo;s does, until the sandbox&amp;rsquo;s cleanup stops it or 5 minutes pass. A direct connection from a VM (the self-check&amp;rsquo;s) fails, as a confined VM&amp;rsquo;s does, unless &lt;code&gt;$STUB_DIR/net-direct&lt;/code&gt; exists. A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s git and its seed&amp;rsquo;s scripts run on the host, with real bash, git and tar, on &lt;code&gt;$STUB_DIR/vmfs/&amp;lt;folder&amp;gt;&lt;/code&gt;, and &lt;code&gt;ssh&lt;/code&gt; fetches from there (it fails with &lt;code&gt;$STUB_DIR/ssh-fails&lt;/code&gt;). A clone&amp;rsquo;s command fails, as any shell does, when &lt;code&gt;$STUB_DIR/shell-fails-on&lt;/code&gt; holds text its arguments hold, such as &lt;code&gt;index-pack&lt;/code&gt; for the seed&amp;rsquo;s apply. &lt;code&gt;security&lt;/code&gt; stands in for the Keychain and &lt;code&gt;tmutil&lt;/code&gt; for Time Machine, both keeping their items in the state, never in the real ones. &lt;code&gt;mise&lt;/code&gt; writes &lt;code&gt;$MISE_STUB_LOCK&lt;/code&gt; as the lock (&lt;code&gt;$MISE_STUB_OLDER_LOCK&lt;/code&gt; for a list of versions), lists &lt;code&gt;$MISE_STUB_VERSIONS&lt;/code&gt;, and fails like mise offline with &lt;code&gt;MISE_STUB_FAIL&lt;/code&gt; set. With &lt;code&gt;MISE_STUB_FAIL=404&lt;/code&gt;, it fails like mise when node&amp;rsquo;s newest version, and one of the older versions a step back locks together, have no musl download yet. A lock of named tools then adds only their entries, for the platforms it names, to the lock that&amp;rsquo;s there, and a lock naming &lt;code&gt;$MISE_STUB_OFFLINE_TOOL&lt;/code&gt; fails like mise offline. &lt;code&gt;chflags&lt;/code&gt; sets no flags, so &lt;code&gt;.git&lt;/code&gt; protection leaves test folders deletable. &lt;code&gt;qemu-img&lt;/code&gt; and QEMU are there so Linux hosts pass devvm&amp;rsquo;s checks.&lt;/p&gt;
&lt;p&gt;To add a stub, write its function in &lt;code&gt;internal/stubtest/stub&lt;/code&gt;, with a comment that says what it does and lists its switches, and add it to &lt;code&gt;stubs()&lt;/code&gt; under the command&amp;rsquo;s name. It logs its call with &lt;code&gt;c.log()&lt;/code&gt; first, keeps what it must remember in the state through &lt;code&gt;c.update&lt;/code&gt;, and reads its switches with &lt;code&gt;c.on&lt;/code&gt; and &lt;code&gt;c.text&lt;/code&gt;. A new command the state needs goes in &lt;code&gt;control&lt;/code&gt;. To add a switch, read it in the stub&amp;rsquo;s function, name it for what it does as above, and add it to that function&amp;rsquo;s comment. Each stub has unit tests in &lt;code&gt;stub_test.go&lt;/code&gt;, which run it in the test&amp;rsquo;s own process. Where a stub prints what devvm parses, such as &lt;code&gt;limactl list --json&lt;/code&gt;, the &lt;a href="https://next.devvm.dev/docs/contributing/testing/#golden-fixtures"&gt;golden fixtures&lt;/a&gt; check that it prints what the real tool prints.&lt;/p&gt;
&lt;p&gt;devvm runs in &lt;code&gt;$WORK&lt;/code&gt; or a folder made in it (&lt;code&gt;mkdir&lt;/code&gt;, then &lt;code&gt;cd&lt;/code&gt;), never in &lt;code&gt;HOME&lt;/code&gt; or devvm&amp;rsquo;s own folders, which it refuses as project folders.&lt;/p&gt;
&lt;h2 data-hextra-search-id="coverage"&gt;Coverage&lt;span class="hx:absolute hx:-mt-20" id="coverage"&gt;&lt;/span&gt;
&lt;a href="#coverage" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;mise run test&lt;/code&gt; measures each package&amp;rsquo;s test coverage, then fails when a package&amp;rsquo;s coverage is more than a point below its line in the baseline, so coverage only goes up. That point of room is there because the same tests can cover a little less from one run to the next, with timing or the tools a machine has installed. A package inside it passes and keeps its line. Each system has a baseline of its own, &lt;code&gt;testdata/coverage/darwin.txt&lt;/code&gt; and &lt;code&gt;testdata/coverage/linux.txt&lt;/code&gt;, because macOS and Linux run different code and skip different tests. On a system without one, &lt;code&gt;mise run test&lt;/code&gt; says so and checks nothing. A package&amp;rsquo;s coverage counts its own Go tests and the CLI tests together. &lt;code&gt;scripts/test.sh&lt;/code&gt; sets &lt;code&gt;CLI_GOCOVERDIR&lt;/code&gt;, so &lt;code&gt;TestScript&lt;/code&gt; builds &lt;code&gt;devvm&lt;/code&gt; with &lt;code&gt;-cover&lt;/code&gt; for every package of devvm&amp;rsquo;s, and each &lt;code&gt;devvm&lt;/code&gt; a script runs writes its counters to that script&amp;rsquo;s own folder inside it. Scripts run in parallel, and &lt;code&gt;devvm&lt;/code&gt; runs that started at the same moment in one folder would race to write the same meta-data file, so one of them would print &lt;code&gt;coverage meta-data emit failed&lt;/code&gt; on stderr and fail any script that checks it. &lt;code&gt;go tool covdata&lt;/code&gt; then merges every script&amp;rsquo;s folder with the Go tests&amp;rsquo; own counters. That way &lt;code&gt;internal/cli&lt;/code&gt;, and code that only the CLI tests reach, such as a backend&amp;rsquo;s real runner, count as tested. The end-to-end tests don&amp;rsquo;t count.&lt;/p&gt;
&lt;p&gt;When a change raises a package&amp;rsquo;s coverage, raise its baseline in the same commit. Run &lt;code&gt;mise run coverage&lt;/code&gt;, which runs the tests as &lt;code&gt;mise run test&lt;/code&gt; does, then writes each package&amp;rsquo;s coverage to this system&amp;rsquo;s baseline where it went up, and commit the file. A change that raises coverage on both systems raises both baselines, so run it on a &lt;a href="https://next.devvm.dev/docs/contributing/testing/#linux-hosts"&gt;Linux host&lt;/a&gt; too. It never lowers a line: a package within a point below its baseline keeps the line it has, and when a package is more than a point below, it fails and writes nothing. A new package gets its line from &lt;code&gt;mise run coverage&lt;/code&gt; too, and a package that&amp;rsquo;s gone loses its line there, because &lt;code&gt;mise run test&lt;/code&gt; fails on both until then. &lt;code&gt;coverage.txtar&lt;/code&gt; checks &lt;code&gt;scripts/coverage.sh&lt;/code&gt;, which compares the coverage with the baseline.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s no target percentage: a package is judged by what&amp;rsquo;s untested in it, not by its number.&lt;/p&gt;
&lt;h2 data-hextra-search-id="end-to-end-tests"&gt;End-to-end tests&lt;span class="hx:absolute hx:-mt-20" id="end-to-end-tests"&gt;&lt;/span&gt;
&lt;a href="#end-to-end-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;mise run e2e&lt;/code&gt; runs devvm against real VMs, so it needs Lima and takes minutes: run it in the background. It runs &lt;code&gt;TestE2E&lt;/code&gt; in &lt;code&gt;tests/e2e&lt;/code&gt;, with the run&amp;rsquo;s flags after &lt;code&gt;--&lt;/code&gt;. First it checks that this machine has every command the chosen sections use, and it names each one that&amp;rsquo;s missing with what installs it (&lt;a href="https://next.devvm.dev/docs/contributing/testing/#whats-platform-specific"&gt;the list&lt;/a&gt;). Then it builds &lt;code&gt;devvm&lt;/code&gt; from the checkout into its sandbox, its files embedded, and runs every check through that binary:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lima home&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.lt-e2e-go&lt;/code&gt; (or &lt;code&gt;$DEVVM_E2E_LIMA_HOME&lt;/code&gt;); it refuses &lt;code&gt;~/.lima&lt;/code&gt; and devvm&amp;rsquo;s own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/tmp/devvm-go-e2e&lt;/code&gt; (&lt;code&gt;XDG_DATA_HOME&lt;/code&gt;, &lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keychain&lt;/td&gt;
&lt;td&gt;service &lt;code&gt;devvm-go-e2e&lt;/code&gt; (&lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt;), fake tokens only, deleted at the end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lock&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/tmp/devvm-go-e2e.lock&lt;/code&gt;, a symlink to the pid of the run that holds it, so only one run uses the sandbox at a time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git identity&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GIT_AUTHOR_*&lt;/code&gt; and &lt;code&gt;GIT_COMMITTER_*&lt;/code&gt; of its own, so the harness&amp;rsquo;s commits and tags work on a machine with no git config, and yours never goes into them; devvm&amp;rsquo;s own git ignores them&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e &lt;span class="c1"&gt;# every section but desktop and from&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --from &lt;span class="c1"&gt;# every section, from too, and base with every feature: the longest&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --only images,gc &lt;span class="c1"&gt;# just these sections&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --clean &lt;span class="c1"&gt;# delete the sandbox&amp;#39;s cached images and tool images first&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --every-feature &lt;span class="c1"&gt;# base with every feature, as a run with from builds it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --slots &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="c1"&gt;# the sections spread over 3 sandboxes that run at once&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --slot &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="c1"&gt;# run in slot 1&amp;#39;s sandbox, its images as it has them&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --newest-base &lt;span class="c1"&gt;# base from Ubuntu&amp;#39;s newest image and packages, in a sandbox of its own&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --golden &lt;span class="c1"&gt;# also capture the stubs&amp;#39; golden fixtures from the real tools&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/contributing/testing/#end-to-end-tests-in-go"&gt;End-to-end tests in Go&lt;/a&gt; says how to run &lt;code&gt;go test&lt;/code&gt; yourself, write a check and add a section.&lt;/p&gt;
&lt;p&gt;A change that touches VMs passes the sections for what it changed, with &lt;code&gt;--only&lt;/code&gt;, and a run with &lt;code&gt;--only&lt;/code&gt; that names &lt;code&gt;from&lt;/code&gt; builds base with every feature, as &lt;code&gt;--from&lt;/code&gt; does. Before you merge a change to &lt;code&gt;assets/&lt;/code&gt; or to &lt;code&gt;--from&lt;/code&gt;, run &lt;code&gt;--from&lt;/code&gt;, because only it runs every section on base with every feature. GitHub&amp;rsquo;s hosted runners can&amp;rsquo;t run the end-to-end tests on macOS, so a Mac of your own runs them there.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--newest-base&lt;/code&gt; builds base as a user&amp;rsquo;s first build does, in place of the pinned release that the other runs use, and &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#checking-base-against-ubuntus-newest"&gt;Maintaining&lt;/a&gt; says when to run it and what to do when it fails. &lt;code&gt;--golden&lt;/code&gt; writes the &lt;a href="https://next.devvm.dev/docs/contributing/testing/#golden-fixtures"&gt;golden fixtures&lt;/a&gt; of this system into the checkout, for you to commit.&lt;/p&gt;
&lt;p&gt;The sections so far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;images&lt;/code&gt;: building base and fixture layers, rebuilds, a failed script and Ctrl+C during a build, then base&amp;rsquo;s recorded packages, each in the cache under its SHA-256, and base built again under the same key with &lt;code&gt;ubuntu-mirror&lt;/code&gt; set to an address nothing answers on, whose apt reads only the build&amp;rsquo;s own folder of packages.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;project&lt;/code&gt;: devvm in a new project folder (under &lt;code&gt;/tmp/devvm-go-e2e/p&lt;/code&gt;) makes a VM from base and opens a shell there, which reads its commands from devvm&amp;rsquo;s input. The folder and the shared tools are mounted and nothing else is, there&amp;rsquo;s no SSH agent, no Docker (no docker layer) and the hostname is the folder&amp;rsquo;s. The ssh config lists it as &lt;code&gt;devvm-web&lt;/code&gt; with its host keys pinned; through an &lt;code&gt;~/.ssh/config&lt;/code&gt; of the run&amp;rsquo;s own that includes it under a &lt;code&gt;Host *&lt;/code&gt; forwarding the agent, &lt;code&gt;ssh devvm-web&lt;/code&gt; works, forwards no agent (a throwaway one), and refuses a changed host key. &lt;code&gt;.git&lt;/code&gt; is locked (macOS) and git in the VM can still commit. &lt;code&gt;devvm stop&lt;/code&gt; stops it and drops its entry, and on macOS reports and locks a submodule git folder the VM added. With stand-in clipboard tools in &lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;, &lt;code&gt;devvm paste --json&lt;/code&gt; puts the copied image into the running VM&amp;rsquo;s paste folder, where its SHA-256 matches, mode 600 in a folder of mode 700, and the stand-in copier got the path; &lt;code&gt;devvm paste rm --force&lt;/code&gt; deletes it and leaves a file of the user&amp;rsquo;s; and a stopped VM is refused before the clipboard is read. &lt;code&gt;TestE2EExecQuoting&lt;/code&gt; in &lt;code&gt;internal/backend/registry&lt;/code&gt;, which runs only there (&lt;code&gt;DEVVM_E2E_VM&lt;/code&gt; names the VM), checks that arguments with spaces, quotes, &lt;code&gt;$&lt;/code&gt;, newlines and globs, a folder and input reach the guest as given, through the &lt;code&gt;Exec&lt;/code&gt; of the backend the VM&amp;rsquo;s state records, so one test covers every backend. Then a VM from a &lt;code&gt;devcontainer.json&lt;/code&gt;, with no ports by default: its &lt;code&gt;forwardPorts&lt;/code&gt; said and not forwarded, none reaching this machine, its &lt;code&gt;containerEnv&lt;/code&gt; in the shell and its commands, its &lt;code&gt;postCreateCommand&lt;/code&gt; run once in the folder, its &lt;code&gt;postStartCommand&lt;/code&gt; at each start (again after &lt;code&gt;devvm restart&lt;/code&gt;), nothing written to the folder, and a changed file warned about without changing the VM. Then a claude VM with a fake agent config, history, git identity and token in a home of its own: &lt;code&gt;devvm agent import&lt;/code&gt; copies the agent&amp;rsquo;s settings into the sandbox&amp;rsquo;s agent store without the history or the links out of its folder, naming each link it leaves out, and with &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;follow-links&lt;/code&gt; naming a dotfiles folder, it copies the skill folder a link leads to there as a folder, never a link, and still none of the links to a file outside it. The store&amp;rsquo;s folder is mounted read-only and linked into the VM&amp;rsquo;s home, the linked skill&amp;rsquo;s copy with it, which root can&amp;rsquo;t write either, and the home folder&amp;rsquo;s isn&amp;rsquo;t mounted, its settings are copied and its history isn&amp;rsquo;t, the VM gets the git identity, the timezone and its hostname, and, open as it is, the token&amp;rsquo;s placeholder and never the token. &lt;code&gt;devvm agent save&lt;/code&gt; without a terminal shows the VM&amp;rsquo;s changed &lt;code&gt;settings.json&lt;/code&gt; as a diff and its new &lt;code&gt;commands&lt;/code&gt; folder&amp;rsquo;s file, then refuses and saves nothing, and after a yes it saves both into the store, but neither the VM&amp;rsquo;s fake login beside them nor the folder&amp;rsquo;s link out of it. Then SSH agents, with a home of their own and throwaway keys: a &lt;code&gt;--ssh-agent&lt;/code&gt; VM uses a throwaway agent standing for yours; after &lt;code&gt;devvm ssh-agent add&lt;/code&gt; and &lt;code&gt;devvm ssh-agent devvm&lt;/code&gt; it keeps yours, in its shell and by name, until a restart, then uses only devvm&amp;rsquo;s own agent&amp;rsquo;s key, in its shells and by name; after &lt;code&gt;devvm ssh-agent off&lt;/code&gt;, none.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;clone&lt;/code&gt;: &lt;code&gt;--clone&lt;/code&gt; with a throwaway repo, and host git and devvm run with a home of the section&amp;rsquo;s own, so neither reads your &lt;code&gt;~/.ssh/config&lt;/code&gt; or your git settings, and the Include line isn&amp;rsquo;t offered. The VM has its own clone with every branch, even though the repo&amp;rsquo;s &lt;code&gt;url.*.insteadOf&lt;/code&gt; sends its URL elsewhere, only the shared tools are mounted, and its shell opens in the clone. The repo gets a &lt;code&gt;devvm&lt;/code&gt; remote named after the VM, and nothing of &lt;code&gt;.git&lt;/code&gt; is locked or watched. Without a terminal, &lt;code&gt;devvm rm --force&lt;/code&gt; refuses while the clone has commits that weren&amp;rsquo;t fetched and keeps the VM. Once &lt;code&gt;git fetch devvm&lt;/code&gt; through devvm&amp;rsquo;s ssh config has brought the VM&amp;rsquo;s commit, &lt;code&gt;devvm rm&lt;/code&gt; refuses for uncommitted changes in the clone, and then for those in a worktree in the clone, shown under its path, and &lt;code&gt;devvm rm --no-clone-check&lt;/code&gt; deletes the VM after a warning, the worktree&amp;rsquo;s change with it, and removes the remote, while the fetched work stays as a local branch. A git worktree&amp;rsquo;s VM gets a clone of only its branch and that branch&amp;rsquo;s upstream. On a VM that mounts its folder, &lt;code&gt;devvm clone on&lt;/code&gt; without a terminal is refused, and &lt;code&gt;devvm clone&lt;/code&gt; shows off. &lt;code&gt;devvm clone on --force&lt;/code&gt; then makes it again with its own clone of every branch, only the shared tools mounted and &lt;code&gt;.git&lt;/code&gt; unlocked, and it keeps its home and its ID. &lt;code&gt;devvm clone off --force&lt;/code&gt; without a terminal refuses while the clone has commits that weren&amp;rsquo;t fetched and keeps the clone, and once they&amp;rsquo;re fetched, it mounts the folder again with &lt;code&gt;.git&lt;/code&gt; protected, keeps the VM&amp;rsquo;s home and ID, removes the remote and leaves the work as a local branch. Last, &lt;code&gt;devvm --clone --repos all&lt;/code&gt; in a folder of repos gives one VM a clone of each repo at its path, with every branch, the folder&amp;rsquo;s own file, and nothing mounted but the shared tools. &lt;code&gt;devvm clone fetch&lt;/code&gt; brings both repos&amp;rsquo; work back and lists the branch with both repos, &lt;code&gt;devvm clone add&lt;/code&gt; copies a third repo into the VM at its path, with a remote, &lt;code&gt;devvm rm&lt;/code&gt; without a terminal refuses for the work in one repo that wasn&amp;rsquo;t fetched, naming that repo, and &lt;code&gt;devvm rm --no-clone-check&lt;/code&gt; deletes the VM and removes each repo&amp;rsquo;s remote. A repo with a detached &lt;code&gt;HEAD&lt;/code&gt;, an annotated tag, origin&amp;rsquo;s branches and an older VM&amp;rsquo;s remote gets a clone detached at the same commit, with the tag still annotated and origin&amp;rsquo;s branches, and none of the VM remote&amp;rsquo;s. The same repo&amp;rsquo;s staged, unstaged and intent-to-add changes and a tracked file turned into a folder give the same &lt;code&gt;git status&lt;/code&gt; in the VM, which has neither the untracked &lt;code&gt;.env&lt;/code&gt; nor the folder, and devvm names the folder. Its clone has origin&amp;rsquo;s URL, another remote&amp;rsquo;s https URL without the user and token it has here, a branch as far ahead of its upstream as here, and the repo&amp;rsquo;s &lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt;, which a commit there takes with no identity given, none of its credential settings, and its pre-commit hook, which runs there. &lt;code&gt;devvm clone fetch&lt;/code&gt; brings back a commit only the VM&amp;rsquo;s detached &lt;code&gt;HEAD&lt;/code&gt; has, as &lt;code&gt;saved/devvm/HEAD&lt;/code&gt;, and &lt;code&gt;devvm rm&lt;/code&gt; names another, but not the uncommitted changes copied in, which the VM left as they came. A repo whose rebase, started with &lt;code&gt;--autostash&lt;/code&gt;, stopped on a conflict, after a reset, with a stash of a plain entry and a &lt;code&gt;--all&lt;/code&gt; one, gets a clone in the same rebase, which &lt;code&gt;git rebase --continue&lt;/code&gt; finishes there, bringing the autostash back; its stash is the repo&amp;rsquo;s but for the &lt;code&gt;--all&lt;/code&gt; entry, which devvm names, the commit only the reset&amp;rsquo;s &lt;code&gt;ORIG_HEAD&lt;/code&gt; reached isn&amp;rsquo;t there, and &lt;code&gt;devvm rm&lt;/code&gt; names a stash entry the VM made, not the one copied in. A &lt;code&gt;blob:none&lt;/code&gt; clone of a small public repo, on the internet tier, gets a promisor clone whose git fetches a blob it lacks from the repo&amp;rsquo;s origin. Work in the VM that names another blob neither side has doesn&amp;rsquo;t come back, and &lt;code&gt;devvm clone fetch&lt;/code&gt; says so with &lt;code&gt;clone_fetch_partial&lt;/code&gt;, then brings it back once git in the VM has read the blob. Both checks are skipped when github.com can&amp;rsquo;t be reached. A repo with a submodule that has one of its own, both initialised, gets clones of them in the VM, where &lt;code&gt;git submodule status --recursive&lt;/code&gt; is as here; a VM commit in the submodule comes back into its repo here with &lt;code&gt;devvm clone fetch&lt;/code&gt;, and &lt;code&gt;devvm rm&lt;/code&gt; without a terminal names a commit in the nested one that wasn&amp;rsquo;t fetched, and keeps the VM. A repo that uses Git LFS, made without &lt;code&gt;git-lfs&lt;/code&gt; on this machine, has its LFS file&amp;rsquo;s content in the VM, whose &lt;code&gt;git status&lt;/code&gt; is clean, with git-lfs&amp;rsquo;s filter in the clone&amp;rsquo;s own config and not in the VM&amp;rsquo;s system or global config; a file the VM&amp;rsquo;s &lt;code&gt;git-lfs&lt;/code&gt; adds comes back with &lt;code&gt;devvm clone fetch&lt;/code&gt;, its object in the repo here, and an object in the VM that isn&amp;rsquo;t what its pointer names stays out, named with &lt;code&gt;clone_lfs_kept&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gc&lt;/code&gt;: a VM from a folder named &lt;code&gt;img-keep&lt;/code&gt;, which is named like an image, and a fixture layer edited after its build: &lt;code&gt;devvm gc&lt;/code&gt; deletes the stale image and its record and an old tool image no VM lists (once there&amp;rsquo;s a tools lock), and keeps base and the VM.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tools&lt;/code&gt;: first, the shared tools resolve to upstream&amp;rsquo;s newest versions, with devvm&amp;rsquo;s pinned mise (downloaded once), each download with its checksum. This section is the only one that uses the newest versions, and no other step checks for them (&lt;code&gt;DEVVM_NO_TOOL_CHECK&lt;/code&gt;). At the section&amp;rsquo;s end, e2e puts the pinned lock back. Then a node project&amp;rsquo;s VM: node, npm, pnpm, bun and yarn at the locked versions, each a read-only EROFS image, the share read-only even for root, &lt;code&gt;npm i -g&lt;/code&gt; into the VM&amp;rsquo;s home, a non-login shell over SSH, an &lt;code&gt;.nvmrc&lt;/code&gt;&amp;rsquo;s own version, the tools mounted at boot without devvm, and a second node VM that builds nothing. Last, a .NET project&amp;rsquo;s VM on the allowlist tier, chosen by its solution file: the shared SDK at the locked version from the share, a console project that restores a package from NuGet, builds and runs, &lt;code&gt;dotnet tool install -g&lt;/code&gt; into &lt;code&gt;~/.dotnet/tools&lt;/code&gt; with the tool run from a non-login shell, every toolchain&amp;rsquo;s environment and &lt;code&gt;PATH&lt;/code&gt; folders in a login shell and a non-login one, a workload installed into &lt;code&gt;~/.dotnet&lt;/code&gt;, nothing of it blocked, and a &lt;code&gt;global.json&lt;/code&gt;&amp;rsquo;s own SDK installed into the VM.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;network&lt;/code&gt;: a VM with Claude Code, Codex, opencode and pi and &lt;code&gt;--network allowlist&lt;/code&gt;, a fake token in devvm&amp;rsquo;s environment and a fake &lt;code&gt;~/.claude.json&lt;/code&gt; and Codex login in a home of its own, which &lt;code&gt;devvm agent import&lt;/code&gt; copies into the sandbox&amp;rsquo;s agent store, only yours to read. Its proxy runs and the self-check passed; its password was in no host process&amp;rsquo;s arguments while devvm launched it (&lt;code&gt;ps&lt;/code&gt;, sampled), and the guest has it; &lt;code&gt;ssh devvm-net&lt;/code&gt; reaches it; with transparent mode stopped, direct connections fail, even as root, to an address and to other ports, TCP to a public server&amp;rsquo;s port 53 included, and with it running a public DNS server and Lima&amp;rsquo;s DNS addresses answer only with the stand-in address, TTL 0, or nothing; an allowed host works and others, or other ports, are blocked; a line in the VM&amp;rsquo;s policy file that reads as a deny but isn&amp;rsquo;t a rule makes the running proxy refuse an allowed host, with no allow command in &lt;code&gt;devvm network log --blocked&lt;/code&gt;, &lt;code&gt;devvm network rm&lt;/code&gt; warns of it, and the host works again once it&amp;rsquo;s gone; with transparent mode stopped, DNS fails at once, &lt;code&gt;/etc/resolv.conf&lt;/code&gt; names &lt;code&gt;127.0.0.1&lt;/code&gt; alone, and Lima&amp;rsquo;s DNS addresses answer nothing. Transparent mode runs: its service, the stand-in address on &lt;code&gt;lo&lt;/code&gt; and dnsmasq and socat on that address alone; names with a dot resolve to it, a name without a dot to nothing, IPv6 has none at once, and &lt;code&gt;/etc/hosts&lt;/code&gt;&amp;rsquo; names keep theirs; curl without proxy settings and a static Go client with its own resolver reach github.com with its own certificate, logged &lt;code&gt;without proxy settings&lt;/code&gt;; a blocked host gets the &lt;code&gt;403&lt;/code&gt; over the VM&amp;rsquo;s CA; port 5432 of a name is refused at once and &lt;code&gt;devvm-why&lt;/code&gt; names it, while an IPv6 connection on loopback that works isn&amp;rsquo;t listed as refused; a port a rule names, on a TLS server on this machine, is redirected while the rule is there and refused at once after &lt;code&gt;devvm network rm&lt;/code&gt;; servers of the VM&amp;rsquo;s own bind &lt;code&gt;0.0.0.0:443&lt;/code&gt; and &lt;code&gt;:80&lt;/code&gt;; the service comes back when it&amp;rsquo;s killed or its table flushed; &lt;code&gt;devvm network transparent off&lt;/code&gt; takes it out at the next launch and &lt;code&gt;on&lt;/code&gt; puts it back. In a VM of the docker layer, containers without proxy settings reach github.com on the default bridge and on a network of their own, a blocked host is logged, no other port of the stand-in address answers them, a container&amp;rsquo;s published 5432 isn&amp;rsquo;t reached through the stand-in address from the VM or another container while its published 443 keeps the VM&amp;rsquo;s connections off it, and an &lt;code&gt;--internal&lt;/code&gt; network reaches nothing. The host&amp;rsquo;s loopback services are out of reach, directly or through the proxy. Behind the run&amp;rsquo;s company proxy on this machine&amp;rsquo;s loopback, named in the shell&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, the VM&amp;rsquo;s proxy sends an allowed host there by name and refuses a blocked one before it gets there. Then &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; names the same company proxy with its user alone, and the shell sets no proxy: the launch is refused until &lt;code&gt;devvm secret set proxy --stdin&lt;/code&gt; saves the password, and once it&amp;rsquo;s saved, the VM&amp;rsquo;s proxy config names the secret and holds no password, and the company proxy, which refuses any request without that password, carries GitHub. After each launch, the password is in no process&amp;rsquo;s arguments, in no log and nowhere in the guest, and after the &lt;code&gt;config.toml&lt;/code&gt; launch it isn&amp;rsquo;t in the VM&amp;rsquo;s proxy config either. The launch after that, with neither setting, goes directly. The section&amp;rsquo;s leak scan, run once its secrets are used and again at its end, looks for each company proxy&amp;rsquo;s password as it is, as a URL&amp;rsquo;s &lt;code&gt;user:password&lt;/code&gt;, as Basic&amp;rsquo;s base64 and as the whole &lt;code&gt;Proxy-Authorization&lt;/code&gt; value, in devvm&amp;rsquo;s logs, the VMs&amp;rsquo; proxies&amp;rsquo; logs and Lima&amp;rsquo;s. Before the section starts, it deletes any of its secrets that a killed run left behind. The proxy refuses requests without the VM&amp;rsquo;s password; the token is nowhere in the VM, which has its own CA and the next one, its own placeholder and logins&amp;rsquo; copies with placeholders only; the proxy puts the token in for its host (for the VM&amp;rsquo;s own placeholder only), an MCP server&amp;rsquo;s header and Codex&amp;rsquo;s key for theirs, over TLS the VM verifies; a second allowlist VM has CAs of its own, each VM trusts only its own and has no key, each proxy serves and presents only its own VM&amp;rsquo;s CAs, and &lt;code&gt;devvm rm&lt;/code&gt; deletes one VM&amp;rsquo;s CAs and leaves the other&amp;rsquo;s; the home folder&amp;rsquo;s and the store&amp;rsquo;s login files are unchanged. &lt;code&gt;devvm agent save&lt;/code&gt; saves the VM&amp;rsquo;s changed &lt;code&gt;~/.claude.json&lt;/code&gt; with the store&amp;rsquo;s MCP header in place of its placeholder, and once the VM changes that server&amp;rsquo;s URL it leaves the file out, so the store keeps the server as it was. &lt;code&gt;devvm secret set github --stdin&lt;/code&gt; saves a fake token (in the Keychain on macOS, under the run&amp;rsquo;s service, found through a link to &lt;code&gt;~/Library/Keychains&lt;/code&gt; in the VM&amp;rsquo;s home), read from a file so it&amp;rsquo;s in no process&amp;rsquo;s arguments, and &lt;code&gt;devvm secret&lt;/code&gt; lists it saved, while asking &lt;code&gt;devvm secret&lt;/code&gt; for a &lt;code&gt;get&lt;/code&gt; subcommand is refused without printing it; &lt;code&gt;secret use github&lt;/code&gt; binds it to the running proxy at once, and on the next launch the VM has its own placeholder in &lt;code&gt;GH_TOKEN&lt;/code&gt;, never the token, which the proxy puts in for &lt;code&gt;api.github.com&lt;/code&gt;; &lt;code&gt;secret unuse&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; take the binding and the token away. &lt;code&gt;TestE2ESelfCheck&lt;/code&gt; in &lt;code&gt;internal/netpolicy&lt;/code&gt; runs the self-check on the VM: it passes, then, once the VM is started outside devvm, it fails and stops the VM. &lt;code&gt;devvm stop&lt;/code&gt; stops the VM and its proxy at once. &lt;code&gt;devvm network open&lt;/code&gt; makes its next start direct, its proxy set in the guest and answering, and the open VM holds no real secret either: the token is nowhere in it, its environment and Codex&amp;rsquo;s login hold only its placeholders, its proxy puts the token in over TLS the VM verifies with its own CA, and a request that goes around the proxy carries only the placeholder and gets a 401 from the token&amp;rsquo;s host. Then &lt;code&gt;devvm network internet&lt;/code&gt; and &lt;code&gt;devvm network none&lt;/code&gt; change its tier at once, the VM running on. Restarted behind the run&amp;rsquo;s company proxy on this machine&amp;rsquo;s loopback, named in the shell&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt; with a fake password that the check reads from a file, the guest has the proxy and reaches GitHub through it, while devvm&amp;rsquo;s run logs hold the password only as &lt;code&gt;&amp;lt;password&amp;gt;&lt;/code&gt; and Lima&amp;rsquo;s &lt;code&gt;ha.stderr.log&lt;/code&gt; only as stars. &lt;code&gt;devvm network allowlist&lt;/code&gt; while it runs open shows it &lt;code&gt;unenforced&lt;/code&gt; until &lt;code&gt;devvm restart&lt;/code&gt; starts it confined; &lt;code&gt;devvm network open&lt;/code&gt; while it runs confined keeps it on its proxy until it next starts. Behind a company proxy of the run&amp;rsquo;s own that fakes OpenAI&amp;rsquo;s token endpoint with a certificate from the run&amp;rsquo;s CA, a login made in the VM is captured: the store gets the fake tokens and API key, and the VM gets placeholders. Then &lt;code&gt;devvm agent login codex&lt;/code&gt; runs the real Codex&amp;rsquo;s login in the VM, curl on this machine opens its callback with the state Codex&amp;rsquo;s address names, through the forward of &lt;code&gt;localhost:1455&lt;/code&gt;, devvm names the account the store saved, the VM&amp;rsquo;s Codex holds only placeholders, and the forward is gone once the login ends, and gone too after an interrupted login. &lt;code&gt;devvm agent login opencode --device-code&lt;/code&gt; runs the real opencode 2&amp;rsquo;s Codex device code login in the VM, which the fake endpoint answers too, devvm says the store saved the login, and &lt;code&gt;opencode auth export&lt;/code&gt; in the VM shows only placeholders. A second VM with opencode has &lt;code&gt;OPENCODE_DISABLE_AUTOUPDATE=1&lt;/code&gt; in its login shell, makes its database and imports a credential of its own, then &lt;code&gt;devvm agent login opencode --api-key --provider openrouter --stdin&lt;/code&gt; saves a fake key from the first VM, and at the second VM&amp;rsquo;s next launch its opencode has devvm&amp;rsquo;s entry with the key&amp;rsquo;s placeholder, never the key, beside its own credential, and once its database is deleted and made again, the next launch gives it the key&amp;rsquo;s placeholder again. With a local server&amp;rsquo;s fake key and a Copilot Enterprise login added to the store&amp;rsquo;s opencode login, its next launch warns that both are withheld, and neither the VM&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; nor its opencode holds the key or the tokens. Once &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt; lists both providers under &lt;code&gt;opencode&lt;/code&gt;, the launch notes the key as passed, the VM&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; and its opencode&amp;rsquo;s database have it, and the login&amp;rsquo;s tokens still stay out. pi runs in the network VM with &lt;code&gt;PI_SKIP_VERSION_CHECK=1&lt;/code&gt; and &lt;code&gt;PI_TELEMETRY=0&lt;/code&gt;, in a login shell and in a non-login &lt;code&gt;bash -c&lt;/code&gt; alike, and an install it can&amp;rsquo;t write to, and its policy reaches its catalog at &lt;code&gt;pi.dev&lt;/code&gt;. Its terminal UI, started in a terminal of &lt;code&gt;script&lt;/code&gt;&amp;rsquo;s, finds base&amp;rsquo;s &lt;code&gt;fdfind&lt;/code&gt; and &lt;code&gt;rg&lt;/code&gt; and downloads nothing into &lt;code&gt;~/.pi/agent/bin&lt;/code&gt;, while with a &lt;code&gt;PATH&lt;/code&gt; that has no &lt;code&gt;fdfind&lt;/code&gt; the same start downloads &lt;code&gt;fd&lt;/code&gt;, which shows the start reached that check. The same company proxy fakes Claude&amp;rsquo;s token endpoint and Anthropic&amp;rsquo;s API, which logs the token each request brings, or the &lt;code&gt;x-api-key&lt;/code&gt;: &lt;code&gt;devvm agent login pi --api-key --provider anthropic --stdin&lt;/code&gt; saves a fake key, the VM&amp;rsquo;s pi holds only its placeholder, and pi&amp;rsquo;s own request reaches the API with the key the proxy put in, which no log holds. The same company proxy fakes Groq&amp;rsquo;s API too, and &lt;code&gt;devvm agent login pi --api-key --provider groq --stdin&lt;/code&gt; saves a fake Groq key, the VM&amp;rsquo;s pi holds only its placeholder, and pi&amp;rsquo;s own request reaches Groq&amp;rsquo;s API with the key in its &lt;code&gt;Authorization&lt;/code&gt;, which no log holds. It fakes OpenAI&amp;rsquo;s API as well, and after &lt;code&gt;devvm agent login pi --api-key --provider openai --stdin&lt;/code&gt; saves a fake OpenAI key, the VM&amp;rsquo;s pi holds only its placeholder, which starts with &lt;code&gt;sk-&lt;/code&gt;, and pi&amp;rsquo;s own request reaches OpenAI&amp;rsquo;s API as an API key&amp;rsquo;s, asking for &lt;code&gt;max_output_tokens&lt;/code&gt;, with the key in its &lt;code&gt;Authorization&lt;/code&gt;, which no log holds. The same company proxy fakes Gemini&amp;rsquo;s API, and after &lt;code&gt;devvm agent login pi --api-key --provider google --stdin&lt;/code&gt; saves a fake Gemini key, the VM&amp;rsquo;s pi holds only its placeholder, and pi&amp;rsquo;s own request reaches Gemini&amp;rsquo;s API with the key in its &lt;code&gt;x-goog-api-key&lt;/code&gt; and no key in its URL, which no log holds. Then &lt;code&gt;devvm agent login opencode --api-key --provider groq --stdin&lt;/code&gt; saves a fake Groq key for opencode, the VM&amp;rsquo;s opencode holds only its placeholder, and the request that &lt;code&gt;opencode run&lt;/code&gt; makes reaches Groq&amp;rsquo;s API with the key in its &lt;code&gt;Authorization&lt;/code&gt;, which no log holds. Then &lt;code&gt;claude setup-token&lt;/code&gt;&amp;rsquo;s request, as curl, makes the fake token the &lt;code&gt;claude&lt;/code&gt; secret and gives the VM its placeholder, and the API gets the token for it, while the claude.ai connectors&amp;rsquo; host, &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt;, gets only the placeholder. The OAuth login&amp;rsquo;s placeholder also gets the token at the API, and the connectors&amp;rsquo; host gets only that placeholder too. &lt;code&gt;devvm agent login claude --setup-token&lt;/code&gt;, run in a terminal of its own (&lt;code&gt;script&lt;/code&gt; on macOS, Python&amp;rsquo;s &lt;code&gt;pty&lt;/code&gt; on Linux), shows Claude Code&amp;rsquo;s address there, and the check stops it before any login. Then &lt;code&gt;devvm agent login claude&lt;/code&gt; runs the real Claude Code&amp;rsquo;s &lt;code&gt;claude auth login&lt;/code&gt; in the VM, its code pasted on devvm&amp;rsquo;s input with the state its address names, the store keeps the fake login and the &lt;code&gt;claude&lt;/code&gt; secret is gone, the VM&amp;rsquo;s &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; holds only placeholders and its environment no token, and once the store&amp;rsquo;s access token is due, the VM&amp;rsquo;s next request makes the host refresh it at Claude&amp;rsquo;s endpoint through the company proxy. The refresh trusts the VM&amp;rsquo;s proxy&amp;rsquo;s CAs, the run&amp;rsquo;s among them, so it succeeds. The store keeps the refreshed login, the VM&amp;rsquo;s requests to the API and to &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; go on with the refreshed access token, and no log holds a value. &lt;code&gt;TestClaudeOAuthGet&lt;/code&gt; checks the refresh too. Last, a VM made with &lt;code&gt;--network learn&lt;/code&gt; runs on the internet tier, shown as &lt;code&gt;internet (learning)&lt;/code&gt;, and reaches example.com and example.org; &lt;code&gt;devvm network lock --json&lt;/code&gt; lists both, each with its port, and its next launch counts what it learned; &lt;code&gt;devvm network lock --all&lt;/code&gt; adds exactly the hosts it learned to its own rules and gives it the allowlist tier at once, the VM running on, so example.com still works on 443, while its port 80 and example.net get a &lt;code&gt;403&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;desktop&lt;/code&gt;: a VM of base has none of the desktop&amp;rsquo;s programs, and devvm desktop refuses it, naming the layer. &lt;code&gt;--layers desktop&lt;/code&gt; makes a VM of the desktop image, and devvm desktop serves its desktop on this machine&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; alone, keeping its port and its password from one run to the next. A viewer with a wrong password is refused, and one with the password gets the VM&amp;rsquo;s desktop. The VM&amp;rsquo;s server listens on its user&amp;rsquo;s own socket and on no TCP port, with the clipboard off, and the password is in no file of the VM&amp;rsquo;s, in no run log and in no host process&amp;rsquo;s arguments while devvm desktop starts. With network policy, the VM still reaches only its proxy and not the desktop&amp;rsquo;s port on this machine, the desktop&amp;rsquo;s browsers use the VM&amp;rsquo;s local proxy without a password, a blocked host still gets a &lt;code&gt;403&lt;/code&gt;, and the local proxy isn&amp;rsquo;t forwarded to this machine. When root in the VM runs a server of its own without a password, a viewer with a wrong password is still refused and one with the password gets in, and the refused viewer never reaches the VM, nor does the viewer&amp;rsquo;s clipboard, only its key event. Ctrl+C ends devvm desktop and closes its port, and &lt;code&gt;devvm desktop --clipboard&lt;/code&gt; starts the server again on the same port with the clipboard on, which a viewer with the password gets.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nix&lt;/code&gt;: the nix layer. A copy of &lt;code&gt;assets/layers/nix.sh&lt;/code&gt; as a layer of the run&amp;rsquo;s own, built behind a company proxy of the run&amp;rsquo;s own, reaches Nix&amp;rsquo;s releases through it and leaves no proxy settings for &lt;code&gt;nix-daemon&lt;/code&gt; (and not the company proxy&amp;rsquo;s password) anywhere on its image&amp;rsquo;s disk. Then a folder with &lt;code&gt;package.json&lt;/code&gt;, &lt;code&gt;flake.nix&lt;/code&gt; and &lt;code&gt;.envrc&lt;/code&gt; gets a VM with node on the nix layer (&lt;code&gt;--layers nix&lt;/code&gt;) on the allowlist tier: Nix and direnv at their pins, a store that&amp;rsquo;s root&amp;rsquo;s, &lt;code&gt;sandbox&lt;/code&gt; on with no fallback, &lt;code&gt;trusted-users&lt;/code&gt; root alone and an untrusted user&amp;rsquo;s &lt;code&gt;--option substituters&lt;/code&gt; ignored, &lt;code&gt;nix-daemon&lt;/code&gt; with the VM&amp;rsquo;s own proxy in devvm&amp;rsquo;s drop-in alone, &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; from Nix&amp;rsquo;s cache, a build in Nix&amp;rsquo;s sandbox, &lt;code&gt;sudo nix&lt;/code&gt; and &lt;code&gt;nix&lt;/code&gt; over ssh, the flake&amp;rsquo;s dev shell (nixpkgs at a pinned revision) loaded by direnv in an interactive shell, its &lt;code&gt;node&lt;/code&gt; ahead of the shared node prompt after prompt and gone outside the folder, nix-direnv&amp;rsquo;s cache in the VM&amp;rsquo;s home with no &lt;code&gt;.direnv&lt;/code&gt; in the folder, a fixed-output download from a host that isn&amp;rsquo;t allowed refused with &lt;code&gt;403&lt;/code&gt; and named by &lt;code&gt;devvm-why&lt;/code&gt;, and after &lt;code&gt;devvm network open&lt;/code&gt; and &lt;code&gt;devvm restart&lt;/code&gt;, no drop-in and no proxy for the daemon.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from&lt;/code&gt;: run with a &lt;code&gt;docker&lt;/code&gt; that isn&amp;rsquo;t running, so nothing comes from Docker. Its container images go by their pinned digests, as &lt;code&gt;node:24@sha256:…&lt;/code&gt;, so devvm looks them up nowhere, except the company proxy&amp;rsquo;s &lt;code&gt;alpine:3.21&lt;/code&gt;, which keeps its tag so that devvm&amp;rsquo;s registry lookup is checked too. A VM from &lt;code&gt;node:24&lt;/code&gt; with node, python and Claude Code on the docker and nix layers (Debian 12, in a home of its own) boots, with its base keyed by the pinned digest, its node, python and claude at the locked versions, GNU &lt;code&gt;tar&lt;/code&gt; as its commands find it, its tool images built in a clone of devvm&amp;rsquo;s own Ubuntu base when the run builds them, the docker layer&amp;rsquo;s Docker from Docker&amp;rsquo;s Debian repository, and the nix layer&amp;rsquo;s Nix under systemd running &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; and a build in Nix&amp;rsquo;s sandbox, then, after &lt;code&gt;devvm network allowlist&lt;/code&gt; and &lt;code&gt;devvm restart&lt;/code&gt;, transparent mode&amp;rsquo;s checks as the network section has them, and with its service stopped, Lima&amp;rsquo;s DNS and a public server answering nothing; a VM from &lt;code&gt;alpine:3&lt;/code&gt; with node and dotnet, which its &lt;code&gt;package.json&lt;/code&gt; and &lt;code&gt;global.json&lt;/code&gt; call for, on the docker, nix and desktop layers runs node and pnpm from musl tool images, and dotnet&amp;rsquo;s musl SDK with ICU, which makes and runs a console project, built in its own base and keyed and recorded by its digest, the docker layer&amp;rsquo;s Docker on OpenRC, the desktop layer&amp;rsquo;s programs from Alpine&amp;rsquo;s packages, with no crashed services, and the nix layer&amp;rsquo;s Nix as an OpenRC service, with &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; and a sandboxed build, then after &lt;code&gt;devvm network allowlist&lt;/code&gt; and &lt;code&gt;devvm restart&lt;/code&gt; transparent mode&amp;rsquo;s checks on OpenRC and musl, as for Debian 12, and a download only its daemon makes from a host that isn&amp;rsquo;t allowed refused with the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt;, and with GNU &lt;code&gt;tar&lt;/code&gt; as its commands find it, &lt;code&gt;devvm history import&lt;/code&gt; puts an export into it, while an export with a path outside the agents&amp;rsquo; history imports nothing there, and on a Linux host, given Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; with no mode chosen, &lt;code&gt;devvm mount-cache none&lt;/code&gt; gives it &lt;code&gt;none&lt;/code&gt; at its next start, through the restart that a remount Alpine refuses gets, which devvm&amp;rsquo;s portable check of the folder confirms; base builds from &lt;code&gt;ubuntu:26.04&lt;/code&gt;; and the build VM and its temporary folders are gone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;link&lt;/code&gt;: links between VMs, each check the end-to-end proof of a row of the threat check in &lt;a href="https://next.devvm.dev/docs/contributing/design/#links-between-vms"&gt;the design note&lt;/a&gt;. It runs devvm with a soft limit of 256 open files, macOS&amp;rsquo;s default, as the link sessions it starts get that limit too, and it makes two small open targets, each forwarding no port and running servers on its own &lt;code&gt;127.0.0.1&lt;/code&gt; (&lt;code&gt;/var/tmp/e2e-link.pl&lt;/code&gt;, in perl, which every base has), and a client that forwards every port. Each of the three reserves the link checks&amp;rsquo; ports (&lt;code&gt;ip_local_reserved_ports&lt;/code&gt;), so Linux never gives one to a connection&amp;rsquo;s own end, where a connection that just ended would hold it for a minute and a later server or &lt;code&gt;ssh -R&lt;/code&gt; couldn&amp;rsquo;t bind it. &lt;code&gt;sshd -T&lt;/code&gt; in each VM shows remote forwards allowed on &lt;code&gt;127.77.*:*&lt;/code&gt; alone, at the address the host asks for, and the client&amp;rsquo;s own Lima rules ignore every port. A port the target doesn&amp;rsquo;t publish is refused by &lt;code&gt;devvm link add&lt;/code&gt;, and once a port is published, &lt;code&gt;devvm link add&lt;/code&gt; on the running client reaches it within seconds as &lt;code&gt;NAME:PORT&lt;/code&gt; and &lt;code&gt;NAME.devvm.internal:PORT&lt;/code&gt;, by curl and by a raw TCP client (bash&amp;rsquo;s &lt;code&gt;/dev/tcp&lt;/code&gt;), while with &lt;code&gt;--as NAME&lt;/code&gt; the target&amp;rsquo;s folder name doesn&amp;rsquo;t resolve. Two targets on one port are each reached by their own name, port 80 is linked on port 80, &lt;code&gt;devvm link&lt;/code&gt; and &lt;code&gt;devvm link publish&lt;/code&gt; list what they hold with &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt; in their &lt;code&gt;--json&lt;/code&gt;, and &lt;code&gt;devvm network allowlist&lt;/code&gt; is refused for the client while it links to open targets. A published port that isn&amp;rsquo;t linked has nothing listening for it, &lt;code&gt;devvm link unpublish&lt;/code&gt; refuses the link&amp;rsquo;s next connection, logs it and names the client, and &lt;code&gt;devvm link rm&lt;/code&gt; takes the listener away within seconds. In the client, sshd listens only on its own port and the links&amp;rsquo; addresses, and nothing from a link listens on &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt; or every address, so this machine gets no forward of a link, while a server of the client&amp;rsquo;s own on &lt;code&gt;127.0.0.1&lt;/code&gt; with a link&amp;rsquo;s port is forwarded as usual. Each link&amp;rsquo;s socket is mode 600 in the run folder of mode 700, and the link session and every process it starts listen on no TCP port and connect only to the VMs&amp;rsquo; ssh ports. &lt;code&gt;ssh -R&lt;/code&gt; into the client binds nothing outside &lt;code&gt;127.77.0.0/16&lt;/code&gt; (&lt;code&gt;rfwd_links&lt;/code&gt;). A program in the client that holds a link&amp;rsquo;s address first fails that link alone with &lt;code&gt;link_port_taken&lt;/code&gt;, 256 connections at once, past the socket&amp;rsquo;s backlog of 128 on macOS, are all carried, and a 257th is refused and logged as &lt;code&gt;link_limit&lt;/code&gt;. Root in the client then loosens its sshd and the link session connects again: with &lt;code&gt;PermitListen any&lt;/code&gt; the client binds only the links&amp;rsquo; addresses, because the host asks for nothing else, and with &lt;code&gt;GatewayPorts yes&lt;/code&gt; too, the link session still listens on no TCP port of this machine and connects only to the VMs&amp;rsquo; sshd. &lt;code&gt;devvm network log&lt;/code&gt; shows the links&amp;rsquo; connections and refusals. A stopped target refuses the connection, logs &lt;code&gt;link_target_stopped&lt;/code&gt; and stays stopped, and the client&amp;rsquo;s launch warns of it. Once it&amp;rsquo;s restarted, the link works again. &lt;code&gt;devvm rm&lt;/code&gt; of the target removes the client&amp;rsquo;s link, names the client and removes its sockets, and a VM made again in that folder isn&amp;rsquo;t linked. Then the client and one target get the allowlist tier, the target while it runs. Until the target restarts, &lt;code&gt;devvm ls&lt;/code&gt; shows it &lt;code&gt;unenforced&lt;/code&gt;, the client&amp;rsquo;s next connection is refused and logged as &lt;code&gt;unenforced&lt;/code&gt; while the target&amp;rsquo;s server runs, and &lt;code&gt;devvm link add&lt;/code&gt; and the client&amp;rsquo;s launch warn of it (&lt;code&gt;link_target_unenforced&lt;/code&gt;). Once both have restarted, the client reaches its link by curl through its proxy settings and by a raw TCP client while a direct connection fails. A link added while the client runs is reached at once by curl through its proxy, by &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;CONNECT&lt;/code&gt;, with no link name in &lt;code&gt;NO_PROXY&lt;/code&gt; and the client&amp;rsquo;s boot and host keys unchanged, and the client&amp;rsquo;s proxy refuses names, ports and addresses that aren&amp;rsquo;t on its own list, while the target&amp;rsquo;s proxy refuses the client&amp;rsquo;s link name. &lt;code&gt;devvm link add&lt;/code&gt; refuses an open target, &lt;code&gt;devvm network open&lt;/code&gt; is refused for the target, and with the rule broken by hand in the target&amp;rsquo;s state the next connection is refused and the client&amp;rsquo;s launch warns and runs without the link until the rule holds again. In the &lt;code&gt;--from&lt;/code&gt; tier, an Alpine client reaches its link to port 80. &lt;code&gt;devvm rm&lt;/code&gt; of the client leaves no link session, socket, pid file, log or link state.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every section but &lt;code&gt;tools&lt;/code&gt; uses the shared tools&amp;rsquo; versions pinned in &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;, for both architectures&amp;rsquo; glibc and musl VMs, and the &lt;code&gt;--from&lt;/code&gt; checks start from container images pinned by digest in &lt;code&gt;tests/e2e/from_test.go&lt;/code&gt; (&lt;code&gt;fromNodeDigest&lt;/code&gt;, &lt;code&gt;fromAlpineDigest&lt;/code&gt; and &lt;code&gt;fromUbuntuDigest&lt;/code&gt;). The images built from them stay valid until a pin moves. base starts from the dated release of Ubuntu&amp;rsquo;s cloud image that &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; in &lt;code&gt;tests/e2e/sandbox_test.go&lt;/code&gt; names, given to devvm as &lt;code&gt;DEVVM_UBUNTU_RELEASE&lt;/code&gt;, in place of the newest that a user&amp;rsquo;s devvm pins, so base&amp;rsquo;s key stays the same between runs and on every machine of one architecture. devvm keeps a release it has pinned, so when the sandbox&amp;rsquo;s pin names another release, as it does after &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; moves &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, the run deletes that pin before its first section, and the next build pins &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;. Its packages are those its key recorded at its first build in the sandbox, which stay in the sandbox&amp;rsquo;s package cache through &lt;code&gt;--clean&lt;/code&gt;, so base built again under the same key installs the same packages until &lt;code&gt;assets/&lt;/code&gt; or the release changes its key. &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; moves the lock to upstream&amp;rsquo;s newest versions, resolved with devvm&amp;rsquo;s pinned host mise, &lt;code&gt;scripts/bump.sh e2e-from&lt;/code&gt; moves the digests to what Docker Hub has for each tag, and &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; moves the release to the newest Ubuntu lists; &lt;code&gt;scripts/bump.sh --check&lt;/code&gt; shows them against upstream. The lock&amp;rsquo;s first line is the SHA-256 of the &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; it was resolved from, and a run stops at once when that file has changed since, until &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; resolves the lock again.&lt;/p&gt;
&lt;p&gt;base, the &lt;code&gt;--from&lt;/code&gt; bases and the shared tool images stay cached between runs, except what a rebuild or gc deletes: every stale image in the sandbox (other selections&amp;rsquo; bases, whose features differ, among them) and every unused tool image (an earlier &lt;code&gt;from&lt;/code&gt; run&amp;rsquo;s musl ones, and the &lt;code&gt;tools&lt;/code&gt; section&amp;rsquo;s newest versions where they differ from the pins); every other VM a run makes is deleted at its end, and its project folders are unlocked and deleted. Each check prints &lt;code&gt;[n/N]&lt;/code&gt;, how long it took and the time left as the last complete run of each of its sections measured it, and a heartbeat every minute shows the latest output. e2e keeps each section&amp;rsquo;s times in a file of its own in slot 0&amp;rsquo;s state folder, &lt;code&gt;timings/plain/SECTION&lt;/code&gt;, or &lt;code&gt;timings/features/SECTION&lt;/code&gt; for a run whose base has every feature, because that run also checks base&amp;rsquo;s features. So a run of any selection, in any slot, estimates from and compares with the sections it runs. A check fails on its first failure, except the few marked &lt;code&gt;Flaky&lt;/code&gt;, which flake on timing, such as the network section&amp;rsquo;s check that the proxy&amp;rsquo;s password was in no host process&amp;rsquo;s arguments, and the link section&amp;rsquo;s 256-connection check and its stopped-target check. When one of these fails, e2e shows its output and runs it once more, and a second failure fails it. Its result says &lt;code&gt;retried once&lt;/code&gt;, its line in the timings has a third field, &lt;code&gt;retried&lt;/code&gt;, and the summary counts the retried checks and names each one. A check a run has nothing for is counted as &lt;code&gt;SKIP&lt;/code&gt;: base&amp;rsquo;s features, with base cached. A section that runs fewer checks than its last complete run with the same &lt;code&gt;tests/e2e&lt;/code&gt; Go files fails the run, because an error ended it early, and e2e keeps the times it had. After you edit those files, each section&amp;rsquo;s first complete run sets the count the next runs compare with. Checks look for devvm&amp;rsquo;s messages with &lt;code&gt;devvm _msg&lt;/code&gt;, never by their wording. The Go tests that need a real VM or desktop, &lt;code&gt;TestE2EExecQuoting&lt;/code&gt;, &lt;code&gt;TestE2ESelfCheck&lt;/code&gt; and &lt;code&gt;TestE2EDesktop&lt;/code&gt;, skip unless their &lt;code&gt;DEVVM_E2E_*&lt;/code&gt; variables are set, and e2e runs each of them through &lt;code&gt;s.GoE2E&lt;/code&gt;, which sets those variables in the test&amp;rsquo;s environment, so a value such as the desktop&amp;rsquo;s password is in no process&amp;rsquo;s arguments.&lt;/p&gt;
&lt;p&gt;Each check&amp;rsquo;s command has a time limit, counted from when it starts: three times the check&amp;rsquo;s longest time in its section&amp;rsquo;s last complete run, at least 2 minutes, or 10 minutes for a check with no time yet. The checks that build base or a &lt;code&gt;--from&lt;/code&gt; base, which &lt;code&gt;Builds()&lt;/code&gt; marks, get at least an hour, because their last time may have been a cached build. The steps between two checks, such as the launches that build tool images, get an hour too. When a check runs past its limit, the heartbeat stops the processes it started, with TERM as Ctrl+C would and then KILL 30 seconds later, and the check fails with the heartbeat&amp;rsquo;s last line in its output. When the steps before a check run past their limit, the heartbeat stops their processes the same way, and that check fails without running. Either way, the run goes on to the next check and then to its usual cleanup.&lt;/p&gt;
&lt;h3 data-hextra-search-id="slots"&gt;Slots&lt;span class="hx:absolute hx:-mt-20" id="slots"&gt;&lt;/span&gt;
&lt;a href="#slots" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A host with spare cores and memory can run the sections at once, each set in a sandbox of its own called a slot. &lt;code&gt;mise run e2e -- --slots N&lt;/code&gt; spreads the chosen sections over N slots, from 1 to 9, and runs each slot as a &lt;code&gt;--slot K&lt;/code&gt; run of its own, all at the same time. The default is one slot, which is the run described above. Slot 0 is the sandbox in the table, and slot K adds &lt;code&gt;-K&lt;/code&gt; to its Lima home, state folder, Keychain service and lock, as &lt;code&gt;~/.lt-e2e-go-1&lt;/code&gt;, &lt;code&gt;/tmp/devvm-go-e2e-1&lt;/code&gt;, &lt;code&gt;devvm-go-e2e-1&lt;/code&gt; and &lt;code&gt;/tmp/devvm-go-e2e-1.lock&lt;/code&gt;. Each fixed port the checks use is slot 0&amp;rsquo;s plus 100 times the slot, so slot 1&amp;rsquo;s servers use 47260 where slot 0&amp;rsquo;s use 47160. Slot 0&amp;rsquo;s ports run from 47160 to 47199, from 47240 to 47249, and 47613, 18765 and 18766, so no two slots ever share one.&lt;/p&gt;
&lt;p&gt;e2e places the longest sections first, each in the slot with the least time so far, using each section&amp;rsquo;s time from its last complete run. A section that has never run gets a guess, from 2 minutes for gc and clone to 30 minutes for from. link always goes in the same slot as from when both run, because in the &lt;code&gt;--from&lt;/code&gt; tier link&amp;rsquo;s Alpine client starts from the image that from builds. Each slot runs its own sections in the usual order, and a slot left without a section isn&amp;rsquo;t started. When &lt;code&gt;go&lt;/code&gt; isn&amp;rsquo;t on your &lt;code&gt;PATH&lt;/code&gt;, e2e finds mise&amp;rsquo;s Go once and puts its folder first on the slots&amp;rsquo; &lt;code&gt;PATH&lt;/code&gt;, because slots that each ran &lt;code&gt;mise exec&lt;/code&gt; at the same time would each install the repo&amp;rsquo;s tools over one another. With &lt;code&gt;--from&lt;/code&gt;, e2e passes &lt;code&gt;--every-feature&lt;/code&gt; to every slot, so each slot&amp;rsquo;s base has every feature, as a single &lt;code&gt;--from&lt;/code&gt; run&amp;rsquo;s has.&lt;/p&gt;
&lt;p&gt;Before the slots start, e2e takes every slot&amp;rsquo;s lock and gives each other slot what slot 0 has and it lacks: every image&amp;rsquo;s Lima instance and record, every tool image and its record, and devvm&amp;rsquo;s caches. It clones the large files and never copies them whole: on macOS each one is an APFS clone, which needs both folders on one APFS volume, and on Linux a reflink. The records and the &lt;code&gt;--from&lt;/code&gt; digests are small files, so e2e copies them. When a file can&amp;rsquo;t be cloned, as on a Linux host whose &lt;code&gt;/tmp&lt;/code&gt; is tmpfs, e2e says so and that slot builds its own. With &lt;code&gt;--clean&lt;/code&gt;, nothing is cloned, and each slot deletes its own cached images instead. A &lt;code&gt;--slot K&lt;/code&gt; run of your own uses that slot&amp;rsquo;s images as they are.&lt;/p&gt;
&lt;p&gt;Each slot&amp;rsquo;s output appears as it comes, each line led by its slot&amp;rsquo;s number, such as &lt;code&gt;[1]&lt;/code&gt;, and stays in the slot&amp;rsquo;s &lt;code&gt;e2e.log&lt;/code&gt;. When every slot has ended, e2e prints each slot&amp;rsquo;s sections, results and time, then the sums: checks passed, failed, skipped and retried, the failed checks by name, and the time the whole run took. The run fails when any slot fails or ends without its results. TERM or Ctrl+C stops every slot with TERM, and each one cleans up as a single run does.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/contributing/testing/#slots-for-each-host"&gt;Testing on other hosts&lt;/a&gt; says how many slots each kind of host runs. &lt;a href="https://next.devvm.dev/docs/contributing/testing/"&gt;Testing on other hosts&lt;/a&gt; also covers Linux hosts, x86_64 and the checks to run by hand.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-tests-behind-how-it-works"&gt;The tests behind How it works&lt;span class="hx:absolute hx:-mt-20" id="the-tests-behind-how-it-works"&gt;&lt;/span&gt;
&lt;a href="#the-tests-behind-how-it-works" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The How it works pages say in words what the tests of a mechanism check, and this section names those tests, so you can find the one to extend when you change the mechanism. Each unit test is named with its package, the CLI tests are files in &lt;code&gt;testdata/script/&lt;/code&gt;, and the end-to-end checks are in &lt;code&gt;tests/e2e&lt;/code&gt;, in the section the page names. The design notes name the tests of each emulation themselves (&lt;a href="https://next.devvm.dev/docs/contributing/design/"&gt;design notes&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#how-the-proxy-puts-them-in"&gt;How the proxy puts secrets in&lt;/a&gt;:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TestCheckName&lt;/code&gt;, &lt;code&gt;TestCheckHost&lt;/code&gt;, &lt;code&gt;TestCheckHeader&lt;/code&gt;, &lt;code&gt;TestCheckEnv&lt;/code&gt;, &lt;code&gt;TestCheckPrefix&lt;/code&gt;, &lt;code&gt;TestDefine&lt;/code&gt; and &lt;code&gt;TestChangeApply&lt;/code&gt;, in &lt;code&gt;internal/secrets&lt;/code&gt;, check what a secret of yours may be and what devvm secret set&amp;rsquo;s flags change.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestReservedEnvAssets&lt;/code&gt; and &lt;code&gt;TestEnvReservedForSecrets&lt;/code&gt;, in &lt;code&gt;internal/netpolicy&lt;/code&gt;, check the variables a secret can&amp;rsquo;t take.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestInjectSecretShapes&lt;/code&gt; and &lt;code&gt;TestSchemeOK&lt;/code&gt;, in &lt;code&gt;internal/proxy&lt;/code&gt;, check each shape a value goes in and each that keeps the placeholder, and &lt;code&gt;TestPathWithin&lt;/code&gt;, &lt;code&gt;TestForRequestMethods&lt;/code&gt; and &lt;code&gt;TestInterceptSecretMethods&lt;/code&gt; that a binding&amp;rsquo;s path and methods let it in only for the requests they match.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestGetChecksTheBinding&lt;/code&gt; checks that a binding that isn&amp;rsquo;t the secret&amp;rsquo;s as it&amp;rsquo;s saved gets nothing, &lt;code&gt;TestValueMax&lt;/code&gt; and &lt;code&gt;TestKeychainLine&lt;/code&gt;, in &lt;code&gt;internal/platform&lt;/code&gt;, that a value too long for the Keychain&amp;rsquo;s line is refused, and &lt;code&gt;TestPlaceholders&lt;/code&gt; the placeholders&amp;rsquo; one shape.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestCustomStore&lt;/code&gt;, &lt;code&gt;TestCustomsUnreadable&lt;/code&gt; and &lt;code&gt;TestWriteFilesCustom&lt;/code&gt; check the list, its mode and its checks, &lt;code&gt;TestValuesCachedByBinding&lt;/code&gt;, in &lt;code&gt;internal/proxy&lt;/code&gt;, that two bindings of one name are cached apart, and &lt;code&gt;TestCustomSecrets&lt;/code&gt;, in &lt;code&gt;internal/vm&lt;/code&gt;, use, a new value and the question before a delete.&lt;/li&gt;
&lt;li&gt;The CLI tests are &lt;code&gt;secret_custom.txtar&lt;/code&gt; and &lt;code&gt;layout.txtar&lt;/code&gt;, and the end-to-end checks are in &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s &lt;code&gt;network&lt;/code&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;The VM&amp;rsquo;s CA&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;TestInitCA&lt;/code&gt;, &lt;code&gt;TestInitCASwitch&lt;/code&gt;, &lt;code&gt;TestInitCAReplaced&lt;/code&gt;, &lt;code&gt;TestInitCATogether&lt;/code&gt; and &lt;code&gt;TestInitCACancelled&lt;/code&gt;, in &lt;code&gt;internal/trust&lt;/code&gt;, &lt;code&gt;TestPrepareOpen&lt;/code&gt;, in &lt;code&gt;internal/netpolicy&lt;/code&gt;, and &lt;code&gt;TestNextCASigns&lt;/code&gt;, &lt;code&gt;TestLoadCA&lt;/code&gt; and &lt;code&gt;TestServersApart&lt;/code&gt;. The CLI tests are &lt;code&gt;network.txtar&lt;/code&gt;, &lt;code&gt;sync.txtar&lt;/code&gt; and &lt;code&gt;layout.txtar&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;Logins made in a VM&lt;/a&gt;:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TestCaptureLogin&lt;/code&gt;, &lt;code&gt;TestCapturePaths&lt;/code&gt;, &lt;code&gt;TestCaptureEarlyHintsAnswerAndSaved&lt;/code&gt;, &lt;code&gt;TestCaptureErrorPasses&lt;/code&gt;, &lt;code&gt;TestCaptureRefuses&lt;/code&gt; and &lt;code&gt;TestCaptureGet&lt;/code&gt;, in &lt;code&gt;internal/proxy&lt;/code&gt;, check what goes out, what the VM gets and what&amp;rsquo;s refused.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestCodexCapture&lt;/code&gt;, &lt;code&gt;TestOpencodeCapture&lt;/code&gt;, &lt;code&gt;TestClaudeCapture&lt;/code&gt;, &lt;code&gt;TestClaudeSetupToken&lt;/code&gt;, &lt;code&gt;TestClaudeOAuthGet&lt;/code&gt;, &lt;code&gt;TestCaptureRefuses&lt;/code&gt;, &lt;code&gt;TestEndpoints&lt;/code&gt; and &lt;code&gt;TestPick&lt;/code&gt;, in &lt;code&gt;internal/agentlogin&lt;/code&gt;, check each agent&amp;rsquo;s file, its placeholders and copies, and its refresh.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestOneClaudeLogin&lt;/code&gt;, &lt;code&gt;TestClaudeBindings&lt;/code&gt; and &lt;code&gt;TestClaudeOAuthVMCopy&lt;/code&gt;, in &lt;code&gt;internal/secrets&lt;/code&gt;, check the one Claude Code login and its bindings, and &lt;code&gt;TestCapturer&lt;/code&gt; and &lt;code&gt;TestCaptureOwnAgents&lt;/code&gt;, in &lt;code&gt;internal/netpolicy&lt;/code&gt;, the endpoints in every VM&amp;rsquo;s config and which agent a capture is.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestAgentLoginTerminal&lt;/code&gt;, in &lt;code&gt;internal/vm&lt;/code&gt;, and &lt;code&gt;TestTerminal&lt;/code&gt;, in &lt;code&gt;internal/ui&lt;/code&gt;, check that an agent&amp;rsquo;s login gets the terminal&amp;rsquo;s files only when devvm&amp;rsquo;s input and output are both terminals. The end-to-end checks are in &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s &lt;code&gt;network&lt;/code&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#agents-logins-and-settings"&gt;Agents&amp;rsquo; logins and settings&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;TestFormatsWithholdUnknown&lt;/code&gt; plants a field that no format knows in every login file, &lt;code&gt;~/.claude.json&lt;/code&gt; included, and checks that no VM&amp;rsquo;s copy holds it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#learning-from-the-log"&gt;Learning from the log&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;TestTickable&lt;/code&gt; checks that no name devvm network lock ticks is a shared-hosting domain or under one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/images/#a-companys-ca-in-builds"&gt;A company&amp;rsquo;s CA in builds&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s &lt;code&gt;images&lt;/code&gt; section checks that a layer built with a test CA trusts it while its script runs and keeps its key once the folder is emptied, and that a copy of its image booted without devvm has none of devvm&amp;rsquo;s CA files. Its &lt;code&gt;project&lt;/code&gt; and &lt;code&gt;tools&lt;/code&gt; sections check &lt;a href="https://next.devvm.dev/docs/internals/network/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt; in a VM, which &lt;code&gt;tests/e2e&lt;/code&gt; runs on real VMs.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Customizing images</title><link>https://next.devvm.dev/docs/using/customizing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/customizing/</guid><description>
&lt;p&gt;You customize images with your own layers, which add what a project needs, and by choosing base&amp;rsquo;s features, which are devvm&amp;rsquo;s optional extras that every VM gets. Your layers live in &lt;code&gt;~/.config/devvm&lt;/code&gt; (&lt;code&gt;$XDG_CONFIG_HOME/devvm&lt;/code&gt;), not next to devvm&amp;rsquo;s binary, so upgrading devvm keeps them. To give every new VM something of your own, write it as a layer and make it one of the layers new VMs get (&lt;a href="#extras-of-your-own"&gt;extras of your own&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="your-own-layers"&gt;Your own layers&lt;span class="hx:absolute hx:-mt-20" id="your-own-layers"&gt;&lt;/span&gt;
&lt;a href="#your-own-layers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer new mailpit &lt;span class="c1"&gt;# writes ~/.config/devvm/layers/mailpit.sh and mailpit.policy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$EDITOR&lt;/span&gt; ~/.config/devvm/layers/mailpit.sh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --layers mailpit &lt;span class="c1"&gt;# a new VM with your layer; or devvm build mailpit&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When you customize a new VM, its list also shows your layers under Layers, so you can choose &lt;code&gt;mailpit&lt;/code&gt; there instead of giving &lt;code&gt;--layers&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;). To give every new VM your layer, choose it with &lt;code&gt;devvm setup --layers mailpit&lt;/code&gt;, or add it to the &lt;code&gt;layers&lt;/code&gt; key in &lt;code&gt;config.toml&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/settings/#layers-for-new-vms"&gt;layers for new VMs&lt;/a&gt;). When you delete a layer&amp;rsquo;s script that you chose there, new VMs are made without it, and devvm warns you.&lt;/p&gt;
&lt;p&gt;A &lt;a href="https://next.devvm.dev/docs/using/images/#layers"&gt;layer&lt;/a&gt; is a script, &lt;code&gt;~/.config/devvm/layers/&amp;lt;name&amp;gt;.sh&lt;/code&gt;, that bash runs once as the VM&amp;rsquo;s user, who has sudo, in an image on top of its parent. &lt;code&gt;devvm layer new NAME&lt;/code&gt; writes a starter script, and also &lt;code&gt;NAME.policy&lt;/code&gt; next to it unless that file exists. It refuses to overwrite a script that exists.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Names&lt;/strong&gt; are made of lowercase letters, digits and dashes, and start with a letter or digit. A name can&amp;rsquo;t be &lt;code&gt;base&lt;/code&gt;, a &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;built-in layer&amp;rsquo;s&lt;/a&gt; name (&lt;code&gt;desktop&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt; or &lt;code&gt;nix&lt;/code&gt;) or a shared tool&amp;rsquo;s name (&lt;code&gt;node&lt;/code&gt;, &lt;code&gt;claude&lt;/code&gt; and so on). A command&amp;rsquo;s name, such as &lt;code&gt;log&lt;/code&gt;, is fine, because devvm takes layers only through &lt;code&gt;--layers&lt;/code&gt;, the list and image names.&lt;/li&gt;
&lt;li&gt;Built-in layers go in the same image names as yours, bottom first, as in &lt;code&gt;devvm --layers docker,mailpit&lt;/code&gt;, which makes the image &lt;code&gt;docker+mailpit&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Put interactive shell setup in &lt;code&gt;~/.bashrc.d/&amp;lt;name&amp;gt;.sh&lt;/code&gt;, which every VM&amp;rsquo;s &lt;code&gt;~/.bashrc&lt;/code&gt; reads, and PATH changes in &lt;code&gt;~/.profile&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Download files with &lt;code&gt;devvm-fetch URL SHA256 OUT&lt;/code&gt;, which &lt;code&gt;base&lt;/code&gt; installs. It tries a download that was cut or stalled again from where it stopped, and it fails when the file&amp;rsquo;s checksum doesn&amp;rsquo;t match (&lt;a href="https://next.devvm.dev/docs/internals/images/#building"&gt;building&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm runs a line of its own in place of your script&amp;rsquo;s &lt;code&gt;#!&lt;/code&gt; line, which gives it &lt;code&gt;$devvm_arch&lt;/code&gt;, the VM&amp;rsquo;s architecture as &lt;code&gt;arm64&lt;/code&gt; or &lt;code&gt;amd64&lt;/code&gt;, &lt;code&gt;$devvm_libc&lt;/code&gt;, which is &lt;code&gt;musl&lt;/code&gt; on Alpine and &lt;code&gt;gnu&lt;/code&gt; elsewhere, and &lt;code&gt;devvm_sha TOOL&lt;/code&gt;, which prints the checksum you pinned for this VM, as the &lt;a href="#example-mailpit"&gt;example&lt;/a&gt; shows. Names that start with &lt;code&gt;devvm_&lt;/code&gt; are devvm&amp;rsquo;s, and one your script sets is your script&amp;rsquo;s from then on. Bash&amp;rsquo;s errors give your file&amp;rsquo;s own line numbers, or one more without a &lt;code&gt;#!&lt;/code&gt; line (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-scripts-prelude"&gt;the prelude&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NAME.policy&lt;/code&gt; lists the hosts that VMs with the layer can reach on the &lt;a href="https://next.devvm.dev/docs/safety/network/#allowlists"&gt;allowlist tier&lt;/a&gt;, one rule per line.&lt;/li&gt;
&lt;li&gt;Editing the script rebuilds its image, and the ones built on it, the next time they&amp;rsquo;re used (&lt;a href="https://next.devvm.dev/docs/using/images/#rebuilding"&gt;rebuilding&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A layer&amp;rsquo;s script changes the VM&amp;rsquo;s disk, so &lt;code&gt;devvm layer add mailpit&lt;/code&gt; gives a VM you have the layer by making the VM again, keeping its home folder and settings (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;), and &lt;code&gt;devvm layer rm mailpit&lt;/code&gt; takes it out again in the same way (&lt;a href="https://next.devvm.dev/docs/using/images/#taking-layers-out-of-a-vm"&gt;taking layers out of a VM&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To edit layers with an agent in a VM, keep them in a repo of their own and copy them in, because devvm refuses a VM for a folder inside &lt;code&gt;~/.config/devvm&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/security/#only-the-project-folder"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="example-mailpit"&gt;Example: mailpit&lt;span class="hx:absolute hx:-mt-20" id="example-mailpit"&gt;&lt;/span&gt;
&lt;a href="#example-mailpit" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This layer installs &lt;a href="https://mailpit.axllent.org/" target="_blank" rel="noopener"&gt;Mailpit&lt;/a&gt;, which catches the emails your app sends while you develop it, and starts it with the VM. Point your app&amp;rsquo;s SMTP settings at &lt;code&gt;localhost:1025&lt;/code&gt;, and read the emails at &lt;code&gt;localhost:8025&lt;/code&gt; in your browser, because devvm &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;forwards&lt;/a&gt; both ports to your machine. Put these lines in &lt;code&gt;~/.config/devvm/layers/mailpit.sh&lt;/code&gt;, below the starter&amp;rsquo;s &lt;code&gt;set -euo pipefail&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;mailpit_version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.32.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;mailpit_sha256_amd64&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4b5993c978e8604c70d43927e2ad103b311bba3b1822fa0cf1d4ee4ec890a93c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;mailpit_sha256_arm64&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;e1e45d1dc72bd497fb262a1e4100178eee057c42c5fc36d143eb8621769e1137
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm-fetch &lt;span class="s2"&gt;&amp;#34;https://github.com/axllent/mailpit/releases/download/v&lt;/span&gt;&lt;span class="nv"&gt;$mailpit_version&lt;/span&gt;&lt;span class="s2"&gt;/mailpit-linux-&lt;/span&gt;&lt;span class="nv"&gt;$devvm_arch&lt;/span&gt;&lt;span class="s2"&gt;.tar.gz&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;devvm_sha mailpit&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; /tmp/mailpit.tar.gz
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo tar -xzf /tmp/mailpit.tar.gz -C /usr/local/bin mailpit
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm /tmp/mailpit.tar.gz
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;%s\n&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[Unit]&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Description=Mailpit&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[Service]&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ExecStart=/usr/local/bin/mailpit&amp;#39;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;DynamicUser=yes&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[Install]&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;WantedBy=multi-user.target&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sudo tee /etc/systemd/system/mailpit.service &amp;gt;/dev/null
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; --now mailpit&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The version and each download&amp;rsquo;s SHA-256 sit at the top, so &lt;code&gt;devvm-fetch&lt;/code&gt; refuses a download that doesn&amp;rsquo;t match. &lt;code&gt;$devvm_arch&lt;/code&gt; names the VM&amp;rsquo;s build in the address, and &lt;code&gt;devvm_sha mailpit&lt;/code&gt; picks the matching pin, &lt;code&gt;mailpit_sha256_arm64&lt;/code&gt; or &lt;code&gt;mailpit_sha256_amd64&lt;/code&gt;, or names the pin the script lacks, so the download fails. On Alpine, it takes &lt;code&gt;mailpit_sha256_arm64_musl&lt;/code&gt; instead when you pin one, for a tool with a separate musl build. To update Mailpit, change all three and rebuild the image. The downloads come from GitHub&amp;rsquo;s releases, which &lt;code&gt;base&lt;/code&gt;&amp;rsquo;s allowlist has, so &lt;code&gt;mailpit.policy&lt;/code&gt; can stay empty. On a base made &lt;code&gt;--from&lt;/code&gt; an Alpine container image, start it with OpenRC (&lt;code&gt;rc-update&lt;/code&gt;, &lt;code&gt;rc-service&lt;/code&gt;) instead of systemd.&lt;/p&gt;
&lt;h2 data-hextra-search-id="base-image-features"&gt;Base image features&lt;span class="hx:absolute hx:-mt-20" id="base-image-features"&gt;&lt;/span&gt;
&lt;a href="#base-image-features" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Features are optional extras that devvm builds into &lt;a href="https://next.devvm.dev/docs/using/images/#base"&gt;&lt;code&gt;base&lt;/code&gt;&lt;/a&gt; after base&amp;rsquo;s own setup, so every VM has them.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;What it adds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;omb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://ohmybash.github.io/" target="_blank" rel="noopener"&gt;oh-my-bash&lt;/a&gt;: a themed prompt, completions and aliases, with auto-update off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fzf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;fuzzy Ctrl-R history and Ctrl-T file search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cli-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;bat, fd, eza, zoxide (&lt;code&gt;z&lt;/code&gt;), btop, tree, tldr&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The desktop that &lt;a href="https://next.devvm.dev/docs/using/desktop/"&gt;&lt;code&gt;devvm desktop&lt;/code&gt;&lt;/a&gt; opens isn&amp;rsquo;t a feature but a &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;built-in layer&lt;/a&gt;, &lt;code&gt;desktop&lt;/code&gt;, so only the VMs you choose it for get it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="choosing-features"&gt;Choosing features&lt;span class="hx:absolute hx:-mt-20" id="choosing-features"&gt;&lt;/span&gt;
&lt;a href="#choosing-features" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On its first run, devvm asks which features &lt;code&gt;base&lt;/code&gt; gets, after the size and coding agents that new VMs get and before it shows what the folder&amp;rsquo;s new VM gets. devvm build and devvm rebuild ask too, until the features are chosen. The list starts with every feature chosen, and you choose in it as in &lt;a href="https://next.devvm.dev/docs/using/images/#choosing-in-a-list"&gt;any of devvm&amp;rsquo;s lists&lt;/a&gt;. Without a terminal, devvm chooses every feature. devvm prints the choice and saves it, in the order the features run. When &lt;code&gt;features&lt;/code&gt; in &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; chooses them, devvm doesn&amp;rsquo;t ask.&lt;/p&gt;
&lt;p&gt;To change the choice:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup &lt;span class="c1"&gt;# asks again, starting from the current choice&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --features fzf,omb &lt;span class="c1"&gt;# without asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --features none &lt;span class="c1"&gt;# without asking, and base gets no features&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In a terminal, &lt;code&gt;devvm setup&lt;/code&gt; asks for the features among its other questions, which &lt;a href="https://next.devvm.dev/docs/using/settings/#devvm-setup"&gt;devvm setup&lt;/a&gt; lists in order. &lt;code&gt;--features&lt;/code&gt; asks for none of the others. Without a terminal, &lt;code&gt;devvm setup&lt;/code&gt; keeps the choice. devvm refuses a name that isn&amp;rsquo;t a feature, and an empty &lt;code&gt;--features ''&lt;/code&gt;, and then nothing changes. You can also choose them by hand with &lt;code&gt;features&lt;/code&gt; in &lt;code&gt;config.toml&lt;/code&gt;, such as &lt;code&gt;features = [&amp;quot;fzf&amp;quot;, &amp;quot;omb&amp;quot;]&lt;/code&gt;, which wins over what &lt;code&gt;devvm setup&lt;/code&gt; saved, and then &lt;code&gt;devvm setup --features&lt;/code&gt; refuses to change them. &lt;code&gt;features = []&lt;/code&gt; chooses none, and devvm skips a name without a script, with a warning.&lt;/p&gt;
&lt;p&gt;A new choice makes &lt;code&gt;base&lt;/code&gt; and the images built on it rebuild the next time they&amp;rsquo;re used, and &lt;code&gt;devvm setup&lt;/code&gt; says so. The old images are then stale, and &lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;&lt;code&gt;devvm gc&lt;/code&gt;&lt;/a&gt; deletes them.&lt;/p&gt;
&lt;h3 data-hextra-search-id="extras-of-your-own"&gt;Extras of your own&lt;span class="hx:absolute hx:-mt-20" id="extras-of-your-own"&gt;&lt;/span&gt;
&lt;a href="#extras-of-your-own" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Base&amp;rsquo;s features are the ones in the table above, and devvm ships all of them. To give every new VM an extra of your own, such as your shell setup or a tool you always use, write it as a &lt;a href="#your-own-layers"&gt;layer of your own&lt;/a&gt; and choose it as one of the layers new VMs get:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer new dotfiles &lt;span class="c1"&gt;# writes ~/.config/devvm/layers/dotfiles.sh&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$EDITOR&lt;/span&gt; ~/.config/devvm/layers/dotfiles.sh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --layers dotfiles &lt;span class="c1"&gt;# every new VM gets it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A new VM&amp;rsquo;s summary then shows &lt;code&gt;dotfiles&lt;/code&gt;, and when you customize the VM, its list shows &lt;code&gt;dotfiles&lt;/code&gt; under Layers, already chosen because devvm setup chose it, so you can leave it out of that VM (&lt;a href="https://next.devvm.dev/docs/using/settings/#layers-for-new-vms"&gt;layers for new VMs&lt;/a&gt;). A layer is an image built on top of base, so the images that have it are named with it, such as &lt;code&gt;dotfiles&lt;/code&gt; or &lt;code&gt;docker+dotfiles&lt;/code&gt;, and editing its script rebuilds only those images, never base.&lt;/p&gt;</description></item><item><title>Security model</title><link>https://next.devvm.dev/docs/internals/security/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/security/</guid><description>
&lt;p&gt;devvm treats everything in a VM as untrusted, including a coding agent with root, because the VM&amp;rsquo;s user has passwordless sudo. This page explains how devvm keeps that code away from the rest of your machine. &lt;a href="https://next.devvm.dev/docs/safety/"&gt;Staying safe&lt;/a&gt; lists &lt;a href="https://next.devvm.dev/docs/safety/#what-a-vm-can-reach"&gt;what a VM can reach&lt;/a&gt; and the habits that &lt;a href="https://next.devvm.dev/docs/safety/#the-habits"&gt;keep you safe&lt;/a&gt;, and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/"&gt;Attack vectors&lt;/a&gt; goes through common attacks one by one and lists what devvm leaves open.&lt;/p&gt;
&lt;p&gt;All of it rests on the VM&amp;rsquo;s boundary. &lt;a href="https://next.devvm.dev/docs/internals/processes/"&gt;Processes&lt;/a&gt; goes through each process on this machine that a VM&amp;rsquo;s bytes reach, what it holds and how it&amp;rsquo;s confined, and lists the listeners a VM reaches.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-devvm-protects-and-how"&gt;What devvm protects, and how&lt;span class="hx:absolute hx:-mt-20" id="what-devvm-protects-and-how"&gt;&lt;/span&gt;
&lt;a href="#what-devvm-protects-and-how" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 data-hextra-search-id="only-the-project-folder"&gt;Only the project folder&lt;span class="hx:absolute hx:-mt-20" id="only-the-project-folder"&gt;&lt;/span&gt;
&lt;a href="#only-the-project-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM mounts its project folder read-write at the same path. The only other things it mounts from the host are the shared tools and its &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;agents&amp;rsquo; config folders&lt;/a&gt;, both read-only, so it never mounts your home folder, which Lima&amp;rsquo;s own templates do. A &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; VM doesn&amp;rsquo;t mount the project folder either. It has its own clone, and its work reaches the repo only when you fetch it. When you run devvm in a subfolder and it uses the project folder&amp;rsquo;s VM, that VM mounts nothing more than it already did (&lt;a href="https://next.devvm.dev/docs/internals/overview/#a-subfolders-vm"&gt;a subfolder&amp;rsquo;s VM&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm refuses a project folder that would hand the VM more than the project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A folder that is or holds your home folder, devvm&amp;rsquo;s settings (&lt;code&gt;~/.config/devvm&lt;/code&gt;), its state (&lt;code&gt;~/.local/share/devvm&lt;/code&gt;, which holds its binaries and other VMs&amp;rsquo; disks) or its Lima home (&lt;code&gt;unsafe_folder&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A folder inside devvm&amp;rsquo;s own folders (&lt;code&gt;unsafe_folder_inside&lt;/code&gt;). A VM in &lt;code&gt;~/.config/devvm/layers&lt;/code&gt; could rewrite the scripts that every image build runs, and a VM in devvm&amp;rsquo;s data folder could rewrite the files devvm runs on the host.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm compares each of these folders with the project folder both by path and by the folder itself, so it also catches a project folder, or a folder above it, that is the same folder as one of devvm&amp;rsquo;s by device and inode, or the other way round. So on a volume that ignores case, as a Mac&amp;rsquo;s does by default, a project at &lt;code&gt;~/.Config/devvm/layers&lt;/code&gt; is inside &lt;code&gt;~/.config/devvm&lt;/code&gt;, although the two paths differ. &lt;code&gt;--unsafe-folder&lt;/code&gt; mounts such a folder anyway, and devvm says so. A &lt;code&gt;--clone&lt;/code&gt; VM mounts nothing, so devvm doesn&amp;rsquo;t refuse its folder.&lt;/p&gt;
&lt;p&gt;A project folder inside a coding agent&amp;rsquo;s folder in your home folder, such as &lt;code&gt;~/.claude/skills/mine&lt;/code&gt;, or one that holds an agent&amp;rsquo;s folder, such as &lt;code&gt;~/.pi&lt;/code&gt; for pi&amp;rsquo;s &lt;code&gt;~/.pi/agent&lt;/code&gt;, gives its VM read-write access to that agent&amp;rsquo;s settings on this machine, such as Claude Code&amp;rsquo;s hooks, which run on the host. devvm doesn&amp;rsquo;t refuse such a folder, because working on a skill in place is common, but each launch of a VM that mounts it warns once, naming every agent&amp;rsquo;s folder it overlaps (&lt;code&gt;project_agent_folder&lt;/code&gt;). devvm finds them by the same comparison and also by the agent folder&amp;rsquo;s name, so a folder that the VM could make later counts. A &lt;code&gt;--clone&lt;/code&gt; VM gets no warning.&lt;/p&gt;
&lt;h3 data-hextra-search-id="one-vm-per-folder"&gt;One VM per folder&lt;span class="hx:absolute hx:-mt-20" id="one-vm-per-folder"&gt;&lt;/span&gt;
&lt;a href="#one-vm-per-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM belongs to the folder it was made for, which devvm knows by its path and by the folder itself: its device and inode, and its birth time where the file system keeps one. macOS numbers its disks&amp;rsquo; devices in the order they appear at boot, so after a restart an unchanged folder can be on a device with another number. devvm still takes it as the same folder when it&amp;rsquo;s at the same path, with no link on that path, and has the same inode and birth time on a file system that never gives a new folder a deleted one&amp;rsquo;s inode number. That&amp;rsquo;s safe because nothing in a VM can give a folder an inode and a birth time, and a copy that keeps both, such as a snapshot, is at another path unless you mount it at the folder&amp;rsquo;s own. devvm reads the folder&amp;rsquo;s identity from the folder opened at its path with no link followed, so a link that a VM puts there for a moment can&amp;rsquo;t pass such a copy off as the folder. For a VM whose state records the folder&amp;rsquo;s volume (below), the folder on the renumbered disk must also be on that volume when devvm can tell it, so a copy of the disk that has a volume ID of its own but keeps the folder&amp;rsquo;s inode and birth time, mounted at the folder&amp;rsquo;s own path, is another folder. A copy that keeps the volume ID too, as &lt;code&gt;dd&lt;/code&gt; makes, still matches, as below. The VM&amp;rsquo;s next start records the folder on its device as it is now, before the start mounts it, and never when the folder is on another volume (&lt;a href="https://next.devvm.dev/docs/internals/overview/#an-existing-vm"&gt;an existing VM&lt;/a&gt;). When you delete a folder and make it again at the same path, or clone another repo where an old one was, devvm refuses to give the new folder the old folder&amp;rsquo;s VM, so the new folder never quietly gets what&amp;rsquo;s in the old VM&amp;rsquo;s disk. &lt;code&gt;devvm rm&lt;/code&gt; deletes the old VM and &lt;code&gt;devvm adopt&lt;/code&gt; gives it to the new folder, and each does so only after you confirm (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-made-again"&gt;a folder made again&lt;/a&gt;). When you move or rename the folder, the folder at its new path is the same folder, so devvm offers it the VM, and moves the VM only after you confirm (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-moved-or-renamed-folder"&gt;a moved or renamed folder&lt;/a&gt;). It never offers a VM to a copy, to a folder another user owns, or on a file system that may give a new folder the inode number of a deleted one, so a VM never moves to a folder that only looks like its own. The folders that get the offer are those whose file system records a birth time: on macOS, folders on APFS and HFS+, and on Linux, folders on ext4, XFS, Btrfs, tmpfs, ZFS, F2FS and bcachefs. Folders on network shares, FUSE file systems and USB drives formatted with FAT or exFAT never get the offer.&lt;/p&gt;
&lt;p&gt;A folder that moved, and whose disk was numbered anew since, is on another device at another path, so its device, inode and birth time alone don&amp;rsquo;t name it. So the VM&amp;rsquo;s state also records the folder&amp;rsquo;s volume, which no renumbering changes. On macOS that&amp;rsquo;s its volume UUID, as &lt;code&gt;diskutil info&lt;/code&gt; gives it for the folder&amp;rsquo;s mount point, and on Linux it&amp;rsquo;s the file system&amp;rsquo;s own ID (&lt;code&gt;f_fsid&lt;/code&gt;) on ext4, Btrfs, where each subvolume has its own, and ZFS. XFS, F2FS and tmpfs derive that ID from the device or the mount, so a folder on them, or on any other file system, records no volume and keeps the rule above. devvm reads the folder&amp;rsquo;s mount point, its device and its file system&amp;rsquo;s ID from the folder opened with no link on its path, and on macOS it takes &lt;code&gt;diskutil&lt;/code&gt;&amp;rsquo;s answer only when it names that mount point and that device, so a volume mounted there meanwhile isn&amp;rsquo;t taken for it. A folder on a volume mounted read-only, or a snapshot, records no volume and matches none. The state records the volume bound to the folder&amp;rsquo;s inode and birth time, so a record that an older devvm left beside a folder it moved, whose inode is another, names no volume and is recorded again. devvm offers a moved folder the VM when its volume, inode and birth time are the recorded ones and the conditions above hold. When the record&amp;rsquo;s volume is marked unchecked, devvm offers the VM only once it has read the volume and found the one recorded. It looks the volume up only once the inode and birth time match. A command looks each mount&amp;rsquo;s volume up once, and looks up none after one lookup fails. A lookup has 1 second when a launch records it or when &lt;code&gt;devvm ls&lt;/code&gt; and &lt;code&gt;devvm space&lt;/code&gt; check whether a folder is gone, and 5 seconds when devvm makes, adopts or moves a VM, offers a move, or checks a renumbered folder at its own path. A lookup that fails or takes longer records nothing, and a later launch tries again. When devvm can&amp;rsquo;t tell a renumbered folder&amp;rsquo;s volume, it judges the folder by the rule above, as one whose state records no volume. The launch then records the folder&amp;rsquo;s new device with the volume it had, marked unchecked (&lt;code&gt;folder_unchecked&lt;/code&gt; in &lt;code&gt;vm.json&lt;/code&gt;), so each later launch looks the volume up again and takes the folder for another one when it&amp;rsquo;s on another volume, until a lookup finds the volume recorded and clears the mark. On Linux, where the folder&amp;rsquo;s volume is read in the process at no cost, every launch compares it with the volume recorded, so a copy with a volume ID of its own, such as a Btrfs snapshot or a ZFS clone, mounted at the folder&amp;rsquo;s path is another folder even on the device the original had. A copy made with &lt;code&gt;dd&lt;/code&gt; or an LVM snapshot of ext4 keeps the volume&amp;rsquo;s UUID, and so its ID, as above. A Btrfs snapshot rolled back at the folder&amp;rsquo;s path is another subvolume, with an ID of its own, so its folder is another folder, which &lt;code&gt;devvm adopt&lt;/code&gt; gives the VM, and so is the folder after you give its volume a new UUID, as &lt;code&gt;tune2fs -U&lt;/code&gt; does. devvm reads the folder&amp;rsquo;s owner, which the offer of a move needs, from the same open folder as its identity, so the folder that&amp;rsquo;s checked as yours is the one whose identity devvm matches and records. It reads the owner as the system reports it, so on a macOS volume that ignores ownership, as disk images and external disks often do, every folder is yours, and that check tells nothing there. A clone of a disk, by &lt;code&gt;asr&lt;/code&gt; or &lt;code&gt;dd&lt;/code&gt;, or an LVM snapshot mounted for writing, keeps the volume, inode and birth time, so its copy of the folder at another path matches too, when nothing is left at the old path, as at the same path it already did. A volume ID can also be forged by anyone who can write a volume&amp;rsquo;s metadata, which takes root, or a disk or disk image that someone crafted and you attach. Such a forgery gets no more than a copy that keeps all three does, which is an offer of the VM that you confirm at another path, and the VM itself at the folder&amp;rsquo;s own path, where it has to be mounted. Nothing in a VM can make one (&lt;a href="https://next.devvm.dev/docs/contributing/design/#a-folders-volume"&gt;a folder&amp;rsquo;s volume&lt;/a&gt;). A folder whose state records its volume is also on its disk when the first folder above its old path is on that volume, so a renumbered disk isn&amp;rsquo;t taken for an unmounted one (&amp;ldquo;not connected&amp;rdquo;). The state records the volume when the VM is made, adopted or moved, and, for a VM whose state doesn&amp;rsquo;t record one yet, at its first launch that finds its folder.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-projects-devcontainerjson"&gt;A project&amp;rsquo;s devcontainer.json&lt;span class="hx:absolute hx:-mt-20" id="a-projects-devcontainerjson"&gt;&lt;/span&gt;
&lt;a href="#a-projects-devcontainerjson" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A project&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/devcontainer/"&gt;&lt;code&gt;devcontainer.json&lt;/code&gt;&lt;/a&gt; belongs to the project, and so to the VM, which can rewrite it for the folder&amp;rsquo;s next VM, or for the VM itself when you run &lt;code&gt;devvm update&lt;/code&gt;. devvm reads it only when it makes a VM, new or again, and uses only what it can do inside the VM. Nothing in it runs on this machine, so &lt;code&gt;initializeCommand&lt;/code&gt; never runs. Nothing in it reaches this machine&amp;rsquo;s files, because devvm doesn&amp;rsquo;t follow a link out of the folder, or this machine&amp;rsquo;s environment, because devvm refuses &lt;code&gt;${localEnv:…}&lt;/code&gt; before it makes anything. It can&amp;rsquo;t add a mount or change the VM&amp;rsquo;s network tier or other confinement.&lt;/p&gt;
&lt;p&gt;Its commands run in the VM as the VM&amp;rsquo;s user, confined like anything else in it. Its features can only be devvm&amp;rsquo;s own layers, so devvm never fetches or runs a feature&amp;rsquo;s script, and it refuses &lt;code&gt;docker-outside-of-docker&lt;/code&gt;. devvm uses its &lt;code&gt;image&lt;/code&gt; only when the image&amp;rsquo;s registry gives it to anyone who asks anonymously, so it never uses a container image that only your Docker has or that only your registry login reaches. It refuses a registry named &lt;code&gt;localhost&lt;/code&gt; or by an address that isn&amp;rsquo;t the internet&amp;rsquo;s, and its lookup connects only to the internet&amp;rsquo;s addresses, so it never uses an image on this machine or its network, except through a company proxy, which resolves the registry&amp;rsquo;s name itself (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#spreading-beyond-the-vm"&gt;attack vectors&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;An existing VM never changes when the file does, until you run &lt;code&gt;devvm update&lt;/code&gt;, which says it reads the file again and asks before it makes the VM again. The file read again is held to the same refusals as a new VM&amp;rsquo;s, and it can&amp;rsquo;t replace a base you chose with &lt;code&gt;--from&lt;/code&gt;, bring back a port you took out with &lt;code&gt;devvm ports rm&lt;/code&gt;, or change its network tier, size, SSH agent or &lt;code&gt;.git&lt;/code&gt; protection, which devvm keeps.&lt;/p&gt;
&lt;p&gt;Its &lt;code&gt;forwardPorts&lt;/code&gt; are added to the VM&amp;rsquo;s ports, as &lt;code&gt;devvm ports add&lt;/code&gt; adds them, even beyond a list you narrowed, both when devvm makes the VM and when &lt;code&gt;devvm update&lt;/code&gt; reads the file again. They go through the one port forwarder, so they listen on this machine&amp;rsquo;s loopback alone (127.0.0.1 and ::1), never take a port that a program on this machine has, and never take a port another VM forwards (&lt;a href="https://next.devvm.dev/docs/internals/ports/"&gt;port forwarding&lt;/a&gt;). What a cloned repo&amp;rsquo;s file opens is so only what &lt;code&gt;devvm ports add&lt;/code&gt; could open, but it reaches whatever on this machine connects to those ports, a browser&amp;rsquo;s pages included (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;attack vectors&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="read-only-and-confined-builds"&gt;Read-only and confined builds&lt;span class="hx:absolute hx:-mt-20" id="read-only-and-confined-builds"&gt;&lt;/span&gt;
&lt;a href="#read-only-and-confined-builds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm builds images with nothing from the host mounted, and it confines their builds (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;details&lt;/a&gt;). Every build reaches the internet. On macOS it can&amp;rsquo;t reach the host&amp;rsquo;s loopback, but it reaches your LAN, the host&amp;rsquo;s own address on it included, and on Linux it reaches the host&amp;rsquo;s loopback too. Credentials never go into images.&lt;/p&gt;
&lt;p&gt;A tool build writes into a folder of its own and never into the shared tools, and devvm checks each tool image, moves it in and writes its record, with its hash (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;details&lt;/a&gt;). Tool images for glibc, which any VM may mount, build only in devvm&amp;rsquo;s own Ubuntu base, never in a &lt;code&gt;--from&lt;/code&gt; image, and musl ones are keyed by the digest of the &lt;code&gt;--from&lt;/code&gt; base they build in, so a container image&amp;rsquo;s code never reaches another VM&amp;rsquo;s tools. devvm&amp;rsquo;s VMs live in a Lima home of their own, so Lima settings you made for other VMs never reach them. devvm also refuses a VM with a network it didn&amp;rsquo;t give the VM, because that network would reach around the proxy (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="git-protection"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;span class="hx:absolute hx:-mt-20" id="git-protection"&gt;&lt;/span&gt;
&lt;a href="#git-protection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The VM can&amp;rsquo;t change the parts of &lt;code&gt;.git&lt;/code&gt; that run code on the host, because devvm locks hooks and config. On macOS it sets a flag the VM can&amp;rsquo;t clear, and on Linux it makes them read-only in the user namespace that QEMU runs in. A Linux host whose kernel doesn&amp;rsquo;t let devvm use a user namespace has no locks, and devvm only watches &lt;code&gt;.git&lt;/code&gt; there (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="network-tiers"&gt;Network tiers&lt;span class="hx:absolute hx:-mt-20" id="network-tiers"&gt;&lt;/span&gt;
&lt;a href="#network-tiers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM on a confined tier, internet, allowlist or none, reaches nothing but its own proxy on the host and the &lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;links&lt;/a&gt; you added to it. On macOS its Lima process runs under a macOS sandbox, and on Linux QEMU&amp;rsquo;s network is restricted (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;details&lt;/a&gt;). Even root in the VM can&amp;rsquo;t get around that. A link&amp;rsquo;s connections don&amp;rsquo;t use the VM&amp;rsquo;s network, because this machine carries them over ssh, and only to a port that another VM on the same tier or a stricter one publishes. An open VM runs on its backend&amp;rsquo;s own network, and its proxy applies no rules.&lt;/p&gt;
&lt;p&gt;The proxy applies the tier&amp;rsquo;s rules, and it refuses the host&amp;rsquo;s own addresses and internal addresses unless a rule names them (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;). The one thing that VMs share through their proxies is the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt;, for those with the nix layer. Only the host writes it, with packages from cache.nixos.org whose signature it checked, and nothing a VM sends is stored, so a VM can make the host fetch but can&amp;rsquo;t change what another VM gets. After each start, devvm checks that the VM still runs confined and can&amp;rsquo;t connect out directly, and it stops a VM that fails the check instead of opening it (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="ssh-into-vms"&gt;ssh into VMs&lt;span class="hx:absolute hx:-mt-20" id="ssh-into-vms"&gt;&lt;/span&gt;
&lt;a href="#ssh-into-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;ssh and editors reach a running VM by name through the entries that devvm writes (&lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;ssh access by name&lt;/a&gt;). Each entry is built so that ssh connects only to that VM and the connection gives the VM nothing else of this machine&amp;rsquo;s:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each entry checks the VM&amp;rsquo;s own host keys,&lt;/strong&gt; which devvm keeps in the VM&amp;rsquo;s folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/known_hosts&lt;/code&gt;, as a record of the VM&amp;rsquo;s current start. devvm reads them from the VM through its backend, instead of over the network, once each start, after the VM runs, whatever ports the VM forwards, and the record names the start it was read for, so the keys of an earlier start are read again rather than trusted, whoever started the VM. devvm also removes the record before each start of its own. A VM whose Lima config changed gets new host keys when it boots. A VM whose keys devvm can&amp;rsquo;t read gets no entry, and ssh refuses a host key that doesn&amp;rsquo;t match. devvm&amp;rsquo;s port forwarder, the sessions of links between VMs and a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s git all check the VM against the same record.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only host keys go into the record.&lt;/strong&gt; devvm keeps a line the VM shows only when its key decodes and names its own type, which works for every key type ssh has, and it drops certificates, markers such as &lt;code&gt;@cert-authority&lt;/code&gt;, patterns and anything else. So the VM can&amp;rsquo;t add a line that would make ssh trust another host, or trust a key for another name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each connection is its own.&lt;/strong&gt; The entries set &lt;code&gt;ControlMaster no&lt;/code&gt;, so a session never rides on a connection that another program opened. Of Lima&amp;rsquo;s own ssh settings for the VM, devvm copies only the address, port, user and login key, because Lima&amp;rsquo;s settings turn host key checks off.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The entries turn off everything else your ssh could share with the VM.&lt;/strong&gt; They set &lt;code&gt;ForwardX11 no&lt;/code&gt;, &lt;code&gt;ForwardX11Trusted no&lt;/code&gt;, &lt;code&gt;Tunnel no&lt;/code&gt;, &lt;code&gt;PermitRemoteOpen none&lt;/code&gt;, &lt;code&gt;AddKeysToAgent no&lt;/code&gt;, &lt;code&gt;ProxyJump none&lt;/code&gt;, &lt;code&gt;ProxyCommand none&lt;/code&gt;, &lt;code&gt;UpdateHostKeys no&lt;/code&gt; and &lt;code&gt;HashKnownHosts no&lt;/code&gt;, whatever your own &lt;code&gt;Host *&lt;/code&gt; says. That turns off X11, tunnels, remote SOCKS forwards and adding keys to an agent. &lt;code&gt;PermitRemoteOpen&lt;/code&gt; needs OpenSSH 8.7 or newer (&lt;code&gt;ssh -V&lt;/code&gt;), and an older ssh refuses the entries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Of your environment, the entries send only &lt;code&gt;COLORTERM&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;SendEnv COLORTERM&lt;/code&gt;), which says whether your terminal shows 24-bit color. The VM gets it only where its sshd accepts it, as Ubuntu&amp;rsquo;s does in devvm&amp;rsquo;s base. devvm doesn&amp;rsquo;t set that up itself, so a VM made &lt;code&gt;--from&lt;/code&gt; a container image whose sshd doesn&amp;rsquo;t accept it, such as Alpine&amp;rsquo;s, gets none. ssh sends it as your terminal has it, and it adds to the variables your own &lt;code&gt;Host *&lt;/code&gt; sends, such as macOS&amp;rsquo;s &lt;code&gt;LANG&lt;/code&gt; and &lt;code&gt;LC_*&lt;/code&gt;, rather than replacing them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your agent is forwarded only as the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;SSH agent&lt;/a&gt; choice says.&lt;/strong&gt; devvm&amp;rsquo;s own connections to a VM follow the same choice, the one the VM&amp;rsquo;s current start was made with, and each carries that VM&amp;rsquo;s agent alone. devvm finds the VM&amp;rsquo;s agent, which is yours, devvm&amp;rsquo;s own or none, and the VM&amp;rsquo;s proxy relays it on a socket of the VM&amp;rsquo;s own, passing on only listing keys, signing and binding a session to a host, so the VM can&amp;rsquo;t remove the agent&amp;rsquo;s keys, lock it or add keys to it (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;). devvm gives that socket to the backend&amp;rsquo;s start of the VM, to its shell and to the commands that set it up, such as the setup devvm sends and the &lt;code&gt;devcontainer.json&lt;/code&gt; commands. The backend&amp;rsquo;s other commands get no agent, and neither do the reads of a VM&amp;rsquo;s host keys, the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;self-check&lt;/a&gt;&amp;rsquo;s probe, the checks of a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s clone or &lt;code&gt;devvm paste&lt;/code&gt;&amp;rsquo;s writes and counts. devvm never changes its own environment, so when one run reaches several VMs, such as a group&amp;rsquo;s links, no VM gets another VM&amp;rsquo;s agent. devvm&amp;rsquo;s background processes, such as the proxy and the port forwarder, start without an agent in their environment, and the proxy reaches only the one its config names. devvm&amp;rsquo;s own ssh to a VM uses the VM&amp;rsquo;s login key alone. &lt;code&gt;devvm limactl&lt;/code&gt; runs without your agent too, because Lima&amp;rsquo;s ssh shares one connection per VM, kept open after the command ends, and an agent forwarded over it is the agent of whichever command opened it. With your agent, a &lt;code&gt;devvm limactl shell&lt;/code&gt; could open that connection and pass your agent to devvm&amp;rsquo;s later sessions of a VM whose choice is devvm&amp;rsquo;s agent or none.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A session carries the VM&amp;rsquo;s connections through your machine only where your ssh asks for it. The entries can&amp;rsquo;t turn off a &lt;code&gt;RemoteForward&lt;/code&gt; of yours without also refusing an &lt;code&gt;ssh -R&lt;/code&gt; you type, so a &lt;code&gt;RemoteForward&lt;/code&gt; still applies. The VM&amp;rsquo;s sshd allows local forwarding (&lt;code&gt;-L&lt;/code&gt; and &lt;code&gt;-D&lt;/code&gt;, which VS Code uses), and it allows remote forwards only on addresses in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, which devvm keeps for links between VMs, so a remote forward on the VM&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, as &lt;code&gt;ssh -R&lt;/code&gt; asks by default, is refused. It allows no tunnels or X11. Root in the VM can change all of that, so it&amp;rsquo;s your ssh that decides, and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;remote forwards you add&lt;/a&gt; says what&amp;rsquo;s left open.&lt;/p&gt;
&lt;h3 data-hextra-search-id="secrets-stay-on-the-host"&gt;Secrets stay on the host&lt;span class="hx:absolute hx:-mt-20" id="secrets-stay-on-the-host"&gt;&lt;/span&gt;
&lt;a href="#secrets-stay-on-the-host" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm saves secrets in the macOS Keychain, or elsewhere in files only you can read, and it never puts a secret in a process&amp;rsquo;s arguments (&lt;a href="https://next.devvm.dev/docs/internals/network/#where-secrets-are-saved"&gt;where secrets are saved&lt;/a&gt;). A VM uses only the Claude Code token, when its image has &lt;code&gt;claude&lt;/code&gt;, and the secrets you bind to it. On every tier, a VM&amp;rsquo;s secrets and its agents&amp;rsquo; logins stay on your machine, and its proxy puts them only into requests for their own hosts.&lt;/p&gt;
&lt;p&gt;The secrets work only for that VM. Its proxy needs the VM&amp;rsquo;s own password, and the VM&amp;rsquo;s placeholders end in a random value of the VM&amp;rsquo;s own, which isn&amp;rsquo;t the password, so a placeholder that the VM sends elsewhere gives nothing away. Another VM, or a program on the host that reaches the proxy&amp;rsquo;s port, gets no secret. The password is in files only you can read, and never in a process&amp;rsquo;s arguments or in devvm&amp;rsquo;s run logs, and only you can read the proxy&amp;rsquo;s logs.&lt;/p&gt;
&lt;p&gt;Each VM&amp;rsquo;s proxy reads traffic to the hosts it puts secrets in for with the VM&amp;rsquo;s own CA, which devvm keeps in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/ca/&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;the VM&amp;rsquo;s CA&lt;/a&gt;). Your machine never trusts it, but inside its VM it vouches for any site, and no other VM trusts it. Only you can read the keys, they never leave this machine, and devvm keeps them out of Time Machine. Each CA lasts 30 days, and the next one, which the VM already trusts, takes over a week before the current one ends. The certificates that the proxy makes never outlast their CA. What a copy of a key could do, and for how long, is under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#this-machine"&gt;the proxy&amp;rsquo;s CA keys&lt;/a&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="set-id-files-on-linux-hosts"&gt;Set-id files on Linux hosts&lt;span class="hx:absolute hx:-mt-20" id="set-id-files-on-linux-hosts"&gt;&lt;/span&gt;
&lt;a href="#set-id-files-on-linux-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Root in a VM can set the set-user-id and set-group-id bits on files in the project folder. On macOS these bits don&amp;rsquo;t reach the host, because virtiofs drops them, but on Linux they do. A file that a Lima VM writes is yours, so a set-user-id file runs as you for anyone else on the machine who runs it. A set-user-id file that your machine&amp;rsquo;s root owns runs as root for anyone who runs it, you included, and since the VM&amp;rsquo;s writes are yours, such a file came from something else on this machine.&lt;/p&gt;
&lt;p&gt;devvm names such files when it makes a VM and once a VM is stopped, by &lt;code&gt;devvm stop&lt;/code&gt; or found stopped at a launch, but not at a launch into a running VM, because the search reads every file&amp;rsquo;s metadata and takes about a second for 200,000 files. It skips &lt;code&gt;.git&lt;/code&gt; folders, which hold most of a big project&amp;rsquo;s files and whose files nothing runs by their path. It lists root&amp;rsquo;s files apart with &lt;code&gt;setid_root_files&lt;/code&gt;, and you shouldn&amp;rsquo;t run them but delete them with &lt;code&gt;sudo rm&lt;/code&gt;. It lists the rest with &lt;code&gt;setid_files&lt;/code&gt;, and &lt;code&gt;chmod u-s,g-s FILE&lt;/code&gt; clears their bits.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-it-doesnt-protect"&gt;What it doesn&amp;rsquo;t protect&lt;span class="hx:absolute hx:-mt-20" id="what-it-doesnt-protect"&gt;&lt;/span&gt;
&lt;a href="#what-it-doesnt-protect" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each defense on this page leaves something open, such as what allowed hosts and secrets permit, open VMs, files the VM writes into the project folder, links between VMs, and escapes from the VM itself through bugs in Lima, Apple&amp;rsquo;s Virtualization framework or QEMU. &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/"&gt;Attack vectors&lt;/a&gt; keeps the one list of them, under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#narrowed-not-closed"&gt;Narrowed, not closed&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#left-to-you"&gt;Left to you&lt;/a&gt;, and each entry there links back to its mechanism.&lt;/p&gt;
&lt;p&gt;Found a way out of a VM? See &lt;a href="https://github.com/devvmhq/devvm/blob/main/SECURITY.md" target="_blank" rel="noopener"&gt;SECURITY.md&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Writing docs</title><link>https://next.devvm.dev/docs/contributing/docs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/docs/</guid><description>
&lt;h2 data-hextra-search-id="writing-docs"&gt;Writing docs&lt;span class="hx:absolute hx:-mt-20" id="writing-docs"&gt;&lt;/span&gt;
&lt;a href="#writing-docs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The site is &lt;a href="https://gohugo.io" target="_blank" rel="noopener"&gt;Hugo&lt;/a&gt; with the &lt;a href="https://imfing.github.io/hextra/" target="_blank" rel="noopener"&gt;Hextra&lt;/a&gt; theme, built from &lt;code&gt;docs/&lt;/code&gt;. Hextra is a Hugo module pinned in &lt;code&gt;docs/go.mod&lt;/code&gt;; update it with &lt;code&gt;hugo mod get github.com/imfing/hextra@&amp;lt;version&amp;gt;&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pages&lt;/strong&gt; are Markdown files in &lt;code&gt;docs/content/docs/&lt;/code&gt;, one per topic, in a folder per section of the sidebar. The sections run in the order a new user needs them: &lt;code&gt;getting-started/&lt;/code&gt;, &lt;code&gt;using/&lt;/code&gt;, &lt;code&gt;releases/&lt;/code&gt;, &lt;code&gt;safety/&lt;/code&gt;, &lt;code&gt;backends/&lt;/code&gt;, &lt;code&gt;compared/&lt;/code&gt;, &lt;code&gt;cli/&lt;/code&gt;, &lt;code&gt;internals/&lt;/code&gt;, then &lt;code&gt;contributing/&lt;/code&gt;. Each folder&amp;rsquo;s &lt;code&gt;_index.md&lt;/code&gt; is the section&amp;rsquo;s own page, which lists its pages. Update the page for any behavior you change, in the same change. The README stays high level: it says what devvm is and links to the pages for the rest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What goes where:&lt;/strong&gt; the user pages, in &lt;code&gt;getting-started/&lt;/code&gt;, &lt;code&gt;using/&lt;/code&gt;, &lt;code&gt;safety/&lt;/code&gt;, &lt;code&gt;backends/&lt;/code&gt; and &lt;code&gt;compared/&lt;/code&gt;, say what devvm does, what you type and what you see, and they name no repo paths, Go identifiers or message names. How it works, in &lt;code&gt;internals/&lt;/code&gt;, explains how devvm does it, for readers who want to check a claim, and it holds the mechanisms and the message names that come from them. Contributing, in &lt;code&gt;contributing/&lt;/code&gt;, covers changing devvm, so repo paths, Go identifiers, version bumps, releases and tests go there, and so do the &lt;a href="https://next.devvm.dev/docs/contributing/design/"&gt;design notes&lt;/a&gt;, which say why devvm is built as it is and hold each emulation&amp;rsquo;s design note and threat check. A user page links once to its How it works page where there is one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Current behavior, but for releases:&lt;/strong&gt; every page describes how devvm works now, and none mentions older behavior, what changed or what moved, because that goes in the changelog and on the release pages. Releases, in &lt;code&gt;releases/&lt;/code&gt;, is the one place the docs describe history. It has a page for each minor release, such as &lt;code&gt;releases/0.2.0.md&lt;/code&gt;, which covers the release and its release candidates and is written as the release is made. Each change there has a section of its own, under Breaking changes, Changes, Fixes or Hardening, that tells its full story: what was wrong or missing, how it showed, how devvm works now, at the level of the user pages, and what you do, with links to the user or How it works pages for anything deeper. The changelog&amp;rsquo;s entry links each section, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; says. These pages follow the docs voice, but they aren&amp;rsquo;t user pages, so the rules for leading with a command don&amp;rsquo;t apply.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;User pages lead with doing:&lt;/strong&gt; a task on a user page, in &lt;code&gt;getting-started/&lt;/code&gt;, &lt;code&gt;using/&lt;/code&gt;, &lt;code&gt;safety/&lt;/code&gt;, &lt;code&gt;backends/&lt;/code&gt; or &lt;code&gt;compared/&lt;/code&gt;, shows its command, in a copyable block or numbered steps, and a short explanation follows. One paragraph of why next to its command is fine, but two or more paragraphs back to back mean the mechanism belongs on the How it works page, under a heading that the user page links to, with every fact moved rather than dropped. The docs-voice skill&amp;rsquo;s &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/docs-voice/SKILL.md" target="_blank" rel="noopener"&gt;SKILL.md&lt;/a&gt; has the rule, under Commands first on user pages, with an example, and its &lt;code&gt;scan.sh -p paras&lt;/code&gt; and &lt;code&gt;scan.sh -p long&lt;/code&gt; list the runs and the long paragraphs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Front matter&lt;/strong&gt; sets &lt;code&gt;title&lt;/code&gt;, shown as the page&amp;rsquo;s heading, &lt;code&gt;weight&lt;/code&gt;, the page&amp;rsquo;s place in its section, or a section&amp;rsquo;s place in the sidebar for an &lt;code&gt;_index.md&lt;/code&gt;, and &lt;code&gt;explainer&lt;/code&gt;, the line under the title on the page&amp;rsquo;s social card, which Social cards below describes. Start the body at &lt;code&gt;##&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Links&lt;/strong&gt; to other pages point at their files (&lt;code&gt;[Contributing](_index.md)&lt;/code&gt;), so the linters can check them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Diagrams&lt;/strong&gt; are Mermaid code blocks, fenced with &lt;code&gt;mermaid&lt;/code&gt;, which a script draws as SVGs before Hugo builds the site, so no page loads Mermaid or any other diagram JavaScript. A diagram goes where it helps the reader follow the text, with at most one sentence to introduce it, and the text keeps every fact the diagram shows.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Drawing them:&lt;/strong&gt; &lt;code&gt;mise run docs:diagrams&lt;/code&gt; installs &lt;a href="https://pele.run" target="_blank" rel="noopener"&gt;pele&lt;/a&gt; with &lt;code&gt;npm ci --ignore-scripts&lt;/code&gt;, at the version and integrity that &lt;code&gt;docs/package.json&lt;/code&gt; and &lt;code&gt;docs/package-lock.json&lt;/code&gt; pin, and then runs &lt;code&gt;docs/render-diagrams.mjs&lt;/code&gt;. The script draws each block in &lt;code&gt;docs/content&lt;/code&gt; as an SVG in &lt;code&gt;docs/.build/diagrams/&lt;/code&gt;, which git ignores, with a JSON file of the diagram&amp;rsquo;s size beside it. It names both files for the block&amp;rsquo;s key, which is a hash of the salt and the block&amp;rsquo;s text. The salt is a hash of pele&amp;rsquo;s version and the script itself, and the script writes it to that folder too. &lt;code&gt;mise run docs&lt;/code&gt; and &lt;code&gt;mise run lint:docs&lt;/code&gt; run it first, and so do the Docs workflow&amp;rsquo;s builds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching:&lt;/strong&gt; a run with nothing changed takes a few hundredths of a second. mise skips the task when the drawings&amp;rsquo; folder is newer than every page in &lt;code&gt;docs/content&lt;/code&gt;, the script, &lt;code&gt;docs/package.json&lt;/code&gt; and the lock, so the script updates the folder&amp;rsquo;s time on every run. The task runs &lt;code&gt;npm ci&lt;/code&gt; only when the lock&amp;rsquo;s SHA-256 differs from the one it wrote to &lt;code&gt;docs/node_modules/.devvm-lock-sha256&lt;/code&gt; after its last install. The script keeps every drawing that&amp;rsquo;s already there, draws only the blocks it has no drawing of, and deletes the files no block&amp;rsquo;s key names, so a changed diagram is drawn again on its own, and a new pele or a change to the script draws them all again. The CI workflow&amp;rsquo;s check job caches npm&amp;rsquo;s downloads, keyed on the lock, and the Docs workflow, which publishes, keeps no cache and draws every diagram.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Putting them in pages:&lt;/strong&gt; &lt;code&gt;hugo.yaml&lt;/code&gt; mounts that folder at &lt;code&gt;assets/diagrams&lt;/code&gt;, and the render hook, &lt;code&gt;docs/layouts/_markup/render-codeblock-mermaid.html&lt;/code&gt;, which takes the place of Hextra&amp;rsquo;s, reads the salt, computes each block&amp;rsquo;s key from it and the block&amp;rsquo;s text, and puts the SVG in the page. A block without its SVG fails the build, so run &lt;code&gt;mise run docs:diagrams&lt;/code&gt; again after you change a diagram, even while &lt;code&gt;mise run docs&lt;/code&gt; serves the site, because the server doesn&amp;rsquo;t redraw them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The theme&lt;/strong&gt; is in &lt;code&gt;custom.css&lt;/code&gt;, which sets pele&amp;rsquo;s &lt;code&gt;--pele-*&lt;/code&gt; variables from the site&amp;rsquo;s palette, so a diagram never sets its own colors or font. Panels are on the surface color with blue borders, lines and arrows are lime, subgraphs, lifelines and notes use the border color, and text is in Departure Mono at 14px, larger than the home page&amp;rsquo;s art so labels read easily.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The layout&lt;/strong&gt; is pele&amp;rsquo;s own, with the Mermaid settings that &lt;code&gt;render-diagrams.mjs&lt;/code&gt; passes, such as right-angled edges. A diagram can set its own layout in front matter, as Staying safe&amp;rsquo;s three columns set &lt;code&gt;minNodeWidth&lt;/code&gt;, but never its own colors or font. pele lays subgraphs out from left to right in the order they&amp;rsquo;re written.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Measuring labels:&lt;/strong&gt; the script measures each label by Departure Mono&amp;rsquo;s metrics, where every character is 350/550 of the font size wide, so labels fit their boxes. pele draws edge labels, messages and notes at seven-eighths of the size, 12px, and has no option to change it, so the measurer gives that text its width at 14px and the script then writes it at 14px. A self-check, before anything is drawn, fails the run when pele no longer measures and writes that text as the script expects, and every group of small text that pele draws must carry the 12px size the script replaces. The script also puts a newline after each label, where the SVG draws nothing, so the site&amp;rsquo;s search sees one label&amp;rsquo;s last word apart from the next label&amp;rsquo;s first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Size:&lt;/strong&gt; each diagram is drawn at its own size and never scaled to fit. The hook sets each diagram&amp;rsquo;s width on it, and a diagram wider than the text reaches into the page&amp;rsquo;s right margin, the article&amp;rsquo;s padding, as far as it needs, and into the padding on the left for whatever the right margin can&amp;rsquo;t hold, so it never covers the table of contents. A diagram wider than the text and both paddings scrolls sideways, as the widest ones do on a narrow screen. &lt;code&gt;custom.css&lt;/code&gt; gives each one &lt;code&gt;content-visibility: auto&lt;/code&gt;, so the browser draws it only when it nears the screen, and the hook sets the diagram&amp;rsquo;s height as its &lt;code&gt;contain-intrinsic-block-size&lt;/code&gt;, so the page doesn&amp;rsquo;t jump while you scroll.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility:&lt;/strong&gt; every diagram has an &lt;code&gt;accTitle&lt;/code&gt; and a one-line &lt;code&gt;accDescr&lt;/code&gt;, which become the SVG&amp;rsquo;s title and description that screen readers read, and the script fails on a diagram without them. The description says in full sentences what the diagram shows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Labels:&lt;/strong&gt; keep labels short, and break a long one with &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;. In a label, write &lt;code&gt;&amp;lt;&lt;/code&gt; as &lt;code&gt;#lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; as &lt;code&gt;#gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pele&amp;rsquo;s version&lt;/strong&gt; is pinned exactly, and &lt;code&gt;scripts/bump.sh pele&lt;/code&gt; moves it (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#updating-pinned-versions"&gt;updating pinned versions&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Style:&lt;/strong&gt; succinct and direct. Commands are written as devvm x or in backticks, never in quotes. No &lt;code&gt;please&lt;/code&gt;, &lt;code&gt;simply&lt;/code&gt; or &lt;code&gt;note that&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The home page&lt;/strong&gt; is &lt;code&gt;docs/content/_index.md&lt;/code&gt;, on Hextra&amp;rsquo;s &lt;code&gt;hextra-home&lt;/code&gt; layout: its hero shortcodes, then plain Markdown. &lt;code&gt;custom.css&lt;/code&gt; styles it through the one &lt;code&gt;div&lt;/code&gt; that the layout wraps its content in. After the hero, the page has a quick start, what&amp;rsquo;s supported, why to use devvm with its feature cards, a short FAQ, and a closing call to action with the hero&amp;rsquo;s buttons. It keeps a marketing tone, but each of its claims matches the docs page it links to, it uses the same terms, and it says each thing once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The quick start&lt;/strong&gt; shows the three commands to run first, each after a comment short enough to fit a phone&amp;rsquo;s width, because a comment after its command would scroll out of view there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Feature cards&lt;/strong&gt; on the home page come from two shortcodes in &lt;code&gt;docs/layouts/_shortcodes/&lt;/code&gt;, which make a &lt;code&gt;{{&amp;lt; features &amp;gt;}}&lt;/code&gt; grid of &lt;code&gt;{{&amp;lt; feature title=&amp;quot;Ready in seconds&amp;quot; icon=&amp;quot;high-voltage&amp;quot; art=&amp;quot;copies&amp;quot; &amp;gt;}}&lt;/code&gt; cards, each closed with &lt;code&gt;{{&amp;lt; /feature &amp;gt;}}&lt;/code&gt;. A card shows its title as a heading, after the pixel icon its &lt;code&gt;icon&lt;/code&gt; names, drawn in the title&amp;rsquo;s own color at 24px, then the Markdown inside it, then its illustration, which is optional. The cards are in one centered column on smaller screens. From 1024px wide, they go into two columns, the first, third and so on on the left and the rest on the right, and each card is as tall as its content, so no card leaves a gap under it. &lt;code&gt;features&lt;/code&gt; places them: &lt;code&gt;feature&lt;/code&gt; renders its card through &lt;code&gt;docs/layouts/_partials/feature-card.html&lt;/code&gt; and hands it over, and each card&amp;rsquo;s &lt;code&gt;order&lt;/code&gt; style keeps the page&amp;rsquo;s order when the columns stack. What&amp;rsquo;s supported uses the same cards with smaller illustrations, and Quick start uses them with a terminal in each card. &lt;code&gt;{{&amp;lt; features columns=&amp;quot;3&amp;quot; &amp;gt;}}&lt;/code&gt; puts three in a row from 1024px wide, and &lt;code&gt;level=&amp;quot;3&amp;quot;&lt;/code&gt; on a card makes its title an &lt;code&gt;h3&lt;/code&gt;, under the section&amp;rsquo;s own heading.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Art beside a section&amp;rsquo;s text&lt;/strong&gt; comes from &lt;code&gt;{{&amp;lt; beside art=&amp;quot;blast-radius&amp;quot; &amp;gt;}}&lt;/code&gt;, closed with &lt;code&gt;{{&amp;lt; /beside &amp;gt;}}&lt;/code&gt;, in &lt;code&gt;docs/layouts/_shortcodes/beside.html&lt;/code&gt;. It renders the Markdown inside it, then the illustration it names. From 1024px wide, the text and the drawing each take half the column, with the drawing on the right, centered on the text. On narrower screens, the drawing goes below the text. Why use devvm? uses it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install commands&lt;/strong&gt; come from &lt;code&gt;{{&amp;lt; install &amp;gt;}}&lt;/code&gt; in &lt;code&gt;docs/layouts/_shortcodes/install.html&lt;/code&gt;, which the home page and Installing use. The commands are written in one place, &lt;code&gt;docs/layouts/_partials/install-tabs.html&lt;/code&gt;, which the tabs and the pages&amp;rsquo; Markdown copies both read. It renders Hextra&amp;rsquo;s tabs with a macOS tab, which has the Homebrew command, and a Linux tab, which has the install script. The macOS tab is selected in the HTML, so it shows when JavaScript is off. A small script in &lt;code&gt;docs/layouts/_partials/install-os.html&lt;/code&gt; selects the Linux tab as the page loads when the browser&amp;rsquo;s platform or user agent string says Linux, apart from Android. To check the Linux tab in headless Chrome, pass &lt;code&gt;--user-agent=&lt;/code&gt; with a Linux user agent string. &lt;code&gt;custom.css&lt;/code&gt; styles the tabs on a blue line, with the selected tab in lime.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other content per operating system&lt;/strong&gt; goes in &lt;code&gt;{{&amp;lt; os-tabs &amp;gt;}}&lt;/code&gt;, with a &lt;code&gt;{{&amp;lt; os-tab name=&amp;quot;macOS&amp;quot; &amp;gt;}}&lt;/code&gt; and then a &lt;code&gt;{{&amp;lt; os-tab name=&amp;quot;Linux&amp;quot; &amp;gt;}}&lt;/code&gt; inside it, each holding Markdown, as Installing&amp;rsquo;s requirements tables do. It uses the same tabs, styles and script as the install commands, so the visitor&amp;rsquo;s system is selected, and the build fails unless the tabs are macOS&amp;rsquo;s, then Linux&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Colors:&lt;/strong&gt; the site is dark only (&lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;params.theme&lt;/code&gt;). Its palette is in &lt;code&gt;docs/assets/css/custom.css&lt;/code&gt;: a black background and one lime accent, &lt;code&gt;#7fff00&lt;/code&gt;, which sets Hextra&amp;rsquo;s primary color. The home page&amp;rsquo;s illustrations also use &lt;code&gt;#0086b3&lt;/code&gt;, the blue that Hextra&amp;rsquo;s syntax highlighting gives commands like &lt;code&gt;cd&lt;/code&gt;, and &lt;code&gt;#ff5370&lt;/code&gt; (&lt;code&gt;--devvm-red&lt;/code&gt;), the JustBlack theme&amp;rsquo;s red, which marks only what an attack has compromised. The red&amp;rsquo;s contrast is 6.7:1 on the black and 6.0:1 on the surface color, and it&amp;rsquo;s much darker than the lime, so the two stay apart for readers who can&amp;rsquo;t tell red from green.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fonts:&lt;/strong&gt; the site uses Instrument Sans for text, Martian Mono for code, and Departure Mono, a pixel font, for the logo and the home page&amp;rsquo;s headings, badge and buttons. All three are in &lt;code&gt;docs/static/fonts/&lt;/code&gt;, each in its own folder with its license, and &lt;code&gt;docs/layouts/_partials/custom/head-end.html&lt;/code&gt; declares them. Instrument Sans and Martian Mono are upstream&amp;rsquo;s variable WOFF2 files, so one file holds every weight, and the partial&amp;rsquo;s comment records where each font came from, at which commit or release, and its SHA-256. To update a font, download the new version from the same place, check its SHA-256, and update the comment. Departure Mono is sharp at multiples of 11px and has one weight.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No third-party requests:&lt;/strong&gt; devvm.dev and next.devvm.dev load every script, stylesheet, font and image from the site itself, so a visitor&amp;rsquo;s browser asks no other host for anything. &lt;code&gt;mise run lint:docs&lt;/code&gt; checks this after it builds the site: &lt;code&gt;TestNoThirdPartyLoads&lt;/code&gt; in &lt;code&gt;internal/cli/docgen/site_test.go&lt;/code&gt; reads every page and stylesheet and fails on a link, script, image, frame or CSS &lt;code&gt;url()&lt;/code&gt; that points at a host other than the ones in &lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s and &lt;code&gt;next.yaml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;baseURL&lt;/code&gt;. Hugo fetches FlexSearch, which Hextra&amp;rsquo;s search uses, when it builds the site, and the site serves it itself, so it passes. Diagrams are SVGs inside the pages, so they load nothing. Links that a visitor clicks, such as GitHub&amp;rsquo;s, aren&amp;rsquo;t loads, and the check ignores them. The social cards draw it from &lt;code&gt;docs/assets/fonts/departure-mono/&lt;/code&gt;, which has the same release&amp;rsquo;s OTF and license, because Hugo can&amp;rsquo;t draw text from a WOFF2.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The logo&lt;/strong&gt; in the navbar is the branding page&amp;rsquo;s &lt;code&gt;devvm-logo-on-dark.svg&lt;/code&gt; at its own size, which &lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;params.navbar.logo&lt;/code&gt; names, with the site&amp;rsquo;s title as its alt text. Right-clicking it opens the branding page instead of the browser&amp;rsquo;s menu, through a script in &lt;code&gt;docs/layouts/_partials/custom/footer.html&lt;/code&gt;. A left click, or Enter on the focused logo, still goes to the home page.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The branding page&lt;/strong&gt; is &lt;code&gt;docs/content/branding.md&lt;/code&gt;, at &lt;code&gt;/branding/&lt;/code&gt;, on its own layout, &lt;code&gt;docs/layouts/branding.html&lt;/code&gt;, which is Hextra&amp;rsquo;s home layout with the home page&amp;rsquo;s look and the script that copies a swatch&amp;rsquo;s hex. Its front matter keeps it out of the sidebar. It has the logo as box-drawing text in a code block, the logo&amp;rsquo;s SVGs and PNGs, the icons, the social card, the palette, the fonts, how to use the logo and the credits.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its downloads&lt;/strong&gt; are in &lt;code&gt;docs/static/branding/&lt;/code&gt;, and &lt;code&gt;{{&amp;lt; brand-asset &amp;gt;}}&lt;/code&gt; tiles inside &lt;code&gt;{{&amp;lt; brand-assets &amp;gt;}}&lt;/code&gt; show each one on its background, with a link to each file. The build fails when a file doesn&amp;rsquo;t exist, and it reads each PNG&amp;rsquo;s size for its link. &lt;code&gt;devvm-logo-on-dark.svg&lt;/code&gt; and &lt;code&gt;devvm-logo-on-light.svg&lt;/code&gt; are the logo, drawn on a pixel grid as the favicon is, made from Departure Mono&amp;rsquo;s 11px glyphs. The prompt and devvm are at twice the glyphs&amp;rsquo; size, the box is in 1-pixel lines, and the lock, a block with a keyhole under a 2-pixel arch, sits on the box&amp;rsquo;s bottom-right corner, with the box&amp;rsquo;s lines stopping short of it so that the arch stands clear. The version for light backgrounds is black, with its prompt in the dark lime, &lt;code&gt;#408000&lt;/code&gt; (&lt;code&gt;--devvm-accent-dark&lt;/code&gt;), which is the lime&amp;rsquo;s hue at half its lightness, with a contrast of 4.9:1 on white, where the lime has 1.2:1. Each logo&amp;rsquo;s PNG is its SVG at four times its size on a transparent background, and &lt;code&gt;devvm-icon-64.png&lt;/code&gt; to &lt;code&gt;devvm-icon-1024.png&lt;/code&gt; are &lt;code&gt;docs/static/favicon.svg&lt;/code&gt; at 4 to 64 times its size. After changing an SVG, render its PNGs again with headless Chrome&amp;rsquo;s &lt;code&gt;--screenshot&lt;/code&gt; at the exact size, passing &lt;code&gt;--default-background-color=00000000&lt;/code&gt; for the logos&amp;rsquo; transparency, and look at each one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The palette&lt;/strong&gt; comes from &lt;code&gt;{{&amp;lt; palette &amp;gt;}}&lt;/code&gt;, which reads the colors that &lt;code&gt;docs/data/palette.yaml&lt;/code&gt; lists, with each one&amp;rsquo;s name and use, and takes each hex from its variable in &lt;code&gt;custom.css&lt;/code&gt;, so the page always shows the site&amp;rsquo;s colors. The build fails when a variable isn&amp;rsquo;t there. A new color goes in both files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The fonts&lt;/strong&gt; each come from &lt;code&gt;{{&amp;lt; font-sample &amp;gt;}}&lt;/code&gt;, which shows a line of text in the font, with a link to the license the site serves for it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The favicon&lt;/strong&gt; is the same mark drawn on a 16-pixel grid in &lt;code&gt;docs/static/favicon.svg&lt;/code&gt;: the box, a lime prompt in its middle and a small lock centered on its bottom-right corner, overhanging it by 2 pixels each way, its shackle a closed arch, with the box&amp;rsquo;s lines stopping a pixel short of the lock, on black, with a pixel of black around the whole mark. Hextra links its icons by name, and the ones in &lt;code&gt;docs/static/&lt;/code&gt; take the place of its own: &lt;code&gt;favicon-16x16.png&lt;/code&gt; and &lt;code&gt;favicon-32x32.png&lt;/code&gt;, &lt;code&gt;favicon.ico&lt;/code&gt;, which holds those two PNGs, &lt;code&gt;apple-touch-icon.png&lt;/code&gt;, which is the grid at 160px with 10px of black around it, and the two &lt;code&gt;android-chrome-*.png&lt;/code&gt; icons that &lt;code&gt;site.webmanifest&lt;/code&gt; lists. Each PNG is the SVG at a whole multiple of its size, so its pixels stay sharp. &lt;strong&gt;The social card&lt;/strong&gt; in &lt;code&gt;docs/static/images/social-card.png&lt;/code&gt; is the 1200x630 card that the branding page offers for links to devvm. It has &lt;code&gt;devvm-logo-on-dark.svg&lt;/code&gt; at twice its size, the home page&amp;rsquo;s headline and tagline in Departure Mono, and the site&amp;rsquo;s colors. After changing the SVG or the card&amp;rsquo;s text, render the PNGs again with headless Chrome&amp;rsquo;s &lt;code&gt;--screenshot&lt;/code&gt; at the image&amp;rsquo;s exact size, and look at each one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Social cards:&lt;/strong&gt; every page gets a 1200x630 card of its own, which Hugo draws when it builds the site, and which sites and chat apps show when someone shares the page&amp;rsquo;s link.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The card&lt;/strong&gt; is &lt;code&gt;docs/assets/images/og-template.png&lt;/code&gt;, which is &lt;code&gt;social-card.png&lt;/code&gt; with the headline and tagline painted out in the background&amp;rsquo;s black, so it has the logo, devvm.dev and the lime bar, in the same four colors and nothing else. &lt;code&gt;docs/layouts/_partials/og-image.html&lt;/code&gt; draws three things on it with Hugo&amp;rsquo;s &lt;code&gt;images.Text&lt;/code&gt;, in Departure Mono: the page&amp;rsquo;s section in lime capitals at 22px, its title in white at 66px, or at 55px or 44px when a smaller size fits it in two lines, and its explainer in gray at 33px. A docs page&amp;rsquo;s section is its section&amp;rsquo;s title, such as Using devvm, a section&amp;rsquo;s own page has Docs, and the home page and the branding page have none. The text is centered between the logo and devvm.dev. Each size is a multiple of 11px and each line starts at a whole pixel, so the text is as sharp as the logo, and the card keeps only the template&amp;rsquo;s four colors. &lt;code&gt;docs/layouts/_partials/og-wrap.html&lt;/code&gt; wraps the lines at spaces, and because the font is monospaced, a line&amp;rsquo;s width is its length.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The explainer&lt;/strong&gt; is the &lt;code&gt;explainer&lt;/code&gt; in each page&amp;rsquo;s front matter: a few plain words on what the reader gets from the page, such as &lt;code&gt;Install devvm and check what it needs&lt;/code&gt;, without a full stop. It isn&amp;rsquo;t the page&amp;rsquo;s &lt;code&gt;description&lt;/code&gt;, which search engines and &lt;code&gt;llms.txt&lt;/code&gt; show, because that&amp;rsquo;s a sentence or two, and most pages have none. The home page&amp;rsquo;s card shows its &lt;code&gt;cardTitle&lt;/code&gt;, the hero&amp;rsquo;s headline, in place of its title, because the logo already says devvm. The CLI reference&amp;rsquo;s pages get their command&amp;rsquo;s &lt;code&gt;Short&lt;/code&gt; as their explainer when &lt;code&gt;mise run cli-docs&lt;/code&gt; writes them. &lt;code&gt;TestExplainers&lt;/code&gt; in &lt;code&gt;internal/cli/docgen&lt;/code&gt; fails when a page has no explainer, or when its explainer takes more than two lines of 48 characters or its title more than two lines of 36, which are the card&amp;rsquo;s lines at 33px and 44px.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The tags:&lt;/strong&gt; &lt;code&gt;docs/layouts/_partials/custom/head-end.html&lt;/code&gt; writes &lt;code&gt;og:image&lt;/code&gt; with its type, width, height and &lt;code&gt;og:image:alt&lt;/code&gt;, and &lt;code&gt;twitter:image:alt&lt;/code&gt;, whose text is devvm docs, the title and the explainer. &lt;code&gt;docs/layouts/_partials/_funcs/get-page-images.html&lt;/code&gt; takes the place of Hugo&amp;rsquo;s own, which its Twitter card and schema templates call for a page&amp;rsquo;s images, so &lt;code&gt;twitter:image&lt;/code&gt; and the schema&amp;rsquo;s image are the same card. &lt;code&gt;hugo.yaml&lt;/code&gt; names no &lt;code&gt;params.images&lt;/code&gt;, so Hextra&amp;rsquo;s Open Graph template writes no second &lt;code&gt;og:image&lt;/code&gt;. A card&amp;rsquo;s address is the site&amp;rsquo;s, so next.devvm.dev&amp;rsquo;s pages show next.devvm.dev&amp;rsquo;s cards.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The illustrations&lt;/strong&gt; on the home page are SVGs in &lt;code&gt;docs/assets/home/&lt;/code&gt;, and &lt;code&gt;{{&amp;lt; art &amp;quot;name&amp;quot; &amp;gt;}}&lt;/code&gt; inlines one into the page, so that it gets the page&amp;rsquo;s fonts and colors. A feature card&amp;rsquo;s &lt;code&gt;art&lt;/code&gt; parameter inlines one the same way, through &lt;code&gt;docs/layouts/_partials/art.html&lt;/code&gt;. Each one is drawn on Departure Mono&amp;rsquo;s 11px cell, 7 pixels wide and 14 tall, so its text and shapes are sharpest at its own size or at twice its size. The &lt;code&gt;art&lt;/code&gt; shortcode shows it at twice its size, 728px wide. A card shows it as wide as the card, at whatever scale that takes.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each card&amp;rsquo;s drawing shows what its text says, and nothing more.&lt;/strong&gt; The big cards&amp;rsquo; drawings are 364 by 140 pixels, or 168 for &lt;code&gt;isolated.svg&lt;/code&gt;: &lt;code&gt;zero-config.svg&lt;/code&gt; shows a dev server&amp;rsquo;s forwarded port, &lt;code&gt;devvm code&lt;/code&gt; and a commit authored by you, &lt;code&gt;copies.svg&lt;/code&gt; the base image and its copies, &lt;code&gt;isolated.svg&lt;/code&gt; the mount and the proxy, &lt;code&gt;agents.svg&lt;/code&gt; the agents&amp;rsquo; mounts, the history that stays and the token, and &lt;code&gt;make-it-yours.svg&lt;/code&gt; the stack of base, your layer and the VM, with &lt;code&gt;--from&lt;/code&gt;. The What&amp;rsquo;s supported cards&amp;rsquo; drawings are 224 by 70 pixels: &lt;code&gt;toolchains.svg&lt;/code&gt;, &lt;code&gt;coding-agents.svg&lt;/code&gt; and &lt;code&gt;layers.svg&lt;/code&gt;, which shows the image &lt;code&gt;docker+nix&lt;/code&gt; as a stack and the built-in layers beside it. The Quick start cards&amp;rsquo; drawings are terminals of 254 by 181 pixels, which a card shows at most twice their size: &lt;code&gt;step-cd.svg&lt;/code&gt; types &lt;code&gt;cd ~/some-project&lt;/code&gt; on your machine, &lt;code&gt;step-pick.svg&lt;/code&gt; types devvm, shows a short version of the new VM&amp;rsquo;s summary and presses enter at Customize it? [y/N], and &lt;code&gt;step-agent.svg&lt;/code&gt; types claude in the VM&amp;rsquo;s shell. Why use devvm?&amp;rsquo;s drawing, &lt;code&gt;blast-radius.svg&lt;/code&gt;, is 364 by 210 pixels and shows the same four attacks as its text on two machines. Without devvm, they light up on your machine, and the project, &lt;code&gt;~/.aws&lt;/code&gt;, &lt;code&gt;~/.ssh&lt;/code&gt; and another project turn red one after another. With devvm, they light up in the VM, each one&amp;rsquo;s path toward your machine ends at the VM&amp;rsquo;s border with a cross, and your machine&amp;rsquo;s folders stay as they are.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every text element holds one run of characters at its own &lt;code&gt;x&lt;/code&gt;,&lt;/strong&gt; because Hugo&amp;rsquo;s &lt;code&gt;--minify&lt;/code&gt; removes the spaces between &lt;code&gt;tspan&lt;/code&gt; elements. A gap of a cell is 7 pixels added to &lt;code&gt;x&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Animations&lt;/strong&gt; are CSS keyframes in &lt;code&gt;custom.css&lt;/code&gt;, which classes in the SVGs turn on. &lt;code&gt;pulse&lt;/code&gt; dims and brightens a lime arrow every 3 seconds, and &lt;code&gt;pulse-2&lt;/code&gt; and &lt;code&gt;pulse-3&lt;/code&gt; start a part of the arrow 0.3 and 0.6 seconds later, so the pulse runs along it. &lt;code&gt;pulse-slow&lt;/code&gt; does the same every 4 seconds. &lt;code&gt;lit&lt;/code&gt; lights a text&amp;rsquo;s fill and &lt;code&gt;lit-chip&lt;/code&gt; a chip&amp;rsquo;s opacity for most of a 4-second loop, and &lt;code&gt;lit-2&lt;/code&gt;, &lt;code&gt;lit-3&lt;/code&gt; and &lt;code&gt;lit-4&lt;/code&gt; start them 0.5, 1 and 1.5 seconds later, so they light one after another. &lt;code&gt;blink&lt;/code&gt; turns a cursor on and off every 2 seconds. &lt;code&gt;mover&lt;/code&gt; marks a block that travels a path, &lt;code&gt;mover-token&lt;/code&gt; along the token&amp;rsquo;s line, under the proxy and down to the API in 3 seconds, and &lt;code&gt;mover-egress&lt;/code&gt; under the proxy, down to the allowlist and back, then out to the internet in 4 seconds. A block is drawn before the shapes it passes under. &lt;code&gt;attack-1&lt;/code&gt; to &lt;code&gt;attack-4&lt;/code&gt;, &lt;code&gt;path-1&lt;/code&gt; to &lt;code&gt;path-4&lt;/code&gt; and &lt;code&gt;reach-1&lt;/code&gt; to &lt;code&gt;reach-4&lt;/code&gt; tell &lt;code&gt;blast-radius.svg&lt;/code&gt;&amp;rsquo;s story in an 8-second loop, and every part of the drawing stays in place all along, so the story only changes colours and draws lines. Each attack&amp;rsquo;s chip turns from gray to lime at 0.4, 1.6, 2.8 and 4 seconds. In the VM, its path then draws itself down to the VM&amp;rsquo;s border, and when it gets there, the cross at the border turns lime and, on the machine without devvm, the folder it reaches turns red. Everything holds from 5.2 seconds, and from 6.6 seconds the colours go back and the paths draw back up, so the drawing rests from 7.2 seconds until the story starts again. Each step has its own keyframes, so that all of them end together. The SVG draws each part in its end colour, and &lt;code&gt;--rest&lt;/code&gt; in &lt;code&gt;custom.css&lt;/code&gt; gives the colour it has before its step, so a drawing without animation shows the end of the story. The Quick start terminals each loop on their own. &lt;code&gt;type&lt;/code&gt; marks a cover over a command, which shrinks from the right one cell at a time while &lt;code&gt;caret&lt;/code&gt; moves the cursor along, both in &lt;code&gt;--chars&lt;/code&gt; steps across &lt;code&gt;--width&lt;/code&gt;, and &lt;code&gt;caret-blink&lt;/code&gt; keeps the cursor solid while it types and makes it blink after. In &lt;code&gt;step-pick.svg&lt;/code&gt;, &lt;code&gt;pick-summary&lt;/code&gt; shows the summary once devvm is typed, &lt;code&gt;pick-ask&lt;/code&gt; shows the question after it, and &lt;code&gt;key&lt;/code&gt; lights enter as it&amp;rsquo;s pressed. Their styles in &lt;code&gt;custom.css&lt;/code&gt; are each part&amp;rsquo;s end state too, and their keyframes start from the beginning. When the visitor&amp;rsquo;s system asks for reduced motion, &lt;code&gt;prefers-reduced-motion&lt;/code&gt; turns every animation off and hides the blocks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;To see an animation&amp;rsquo;s state in a screenshot,&lt;/strong&gt; pause the animations with a stylesheet of your own and set each class&amp;rsquo;s &lt;code&gt;animation-delay&lt;/code&gt; to minus the time you want, because headless Chrome&amp;rsquo;s &lt;code&gt;--virtual-time-budget&lt;/code&gt; barely moves CSS animations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Icons&lt;/strong&gt; are pixel icons in &lt;code&gt;docs/assets/icons/&lt;/code&gt;, one SVG per icon. Most come from &lt;a href="https://github.com/atelier-anchor/dinkie-icons" target="_blank" rel="noopener"&gt;Dinkie Icons&lt;/a&gt;, which is MIT licensed, and the folder keeps its license and a README that names the version they were copied from. The penguin, prompt, warning and light bulb icons are drawn for devvm in the same style. &lt;code&gt;{{&amp;lt; icon &amp;quot;rocket&amp;quot; &amp;gt;}}&lt;/code&gt; inlines one through &lt;code&gt;docs/layouts/_partials/icon.html&lt;/code&gt;, so it takes the text&amp;rsquo;s color, and the build fails when no icon has that name. An icon is 0.75em square, which makes each of its pixels one screen pixel in 16px text, and it sits on the text&amp;rsquo;s baseline. Screen readers skip it, unless a second argument gives it a label, as in &lt;code&gt;{{&amp;lt; icon &amp;quot;warning&amp;quot; &amp;quot;Warning&amp;quot; &amp;gt;}}&lt;/code&gt;, for an icon that says something the text doesn&amp;rsquo;t. To add a Dinkie icon, copy its path data from the same version of the &lt;code&gt;@dinkie-icons/react&lt;/code&gt; npm package into a new file named after the icon in kebab case, with the same &lt;code&gt;svg&lt;/code&gt; attributes as the others. A new icon of your own uses the same 12-pixel grid and 1-pixel lines, and the README lists it.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each section&amp;rsquo;s icon&lt;/strong&gt; is chosen once, in &lt;code&gt;docs/data/sections.yaml&lt;/code&gt;, which maps a section&amp;rsquo;s folder under &lt;code&gt;docs/&lt;/code&gt; to an icon&amp;rsquo;s name, as in &lt;code&gt;getting-started: rocket&lt;/code&gt;. A new section gets a line there. The section cards and the sidebar both read it, so they always show the same icon, and the build fails when the list names a section or an icon that doesn&amp;rsquo;t exist.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Section cards&lt;/strong&gt; on the docs&amp;rsquo; first page are Hextra&amp;rsquo;s &lt;code&gt;{{&amp;lt; cards &amp;gt;}}&lt;/code&gt; holding a &lt;code&gt;{{&amp;lt; section-card path=&amp;quot;getting-started&amp;quot; &amp;gt;}}&lt;/code&gt; for each section, with its one-line description inside, closed with &lt;code&gt;{{&amp;lt; /section-card &amp;gt;}}&lt;/code&gt;. The shortcode takes the section&amp;rsquo;s title and link from its page under &lt;code&gt;docs/&lt;/code&gt;, and its icon from &lt;code&gt;sections.yaml&lt;/code&gt;, and the build fails when there&amp;rsquo;s no such page. Hextra&amp;rsquo;s card takes an icon only from Hextra&amp;rsquo;s own set, so the shortcode puts ours in the card&amp;rsquo;s title, at 24px. It&amp;rsquo;s dimmed as Hextra dims its own cards&amp;rsquo; icons, and it turns lime on hover.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sidebar&amp;rsquo;s top-level items&lt;/strong&gt; show their section&amp;rsquo;s icon at 12px, in the link&amp;rsquo;s color, so it&amp;rsquo;s gray, and lime for the section you&amp;rsquo;re in. Hextra&amp;rsquo;s sidebar has no icons, so &lt;code&gt;docs/layouts/_partials/custom/head-end.html&lt;/code&gt; writes a CSS rule for each section when the site builds, keyed to the section page&amp;rsquo;s address, with the icon from &lt;code&gt;docs/assets/icons/&lt;/code&gt; as a mask. Nothing is generated into the repo, so there&amp;rsquo;s no step to rerun.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The OS tabs&lt;/strong&gt; of &lt;code&gt;install&lt;/code&gt; and &lt;code&gt;os-tabs&lt;/code&gt; show the Apple icon before macOS and the penguin before Linux, which &lt;code&gt;docs/layouts/_partials/os-tab-name.html&lt;/code&gt; adds to each tab&amp;rsquo;s name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;✓ and ✗&lt;/strong&gt; go before a table cell&amp;rsquo;s word: &lt;code&gt;{{&amp;lt; yes &amp;gt;}} yes&lt;/code&gt; puts a lime check before it, and &lt;code&gt;{{&amp;lt; no &amp;gt;}} doesn't&lt;/code&gt; a gray cross. They go only in cells that are a plain yes or no, or what stands for one, such as the install script&amp;rsquo;s offers it, never in cells that are sentences, and the word stays, because screen readers skip the icon. Icons in tables are 12px, because a table&amp;rsquo;s text is smaller than 16px.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Buttons&lt;/strong&gt; take an icon before their text: &lt;code&gt;docs/layouts/_shortcodes/hextra/hero-button.html&lt;/code&gt; is Hextra&amp;rsquo;s &lt;code&gt;hero-button&lt;/code&gt; with an &lt;code&gt;icon&lt;/code&gt; parameter, as in &lt;code&gt;{{&amp;lt; hextra/hero-button text=&amp;quot;Install&amp;quot; link=&amp;quot;docs/getting-started/install/&amp;quot; icon=&amp;quot;download&amp;quot; &amp;gt;}}&lt;/code&gt;, drawn at 24px like the headings&amp;rsquo; icons. The 404 page&amp;rsquo;s two buttons have their icons in its layout, a rocket for Getting started and the open book for the docs, as the home page&amp;rsquo;s Read the docs has it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The navbar&amp;rsquo;s GitHub link&lt;/strong&gt; uses Dinkie&amp;rsquo;s GitHub icon, which &lt;code&gt;docs/data/icons.yaml&lt;/code&gt; adds to Hextra&amp;rsquo;s own icons as &lt;code&gt;dinkie-github&lt;/code&gt;, and &lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s menu names. Hextra&amp;rsquo;s icon partial reads only that data, so an icon for the navbar goes there as its SVG, not in &lt;code&gt;docs/assets/icons/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Heading icons:&lt;/strong&gt; a heading gets an icon before its text with an &lt;code&gt;icon&lt;/code&gt; attribute, as in &lt;code&gt;## Quick start {icon=&amp;quot;rocket&amp;quot;}&lt;/code&gt;, which the home page&amp;rsquo;s section headings use. &lt;code&gt;docs/layouts/_markup/render-heading.html&lt;/code&gt; takes the place of Hextra&amp;rsquo;s heading render hook and adds the icon after Hugo makes the heading&amp;rsquo;s anchor, so the anchor comes from the text alone, such as &lt;code&gt;quick-start&lt;/code&gt;. On the home page, &lt;code&gt;custom.css&lt;/code&gt; draws these icons in lime at 24px, so each icon pixel is two screen pixels, as each of Departure Mono&amp;rsquo;s pixels is at 22px.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Callouts&lt;/strong&gt; are GitHub&amp;rsquo;s alerts: a blockquote whose first line is &lt;code&gt;[!NOTE]&lt;/code&gt;, &lt;code&gt;[!TIP]&lt;/code&gt; or &lt;code&gt;[!WARNING]&lt;/code&gt;, which GitHub shows the same way. &lt;code&gt;docs/layouts/_markup/render-blockquote-alert.html&lt;/code&gt; takes the place of Hextra&amp;rsquo;s alerts and draws each one on the surface color with a line down its left side, and a title with its icon: information-circled in blue for a note, the light bulb in the soft lime for a tip, and warning in lime for a warning. Any other type fails the build. Hextra&amp;rsquo;s own &lt;code&gt;callout&lt;/code&gt; shortcode isn&amp;rsquo;t used. Use a callout only for a real warning, such as what the VM&amp;rsquo;s boundary rests on, or a tip that saves the reader trouble, such as keeping a VM on a strict tier, and move the sentence into it instead of repeating it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For agents and other tools that read the site,&lt;/strong&gt; &lt;code&gt;hugo.yaml&lt;/code&gt; turns on three things that Hextra has. The site&amp;rsquo;s root has &lt;code&gt;llms.txt&lt;/code&gt;, which lists every section and its pages. Each page has a Markdown copy beside its HTML, such as &lt;code&gt;/docs/using/clone.md&lt;/code&gt; beside &lt;code&gt;/docs/using/clone/&lt;/code&gt;, and a section&amp;rsquo;s copy is &lt;code&gt;index.md&lt;/code&gt; in its folder, such as &lt;code&gt;/docs/using/index.md&lt;/code&gt;. Each docs page has a Copy page menu beside its title, which copies the page&amp;rsquo;s Markdown or opens it. &lt;code&gt;hugo.yaml&lt;/code&gt; lists every output for the home page, the sections and the pages, so the home page and the sections keep their RSS feeds, and the search index is built apart from these outputs.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;llms.txt&lt;/code&gt;&lt;/strong&gt; comes from &lt;code&gt;docs/layouts/llms.txt&lt;/code&gt;, which takes the place of Hextra&amp;rsquo;s. It has the site&amp;rsquo;s title and description, then each section under its title, with the section&amp;rsquo;s own page first and its pages after it. Each one is a link to its Markdown copy, as the llms.txt convention prefers, which &lt;code&gt;docs/layouts/_partials/llms-link.txt&lt;/code&gt; writes, and a line of plain text, which &lt;code&gt;docs/layouts/_partials/llms-summary.txt&lt;/code&gt; writes. A page without a copy gets a link to its HTML page instead. The line is the page&amp;rsquo;s &lt;code&gt;description&lt;/code&gt; from its front matter when it has one, and otherwise its first paragraph, cut at 200 characters. A &lt;code&gt;description&lt;/code&gt; is also the page&amp;rsquo;s description for search engines and link previews, so give a page one when its first paragraph doesn&amp;rsquo;t say what the page covers, as Coding agents has. &lt;code&gt;llms.txt&lt;/code&gt; also lists the CLI reference, with each command&amp;rsquo;s one-line summary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Markdown copies&lt;/strong&gt; come from &lt;code&gt;docs/layouts/page.markdown.md&lt;/code&gt; and &lt;code&gt;section.markdown.md&lt;/code&gt;, which take the place of Hextra&amp;rsquo;s and both use &lt;code&gt;docs/layouts/_partials/markdown-copy.md&lt;/code&gt;. A copy is the page&amp;rsquo;s title as a heading, then its Markdown with its shortcodes rendered. In a copy, a link to a section&amp;rsquo;s &lt;code&gt;_index.md&lt;/code&gt; points at &lt;code&gt;index.md&lt;/code&gt;, the section copy&amp;rsquo;s name, so the links work between the copies, and a link written in code stays as it is.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each shortcode that docs pages use has a Markdown version&lt;/strong&gt; beside its HTML one in &lt;code&gt;docs/layouts/_shortcodes/&lt;/code&gt;, named after it with &lt;code&gt;.markdown.md&lt;/code&gt;, which renders it in the copies. &lt;code&gt;install&lt;/code&gt; writes each system&amp;rsquo;s name in bold, then its commands, which come from &lt;code&gt;docs/layouts/_partials/install-tabs.html&lt;/code&gt;, the same partial its tabs use. &lt;code&gt;os-tabs&lt;/code&gt; writes its tabs the same way, through &lt;code&gt;docs/layouts/_partials/os-sections.md&lt;/code&gt;. &lt;code&gt;section-card&lt;/code&gt; makes a list item that links the section&amp;rsquo;s copy, and Hextra&amp;rsquo;s &lt;code&gt;cards&lt;/code&gt; keeps only what&amp;rsquo;s inside it. &lt;code&gt;yes&lt;/code&gt; and &lt;code&gt;no&lt;/code&gt; become ✓ and ✗. A shortcode without a Markdown version puts its HTML into the copy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The home page and the branding page&lt;/strong&gt; are mostly shortcodes, and neither layout shows the menu. &lt;code&gt;hugo.yaml&lt;/code&gt; gives the home page no Markdown copy, and its front matter sets &lt;code&gt;contextMenu: false&lt;/code&gt;. The branding page&amp;rsquo;s front matter sets &lt;code&gt;outputs: [html]&lt;/code&gt;, &lt;code&gt;contextMenu: false&lt;/code&gt; and &lt;code&gt;llms: false&lt;/code&gt;, so it has no copy, no menu and no line in &lt;code&gt;llms.txt&lt;/code&gt;. Any other page can set &lt;code&gt;llms: false&lt;/code&gt; to stay out of &lt;code&gt;llms.txt&lt;/code&gt;, or &lt;code&gt;contextMenu: false&lt;/code&gt; to have no menu.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;After you add a page or a shortcode,&lt;/strong&gt; build the site and read the page&amp;rsquo;s line in &lt;code&gt;llms.txt&lt;/code&gt; and its Markdown copy. The line should say what the page covers, and the copy should have no shortcode left in it, such as &lt;code&gt;{{&amp;lt; os-tabs &amp;gt;}}&lt;/code&gt;, and no HTML from one. A shortcode that docs pages use gets its Markdown version. To try the menu, serve the site with &lt;code&gt;mise run docs&lt;/code&gt; and open a docs page. &lt;code&gt;custom.css&lt;/code&gt; gives the menu the site&amp;rsquo;s border and secondary text, lime on hover, and its list the surface color.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The 404 page&lt;/strong&gt; is &lt;code&gt;docs/layouts/404.html&lt;/code&gt;, which takes the place of Hextra&amp;rsquo;s and uses the site&amp;rsquo;s navbar and footer. It shows a VM&amp;rsquo;s terminal answering &lt;code&gt;cd ./this-page&lt;/code&gt; with &amp;ldquo;no such page&amp;rdquo;, drawn like the home page&amp;rsquo;s art in &lt;code&gt;docs/assets/home/not-found.svg&lt;/code&gt; with the &lt;code&gt;blink&lt;/code&gt; cursor, then Hextra&amp;rsquo;s search box and links to Getting started and the docs. Build the site and open &lt;code&gt;/404.html&lt;/code&gt; to see it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;mise run lint:docs&lt;/code&gt;, which &lt;code&gt;mise run lint&lt;/code&gt; includes, checks &lt;code&gt;docs/&lt;/code&gt; with:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Linter&lt;/th&gt;
&lt;th&gt;Checks&lt;/th&gt;
&lt;th&gt;Config&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;markdownlint-cli2&lt;/td&gt;
&lt;td&gt;Markdown&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.markdownlint-cli2.yaml&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vale&lt;/td&gt;
&lt;td&gt;the style rules&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.vale.ini&lt;/code&gt;, &lt;code&gt;.vale/styles/devvm/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lychee (&lt;code&gt;--offline&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;links to pages and files&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;It also builds the site with Hugo&amp;rsquo;s &lt;code&gt;--panicOnWarning&lt;/code&gt;, into a temporary folder it removes, so any warning fails it. That includes a deprecation, such as a template that reads &lt;code&gt;site.Data&lt;/code&gt; where Hugo wants &lt;code&gt;hugo.Data&lt;/code&gt;, so a Hugo upgrade that deprecates something the templates use fails here before the feature is removed. It runs &lt;code&gt;TestExplainers&lt;/code&gt; too, so a page without an explainer fails it, and &lt;code&gt;TestUserPageProse&lt;/code&gt; (&lt;code&gt;internal/cli/docgen/prose_test.go&lt;/code&gt;), which holds the user pages to &lt;a href="#writing-docs"&gt;lead with doing&lt;/a&gt;: it fails a run of three or more paragraphs back to back where two are over 80 words, and any paragraph or list item over 150 words. It counts words as &lt;code&gt;scan.sh&lt;/code&gt; does, a code span as one word and a link by its text, and a paragraph of 40 words or fewer that ends with a colon introduces what follows, so it isn&amp;rsquo;t in a run. &lt;code&gt;proseExempt&lt;/code&gt; names the pages that another branch is rewriting, each with why, until that branch lands. &lt;code&gt;TestChangelogShape&lt;/code&gt; (&lt;code&gt;internal/cli/docgen/changelog_test.go&lt;/code&gt;) holds &lt;code&gt;CHANGELOG.md&lt;/code&gt; to the shape that &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; gives an entry, and &lt;code&gt;TestChangelogProblems&lt;/code&gt; checks that each of its rules fails an entry that breaks it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-cli-reference"&gt;The CLI reference&lt;span class="hx:absolute hx:-mt-20" id="the-cli-reference"&gt;&lt;/span&gt;
&lt;a href="#the-cli-reference" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The &lt;a href="https://next.devvm.dev/docs/cli/"&gt;CLI reference&lt;/a&gt; in &lt;code&gt;docs/content/docs/cli/&lt;/code&gt; is generated from devvm&amp;rsquo;s commands with Cobra&amp;rsquo;s docs generator, and checked in. Don&amp;rsquo;t edit it: change the command&amp;rsquo;s &lt;code&gt;Use&lt;/code&gt;, &lt;code&gt;Short&lt;/code&gt;, &lt;code&gt;Long&lt;/code&gt;, &lt;code&gt;Example&lt;/code&gt; or flags, or its docs page in &lt;code&gt;internal/msg/docs.go&lt;/code&gt;, then run:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run cli-docs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It runs &lt;code&gt;internal/cli/docgen&lt;/code&gt;, which replaces every page in that folder: &lt;code&gt;_index.md&lt;/code&gt;, listing the commands, and a page per command named after its path (&lt;code&gt;devvm_build.md&lt;/code&gt;), with &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;explainer&lt;/code&gt; front matter, the explainer being the command&amp;rsquo;s &lt;code&gt;Short&lt;/code&gt;, and links to the other pages as files. Each page has the command&amp;rsquo;s examples, and a Docs section before See also that links to the command&amp;rsquo;s docs page on the site. Hidden commands (&lt;code&gt;_msg&lt;/code&gt;, &lt;code&gt;_qemu&lt;/code&gt;) and Cobra&amp;rsquo;s help command are left out. The pages carry no dates, so the same commands give the same files. They carry no weight either, so Hugo sorts the section by title, and a new command adds its own page and changes only &lt;code&gt;_index.md&lt;/code&gt; and the root&amp;rsquo;s &lt;code&gt;devvm.md&lt;/code&gt;; &lt;code&gt;TestPagesHaveNoWeight&lt;/code&gt; checks this. The &lt;code&gt;.gitattributes&lt;/code&gt; file marks the pages as generated, so GitHub collapses them in a diff.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mise run cli-docs&lt;/code&gt; also writes the generated blocks of hand-written pages, which &lt;code&gt;cli.DocBlocks&lt;/code&gt; in &lt;code&gt;internal/cli/docblocks.go&lt;/code&gt; lists: the Supported agents table in &lt;code&gt;using/coding-agents.md&lt;/code&gt;, and the README&amp;rsquo;s list of the agents. Each block sits between two HTML comments that name it, and docgen replaces only the text between them, from the registry of agents, &lt;code&gt;agents.Defs&lt;/code&gt;, and each agent&amp;rsquo;s policy in &lt;code&gt;assets/shared-tools/&lt;/code&gt;. So don&amp;rsquo;t edit a block by hand: change the agent&amp;rsquo;s &lt;code&gt;Def&lt;/code&gt;, its &lt;code&gt;Docs&lt;/code&gt; included, or its policy, then run &lt;code&gt;mise run cli-docs&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-commands-help"&gt;A command&amp;rsquo;s help&lt;span class="hx:absolute hx:-mt-20" id="a-commands-help"&gt;&lt;/span&gt;
&lt;a href="#a-commands-help" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Every command&amp;rsquo;s help, which its reference page also shows, has the same shape. &lt;code&gt;Short&lt;/code&gt; is an action in sentence case without a full stop, such as &lt;code&gt;List the project VMs&lt;/code&gt;. &lt;code&gt;Long&lt;/code&gt; is one to three short sentences on what the command does, and the rules and edge cases go on its docs page. &lt;code&gt;Example&lt;/code&gt; comes from &lt;code&gt;examples&lt;/code&gt; in &lt;code&gt;internal/cli/help.go&lt;/code&gt;, which takes each command line with a short comment and lines the comments up, the most common invocation first. A flag&amp;rsquo;s description is short, and its long explanation goes on the page.&lt;/p&gt;
&lt;p&gt;Each command describes itself where it&amp;rsquo;s made, so its docs page and group are in its own file, not in tables elsewhere. Its &lt;code&gt;Annotations&lt;/code&gt; come from an &lt;code&gt;about&lt;/code&gt; in &lt;code&gt;internal/cli/help.go&lt;/code&gt;: &lt;code&gt;docs&lt;/code&gt;, the user page that covers it as &lt;code&gt;page#anchor&lt;/code&gt;; &lt;code&gt;group&lt;/code&gt;, its section of the root&amp;rsquo;s help; and &lt;code&gt;noJSON&lt;/code&gt;, why a command without &lt;code&gt;--json&lt;/code&gt; has none. &lt;code&gt;addDocs&lt;/code&gt; gives the root Cobra&amp;rsquo;s usage template with a Docs section at the end, which shows the address of the command&amp;rsquo;s page, and the root&amp;rsquo;s help also ends with the issue tracker, &lt;code&gt;msg.IssuesURL&lt;/code&gt;. The CLI reference links each command&amp;rsquo;s page too, and &lt;code&gt;TestDocLinks&lt;/code&gt; in &lt;code&gt;internal/msg&lt;/code&gt; reads those links from the reference and checks that each page and heading exists and is a user page. &lt;code&gt;helpGroups&lt;/code&gt; in the same file lists the root&amp;rsquo;s sections, in order, and &lt;code&gt;addGroups&lt;/code&gt; adds each group that has a command and sets its commands&amp;rsquo; &lt;code&gt;GroupID&lt;/code&gt;, so a group whose commands don&amp;rsquo;t exist yet stays out of the help. A subcommand can name a group too, such as layer add in Change your VM, when it belongs in another group than its parent. &lt;code&gt;addGroups&lt;/code&gt; then adds that group to the parent, so the parent&amp;rsquo;s own help groups its subcommands the same way, and the usage template lists the subcommand by both names in the root&amp;rsquo;s group, after the group&amp;rsquo;s own commands. Cobra lists a group&amp;rsquo;s commands in alphabetical order, and &lt;code&gt;help&lt;/code&gt; goes in Cobra&amp;rsquo;s own Additional Commands.&lt;/p&gt;
&lt;p&gt;The tests fail when the checked-in pages are stale: &lt;code&gt;TestReferenceIsCurrent&lt;/code&gt; in &lt;code&gt;internal/cli/docgen&lt;/code&gt; generates the reference into a temporary folder and compares it with &lt;code&gt;docs/content/docs/cli/&lt;/code&gt;, and it checks each generated block against its page too, which &lt;code&gt;TestStaleBlockIsCaught&lt;/code&gt; proves it catches. &lt;code&gt;mise run docs&lt;/code&gt; regenerates it before serving the site.&lt;/p&gt;
&lt;h3 data-hextra-search-id="building-the-site"&gt;Building the site&lt;span class="hx:absolute hx:-mt-20" id="building-the-site"&gt;&lt;/span&gt;
&lt;a href="#building-the-site" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;mise run docs&lt;/code&gt; draws the diagrams, then serves the site at &lt;code&gt;http://localhost:1313/&lt;/code&gt; and reloads on every change except a diagram&amp;rsquo;s, which needs &lt;code&gt;mise run docs:diagrams&lt;/code&gt; again. After you run &lt;code&gt;mise run docs:diagrams&lt;/code&gt;, &lt;code&gt;mise exec -- hugo -s docs --minify&lt;/code&gt; builds the site into &lt;code&gt;docs/public/&lt;/code&gt;, as the Docs workflow does for devvm.dev, and &lt;code&gt;mise exec -- hugo -s docs --minify --config hugo.yaml,next.yaml&lt;/code&gt; builds the site as next.devvm.dev has it, with its banner and its noindex (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#the-docs-sites"&gt;the docs sites&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Backends</title><link>https://next.devvm.dev/docs/internals/backends/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/backends/</guid><description>
&lt;p&gt;This page explains how a backend gives devvm what it needs to run a VM, what devvm does when a backend lacks something, and how devvm names VMs. devvm runs its VMs on &lt;a href="https://next.devvm.dev/docs/backends/lima/"&gt;Lima&lt;/a&gt;, and another backend would plug in the same way, through the features below (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-a-backend-does"&gt;What a backend does&lt;span class="hx:absolute hx:-mt-20" id="what-a-backend-does"&gt;&lt;/span&gt;
&lt;a href="#what-a-backend-does" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A backend has four roles, and every backend has all of them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The host:&lt;/strong&gt; it says what it needs that this machine lacks, which &lt;code&gt;devvm doctor&lt;/code&gt; reports, how long a VM&amp;rsquo;s name can be, where its VMs live, and which folders hold their disks, so devvm can check the free space before a step that writes them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Images:&lt;/strong&gt; it builds images and the shared tools&amp;rsquo; images, keeps the images, and names the files of its own that it puts into base, which base&amp;rsquo;s key hashes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Machines:&lt;/strong&gt; it makes, starts, stops, renames and deletes VMs, runs commands and shells in them, and says how ssh and devvm&amp;rsquo;s port forwarder reach them. It also says how a VM runs now: which start it&amp;rsquo;s on, whether that start is confined to the VM&amp;rsquo;s proxy, and the file the VM&amp;rsquo;s proxy and forwarder follow, which ends them when the process that runs the VM ends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Housekeeping:&lt;/strong&gt; it says how much disk its VMs and caches take for &lt;code&gt;devvm space&lt;/code&gt;, lists the VMs with devvm&amp;rsquo;s label that this devvm has no state for, and lists and deletes devvm&amp;rsquo;s share of its own caches for &lt;code&gt;devvm gc --caches&lt;/code&gt;. A backend that can&amp;rsquo;t tell one of these returns nothing, so devvm shows no size or deletes nothing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A backend may also keep files of its own for a VM besides the VM, which &lt;code&gt;devvm gc --orphans&lt;/code&gt; deletes once the VM is gone. Lima keeps none.&lt;/p&gt;
&lt;h2 data-hextra-search-id="features"&gt;Features&lt;span class="hx:absolute hx:-mt-20" id="features"&gt;&lt;/span&gt;
&lt;a href="#features" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each thing devvm needs from a backend is a feature, such as building images, mounting the project folder or confining a VM to its proxy. &lt;code&gt;devvm doctor&lt;/code&gt; lists them as &amp;ldquo;features&amp;rdquo; too, but they aren&amp;rsquo;t the base image features you choose with &lt;code&gt;devvm setup&lt;/code&gt;. Each backend declares how it has each feature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;native&lt;/strong&gt;: the backend does it itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;emulated&lt;/strong&gt;: devvm builds it from other parts of the backend.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;none&lt;/strong&gt;: the backend can&amp;rsquo;t do it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A backend lists every feature, the ones it lacks too, and devvm refuses to use a backend that leaves one out, so a new feature makes each backend say how it has it. Some features are built on others: &lt;code&gt;read-only-paths&lt;/code&gt; and &lt;code&gt;mount-cache&lt;/code&gt; on &lt;code&gt;project-mount&lt;/code&gt;, &lt;code&gt;ports-all&lt;/code&gt; on &lt;code&gt;ports&lt;/code&gt;, &lt;code&gt;agent-toggle&lt;/code&gt; on &lt;code&gt;agent-forwarding&lt;/code&gt;, and &lt;code&gt;link&lt;/code&gt; on &lt;code&gt;ssh&lt;/code&gt;. A backend has such a feature no better than the one it&amp;rsquo;s built on, so the feature is emulated wherever its base is emulated, and none wherever its base is none.&lt;/p&gt;
&lt;p&gt;devvm uses an emulation only once its review has passed, and until then it refuses the emulation. A review takes a &lt;a href="https://next.devvm.dev/docs/contributing/design/#emulated-features"&gt;design note&lt;/a&gt;, a threat check with the security-audit skill, and end-to-end checks that prove the guarantee.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm doctor&lt;/code&gt; lists Lima&amp;rsquo;s features, and &lt;code&gt;devvm doctor --json&lt;/code&gt; those of every backend devvm has. Both show an emulation whose review hasn&amp;rsquo;t passed as &lt;code&gt;unreviewed&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-feature-table"&gt;The feature table&lt;span class="hx:absolute hx:-mt-20" id="the-feature-table"&gt;&lt;/span&gt;
&lt;a href="#the-feature-table" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;Lima&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;build-image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;build images from the layer and feature scripts&lt;/td&gt;
&lt;td&gt;native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;build-confinement&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;builds reach the internet but not the host&amp;rsquo;s loopback, or nothing&lt;/td&gt;
&lt;td&gt;native: Seatbelt on macOS. On Linux, QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt; confines a build with no network, but a build with the internet reaches the host&amp;rsquo;s loopback (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;from&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;base&lt;/code&gt; from a container image (&lt;code&gt;--from&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;native: devvm converts the image to a disk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;clone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a project VM from an image&lt;/td&gt;
&lt;td&gt;native: an APFS copy-on-write copy on macOS, and a qcow2 overlay on Linux (&lt;a href="https://next.devvm.dev/docs/internals/lima/#clones-and-overlays"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;project-mount&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the project folder, read-write&lt;/td&gt;
&lt;td&gt;native: virtiofs on macOS, and 9p on Linux&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;read-only-paths&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;paths in the project folder that the guest can&amp;rsquo;t change while the VM runs, which &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-linux-hosts"&gt;.git protection&lt;/a&gt; asks for on Linux&lt;/td&gt;
&lt;td&gt;native on Linux where the kernel lets devvm use a user namespace: QEMU runs in one of its own, with the paths bound read-only over themselves (&lt;a href="https://next.devvm.dev/docs/contributing/design/#read-only-paths-on-linux"&gt;details&lt;/a&gt;). None on macOS, where &lt;code&gt;.git&lt;/code&gt; protection locks the host&amp;rsquo;s files itself, and none where devvm&amp;rsquo;s check of the kernel fails&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mount-cache&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;choosing how the guest caches the project folder&amp;rsquo;s mount, which &lt;code&gt;devvm mount-cache&lt;/code&gt; sets&lt;/td&gt;
&lt;td&gt;native on Linux, where it&amp;rsquo;s 9p&amp;rsquo;s cache option, &lt;code&gt;none&lt;/code&gt; for new VMs (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-9p-cache-on-linux"&gt;details&lt;/a&gt;). None on macOS, where virtiofs has no such option&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent-folders&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;agents&amp;rsquo; host folders, read-only&lt;/td&gt;
&lt;td&gt;native: read-only mounts, enforced by the host&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tools-share&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the shared tools, read-only&lt;/td&gt;
&lt;td&gt;native: a read-only mount, enforced by the host&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;egress-proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;network traffic only through devvm&amp;rsquo;s proxy&lt;/td&gt;
&lt;td&gt;native: Seatbelt on macOS, and on Linux QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt; with a &lt;code&gt;guestfwd&lt;/code&gt; to the proxy (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ssh for editors&lt;/td&gt;
&lt;td&gt;native: Lima&amp;rsquo;s ssh forward and config&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the listed ports forwarded to the host&amp;rsquo;s loopback&lt;/td&gt;
&lt;td&gt;emulated (reviewed): devvm&amp;rsquo;s forwarder over Lima&amp;rsquo;s ssh, for the listed ports alone, with Lima&amp;rsquo;s own forwards off (&lt;a href="https://next.devvm.dev/docs/internals/lima/#ports"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ports-all&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every port forwarded, servers on the VM&amp;rsquo;s loopback included&lt;/td&gt;
&lt;td&gt;emulated (reviewed): the same forwarder, for whatever listens in the VM from port 1024 up, and never a port the host has (&lt;a href="https://next.devvm.dev/docs/internals/lima/#ports"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent-forwarding&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ssh-agent forwarding, chosen when the VM is made&lt;/td&gt;
&lt;td&gt;native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent-toggle&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;turning a VM&amp;rsquo;s ssh-agent forwarding on or off later&lt;/td&gt;
&lt;td&gt;native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cpus&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s CPUs&lt;/td&gt;
&lt;td&gt;native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;memory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s memory&lt;/td&gt;
&lt;td&gt;native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;disk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s disk size&lt;/td&gt;
&lt;td&gt;native: it grows but never shrinks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;docker-layer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;docker layer&lt;/a&gt;: Docker&amp;rsquo;s engine running in the VM&lt;/td&gt;
&lt;td&gt;native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nix-layer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/images/#nix"&gt;nix layer&lt;/a&gt;: Nix&amp;rsquo;s daemon and its store in the VM, with builds in Nix&amp;rsquo;s sandbox&lt;/td&gt;
&lt;td&gt;native (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-nix-layer"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;link&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;links between VMs: a program in one VM reaches a port another VM publishes, by name&lt;/td&gt;
&lt;td&gt;native: a link session of devvm&amp;rsquo;s own over Lima&amp;rsquo;s ssh, with remote forwards to &lt;code&gt;127.77.0.0/16&lt;/code&gt; alone (&lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;egress-proxy&lt;/code&gt; is what every &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt; but open needs. The open tier needs no feature of its own: every backend must let a VM on its own network reach a port on the host&amp;rsquo;s loopback and set the guest&amp;rsquo;s proxy settings from what devvm confines the VM to, which the conformance suite checks (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;), because every VM&amp;rsquo;s proxy carries its requests. So a backend without &lt;code&gt;egress-proxy&lt;/code&gt; still has open VMs, and devvm refuses every other tier on it in one line (&lt;code&gt;net_tier_backend&lt;/code&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-each-backend-emulates"&gt;What each backend emulates&lt;span class="hx:absolute hx:-mt-20" id="what-each-backend-emulates"&gt;&lt;/span&gt;
&lt;a href="#what-each-backend-emulates" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On Lima, devvm emulates forwarding ports, both the listed ones and every one, through its forwarder, and the emulation is reviewed (&lt;a href="https://next.devvm.dev/docs/internals/ports/"&gt;port forwarding&lt;/a&gt;). Everything else on Lima is Lima&amp;rsquo;s own.&lt;/p&gt;
&lt;p&gt;The forwarder is devvm&amp;rsquo;s own on every backend, never a backend&amp;rsquo;s. A backend that has &lt;code&gt;ports&lt;/code&gt; turns its own forwards off, and devvm&amp;rsquo;s forwarder reaches a running VM&amp;rsquo;s sshd the way the backend&amp;rsquo;s &lt;code&gt;SSH&lt;/code&gt; says, which is a user, a key and a port. devvm refuses that target unless it&amp;rsquo;s on this machine&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;, with the same check it uses for links and the ssh config. devvm reads which ports the VM forwards from its state, chooses which of them are free, pins the VM&amp;rsquo;s host keys for its current start and starts the forwarder, which follows the backend&amp;rsquo;s lifeline for the VM.&lt;/p&gt;
&lt;h2 data-hextra-search-id="missing-and-unreviewed-features"&gt;Missing and unreviewed features&lt;span class="hx:absolute hx:-mt-20" id="missing-and-unreviewed-features"&gt;&lt;/span&gt;
&lt;a href="#missing-and-unreviewed-features" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm checks each feature an image or a VM needs this way:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 493px; --devvm-diagram-width: 617px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 617 493" width="617" height="493" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="dcd6d763e7700bcee--title" aria-describedby="dcd6d763e7700bcee--desc"&gt;&lt;title id="dcd6d763e7700bcee--title"&gt;How devvm checks a feature&lt;/title&gt;&lt;desc id="dcd6d763e7700bcee--desc"&gt;A feature that the image or the VM needs is allowed when the backend has it natively, or emulates it and the emulation is reviewed. An unreviewed emulation, or none, is refused, and devvm stops and names the VM, the feature and the backend, except egress-proxy for a new open VM, which is made open, as asked.&lt;/desc&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_need_how_0"&gt;&lt;path d="M154.23,68L154.23,106"/&gt;&lt;path class="pele-marker" d="M154.23,113L150.87,105L157.59,105Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_how_ok_0"&gt;&lt;path d="M84.23,158L84.23,164Q84.23,176 72.23,176L52.73,176Q40.73,176 40.73,188L40.73,236Q40.73,248 52.73,248L101.81,248Q113.81,248 113.81,260L113.81,266.5"/&gt;&lt;path class="pele-marker" d="M113.81,273.5L110.45,265.5L117.17,265.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_how_ok_2"&gt;&lt;path d="M175.64,158L175.64,236Q175.64,248 163.64,248L141.81,248Q129.81,248 129.81,260L129.81,266.5"/&gt;&lt;path class="pele-marker" d="M129.81,273.5L126.45,265.5L133.17,265.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_how_np_0"&gt;&lt;path d="M224.23,158L224.23,164Q224.23,176 236.23,176L365.36,176Q377.36,176 377.36,188L377.36,259"/&gt;&lt;path class="pele-marker" d="M377.36,266L374,258L380.72,258Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_np_refused_0"&gt;&lt;path d="M329.64,326L329.64,332Q329.64,344 317.64,344L222.77,344Q210.77,344 210.77,356L210.77,399.5"/&gt;&lt;path class="pele-marker" d="M210.77,406.5L207.41,398.5L214.13,398.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_np_warned_0"&gt;&lt;path d="M425.09,326L425.09,332Q425.09,344 437.09,344L489.14,344Q501.14,344 501.14,356L501.14,399.5"/&gt;&lt;path class="pele-marker" d="M501.14,406.5L497.78,398.5L504.5,398.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_how_ok_0"&gt;&lt;rect x="10" y="203" width="61.45" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="40.73" y="216.2" text-anchor="middle"&gt;native&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_how_ok_2"&gt;&lt;rect x="91.45" y="203" width="168.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="175.64" y="216.2" text-anchor="middle"&gt;emulated, reviewed&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_how_np_0"&gt;&lt;rect x="279.82" y="196" width="195.09" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="377.36" y="208.2"&gt;emulated, unreviewed,&lt;/tspan&gt;&lt;tspan x="377.36" y="224.2"&gt;or none&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_np_refused_0"&gt;&lt;rect x="197.86" y="364" width="25.82" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="210.77" y="377.2" text-anchor="middle"&gt;no&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_np_warned_0"&gt;&lt;rect x="483.77" y="364" width="34.73" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="501.14" y="377.2" text-anchor="middle"&gt;yes&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="need" transform="translate(154.23,38)"&gt;&lt;rect x="-102.64" y="-30" width="205.27" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;a feature the image&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;or the VM needs&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-hex" data-id="how" transform="translate(154.23,135.5)"&gt;&lt;polygon points="-116,-22.5 116,-22.5 127.25,0 116,22.5 -116,22.5 -127.25,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;how the backend has it&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="ok" transform="translate(121.81,296)"&gt;&lt;rect x="-49.18" y="-22.5" width="98.36" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;allowed&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-hex" data-id="np" transform="translate(377.36,296)"&gt;&lt;polygon points="-93.73,-30 93.73,-30 108.73,0 93.73,30 -93.73,30 -108.73,0" fill="var(--_s)" stroke="var(--_b)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;egress-proxy, for&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;a new open VM?&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="refused" transform="translate(210.77,445.5)"&gt;&lt;rect x="-138.27" y="-39" width="276.55" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;refused: devvm stops&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;and names the VM,&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;the feature and the backend&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="warned" transform="translate(501.14,436.5)"&gt;&lt;rect x="-107.09" y="-30" width="214.18" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;the VM is made open,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;as asked&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;Before devvm builds an image, makes or starts a VM, or changes a VM&amp;rsquo;s settings, it checks that the backend has every feature the image or the VM needs. The backend itself is behind the same check: every time devvm asks it to build an image or the shared tools, make a VM or start one, devvm checks the features that request needs before the backend sees it, so a request that skipped the first check is refused too. When the backend lacks one, devvm stops and names the VM, the feature and the backend (&lt;code&gt;backend_lacks&lt;/code&gt;). It does the same for a feature the backend only emulates when that emulation&amp;rsquo;s review hasn&amp;rsquo;t passed (&lt;code&gt;backend_unreviewed&lt;/code&gt;). devvm never falls back to something weaker, so a VM on a confined tier never starts with an open network.&lt;/p&gt;
&lt;p&gt;To get the feature, use a backend that has it. A VM keeps its backend, so that means making a new VM.&lt;/p&gt;
&lt;p&gt;A new VM&amp;rsquo;s tier is the one exception, because allowlist is the default, and &lt;a href="https://next.devvm.dev/docs/backends/#when-a-backend-lacks-something"&gt;When a backend lacks something&lt;/a&gt; says what devvm does instead.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-a-start-changes"&gt;What a start changes&lt;span class="hx:absolute hx:-mt-20" id="what-a-start-changes"&gt;&lt;/span&gt;
&lt;a href="#what-a-start-changes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A backend makes a VM as devvm asks, and then changes it only when it starts. Each time devvm starts a stopped VM, it tells the backend what the VM&amp;rsquo;s state asks for, which is its size, the agent folders in devvm&amp;rsquo;s agent store and whether it forwards your SSH agent, together with how the VM is confined. The backend compares that with the VM it has and changes only what differs, so a start that changes nothing leaves the VM&amp;rsquo;s config as it was. Nothing changes a stopped VM&amp;rsquo;s config between starts, so &lt;code&gt;devvm size&lt;/code&gt; and &lt;code&gt;devvm ssh-agent&lt;/code&gt; save what you ask for in the VM&amp;rsquo;s state, and the VM gets it when it next starts.&lt;/p&gt;
&lt;p&gt;A running VM is left as it is, and devvm says what changes when it next starts. Its ports aren&amp;rsquo;t the backend&amp;rsquo;s, so &lt;code&gt;devvm ports&lt;/code&gt; changes them at once, and a running VM&amp;rsquo;s forwarder starts again with the new ones (&lt;a href="https://next.devvm.dev/docs/internals/ports/#its-process-and-files"&gt;port forwarding&lt;/a&gt;). A disk can&amp;rsquo;t shrink, so a start that asks for a smaller disk than the VM has fails before the backend changes anything (&lt;code&gt;disk_shrink&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Which ports a VM forwards stays in the VM&amp;rsquo;s state alone, and the backend never hears of them. The backend keeps only what it needs for the start it made, such as Lima&amp;rsquo;s record of the hostagent it started confined (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="vm-names"&gt;VM names&lt;span class="hx:absolute hx:-mt-20" id="vm-names"&gt;&lt;/span&gt;
&lt;a href="#vm-names" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A project VM&amp;rsquo;s name is &lt;code&gt;devvm-&amp;lt;folder&amp;gt;-&amp;lt;hash&amp;gt;&lt;/code&gt;. The folder part is up to 20 characters of the folder&amp;rsquo;s name, in lowercase, with each run of characters other than letters and digits turned into one dash, because Lima refuses a name with separators in a row, so &lt;code&gt;foo (copy)&lt;/code&gt; gives &lt;code&gt;foo-copy&lt;/code&gt;. The hash part is 14 hex digits of a hash of the folder&amp;rsquo;s path. devvm takes a name as a project VM&amp;rsquo;s only when it has that form, so a name in a state file or a backend&amp;rsquo;s list whose folder part has any other character, starts or ends with a dash, or has two dashes in a row isn&amp;rsquo;t a project VM&amp;rsquo;s. A state file whose name has dashes in a row and no &lt;code&gt;created&lt;/code&gt; time belongs to a VM that Lima refused to make, so devvm reads it as no VM&amp;rsquo;s state and the folder&amp;rsquo;s next VM replaces it.&lt;/p&gt;
&lt;p&gt;A backend may need shorter names, and then devvm cuts the folder&amp;rsquo;s part to fit. When fewer than 4 characters of it would fit, devvm refuses (&lt;code&gt;vm_name_no_room&lt;/code&gt;). On Lima the room for a name depends on the Lima home&amp;rsquo;s path, because Lima keeps each VM&amp;rsquo;s ssh socket under it, so there the fix is a shorter Lima home (&lt;code&gt;lima_home_too_long&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/backends/lima/#limits"&gt;limits&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Only a new VM gets a name, which fits the limit of the backend that makes it. devvm finds a folder&amp;rsquo;s VM by the state that records the folder&amp;rsquo;s path, in the VM&amp;rsquo;s folder in devvm&amp;rsquo;s data folder (&lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, named by the hash that ends the VM&amp;rsquo;s name), so an existing VM keeps the name and the backend its state records, whichever backend new VMs get, and keeps them when its folder moves (&lt;a href="https://next.devvm.dev/docs/internals/overview/#a-moved-folder"&gt;a moved folder&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="which-backends-a-launch-asks"&gt;Which backends a launch asks&lt;span class="hx:absolute hx:-mt-20" id="which-backends-a-launch-asks"&gt;&lt;/span&gt;
&lt;a href="#which-backends-a-launch-asks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A launch asks a backend about its VMs only when some VM&amp;rsquo;s state names that backend. It asks them to write the &lt;a href="https://next.devvm.dev/docs/using/ssh/"&gt;ssh config&lt;/a&gt; and to check the SSH agent&amp;rsquo;s folders. So a backend that no VM uses never runs during a launch, even when it isn&amp;rsquo;t running or isn&amp;rsquo;t installed (&lt;a href="https://next.devvm.dev/docs/backends/#a-vms-backend"&gt;a VM&amp;rsquo;s backend&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Design notes</title><link>https://next.devvm.dev/docs/contributing/design/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/design/</guid><description>
&lt;p&gt;For contributors: why devvm is built the way it is, what was tried and dropped, and what&amp;rsquo;s still open. How each part works is on its own page in &lt;a href="https://next.devvm.dev/docs/internals/"&gt;How it works&lt;/a&gt;, and the rest of &lt;a href="https://next.devvm.dev/docs/contributing/"&gt;Contributing&lt;/a&gt; has the repo&amp;rsquo;s layout and rules. Why devvm is written in Go is under &lt;a href="https://next.devvm.dev/docs/internals/processes/#why-go"&gt;Why Go&lt;/a&gt;, with the processes it runs.&lt;/p&gt;
&lt;h2 data-hextra-search-id="emulated-features"&gt;Emulated features&lt;span class="hx:absolute hx:-mt-20" id="emulated-features"&gt;&lt;/span&gt;
&lt;a href="#emulated-features" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When devvm builds a backend feature from other parts of the backend, the feature is &lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;emulated&lt;/a&gt;, and it gets a note here before its review. The note says what the feature is built from, the guarantee it keeps, what could break it, and which end-to-end checks prove it. The threat check comes next, and only then is the feature marked reviewed. Every feature Lima has is native except its ports, which devvm&amp;rsquo;s forwarder emulates (&lt;a href="#ports-on-lima"&gt;below&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="ssh-into-vms"&gt;ssh into VMs&lt;span class="hx:absolute hx:-mt-20" id="ssh-into-vms"&gt;&lt;/span&gt;
&lt;a href="#ssh-into-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;ssh for editors is native on Lima, so it isn&amp;rsquo;t an emulation, but its sessions keep a guarantee of devvm&amp;rsquo;s own: ssh and editors reach a VM by name through the entries devvm writes (&lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;security model&lt;/a&gt;), and a session gives the VM no way out it doesn&amp;rsquo;t already have, on a confined tier nothing past its proxy, whatever the VM runs as sshd.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What keeps a session from carrying the VM out.&lt;/strong&gt; An ssh session can carry the VM&amp;rsquo;s traffic only through channels the host&amp;rsquo;s ssh asks for: remote forwards (&lt;code&gt;-R&lt;/code&gt;, &lt;code&gt;RemoteForward&lt;/code&gt;, a remote SOCKS forward), X11, a tunnel and the agent; OpenSSH&amp;rsquo;s client refuses a channel the server opens unasked. Root in the VM runs whatever sshd it likes, so the guarantee is the host&amp;rsquo;s ssh&amp;rsquo;s: devvm&amp;rsquo;s entry (first in &lt;code&gt;~/.ssh/config&lt;/code&gt;, so its options win over a &lt;code&gt;Host *&lt;/code&gt;) sets &lt;code&gt;ForwardX11 no&lt;/code&gt;, &lt;code&gt;ForwardX11Trusted no&lt;/code&gt;, &lt;code&gt;Tunnel no&lt;/code&gt;, &lt;code&gt;PermitRemoteOpen none&lt;/code&gt; (so devvm needs OpenSSH 8.7 or newer; no &lt;code&gt;IgnoreUnknown&lt;/code&gt; for older ones, as its first value wins and would replace a user&amp;rsquo;s &lt;code&gt;Host *&lt;/code&gt; one, such as macOS&amp;rsquo;s for &lt;code&gt;UseKeychain&lt;/code&gt;), &lt;code&gt;ForwardAgent&lt;/code&gt; as the agent choice the VM&amp;rsquo;s current start was made with says, &lt;code&gt;AddKeysToAgent no&lt;/code&gt; (no key of the host&amp;rsquo;s lands in an agent the session forwards), &lt;code&gt;ProxyJump none&lt;/code&gt; and &lt;code&gt;ProxyCommand none&lt;/code&gt; (no hop through something else), &lt;code&gt;UpdateHostKeys no&lt;/code&gt; (the VM can&amp;rsquo;t add host keys; devvm reads them itself) and &lt;code&gt;HashKnownHosts no&lt;/code&gt;. A &lt;code&gt;RemoteForward&lt;/code&gt; can&amp;rsquo;t be turned off without refusing &lt;code&gt;ssh -R&lt;/code&gt; on the command line too, so it isn&amp;rsquo;t (Not covered). VS Code&amp;rsquo;s Remote-SSH uses local and dynamic forwards (&lt;code&gt;-L&lt;/code&gt;, &lt;code&gt;-D&lt;/code&gt;) and is unaffected. Then sshd&amp;rsquo;s own settings, a defence for an honest VM (&lt;code&gt;assets/layers/base.sh&lt;/code&gt;, &lt;code&gt;/etc/ssh/sshd_config.d/00-devvm.conf&lt;/code&gt;, first so it wins; Lima&amp;rsquo;s own forwards are local; it applies only where the image&amp;rsquo;s &lt;code&gt;sshd_config&lt;/code&gt; includes &lt;code&gt;sshd_config.d&lt;/code&gt;, as Ubuntu&amp;rsquo;s and Debian&amp;rsquo;s do, so for some &lt;code&gt;--from&lt;/code&gt; images not at all, which only an honest VM&amp;rsquo;s defence loses):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Local forwarding&lt;/strong&gt; (&lt;code&gt;-L&lt;/code&gt;, &lt;code&gt;-D&lt;/code&gt;, &lt;code&gt;-W&lt;/code&gt;) is allowed: the VM itself connects, from its own network, which its tier confines like any other connection of the VM&amp;rsquo;s (checked). VS Code&amp;rsquo;s Remote-SSH reaches its server this way.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remote forwards bind only &lt;code&gt;127.77.0.0/16&lt;/code&gt;,&lt;/strong&gt; the range devvm keeps for links between VMs, and remote socket forwards are refused. A remote forward makes the host connect on the VM&amp;rsquo;s behalf, so one the host&amp;rsquo;s ssh asked for by mistake could reach anything the host reaches, its loopback services and sockets (&lt;code&gt;docker.sock&lt;/code&gt;, agents) included, around the VM&amp;rsquo;s confinement. &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; binds the address a request names, and &lt;code&gt;PermitListen 127.77.*:*&lt;/code&gt; matches that address as text, so a request for &lt;code&gt;localhost&lt;/code&gt; (ssh&amp;rsquo;s default), &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;0.0.0.0&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt; is refused. Only devvm on the host asks for a forward in that range, always by number. X11 and tunnels are refused too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent forwarding&lt;/strong&gt; is allowed: the entry decides it from the SSH agent choice the VM&amp;rsquo;s current start was made with (&lt;code&gt;ForwardAgent&lt;/code&gt; and &lt;code&gt;IdentityAgent&lt;/code&gt; naming the VM&amp;rsquo;s proxy&amp;rsquo;s relay of that agent, yours or devvm&amp;rsquo;s own, which passes on only listing keys, signing and &lt;code&gt;[email protected]&lt;/code&gt;, so the VM can&amp;rsquo;t remove, lock or add the agent&amp;rsquo;s keys, as &lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt; says). Refusing it would break &lt;code&gt;devvm ssh-agent on&lt;/code&gt; in editors.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These settings guard against the host&amp;rsquo;s ssh asking for a forward that devvm&amp;rsquo;s entry doesn&amp;rsquo;t pin (a &lt;code&gt;RemoteForward&lt;/code&gt; under &lt;code&gt;Host *&lt;/code&gt;, &lt;code&gt;ssh -R&lt;/code&gt;), and only while root in the VM leaves sshd as it is. They&amp;rsquo;re a safeguard for an honest VM, and the boundary is the host&amp;rsquo;s ssh, which accepts a channel only for a forward it asked for.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; OpenSSH&amp;rsquo;s client refusing unrequested channels, and devvm&amp;rsquo;s &lt;code&gt;Include&lt;/code&gt; line first in &lt;code&gt;~/.ssh/config&lt;/code&gt;, so its entries&amp;rsquo; options win.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; host ssh settings that come before devvm&amp;rsquo;s entries.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A remote forward you ask for (&lt;code&gt;ssh -R&lt;/code&gt;, a &lt;code&gt;RemoteForward&lt;/code&gt; of yours): &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;remote forwards you add&lt;/a&gt; lists what it leaves open.&lt;/li&gt;
&lt;li&gt;Sessions see the proxy&amp;rsquo;s password, as devvm&amp;rsquo;s own shells do, and VS Code and Cursor relay what &lt;a href="https://next.devvm.dev/docs/using/ssh/#vs-code-and-cursor"&gt;VS Code and Cursor&lt;/a&gt; describes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="ports-on-lima"&gt;Ports on Lima&lt;span class="hx:absolute hx:-mt-20" id="ports-on-lima"&gt;&lt;/span&gt;
&lt;a href="#ports-on-lima" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; when a VM forwards every port, each TCP port from 1024 up that a server in it listens on, on its loopback or on all its addresses, is forwarded to the same port on the host&amp;rsquo;s loopback, and only to its loopback. When a VM lists its ports, only those are forwarded, however many it lists, by the same rules. The forwarder never takes a port that a program on the host has on any address when the forward is made, or a port devvm records for another VM. Forwarding gives the VM no way out that it doesn&amp;rsquo;t already have, because every connection starts on the host. Lima&amp;rsquo;s own forwards listen with &lt;code&gt;SO_REUSEADDR&lt;/code&gt;, so on macOS, whenever a server in the VM starts, Lima takes &lt;code&gt;127.0.0.1:PORT&lt;/code&gt; while a program on the host has &lt;code&gt;*:PORT&lt;/code&gt;, and that program&amp;rsquo;s loopback connections go with it. That&amp;rsquo;s why Lima forwards nothing and devvm&amp;rsquo;s forwarder forwards the VM&amp;rsquo;s ports instead. On macOS, a confined VM doesn&amp;rsquo;t depend on Lima for that, because its hostagent&amp;rsquo;s sandbox refuses it every port but its ssh port, so Lima can&amp;rsquo;t forward a port of the VM&amp;rsquo;s even if it ignored its rules. The emulation is reviewed, with the threat check&amp;rsquo;s findings fixed or listed below, which is why the host key read is capped, reports are paced and the log is limited, and the end-to-end checks prove the rest.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima&amp;rsquo;s forwards off.&lt;/strong&gt; Each VM&amp;rsquo;s &lt;code&gt;portForwards&lt;/code&gt; holds three ignore rules, each for every guest port and protocol (&lt;code&gt;any&lt;/code&gt;, which is TCP and UDP). They&amp;rsquo;re on &lt;code&gt;127.0.0.1&lt;/code&gt;, which Lima also matches for &lt;code&gt;::1&lt;/code&gt;, on &lt;code&gt;0.0.0.0&lt;/code&gt; and on &lt;code&gt;::&lt;/code&gt;, which together match servers on all addresses. They come ahead of Lima&amp;rsquo;s own last rule, which forwards everything. &lt;code&gt;CreateVM&lt;/code&gt; sets them with &lt;code&gt;limactl clone --set&lt;/code&gt;. &lt;code&gt;Start&lt;/code&gt; sets them only where &lt;code&gt;limactl list&lt;/code&gt; shows other rules, because an edit gives the VM new host keys at its next boot. Lima&amp;rsquo;s ssh is its VM driver&amp;rsquo;s forward (&lt;code&gt;ssh.localPort&lt;/code&gt;), not a rule, so the ignore rules leave it alone, and they cover the guest&amp;rsquo;s own ssh port like any other.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sandbox&amp;rsquo;s binds (macOS, confined tiers).&lt;/strong&gt; The hostagent of a confined VM runs under a Seatbelt profile (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;) that denies every network bind but two kinds. It may bind the VM&amp;rsquo;s ssh port over TCP, which devvm chooses and records in the VM&amp;rsquo;s state (the &lt;code&gt;ports&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;host.ssh&lt;/code&gt;), and unix sockets in the VM&amp;rsquo;s Lima folder, which hold the hostagent&amp;rsquo;s own socket (&lt;code&gt;ha.sock&lt;/code&gt;), the VM&amp;rsquo;s network (&lt;code&gt;default_ep.sock&lt;/code&gt;, &lt;code&gt;default_fd.sock&lt;/code&gt;) and ssh&amp;rsquo;s control socket. Seatbelt matches a bind by its port alone, on any address, even when the rule names &lt;code&gt;localhost&lt;/code&gt;, and it can&amp;rsquo;t allow an ephemeral bind (port 0) without allowing every port. It matches a unix socket by its path with links resolved, so a link in the Lima folder doesn&amp;rsquo;t let the hostagent bind a socket elsewhere. Lima&amp;rsquo;s host resolver binds two ephemeral ports for its DNS server, so a confined VM starts with the resolver off and &lt;code&gt;127.0.0.1&lt;/code&gt; as its DNS server, as on Linux, where nothing listens and lookups fail at once. The hostagent reaches the guest agent over vsock, which needs no bind. This list comes from starting a VM under a profile that reported every bind, then under one that denied the rest: Lima logs a forward it&amp;rsquo;s refused (&lt;code&gt;failed to listen&lt;/code&gt;) and carries on, while a refused resolver ends the start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Which ports.&lt;/strong&gt; Which ports each VM forwards, all, none or a list, is in its state (&lt;code&gt;ports.forward&lt;/code&gt;), and the backend never hears of them: neither &lt;code&gt;Start&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Want&lt;/code&gt; nor any other call of the backend&amp;rsquo;s has them. &lt;code&gt;vmssh.Forwards.Start&lt;/code&gt;, the one owner of the forwarder, reads them from the VM&amp;rsquo;s state each time it starts one, after a start of the VM and when &lt;code&gt;devvm ports&lt;/code&gt; changes a running VM&amp;rsquo;s ports, without editing Lima&amp;rsquo;s config. A stopped VM&amp;rsquo;s change is its state&amp;rsquo;s alone, because its next start reads it. When the VM lists ports, the forwarder forwards those less the ports a program on the host has, which the owner leaves out with a &lt;code&gt;ports_taken&lt;/code&gt; warning. When none is left, no forwarder runs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forwarder per VM, on the host.&lt;/strong&gt; The forwarder is &lt;code&gt;vmssh.Forwarder&lt;/code&gt;, which isn&amp;rsquo;t a backend&amp;rsquo;s. Its owner, &lt;code&gt;vmssh.Forwards&lt;/code&gt;, runs it detached as &lt;code&gt;devvm _ports&lt;/code&gt;, one per VM, for project VMs alone, because only a project VM&amp;rsquo;s start goes through it, and builds&amp;rsquo; starts don&amp;rsquo;t. The owner starts it once the backend&amp;rsquo;s &lt;code&gt;Start&lt;/code&gt; returns, and again on a running VM when its ports change, each after stopping any forwarder the VM had, which ends the connections open through it. devvm finds that one by its pid file, which it checks against the process&amp;rsquo;s arguments, as it does for the proxy. It sends that forwarder SIGTERM and kills it if it hasn&amp;rsquo;t ended within 2 s, so its ports are free before devvm asks which listed ports a host program has. devvm holds a lock of the VM&amp;rsquo;s own (&lt;code&gt;ports.lock&lt;/code&gt;, beside its pid file &lt;code&gt;ports.pid&lt;/code&gt; in the VM&amp;rsquo;s run folder) from stopping the old forwarder until the new one has started, so two devvm runs at once, such as a start and &lt;code&gt;devvm ports&lt;/code&gt;, leave one forwarder, the one its pid file names. The owner waits up to 10 s for the forwarder to say it forwards while it runs. The forwarder says so in a status file of its own beside its pid file (&lt;code&gt;ports.status&lt;/code&gt;), which holds its pid and which devvm removes before each start. If it doesn&amp;rsquo;t, devvm warns with &lt;code&gt;ports_forward_failed&lt;/code&gt;, naming its log, and leaves it to keep trying while the VM runs on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reaching the VM.&lt;/strong&gt; The forwarder makes one ssh connection, a master (&lt;code&gt;ssh -F none -M -S &amp;lt;socket&amp;gt;&lt;/code&gt;), to the VM&amp;rsquo;s sshd on Lima&amp;rsquo;s ssh port on the host&amp;rsquo;s loopback. Lima&amp;rsquo;s &lt;code&gt;SSH&lt;/code&gt; gives the port with the user and the key, the first &lt;code&gt;IdentityFile&lt;/code&gt; of Lima&amp;rsquo;s ssh config, and devvm refuses that target unless the config names &lt;code&gt;127.0.0.1&lt;/code&gt; (&lt;code&gt;vmssh.FromTarget&lt;/code&gt;, the check links and the ssh config use too). It logs in as Lima&amp;rsquo;s user with Lima&amp;rsquo;s key alone (&lt;code&gt;IdentitiesOnly&lt;/code&gt;, &lt;code&gt;IdentityAgent=none&lt;/code&gt;), &lt;code&gt;_config/user&lt;/code&gt; in devvm&amp;rsquo;s Lima home, which every VM there authorizes, and never with the user&amp;rsquo;s agent. The master reads none of the user&amp;rsquo;s configuration and forwards nothing either way, with &lt;code&gt;ClearAllForwardings&lt;/code&gt;, &lt;code&gt;PermitRemoteOpen none&lt;/code&gt;, &lt;code&gt;ProxyCommand none&lt;/code&gt;, and no agent, X11 or tunnel. The VM&amp;rsquo;s sshd allows local forwarding, and remote forwards only to &lt;code&gt;127.77.0.0/16&lt;/code&gt; for &lt;a href="#links-between-vms"&gt;links&lt;/a&gt; (&lt;code&gt;base.sh&lt;/code&gt;), and &lt;code&gt;-W&lt;/code&gt; is local forwarding. Its control socket is in &lt;code&gt;~/.local/share/devvm/run&lt;/code&gt; (mode 700) and is named by a hash of the VM&amp;rsquo;s name, because a socket&amp;rsquo;s path has fewer than 104 characters. When the connection is lost, the forwarder closes its forwards and makes the connection again every 2 s while the lifeline holds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What listens.&lt;/strong&gt; The master&amp;rsquo;s session runs &lt;code&gt;ports.sh&lt;/code&gt; (&lt;code&gt;assets/guest/ports.sh&lt;/code&gt;) as the VM&amp;rsquo;s user (&lt;code&gt;sh -s&lt;/code&gt;). It prints the local addresses of the VM&amp;rsquo;s listening TCP sockets, which are the state &lt;code&gt;0A&lt;/code&gt; lines of &lt;code&gt;/proc/net/tcp&lt;/code&gt; and &lt;code&gt;tcp6&lt;/code&gt;, whenever they change and every 10 s regardless, so it ends soon after the connection does. The forwarder treats the report as untrusted. A line over 128 bytes or a report over 4096 lines ends the connection, and anything that isn&amp;rsquo;t a hex address and port is skipped. Reports are applied at least 500 ms apart, and one that comes sooner waits, holding up the VM&amp;rsquo;s ssh channel with it, so the VM can&amp;rsquo;t make the forwarder bind, dial and read devvm&amp;rsquo;s state at its own pace. The VM can make the forwarder write to its log, with ports coming and going and with the session&amp;rsquo;s stderr, so the log takes 200 writes at once and then one every 10 s. Each write is at most 512 bytes, without control characters other than newlines and tabs, C1 included, and the log is rotated before it passes 1 MiB, its end kept in &lt;code&gt;ports.log.1&lt;/code&gt;. A forwarded port&amp;rsquo;s connections go to &lt;code&gt;127.0.0.1&lt;/code&gt; for a server on all IPv4 addresses or on that address, and to &lt;code&gt;::1&lt;/code&gt; for a server on all IPv6 addresses or on that address. A server on another &lt;code&gt;127.x&lt;/code&gt; address alone gets its connections there. Servers on other addresses alone aren&amp;rsquo;t forwarded.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How many.&lt;/strong&gt; With every port, the forwarder takes ports from 1024 up, because the ports below are the host&amp;rsquo;s system services. With listed ports, it takes those alone (&lt;code&gt;-only&lt;/code&gt;), a listed port below 1024 included, because the user asked for it, and a bind the host refuses is logged. Either way the forwarder takes at most 256 ports at once (&lt;code&gt;vmssh.MaxForwards&lt;/code&gt;). It records why it couldn&amp;rsquo;t take each port in &lt;code&gt;ports.forwarded&lt;/code&gt;, by the bind&amp;rsquo;s error: in use (&lt;code&gt;EADDRINUSE&lt;/code&gt;), past its limit, or refused (&lt;code&gt;EACCES&lt;/code&gt; or &lt;code&gt;EPERM&lt;/code&gt;, such as below 1024 on Linux), and &lt;code&gt;devvm ports&lt;/code&gt; warns each with its own message (&lt;code&gt;ports_taken&lt;/code&gt;, &lt;code&gt;ports_limit&lt;/code&gt;, &lt;code&gt;ports_refused&lt;/code&gt;). Any other error, such as &lt;code&gt;EMFILE&lt;/code&gt;, &lt;code&gt;ENOBUFS&lt;/code&gt; or &lt;code&gt;EADDRNOTAVAIL&lt;/code&gt;, says nothing about the port, so it&amp;rsquo;s logged, not recorded, and the port is tried again at the next report, the log&amp;rsquo;s limit capping the repeats. A port past the limit is tried again at the next report once the forwarder forwards fewer. A record from before the reasons, whose third line holds every port it couldn&amp;rsquo;t take, is read as giving no reason, so it warns of none rather than call a refused port in use. It reads the reserved ports (below) again with each report, and while it can&amp;rsquo;t read them, it takes no new port and keeps those it has. A port it has that has since become reserved, such as one another VM&amp;rsquo;s start has chosen, is given up at that report, though the VM still listens on it, and also within 10 s on the host&amp;rsquo;s own clock (&lt;code&gt;Forwarder.Recheck&lt;/code&gt;), whether or not the VM reports, so a VM that holds its session open and stays silent can&amp;rsquo;t keep it. A reserved port the VM listens on waits and is tried again at each report until it&amp;rsquo;s no longer reserved. A port that a host program has, or that the host refused, is tried again only once the VM&amp;rsquo;s server on it goes and comes back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listening.&lt;/strong&gt; The forwarder listens on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;, or on IPv4 alone on a host without IPv6, which a bind on &lt;code&gt;::1&lt;/code&gt; reports as &lt;code&gt;EADDRNOTAVAIL&lt;/code&gt;, &lt;code&gt;EAFNOSUPPORT&lt;/code&gt; or &lt;code&gt;EPROTONOSUPPORT&lt;/code&gt;. &lt;code&gt;EACCES&lt;/code&gt; or &lt;code&gt;EPERM&lt;/code&gt; on &lt;code&gt;::1&lt;/code&gt; alone, with &lt;code&gt;127.0.0.1&lt;/code&gt; bound, also gives IPv4 alone, with a line in the log, because that&amp;rsquo;s a host denying IPv6 rather than a port it refuses. Any other error on &lt;code&gt;::1&lt;/code&gt; closes the port&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; listener and counts as that bind&amp;rsquo;s error would on &lt;code&gt;127.0.0.1&lt;/code&gt;, recorded or tried again at the next report as the bullet above says, so a passing error such as &lt;code&gt;EMFILE&lt;/code&gt; never leaves a forward on IPv4 alone until its port is opened again. It binds without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; (&lt;code&gt;platform.ListenExclusive&lt;/code&gt;). With that option, which Go and Lima set, macOS lets a socket take &lt;code&gt;127.0.0.1:PORT&lt;/code&gt; while a program has &lt;code&gt;*:PORT&lt;/code&gt;, and that program&amp;rsquo;s loopback connections go with it. Without the option, the bind is refused when another program has the port on any address. This was checked on macOS for a program on &lt;code&gt;0.0.0.0&lt;/code&gt;, on &lt;code&gt;::&lt;/code&gt; (IPv4 and IPv6 at once, as Node&amp;rsquo;s and Go&amp;rsquo;s servers listen), on IPv6 alone and on &lt;code&gt;127.0.0.1&lt;/code&gt;, each with and without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; of its own. A port held only by ended connections (&lt;code&gt;TIME_WAIT&lt;/code&gt;, with nothing answering on it) is taken as usual, so a server that restarts gets its forward back. When a bind is refused, the forwarder dials the port and takes it only if the dial is refused. A full backlog times out, which counts as taken. A port the forwarder took on &lt;code&gt;127.0.0.1&lt;/code&gt; but finds in use on &lt;code&gt;::1&lt;/code&gt; is given up, so &lt;code&gt;localhost&lt;/code&gt; never reaches two programs. On Linux, &lt;code&gt;SO_REUSEADDR&lt;/code&gt; stays on. Linux refuses that bind with the option too while another socket listens on the port, and without it, the forwarder&amp;rsquo;s own ended connections (&lt;code&gt;TIME_WAIT&lt;/code&gt;) would keep anyone from listening on the port for a minute, its next forwarder included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each connection.&lt;/strong&gt; Each forwarded connection is a channel of the master&amp;rsquo;s (&lt;code&gt;ssh -S &amp;lt;socket&amp;gt; -W HOST:PORT&lt;/code&gt;), with one process per connection and at most 256 at once. The VM&amp;rsquo;s sshd opens it to the VM&amp;rsquo;s own loopback from inside the VM. The channel&amp;rsquo;s ssh has the master&amp;rsquo;s options. If the master is gone, ssh connects on its own, and it then reaches the VM&amp;rsquo;s sshd the same way, never the host&amp;rsquo;s. Each relay&amp;rsquo;s ssh runs with a context of its own, which closing its forward cancels, so the ssh is killed with the forward even when the VM never ends its channel. &lt;code&gt;pipeSSH&lt;/code&gt;, which carries every relay of the forwarder&amp;rsquo;s, the link sessions&amp;rsquo; and a login&amp;rsquo;s callback, also cancels that context once the client on the host has closed its side and the VM has sent nothing for 30 seconds (&lt;code&gt;relayGrace&lt;/code&gt;), and once the client can take nothing more and the ssh hasn&amp;rsquo;t exited within 30 seconds. Each write of the VM&amp;rsquo;s bytes to the client starts the grace again once it&amp;rsquo;s done, and the grace doesn&amp;rsquo;t run while that write waits for the client, so a client that closes for writing alone and waits still gets an answer the VM keeps sending, however slowly it reads. The VM must send something at least every 30 seconds, its first byte included, so a client that half-closes and waits longer than that for a first byte, such as &lt;code&gt;nc -N&lt;/code&gt; in front of a slow query, is cut. The timer (&lt;code&gt;graceTimer&lt;/code&gt;) runs only once the client&amp;rsquo;s side has closed, or once the copy to the client has ended, with a write that failed or the VM&amp;rsquo;s EOF, and a relay that ends stops it for good, so the client&amp;rsquo;s goroutine, which can outlive the relay, never starts it again. The relay&amp;rsquo;s own context, its owner&amp;rsquo;s, also closes the client&amp;rsquo;s connection when it ends, so a write that waits on a client that stopped reading ends with its forward, its link or &lt;code&gt;LoopbackForward.Close&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reserved ports.&lt;/strong&gt; The forwarder never takes the VM&amp;rsquo;s own Lima ssh port, which Lima&amp;rsquo;s &lt;code&gt;SSH&lt;/code&gt; names, or its proxy port, which its state records, and the owner passes both as &lt;code&gt;-reserve&lt;/code&gt;. It also never takes the ssh, proxy and desktop ports devvm chooses and records in any VM&amp;rsquo;s state, the ports another VM&amp;rsquo;s running forwarder forwards now, as its &lt;code&gt;ports.forwarded&lt;/code&gt; record says, or the ports another VM lists while it has a claim on them, which is while its forwarder runs or while devvm holds its &lt;code&gt;ports.lock&lt;/code&gt; to start one again, unless this VM lists them too (&lt;code&gt;ports.Reserved&lt;/code&gt;). A stopped VM&amp;rsquo;s listed ports aren&amp;rsquo;t reserved from other VMs&amp;rsquo; forwarders, but the ports devvm chooses still avoid them (&lt;code&gt;ports.Used&lt;/code&gt;). Every Lima VM&amp;rsquo;s ssh port is one of those, whatever its tier: devvm chooses it when it makes the VM, sets it with &lt;code&gt;limactl clone --set .ssh.localPort&lt;/code&gt;, and records it in the VM&amp;rsquo;s &lt;code&gt;ports&lt;/code&gt; section before the clone (&lt;code&gt;ports.Allocator.SSH&lt;/code&gt;). One allocator, &lt;code&gt;ports.Allocator&lt;/code&gt;, chooses every host port devvm chooses, the ssh, proxy and desktop ports, and records it while it holds the VM&amp;rsquo;s lock and then the claims lock (&lt;code&gt;run/claims.lock&lt;/code&gt;, &lt;code&gt;state.VM.Claim&lt;/code&gt;) until the VM&amp;rsquo;s state is written, so two devvm commands making or starting VMs at once never choose the same one. A build VM has no state, so devvm chooses its ssh port too, on every host, through the same allocator (&lt;code&gt;ports.Allocator.Build&lt;/code&gt;), under the claims lock alone (&lt;code&gt;state.Claims&lt;/code&gt;), and on macOS the build&amp;rsquo;s Seatbelt profile names that port. It records the port by the build VM&amp;rsquo;s name (&lt;code&gt;run/build-ports/&amp;lt;name&amp;gt;&lt;/code&gt;), where &lt;code&gt;ports.Used&lt;/code&gt; reads it, until &lt;code&gt;limactl start&lt;/code&gt; returns, and by then Lima has bound the port or the start has failed. The devvm that starts the build holds a file lock on that record until then, and the kernel lets go of the lock when that devvm ends, even when it&amp;rsquo;s killed. Each time devvm chooses a port, under the claims lock, it first deletes the records whose lock no process holds and that are over 15 minutes old. The age matters because a killed devvm leaves its &lt;code&gt;limactl start&lt;/code&gt; running, which may still bind the port for up to Lima&amp;rsquo;s 10 minutes of waiting for the VM&amp;rsquo;s ssh. So a devvm killed while its build VM starts reserves that port for 15 minutes, and then only until the next port is chosen. A stopped VM gets a new one only when a program on the host has its port on any address, even one that accepts no connections, or when the VM lists it to forward, and its start then sets it with an edit. Lima binds the port only once the VM boots, a few seconds after its start, so a port Lima picked itself would be free for another VM&amp;rsquo;s forwarder in that window, and Lima&amp;rsquo;s own ssh, which checks no host key, would then reach the other VM (the threat check below).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The host key.&lt;/strong&gt; devvm keeps one record of a VM&amp;rsquo;s host keys for each of its starts, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/known_hosts&lt;/code&gt; (&lt;code&gt;vmssh.PinHostKeys&lt;/code&gt;). It removes the record before each start and reads the keys once the VM runs, whatever ports the VM forwards, and a command that finds the VM running without a record of its current start reads them too (&lt;code&gt;starter.pinHostKeys&lt;/code&gt;). It reads them through &lt;code&gt;limactl shell&lt;/code&gt;, at most 64 KiB for at most 30 s, keeping only lines whose key decodes and names its own type (&lt;code&gt;vmssh.ParseHostKeys&lt;/code&gt;). The record&amp;rsquo;s first line names the start it was read for (&lt;code&gt;backend.Run.ID&lt;/code&gt;), so a record of another start, such as one before a &lt;code&gt;limactl start&lt;/code&gt; outside devvm, is read again, and keys read while the VM started again aren&amp;rsquo;t recorded. The forwarder checks the VM against that record, with &lt;code&gt;HostKeyAlias&lt;/code&gt; and &lt;code&gt;StrictHostKeyChecking yes&lt;/code&gt;, as the ssh config, links&amp;rsquo; sessions and a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s git do. All of them reach the VM through one function, &lt;code&gt;vmssh.Checked&lt;/code&gt;, which checks the backend&amp;rsquo;s ssh and adds the record: the forwarder and the ssh config pin the keys when the record is another start&amp;rsquo;s, and links&amp;rsquo; sessions and git take only a record of the current start. The pin keeps the forwarder from talking to a program on the host that takes the ssh port. It doesn&amp;rsquo;t guard against the VM itself, which is already the other end of the connection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its lifeline.&lt;/strong&gt; The forwarder follows the hostagent&amp;rsquo;s pid file (&lt;code&gt;ha.pid&lt;/code&gt;, the lifeline Lima&amp;rsquo;s &lt;code&gt;Running&lt;/code&gt; gives), as the proxy does, and exits once the file is gone, holds anything else, or its process is gone. &lt;code&gt;devvm stop&lt;/code&gt; stops it with the VM, and &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop it before they delete its files with the VM&amp;rsquo;s folder. A VM that stops some other way, such as when its self-check fails or a restart stops it, ends its forwarder through the lifeline, and the next start stops any forwarder that&amp;rsquo;s left before it starts its own.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What keeps a forward from carrying the VM out:&lt;/strong&gt; every connection starts on the host. A program connects to the forwarder&amp;rsquo;s port, and the forwarder asks the VM&amp;rsquo;s sshd to connect to the VM&amp;rsquo;s loopback. The VM opens nothing to the host through the forwarder, because the master asks for no remote forward, agent, X11 or tunnel, and OpenSSH&amp;rsquo;s client refuses a channel that the server opens unasked, whatever sshd root in the VM runs. The only remote forwards devvm asks a VM for are a client&amp;rsquo;s links, on a link session that is a connection of its own, never the forwarder&amp;rsquo;s master (&lt;a href="#links-between-vms"&gt;links&lt;/a&gt;). What the VM sends back goes to the program that connected, as with any forward. On a confined tier, the VM&amp;rsquo;s own connections stay confined by Seatbelt or QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt;, while the forwarder runs on the host as devvm, outside the hostagent&amp;rsquo;s sandbox.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; OpenSSH&amp;rsquo;s client refusing unrequested channels and honoring &lt;code&gt;-F none&lt;/code&gt;, the kernel refusing a bind without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; where another socket has the port (checked on macOS), devvm&amp;rsquo;s state listing every VM&amp;rsquo;s ports, each running forwarder&amp;rsquo;s record of the ports it forwards, and the forwarders&amp;rsquo; pid files and locks saying which VMs have a claim on their listed ports. It also relies on Lima binding its ssh forward on the host&amp;rsquo;s loopback alone, on the host key that devvm pins at the start, and on Lima honoring the ignore rules ahead of its own rule. On macOS, a confined VM relies on Seatbelt refusing the hostagent&amp;rsquo;s binds instead of on the rules, and on the Virtualization framework&amp;rsquo;s own process, which runs outside the profile, binding nothing: the VM&amp;rsquo;s network goes through the hostagent&amp;rsquo;s unix sockets.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a Lima release that forwards despite the ignore rules, or that forwards from somewhere other than &lt;code&gt;portForwards&lt;/code&gt;. On macOS, a confined VM keeps the guarantee even then, because its sandbox refuses the binds. An open VM, and every VM on Linux, where QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt; doesn&amp;rsquo;t cover the hostagent&amp;rsquo;s own binds, still relies on Lima honoring the rules. A Lima release that needs a new bind for a confined VM, such as a resolver that can&amp;rsquo;t be turned off, fails its start closed, and Lima&amp;rsquo;s log names the refused bind. The end-to-end checks look at the rules, and use &lt;code&gt;lsof&lt;/code&gt; or &lt;code&gt;ss&lt;/code&gt; to check that the hostagent has no TCP or UDP port of the VM&amp;rsquo;s and that a host program keeps its port. A program on the host could take Lima&amp;rsquo;s ssh port while the VM is stopped, and the pinned host key refuses it. Lima&amp;rsquo;s key logs in to every VM in devvm&amp;rsquo;s Lima home, as it does for Lima&amp;rsquo;s own ssh, but public key authentication never sends the key to the VM.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion; the sandbox&amp;rsquo;s binds and the ssh port). Leads, each confirmed and fixed, ruled out, or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Another VM answering for this one&amp;rsquo;s ssh:&lt;/strong&gt; confirmed, fixed. An ssh port that Lima picks at a VM&amp;rsquo;s start, and binds once the VM boots, is one devvm doesn&amp;rsquo;t record, so no forwarder reserves it. Another VM forwarding every port, with a server on that port in the window, has its forward take it. Lima then carries on with its other ssh forward and waits on the port (seen with a host program holding it), and Lima&amp;rsquo;s own ssh checks no host key (&lt;code&gt;StrictHostKeyChecking no&lt;/code&gt;), so &lt;code&gt;limactl shell&lt;/code&gt;, the host keys devvm reads and pins after the start, and devvm&amp;rsquo;s setup and shell would reach the other VM. The fix: each VM&amp;rsquo;s ssh port is devvm&amp;rsquo;s, whatever its tier, recorded before the clone and reserved by every forwarder. It&amp;rsquo;s unit-tested and checked by the CLI tests, and end to end, the port a VM&amp;rsquo;s state records is the one Lima listens on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A guest port bound around the rules:&lt;/strong&gt; ruled out on macOS on a confined tier. Lima forwards a port only by binding it on the host, and the sandbox refuses every port but the ssh port. End to end, with Lima&amp;rsquo;s own rule put back for one start inside the sandbox, Lima tries the guest&amp;rsquo;s TCP and UDP ports, is refused (&lt;code&gt;operation not permitted&lt;/code&gt;), and has no port but its ssh port, while devvm&amp;rsquo;s forwarder forwards the TCP port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The ssh port on every address:&lt;/strong&gt; listed. Seatbelt allows the ssh port on any address, so a Lima that bound it on &lt;code&gt;0.0.0.0&lt;/code&gt; would put the VM&amp;rsquo;s sshd on the network, where it still takes only keys. Lima binds it on &lt;code&gt;127.0.0.1&lt;/code&gt;, and the end-to-end checks look at the hostagent&amp;rsquo;s listeners. The rule allows the port over TCP alone, so the guest&amp;rsquo;s UDP server on that port number can&amp;rsquo;t get a forward from it; checked end to end.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A program holding a stopped VM&amp;rsquo;s ssh port:&lt;/strong&gt; ruled out, but for a race. A start looks for the recorded port with a bind on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; as well as a connection, so a program that has the port on any address, even one that accepts no connections, gives the VM a new port. Only a program that takes the port between that check and Lima&amp;rsquo;s bind, a few seconds later, gets Lima&amp;rsquo;s ssh, which is listed under not covered below. End to end, a VM whose port a host program holds starts on a new one, recorded, and the program keeps its own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two VMs choosing the same ssh port:&lt;/strong&gt; confirmed, fixed. Without a lock, two devvm commands making VMs at once could each choose the same port from the ports other VMs record, and the second VM&amp;rsquo;s Lima would wait on a port that the first one&amp;rsquo;s has. devvm chooses and records a port while it holds the claims lock, &lt;code&gt;run/claims.lock&lt;/code&gt; in its data folder, after the VM&amp;rsquo;s own lock (&lt;a href="https://next.devvm.dev/docs/internals/overview/#locks"&gt;locks&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A build VM&amp;rsquo;s ssh port:&lt;/strong&gt; confirmed, fixed. A port that Lima picked at a build&amp;rsquo;s start would be one that no VM&amp;rsquo;s state records, so another VM forwarding every port could take it in the window before Lima binds it, and Lima&amp;rsquo;s ssh would then run the build&amp;rsquo;s scripts in that VM. The fix: devvm chooses every build VM&amp;rsquo;s ssh port, on macOS and Linux, under the claims lock, and records it in &lt;code&gt;run/build-ports/&amp;lt;name&amp;gt;&lt;/code&gt;, which every forwarder reserves, until the build VM&amp;rsquo;s start returns. A record that a killed devvm leaves is deleted the first time devvm chooses a port once the record is 15 minutes old, because no process holds its lock, and until then it keeps the port from any VM while the start that the killed devvm left may still bind it. Builds carry no credentials, an image is the build VM&amp;rsquo;s own disk, and a tool build writes its images through a folder that only its own VM mounts, so even a VM that reached a build&amp;rsquo;s ssh another way could break that build but couldn&amp;rsquo;t learn a secret from it or choose what an image or a tool image holds. It&amp;rsquo;s unit-tested on both systems, and the CLI tests check that a build&amp;rsquo;s start sets the port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A browser reaching a VM&amp;rsquo;s ssh port:&lt;/strong&gt; confirmed, fixed. Lima listens on the ssh port on this machine&amp;rsquo;s loopback, and root in the VM can make what answers on port 22 speak HTTP, so a page opened as &lt;code&gt;http://localhost:PORT&lt;/code&gt;, by a link or by a VM that opens URLs, would reach a server the VM controls with the cookies of the apps you use on &lt;code&gt;localhost&lt;/code&gt;, even in a VM that forwards no ports. The fix is that every VM&amp;rsquo;s ssh port, and every build VM&amp;rsquo;s, is one of the Fetch standard&amp;rsquo;s bad ports from 1024 up that Chromium&amp;rsquo;s &lt;code&gt;kRestrictedPorts&lt;/code&gt; also blocks (&lt;code&gt;ports.SSHPorts&lt;/code&gt;, 17 of them, because Chromium lacks 4190 and 6679, which headless Chrome 157 loads). Every browser engine refuses every request to these ports, navigations and WebSockets included. The one allocator chooses them (&lt;code&gt;ports.Allocator.SSH&lt;/code&gt; and &lt;code&gt;Build&lt;/code&gt;, through &lt;code&gt;freeSSH&lt;/code&gt;), its other ports never take one, and a proxy or desktop port that an older devvm chose there moves at the VM&amp;rsquo;s next start. No forwarder takes one unless its VM lists it (&lt;code&gt;ports.Reserved&lt;/code&gt;), so a guest forwarding every port can&amp;rsquo;t fill them, and a stopped VM&amp;rsquo;s listed ports don&amp;rsquo;t keep them from a start. That allows at most 17 running VMs, and a start past that fails with &lt;code&gt;ports_ssh_limit&lt;/code&gt; or &lt;code&gt;ports_ssh_limit_all&lt;/code&gt;, naming the VMs whose ports are in use, or &lt;code&gt;ports_ssh_limit_others&lt;/code&gt;. An older devvm&amp;rsquo;s VM moves onto the list at its next start, in the start&amp;rsquo;s one &lt;code&gt;limactl edit&lt;/code&gt;, and each launch warns of a running VM still on an old port (&lt;code&gt;ports_ssh_old&lt;/code&gt;). A start holds its port, kept or new, for a minute (&lt;code&gt;run/ports.ssh-hold&lt;/code&gt; in the VM&amp;rsquo;s folder), because a stopped VM&amp;rsquo;s port that it keeps would otherwise look free to another start in the window before Lima binds it. The hold is time-limited, so a backend that takes over a minute to bind can lose the port to another start and fail, and its next start gets another. It&amp;rsquo;s unit-tested (&lt;code&gt;TestSSHPorts&lt;/code&gt;, &lt;code&gt;TestSSH&lt;/code&gt;, &lt;code&gt;TestSSHHolds&lt;/code&gt;, &lt;code&gt;TestSSHListed&lt;/code&gt;, &lt;code&gt;TestOffList&lt;/code&gt;, &lt;code&gt;TestBuild&lt;/code&gt;, &lt;code&gt;TestReserved&lt;/code&gt;, &lt;code&gt;TestStartBuildSSHPort&lt;/code&gt;, &lt;code&gt;TestPrepareRestartsTheProxy&lt;/code&gt;, &lt;code&gt;TestDesktopListener&lt;/code&gt;), checked by the CLI tests (&lt;code&gt;ssh_ports&lt;/code&gt;, the frozen 0.1.0 fixture&amp;rsquo;s launches), and end to end each VM&amp;rsquo;s ssh port is on the list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What a failed start or create leaves:&lt;/strong&gt; ruled out. A VM whose create fails, other than by an interrupt, keeps its state, and with it its recorded port, until &lt;code&gt;devvm rm&lt;/code&gt; deletes it, so the port stays reserved and nothing else takes it. &lt;code&gt;devvm rm&lt;/code&gt; deletes the state, which frees the port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unix sockets:&lt;/strong&gt; ruled out as a way out. The hostagent binds them only in the VM&amp;rsquo;s Lima folder, which only Lima&amp;rsquo;s own commands and devvm use.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS around the proxy:&lt;/strong&gt; ruled out. With Lima&amp;rsquo;s resolver off, the guest&amp;rsquo;s DNS server is &lt;code&gt;127.0.0.1&lt;/code&gt;, which &lt;a href="#transparent-mode"&gt;transparent mode&lt;/a&gt;&amp;rsquo;s dnsmasq answers inside the VM with one stand-in address and no upstream, or nothing answers when it&amp;rsquo;s off, and Lima&amp;rsquo;s network&amp;rsquo;s DNS address and the host&amp;rsquo;s address on it answer nothing even when root asks them directly with transparent mode stopped, because the sandbox denies the hostagent the host&amp;rsquo;s DNS service and every connection but the proxy&amp;rsquo;s; checked end to end, with transparent mode stopped and running.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A compromised hostagent:&lt;/strong&gt; listed. The bind rules stop a Lima that misbehaves, not code an attacker runs in it, which the profile still lets read and write your files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts without the sandbox:&lt;/strong&gt; listed. Only confined starts on macOS run under it. A build keeps Lima&amp;rsquo;s host resolver, so its binds aren&amp;rsquo;t denied, and an open VM starts unconfined. Such a VM could run under a profile that denies binds alone, as its ssh port is fixed, but it would need Lima&amp;rsquo;s resolver off too, which changes how it resolves names (the user-mode network&amp;rsquo;s own DNS instead of the host&amp;rsquo;s resolver), so that&amp;rsquo;s proposed rather than done.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check for listed ports&lt;/strong&gt; (the security-audit skill, its local IPC companion). Listed ports use the same forwarder with &lt;code&gt;-only&lt;/code&gt;, so these leads are what listed ports add, each confirmed or ruled out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A port the VM chooses:&lt;/strong&gt; ruled out. &lt;code&gt;-only&lt;/code&gt; comes from the VM&amp;rsquo;s state, less the ports a host program has, both read on the host by the forwarder&amp;rsquo;s owner, and the VM&amp;rsquo;s reports can&amp;rsquo;t add to it. A listed port is forwarded only while a server in the VM listens on it, as with every port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Port 22 listed:&lt;/strong&gt; ruled out as a collision. Port 22 in the VM is its sshd, and Lima&amp;rsquo;s ssh forward comes from another host port, so a listed 22 forwards the VM&amp;rsquo;s sshd to the host&amp;rsquo;s port 22 as it would forward any server. The VM&amp;rsquo;s sshd still takes only keys. A host whose own sshd has port 22 keeps it, with a &lt;code&gt;ports_taken&lt;/code&gt; warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A listed proxy port:&lt;/strong&gt; ruled out. The forwarder reserves the VM&amp;rsquo;s own proxy port whether or not it&amp;rsquo;s listed, and every other VM&amp;rsquo;s as well.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A listed port below 1024:&lt;/strong&gt; taken because the user asked for it. A host service that has the port keeps it, and a bind the host refuses is logged and recorded as refused, never as in use, so &lt;code&gt;devvm ports&lt;/code&gt; warns &lt;code&gt;ports_refused&lt;/code&gt; rather than &lt;code&gt;ports_taken&lt;/code&gt;. One that isn&amp;rsquo;t running yet is under &lt;strong&gt;Not covered&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forwarder left behind:&lt;/strong&gt; ruled out. &lt;code&gt;devvm stop&lt;/code&gt; stops it, &lt;code&gt;devvm rm&lt;/code&gt; stops it and removes its files, any other stop ends it through its lifeline, and a start or change whose listed ports are all taken runs none. Two devvm runs that start a VM&amp;rsquo;s forwarder at once take turns on the VM&amp;rsquo;s lock, so the second stops the first one&amp;rsquo;s forwarder, and neither leaves one that its pid file doesn&amp;rsquo;t name, which nothing would stop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A tier&amp;rsquo;s confinement:&lt;/strong&gt; ruled out. Listed ports take fewer ports than every port, never more, and every connection still starts on the host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another VM takes a stopped or restarting VM&amp;rsquo;s listed port:&lt;/strong&gt; mitigated. Only a running VM holds a port, so while VM V is stopped, another VM E may forward V&amp;rsquo;s listed port, and a hostile E could then try to keep it, such as by forwarding every port and holding its ssh session open without reporting again. Three things stop that. First, the host decides when a port is given up: every forwarder closes each forward whose port is now reserved within 10 s on its own clock, whatever its VM reports, so E gives V&amp;rsquo;s port up once V runs and lists it. Closing a forward also closes every connection it accepted that&amp;rsquo;s still open, so a browser&amp;rsquo;s keep-alive connection to &lt;code&gt;localhost:5173&lt;/code&gt;, opened while E had the port, ends then too, and the browser&amp;rsquo;s later requests, with V&amp;rsquo;s cookies, never reach E over it. Second, V&amp;rsquo;s start, a change of its ports and &lt;code&gt;devvm ports&lt;/code&gt; warn with &lt;code&gt;ports_held&lt;/code&gt; and name E in &lt;code&gt;held_by&lt;/code&gt;, whether E lists the port or forwards every port, so V never waits silently. Third, V&amp;rsquo;s listed ports stay reserved while devvm holds V&amp;rsquo;s &lt;code&gt;ports.lock&lt;/code&gt;, from stopping V&amp;rsquo;s old forwarder until its new one runs, so no other VM takes them in that window. A stale &lt;code&gt;ports.forwarded&lt;/code&gt; can&amp;rsquo;t hold a port either: devvm removes it under that lock before each start, each forwarder writes an empty one when it starts, and a record counts only while its pid is the VM&amp;rsquo;s running forwarder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A relay the VM holds open:&lt;/strong&gt; confirmed, fixed. Closing a forward closed the connections it had accepted, but each connection&amp;rsquo;s ssh (&lt;code&gt;-W&lt;/code&gt;) waits for the VM&amp;rsquo;s sshd to end its channel, so a hostile VM that ignored the EOF kept that ssh process, and one of the forwarder&amp;rsquo;s 256 relays, until the forwarder ended. Up to 256 such ssh processes could pile up on the host for each VM, and the VM&amp;rsquo;s forwards would then refuse every new connection. Each relay now runs with a context of its own, which closing its forward cancels, under the forwarder&amp;rsquo;s lock as the close already runs, so the ssh is killed (&lt;code&gt;exec.CommandContext&lt;/code&gt;), and a relay that ends by itself releases its context. Unit-tested with an ssh stand-in that never exits on its own: the relay ends, its process is gone and its slot is free once the forward closes (&lt;code&gt;TestForwarderEndsStuckRelay&lt;/code&gt;), with no goroutine or file descriptor left under &lt;code&gt;-race&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A relay the VM holds open after its client has gone:&lt;/strong&gt; mitigated. While a forward lasts, a VM that ignores EOF would keep each relay whose client on the host had closed, its ssh process and one of the 256, so a hostile VM could fill the forwarder&amp;rsquo;s relays with connections a browser had already closed. Each relay&amp;rsquo;s ssh is killed once its client has closed and the VM has sent nothing for 30 seconds, or 30 seconds after the client can take nothing more, so a VM keeps such a relay only by sending to it, and only for as long as the client keeps its side open for reading. The grace doesn&amp;rsquo;t run while a write waits for a slow client, so a client that stops reading holds the relay and its ssh itself, as it could by staying open, until it reads again, closes, or the relay&amp;rsquo;s forward or link goes. Unit-tested with an ssh stand-in that never exits: a closed client&amp;rsquo;s relay and a half-closed one&amp;rsquo;s both end after the grace when the stand-in is silent, and one the stand-in keeps talking to goes on past it, while a fully closed client&amp;rsquo;s relay, and one whose writes to its client fail, end within the grace however much the stand-in sends. A half-closed client that doesn&amp;rsquo;t read for many graces still gets all of the stand-in&amp;rsquo;s answer afterwards, and a relay whose write waits on a client that stopped reading ends when its context does (&lt;code&gt;TestPipeSSHGrace&lt;/code&gt;, &lt;code&gt;TestPipeSSHGraceWriteError&lt;/code&gt;, &lt;code&gt;TestPipeSSHGraceSlowClient&lt;/code&gt;, &lt;code&gt;TestRelayGrace&lt;/code&gt;, &lt;code&gt;TestRelayGraceWriteError&lt;/code&gt;, &lt;code&gt;TestRelayGraceSlowClient&lt;/code&gt;, &lt;code&gt;TestRelayCancelEndsBlockedWrite&lt;/code&gt;, &lt;code&gt;TestGraceTimer&lt;/code&gt;). The price is a client that half-closes and waits more than 30 seconds for an answer&amp;rsquo;s first byte, which is cut.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forward on IPv4 alone:&lt;/strong&gt; ruled out except on a host without IPv6 or one that denies it. A bind on &lt;code&gt;::1&lt;/code&gt; that fails with an error that says nothing of the port, such as &lt;code&gt;EMFILE&lt;/code&gt; or &lt;code&gt;ENOBUFS&lt;/code&gt;, closes the port&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; listener, is logged, and has the port tried again at the next report, so &lt;code&gt;localhost&lt;/code&gt; never reaches the VM on one address and another program, or nothing, on the other. Only &lt;code&gt;EADDRNOTAVAIL&lt;/code&gt;, &lt;code&gt;EAFNOSUPPORT&lt;/code&gt; and &lt;code&gt;EPROTONOSUPPORT&lt;/code&gt;, a host without IPv6, give IPv4 alone, and so do &lt;code&gt;EACCES&lt;/code&gt; and &lt;code&gt;EPERM&lt;/code&gt; on &lt;code&gt;::1&lt;/code&gt; alone, logged, as a security module that denies IPv6 sockets would otherwise stop every forward. On such a host, a program that the module lets use IPv6 could still take &lt;code&gt;::1&lt;/code&gt; on a forwarded port, and &lt;code&gt;localhost&lt;/code&gt; would then reach it there, which is listed rather than refused because the alternative is no forwarding at all. Unit-tested with each error on &lt;code&gt;::1&lt;/code&gt; (&lt;code&gt;TestForwarderIPv6Failures&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forward&amp;rsquo;s listener out of files:&lt;/strong&gt; confirmed, fixed. The loop that accepts a forward&amp;rsquo;s connections ended at any error, &lt;code&gt;EMFILE&lt;/code&gt; included, while its listener stayed open, so a burst that ran the forwarder out of open files left that port taking connections that nothing answered until the forward went. The fix is that it tries again after a wait that starts at 5 ms and doubles with each failure in a row, up to a second, and logs only the first failure of a run (&lt;code&gt;daemon.AcceptRetry&lt;/code&gt;), as the link session, a login&amp;rsquo;s forward and the proxy&amp;rsquo;s SSH agent relay do. A login&amp;rsquo;s forward also carries at most 16 connections at once, an ssh process each (&lt;code&gt;TestAcceptRetry&lt;/code&gt;, &lt;code&gt;TestForwarderAcceptRetries&lt;/code&gt;, &lt;code&gt;TestLinksAcceptRetries&lt;/code&gt;, &lt;code&gt;TestForwardLoopbackLimit&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Channels the VM never closes in the master:&lt;/strong&gt; listed. A hostile VM that never sends CLOSE for a killed relay&amp;rsquo;s channel can leave small channel entries, with no file descriptor, in the forwarder&amp;rsquo;s ssh master. At most 256 relays run at once, which bounds them, and no code change is needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;While a VM is stopped, another VM that serves on its listed port, such as &lt;code&gt;localhost:5173&lt;/code&gt;, gets that port&amp;rsquo;s browser origin, with the site data, storage and service workers your browser keeps for it, as two projects on one port would on any host. A service worker that the other VM&amp;rsquo;s page registers there can still answer for that origin after the first VM takes the port back.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A VM can take a free port from 1024 up, or a listed one, on the host&amp;rsquo;s loopback that a program there expects to be its own, such as one that isn&amp;rsquo;t running yet or is restarting. What the VM serves there reaches whatever connects, so a page it serves to the user&amp;rsquo;s browser can reach the internet from the host, past the VM&amp;rsquo;s tier.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A host program that starts on a port while the VM has it forwarded still binds it when it listens on all addresses with &lt;code&gt;SO_REUSEADDR&lt;/code&gt;, as most servers do (checked on macOS). Its loopback connections then reach the VM, because the forward&amp;rsquo;s address is the narrower one. A program that binds without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; is refused.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The VM can make the forwarder dial a host loopback port that&amp;rsquo;s in use and then close the connection at once without sending anything, because that&amp;rsquo;s how the forwarder checks for a port held only by ended connections. This happens at most once per port every second, as the VM&amp;rsquo;s listener on the port goes and comes back.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Servers only on the VM&amp;rsquo;s other addresses, such as its network address or a container&amp;rsquo;s, aren&amp;rsquo;t forwarded.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Other users on the host reach the forwards, because they&amp;rsquo;re on the host&amp;rsquo;s loopback.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;UDP isn&amp;rsquo;t forwarded. &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;Ports&lt;/a&gt; shows how to tunnel it over TCP.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A server that keeps a port while its forward couldn&amp;rsquo;t be made, because the host had the port, isn&amp;rsquo;t forwarded until it stops and starts again.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Another user on the host can take a VM&amp;rsquo;s ssh port while the VM is stopped or booting. Lima&amp;rsquo;s own ssh would then reach that user&amp;rsquo;s program, as it checks no host key, while devvm&amp;rsquo;s forwarder and ssh config pin the VM&amp;rsquo;s.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A VM started outside devvm, such as with &lt;code&gt;devvm limactl start&lt;/code&gt;, or one whose forwarder ended, runs without forwarded ports until its next start through devvm, or until &lt;code&gt;devvm ports&lt;/code&gt; changes its ports, which starts a forwarder with the host key devvm pinned at its last start.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;project&lt;/code&gt;, and &lt;code&gt;network&lt;/code&gt; for the sandbox&amp;rsquo;s binds):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lima&amp;rsquo;s rules ignore everything, the forwarder runs with the host key devvm pinned for the VM, and Lima&amp;rsquo;s ssh listens on the port the VM&amp;rsquo;s state records.&lt;/li&gt;
&lt;li&gt;A stopped VM whose ssh port a host program holds, on &lt;code&gt;127.0.0.1&lt;/code&gt; alone and accepting no connections, starts on a new port that its state records, and the program keeps its own.&lt;/li&gt;
&lt;li&gt;A VM server on a port answers at the host&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; through the forwarder, while Lima&amp;rsquo;s hostagent has neither that port nor a UDP server&amp;rsquo;s port. The forward listens on the host&amp;rsquo;s loopback alone. A port that a host program has on every address keeps that program&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; connections while a server in the VM listens on it, and the forwarder logs that port as not forwarded.&lt;/li&gt;
&lt;li&gt;With listed ports, only those reach the host, whatever address the VM&amp;rsquo;s server is on. A listed port that a host program has is left out with a warning, and forwarded again once it&amp;rsquo;s free.&lt;/li&gt;
&lt;li&gt;On a running VM, &lt;code&gt;devvm ports&lt;/code&gt; changes the forwarder&amp;rsquo;s ports at once. A port that &lt;code&gt;devvm ports add&lt;/code&gt; lists has its server reach the host at once, and once &lt;code&gt;devvm ports rm&lt;/code&gt; takes it out, it doesn&amp;rsquo;t. The VM&amp;rsquo;s boot ID is the same throughout, so it never restarted.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm stop&lt;/code&gt; stops the forwarder, &lt;code&gt;limactl stop&lt;/code&gt; outside devvm ends it (on macOS), and &lt;code&gt;rm&lt;/code&gt; stops it and deletes its files.&lt;/li&gt;
&lt;li&gt;On macOS, a confined VM has a profile that denies every bind but its ssh port&amp;rsquo;s over TCP and unix sockets in its Lima folder, and the same binds that work outside the profile, a TCP port and a UDP socket on the ssh port, fail under it. Its hostagent listens on its ssh port alone, with Lima&amp;rsquo;s resolver off. Started again with Lima&amp;rsquo;s own forwarding rule put back inside the sandbox, the hostagent tries a VM server&amp;rsquo;s TCP and UDP ports and is refused, and has neither. The VM still works: ssh by name, devvm&amp;rsquo;s forwarder (on the host&amp;rsquo;s loopback alone), the proxy and the self-check. Its next start puts the ignore rules back.&lt;/li&gt;
&lt;li&gt;On a confined tier, with transparent mode stopped, DNS fails at once, because the guest&amp;rsquo;s programs ask &lt;code&gt;127.0.0.1&lt;/code&gt; alone, and Lima&amp;rsquo;s network&amp;rsquo;s DNS address and the host&amp;rsquo;s address on it give no answer for a name, with transparent mode running too.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="devcontainerjson"&gt;devcontainer.json&lt;span class="hx:absolute hx:-mt-20" id="devcontainerjson"&gt;&lt;/span&gt;
&lt;a href="#devcontainerjson" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A new VM gets what the project&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; says, as far as devvm does it (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/"&gt;its page&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; nothing from the file runs on or reaches this machine: it reads none of its environment, files, credentials, Docker images or registry logins, adds no mount, writes nothing to the project folder, and weakens no confinement (the network tier, &lt;code&gt;.git&lt;/code&gt; protection). It shapes only what&amp;rsquo;s in a new VM and what runs in it, as the VM&amp;rsquo;s user. devvm&amp;rsquo;s own handling of it (reading, parsing, state, the environment file, commands, ports, the image lookup) can&amp;rsquo;t be turned against this machine or devvm. Reviewed: the threat check&amp;rsquo;s leads are fixed, ruled out or listed below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The problem:&lt;/strong&gt; the file is the project&amp;rsquo;s, so the VM&amp;rsquo;s: the VM writes the folder, and a cloned repo&amp;rsquo;s file is whoever wrote it. Dev Containers runs much of it on the host (&lt;code&gt;initializeCommand&lt;/code&gt;, &lt;code&gt;${localEnv:…}&lt;/code&gt;, builds, &lt;code&gt;mounts&lt;/code&gt;, &lt;code&gt;runArgs&lt;/code&gt;, docker-outside-of-docker&amp;rsquo;s socket), pulls images with the user&amp;rsquo;s logins, and forwards ports at will.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How it&amp;rsquo;s kept:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reading:&lt;/strong&gt; only in the folder, through &lt;code&gt;os.Root&lt;/code&gt; (a link out of it isn&amp;rsquo;t followed, &lt;code&gt;..&lt;/code&gt; included), opened without blocking (a FIFO the VM made in its place opens at once and is refused) and checked as a regular file on the open descriptor, at most 1 MiB. It&amp;rsquo;s read once, at &lt;code&gt;plan&lt;/code&gt;; what the VM is made from is the parsed plan, recorded in its state, never the file read again. Later launches only hash it and warn.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parsing:&lt;/strong&gt; comments and trailing commas are blanked at the same offsets, strings untouched, then &lt;code&gt;encoding/json&lt;/code&gt;; values of the wrong kind, a NUL, an environment variable&amp;rsquo;s name that isn&amp;rsquo;t one, and every variable devvm doesn&amp;rsquo;t fill in are refused before anything&amp;rsquo;s made, &lt;code&gt;${localEnv:…}&lt;/code&gt;/&lt;code&gt;${env:…}&lt;/code&gt; above all. Nothing is filled in from this machine: &lt;code&gt;${containerWorkspaceFolder}&lt;/code&gt; is the folder&amp;rsquo;s path (the same in the VM), &lt;code&gt;${containerEnv:X}&lt;/code&gt; the VM&amp;rsquo;s own &lt;code&gt;X&lt;/code&gt;, left to its shell.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mapped, or refused, or ignored:&lt;/strong&gt; &lt;code&gt;build&lt;/code&gt;/Dockerfiles/Compose are refused; &lt;code&gt;initializeCommand&lt;/code&gt; never runs; &lt;code&gt;mounts&lt;/code&gt;, &lt;code&gt;runArgs&lt;/code&gt;, &lt;code&gt;privileged&lt;/code&gt;, &lt;code&gt;capAdd&lt;/code&gt;, &lt;code&gt;securityOpt&lt;/code&gt;, &lt;code&gt;workspaceMount&lt;/code&gt; and the rest are ignored, named. Features map only to devvm&amp;rsquo;s own layers (docker-in-docker to the docker layer, a toolchain&amp;rsquo;s name to that toolchain); no feature&amp;rsquo;s script is fetched, &lt;code&gt;docker-outside-of-docker&lt;/code&gt; is refused, everything else too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The image:&lt;/strong&gt; &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s path, but only an image its registry gives anyone: asked anonymously (&lt;code&gt;from.Lookup.Public&lt;/code&gt;, never Docker&amp;rsquo;s store), pinned to that digest, which the build pulls by. A registry named &lt;code&gt;localhost&lt;/code&gt; or by an address that isn&amp;rsquo;t the internet&amp;rsquo;s is refused by name, and the lookup&amp;rsquo;s client (&lt;code&gt;from.NewPublicRegistry&lt;/code&gt;) connects only to the internet&amp;rsquo;s addresses, whatever a name resolves to, its token service&amp;rsquo;s included; offline, only a registry digest recorded for that reference stands in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The docker layer:&lt;/strong&gt; the backend&amp;rsquo;s own rules for it, as when it&amp;rsquo;s named; the file never changes the VM&amp;rsquo;s tier.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The environment:&lt;/strong&gt; each variable&amp;rsquo;s value is built as a shell word (single-quoted text, &lt;code&gt;&amp;quot;${X}&amp;quot;&lt;/code&gt; for the VM&amp;rsquo;s own), stored as JSON in the VM&amp;rsquo;s state, and written as &lt;code&gt;export NAME=word&lt;/code&gt; into the VM&amp;rsquo;s environment file before devvm&amp;rsquo;s own (which win); a name is checked again when it&amp;rsquo;s written.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commands:&lt;/strong&gt; stored as argv in the VM&amp;rsquo;s state; run by the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; (on Lima, one &lt;code&gt;sh -c&lt;/code&gt; string, each word in single quotes), as the VM&amp;rsquo;s user, in the folder, after the self-check, &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s locks and a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s clone: confined like anything in the VM. Their output goes to the run log, shown only through &lt;code&gt;printable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ports:&lt;/strong&gt; only numbers and &lt;code&gt;localhost:N&lt;/code&gt;/&lt;code&gt;127.0.0.1:N&lt;/code&gt;, added to the user&amp;rsquo;s ports as &lt;code&gt;devvm ports add&lt;/code&gt; adds them (&lt;code&gt;filePorts&lt;/code&gt;, through &lt;code&gt;AddPorts&lt;/code&gt; and &lt;code&gt;RemovePorts&lt;/code&gt;; &lt;code&gt;--ports&lt;/code&gt; wins when the VM is made): with every port forwarded, the default, they&amp;rsquo;re among them already. The ones the file added are recorded (&lt;code&gt;devcontainer.ports_gave&lt;/code&gt;), so &lt;code&gt;devvm update&lt;/code&gt; takes out only those the file no longer lists and never brings back one &lt;code&gt;devvm ports rm&lt;/code&gt; took out. Forwarded on this machine&amp;rsquo;s loopback alone, as any listed port, by the one forwarder, never a host port of another program&amp;rsquo;s (&lt;code&gt;ports_taken&lt;/code&gt;). A repo&amp;rsquo;s file can so widen a list the user narrowed, to more of this machine&amp;rsquo;s loopback, which is the user&amp;rsquo;s decision to accept by opening the folder; &lt;code&gt;--no-devcontainer&lt;/code&gt; skips it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; &lt;code&gt;os.Root&lt;/code&gt; and &lt;code&gt;O_NONBLOCK&lt;/code&gt;; &lt;code&gt;encoding/json&lt;/code&gt;; Lima&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; passing arguments unchanged; the registry&amp;rsquo;s digest naming what&amp;rsquo;s pulled (a pull checks it); the backend&amp;rsquo;s own confinement of the VM and its builds.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a backend whose &lt;code&gt;Exec&lt;/code&gt; runs its arguments through a host shell; a new property mapped without the same review; a host proxy that reaches this machine or its network for a public-looking name (Not covered).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The project&amp;rsquo;s own VM&lt;/strong&gt; and &lt;strong&gt;the lookup through a host proxy&lt;/strong&gt; (&lt;code&gt;HTTPS_PROXY&lt;/code&gt;), where only names are checked, not what the proxy resolves them to: &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/"&gt;Attack vectors&lt;/a&gt; lists both, under its devcontainer.json entries. Its &lt;code&gt;image&lt;/code&gt; is any public image, whose code runs as root in the build VM, as with &lt;code&gt;--from&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A name that resolves to the internet for devvm and to this machine&amp;rsquo;s network for the backend&amp;rsquo;s pull&lt;/strong&gt; (DNS rebinding) gets only content with the digest the public registry gave, which only someone who has that content can give.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill; its local IPC, data isolation and supply chain companions). Leads, each confirmed and fixed, or ruled out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;An image only this machine or its network has&lt;/strong&gt; (&lt;code&gt;localhost:5000/…&lt;/code&gt;, a private address, a name that resolves to one, its token service on one): confirmed: a backend that pulls it from this machine reaches this machine&amp;rsquo;s loopback, and the lookup was made on this machine; fixed: refused by name and by address (&lt;code&gt;publicHost&lt;/code&gt;, &lt;code&gt;NewPublicRegistry&lt;/code&gt;), a recorded digest included; unit-, CLI- and end-to-end-tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;forwardPorts over a user&amp;rsquo;s port list&lt;/strong&gt; (added to &lt;code&gt;devvm ports -g&lt;/code&gt;&amp;rsquo;s list, or to &lt;code&gt;none&lt;/code&gt;, a limit the user set): accepted: the file&amp;rsquo;s ports are added to the user&amp;rsquo;s list, on this machine&amp;rsquo;s loopback alone, as the Ports entry above says, so opening the folder accepts them, and &lt;code&gt;--no-devcontainer&lt;/code&gt; skips them; CLI- and end-to-end-tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The JSONC stripper and parser&lt;/strong&gt; (comments in strings, an unterminated comment or string, a BOM, trailing commas): ruled out: blanking keeps offsets and leaves strings alone; anything else is invalid JSON; fuzzed (&lt;code&gt;FuzzParse&lt;/code&gt;): no panic, every variable a shell word, nothing of this machine&amp;rsquo;s environment kept.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reading&lt;/strong&gt; (a link out, &lt;code&gt;..&lt;/code&gt;, a FIFO, a device, a huge file, a swap between the check and the read): ruled out: &lt;code&gt;os.Root&lt;/code&gt;, a non-blocking open, the descriptor&amp;rsquo;s own &lt;code&gt;Stat&lt;/code&gt;, 1 MiB; one read per new VM; unit-tested (links, a FIFO).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Variables&lt;/strong&gt; (&lt;code&gt;${localEnv:…}&lt;/code&gt;, &lt;code&gt;${env:…}&lt;/code&gt;, nested or unterminated): ruled out: refused, or left as text for the VM&amp;rsquo;s shell; nothing is read from this machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The environment file and state&lt;/strong&gt; (newlines, quotes, &lt;code&gt;$()&lt;/code&gt;, a name like &lt;code&gt;A;rm&lt;/code&gt;): ruled out: values are shell words, JSON-escaped in state (one line), names checked twice; the file is the VM&amp;rsquo;s own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Command quoting&lt;/strong&gt; (&lt;code&gt;'&lt;/code&gt;, newlines, an argument starting with &lt;code&gt;-&lt;/code&gt;): ruled out: devvm runs &lt;code&gt;bash -lc 'exec &amp;quot;$@&amp;quot;'&lt;/code&gt; with the argv after it, and Lima quotes each word.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Messages&lt;/strong&gt; (the file&amp;rsquo;s values in this machine&amp;rsquo;s terminal): ruled out: every message value goes through &lt;code&gt;msg.OneLine&lt;/code&gt; as it renders, the image through &lt;code&gt;from.Valid&lt;/code&gt;, errors&amp;rsquo; causes aren&amp;rsquo;t printed, the log tail goes through &lt;code&gt;msg.Printable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commands before confinement:&lt;/strong&gt; ruled out: they run after the self-check (which stops a VM whose policy fails), &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s locks, and a clone&amp;rsquo;s seeding.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A digest the registry made up&lt;/strong&gt; (&lt;code&gt;Docker-Content-Digest&lt;/code&gt;): ruled out: &lt;code&gt;sha256:&lt;/code&gt; and 64 hex digits, and every pull checks content against it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;project&lt;/code&gt;): a VM made from a file: its variables in the shell, &lt;code&gt;postCreateCommand&lt;/code&gt; once and &lt;code&gt;postStartCommand&lt;/code&gt; at each start, in the VM and folder, its port forwarded and no other, nothing written to the folder, a changed file only warned about; a file whose image is on this machine&amp;rsquo;s registry refused, nothing made.&lt;/p&gt;
&lt;h2 data-hextra-search-id="network-tiers"&gt;Network tiers&lt;span class="hx:absolute hx:-mt-20" id="network-tiers"&gt;&lt;/span&gt;
&lt;a href="#network-tiers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s network is one of four tiers, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt;, from the lowest to the highest (&lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;what each reaches&lt;/a&gt;). The design keeps two things: every VM&amp;rsquo;s requests go through its own proxy, whatever its tier, and only the open tier ever runs a VM unconfined.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;netpolicy.Tier&lt;/code&gt;, in the VM&amp;rsquo;s &lt;code&gt;net&lt;/code&gt; section as &lt;code&gt;tier&lt;/code&gt;. An unknown tier fails to read (&lt;code&gt;Tier.UnmarshalJSON&lt;/code&gt;), and &lt;code&gt;TierOf&lt;/code&gt; reads a section it can&amp;rsquo;t read as &lt;code&gt;none&lt;/code&gt;, never as &lt;code&gt;open&lt;/code&gt;; a section without a tier reads as &lt;code&gt;allowlist&lt;/code&gt;. &lt;code&gt;Tier.Net&lt;/code&gt; maps the tier to the backend&amp;rsquo;s confinement: &lt;code&gt;NetProxy&lt;/code&gt; for every tier but open, and &lt;code&gt;NetDirect&lt;/code&gt; with the proxy&amp;rsquo;s port and password for open (&lt;code&gt;Confinement.GuestProxy&lt;/code&gt;). &lt;code&gt;netpolicy.Policies&lt;/code&gt; gives each tier its policies (&lt;code&gt;PolicySet&lt;/code&gt;), and &lt;code&gt;Prepare&lt;/code&gt; writes them into the proxy&amp;rsquo;s config: &lt;code&gt;builtin_policies&lt;/code&gt; for the built-in policies and &lt;code&gt;policies&lt;/code&gt; for your files on the allowlist tier, &lt;code&gt;deny_policies&lt;/code&gt; for the user&amp;rsquo;s files on internet and none, whose allows the proxy drops as it reads them, and &lt;code&gt;open&lt;/code&gt; for the open tier, which allows every host and address with no floor and takes no policy at all (&lt;code&gt;Config.check&lt;/code&gt;). Every tier&amp;rsquo;s proxy has the VM&amp;rsquo;s CAs and its bindings file, an open VM&amp;rsquo;s included, and every VM&amp;rsquo;s setup sends the same placeholders and redacted copies (&lt;code&gt;stageSecrets&lt;/code&gt;), so no VM holds a real secret and the tier decides only the confinement and the rules. A running VM keeps the confinement it started with: one made open while it runs confined stays on &lt;code&gt;NetProxy&lt;/code&gt; until its next start, with an open proxy. Every &lt;code&gt;Prepare&lt;/code&gt; reads the tier from the VM&amp;rsquo;s state as it is then, so a command that read the state before a tier change never starts the proxy with the tier before.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rules:&lt;/strong&gt; &lt;code&gt;**&lt;/code&gt; covers addresses as well as names, and &lt;code&gt;:*&lt;/code&gt; any port 1 to 65535. Neither lifts the floor, because only an address rule can (&lt;code&gt;policy.addrAllowed&lt;/code&gt;), so the internet tier&amp;rsquo;s &lt;code&gt;**:*&lt;/code&gt; reaches every public host and address and no internal one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lima:&lt;/strong&gt; an open VM runs as a VM without a proxy would, with no Seatbelt profile and no &lt;code&gt;restrict=on&lt;/code&gt; from the QEMU wrapper, and its guest reaches its proxy at &lt;code&gt;192.168.5.2&lt;/code&gt;, the host&amp;rsquo;s loopback on Lima&amp;rsquo;s user-mode network, on macOS and on Linux. &lt;code&gt;propagateProxyEnv&lt;/code&gt; is off for it, so the host&amp;rsquo;s proxy settings never reach the guest, and its &lt;code&gt;NO_PROXY&lt;/code&gt; adds Lima&amp;rsquo;s names for the host.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt; a client links only to a target on its tier or a stricter one (&lt;code&gt;policyRule&lt;/code&gt;), and a group&amp;rsquo;s VMs are all on one tier. A tier change that would break either is refused (&lt;code&gt;tierLinked&lt;/code&gt;, &lt;code&gt;group_tier_fixed&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The open flag reaching a confined VM&amp;rsquo;s proxy:&lt;/strong&gt; ruled out. &lt;code&gt;Open&lt;/code&gt; is set only for the open tier, a config with &lt;code&gt;open&lt;/code&gt; and any policy is refused, and an unknown or unreadable tier reads as none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A confined VM reaching the host or the LAN:&lt;/strong&gt; ruled out. The confinement is the tier&amp;rsquo;s (&lt;code&gt;Tier.Net&lt;/code&gt;), the floor still judges every address the proxy dials on a confined tier, and &lt;code&gt;**&lt;/code&gt; and &lt;code&gt;:*&lt;/code&gt; lift no floor (&lt;code&gt;TestAnyPort&lt;/code&gt;, &lt;code&gt;TestFloor&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A tier change racing the proxy&amp;rsquo;s config:&lt;/strong&gt; fixed. &lt;code&gt;Prepare&lt;/code&gt; read the tier from the state its caller had read, so a command started before &lt;code&gt;devvm network&lt;/code&gt; changed the tier could start the proxy again with the looser one; it now reads the tier from the VM&amp;rsquo;s state as it is then. Listed: two devvm commands at once can still interleave between that read and the proxy&amp;rsquo;s start, and the next launch puts the right config back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A running confined VM made open:&lt;/strong&gt; listed, by design. Until its next start it stays confined, but its proxy is open&amp;rsquo;s, so through the proxy it reaches this machine&amp;rsquo;s loopback and the LAN, as the open tier you asked for does. &lt;code&gt;devvm network open&lt;/code&gt; asks first in a parent folder (&lt;code&gt;widen&lt;/code&gt;), and the VM keeps its CAs, which its open proxy goes on signing with.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other programs or VMs using an open VM&amp;rsquo;s proxy:&lt;/strong&gt; ruled out. Every request needs the VM&amp;rsquo;s own random password, which is in no process&amp;rsquo;s arguments: the proxy&amp;rsquo;s config is mode 600, and the open self-check names &lt;code&gt;$HTTPS_PROXY&lt;/code&gt;, not its value (&lt;code&gt;TestSelfCheckOpen&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy&amp;rsquo;s password:&lt;/strong&gt; improved. An open VM no longer gets the host&amp;rsquo;s proxy settings, so neither the shell&amp;rsquo;s password nor &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s reaches its guest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open VM spending a secret past its proxy:&lt;/strong&gt; ruled out. Its environment, its git credential helper and its agents&amp;rsquo; copies hold only its placeholders, which end in its own salt, so a request it sends directly carries a placeholder that the secret&amp;rsquo;s host refuses, and only a request through its proxy, with its password, gets the real value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open VM&amp;rsquo;s proxy putting secrets into another host&amp;rsquo;s requests:&lt;/strong&gt; ruled out. The open flag lifts the rules and the floor, not the bindings: the proxy intercepts and puts a secret in only for the binding&amp;rsquo;s own hosts on &lt;code&gt;:443&lt;/code&gt;, and a request inside the tunnel that names another host gets &lt;code&gt;421&lt;/code&gt;, as on every tier (&lt;code&gt;TestInterceptOpen&lt;/code&gt;; &lt;code&gt;TestPrepareOpen&lt;/code&gt; and &lt;code&gt;sync.txtar&lt;/code&gt; for the VM&amp;rsquo;s CAs, salt, bindings and placeholders).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open VM&amp;rsquo;s CA:&lt;/strong&gt; listed, as on every tier. The VM trusts its own CA, whose key stays on this machine, so its proxy can impersonate the secrets&amp;rsquo; hosts to that VM alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;**&lt;/code&gt; matching addresses on the allowlist tier:&lt;/strong&gt; listed. A policy with &lt;code&gt;**&lt;/code&gt; now allows public address literals too, which it refused before.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Old VMs:&lt;/strong&gt; listed. A VM made before tiers reads as allowlist, so one that was open starts confined, and a running one shows as &lt;code&gt;unenforced&lt;/code&gt; until devvm restarts it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;): &lt;code&gt;network&lt;/code&gt;: open from its next start, a direct connection works, its proxy is set, answers the self-check and carries the VM to this machine&amp;rsquo;s loopback and its LAN address, while the allowlist tier refuses this machine&amp;rsquo;s loopback; the open VM holds no real secret, its proxy puts the token in over TLS the VM verifies with its own CA, and a request around the proxy carries only the placeholder and gets a 401; open behind a company proxy, the guest gets its own proxy and never the shell&amp;rsquo;s settings, which go through the VM&amp;rsquo;s proxy alone; internet reaches a host off the allowlist and another port but not this machine&amp;rsquo;s LAN address, and a direct connection still fails; none refuses github.com, lets Claude Code&amp;rsquo;s API through, and keeps a deny. &lt;code&gt;link&lt;/code&gt;: an allowlist client&amp;rsquo;s link to a none target goes on, and to an internet one is refused and warned of.&lt;/p&gt;
&lt;h2 data-hextra-search-id="rules-by-method-and-path"&gt;Rules by method and path&lt;span class="hx:absolute hx:-mt-20" id="rules-by-method-and-path"&gt;&lt;/span&gt;
&lt;a href="#rules-by-method-and-path" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A rule can narrow a host name to some of its requests, by method, by path or both (&lt;a href="https://next.devvm.dev/docs/safety/network/#rules-by-method-and-path"&gt;how to use them&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/network/#requests-by-method-and-path"&gt;how the proxy judges them&lt;/a&gt;), and a secret of yours can go in for some methods alone. The design keeps two things: a request that a deny names doesn&amp;rsquo;t reach its host by any spelling of its method or its path that the threat check below covers, and an allow lets through only what it names, as every server would read it. What it leaves open, such as a form&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt; field and methods outside the list, is listed there.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; the policy files&amp;rsquo; one line per rule, with the methods and then the path after the host (&lt;code&gt;proxy.parseRule&lt;/code&gt;), &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt; on devvm network allow, deny and rm (&lt;code&gt;netpolicy.Rule&lt;/code&gt;), the proxy&amp;rsquo;s interception with the VM&amp;rsquo;s CA, which the secrets already use, and one matcher, &lt;code&gt;proxy.match&lt;/code&gt; in &lt;code&gt;internal/proxy/request.go&lt;/code&gt;, for rules and for secrets&amp;rsquo; bindings, whose path check (&lt;code&gt;plainPath&lt;/code&gt;) is the one that custom secrets&amp;rsquo; &lt;code&gt;--path&lt;/code&gt; had.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Decisions:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One line per rule, in the files there are.&lt;/strong&gt; A rule stays a line of a policy file, &lt;code&gt;api.github.com GET,HEAD /repos/&lt;/code&gt;, which the one parser reads for the proxy, devvm network and devvm doctor (&lt;code&gt;ParsePolicy&lt;/code&gt;), so layers&amp;rsquo; and your own policies, &lt;code&gt;-g&lt;/code&gt;&amp;rsquo;s and each VM&amp;rsquo;s take it as they are. A TOML or table form would be a second grammar beside the line one, for the same files. Every line that was a rule before means what it did, any method and any path. A line with spaces in it wasn&amp;rsquo;t a rule, so a hand-written one that has the new form gains a meaning: &lt;code&gt;example.com GET&lt;/code&gt;, which the proxy skipped, now allows &lt;code&gt;GET&lt;/code&gt;, and &lt;code&gt;!example.com GET&lt;/code&gt;, a broken deny that denied everything, now denies &lt;code&gt;GET&lt;/code&gt; alone. Both are what the line says, and devvm writes such lines only from &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flags, not a quoted rule.&lt;/strong&gt; RULE stays one word, as the cli skill has an argument, and &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt; say how the rule narrows, so devvm network allow takes &lt;code&gt;api.github.com --method GET,HEAD&lt;/code&gt;. The same flags on devvm secret set narrow a secret of yours, with &lt;code&gt;none&lt;/code&gt; for every method, as &lt;code&gt;--path&lt;/code&gt; and &lt;code&gt;--scheme&lt;/code&gt; have it, so a saved secret&amp;rsquo;s methods can go without deleting it. A path is one value, as &lt;code&gt;--path&lt;/code&gt; has one wherever it appears, so two paths are two rules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allows add up, and a deny beats any allow, as before.&lt;/strong&gt; An allow that narrows allows its host for the connection and only its requests one by one, and a deny that narrows refuses only its requests. So narrowing a host that a rule allows whole, devvm&amp;rsquo;s built-in GitHub among them, takes a deny, and devvm network allow warns when an allow by method and path would narrow nothing because the VM&amp;rsquo;s allowlist, or every VM&amp;rsquo;s with &lt;code&gt;-g&lt;/code&gt;, allows its host whole (&lt;code&gt;proxy.Allowlist.CoversWhole&lt;/code&gt;, &lt;code&gt;rule_narrows_nothing&lt;/code&gt;). An allow that replaced the whole allows of earlier policies was ruled out: adding an allow would then take access away, and a user&amp;rsquo;s file would silently override devvm&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Methods from a closed list.&lt;/strong&gt; &lt;code&gt;proxy.Methods&lt;/code&gt; are RFC 9110&amp;rsquo;s, &lt;code&gt;PATCH&lt;/code&gt; and &lt;code&gt;QUERY&lt;/code&gt;, without &lt;code&gt;CONNECT&lt;/code&gt;. A method outside them isn&amp;rsquo;t a rule, so a typo in a deny, such as &lt;code&gt;PSOT&lt;/code&gt;, is a broken deny, which denies everything until it&amp;rsquo;s fixed, rather than a deny of nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paths as patterns, judged only in a plain form.&lt;/strong&gt; &lt;code&gt;*&lt;/code&gt; within a segment, &lt;code&gt;**&lt;/code&gt; for one segment or more, and a last &lt;code&gt;/&lt;/code&gt; for everything below, which is what a binding&amp;rsquo;s path below which its value goes in already meant. Rather than decode and clean a path, which servers do differently, the matcher takes only a path that every server reads alike (&lt;code&gt;plainPath&lt;/code&gt;), as custom secrets&amp;rsquo; &lt;code&gt;--path&lt;/code&gt; did. An allow, and a binding, match exactly, in case too, and never a path in another form, while a deny matches broadly, so each fails closed in its own direction. A deny matches in any case, every path that isn&amp;rsquo;t plain, the path above one that ends with &lt;code&gt;/&lt;/code&gt;, as &lt;code&gt;/gists&lt;/code&gt; is to &lt;code&gt;/gists/&lt;/code&gt; for most servers, and a last segment cut at its first &lt;code&gt;.&lt;/code&gt;, as Rails and Spring route &lt;code&gt;/admin.json&lt;/code&gt; to &lt;code&gt;/admin&lt;/code&gt; and some servers drop a trailing dot. Cutting at the first dot rather than the last covers &lt;code&gt;/admin.tar.gz&lt;/code&gt; too, and it refuses a few more requests than a deny names, which is the side a deny errs on. The cost is that a request to a host with path rules whose path has an encoded character, such as a file name with a space, is refused unless a rule without a path allows it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rules that need requests force interception, or a refusal.&lt;/strong&gt; A host whose requests the rules judge (&lt;code&gt;hostRules.byRequest&lt;/code&gt;) is decrypted on &lt;code&gt;:443&lt;/code&gt; with the VM&amp;rsquo;s CA, and refused on any other port and without a CA, never tunneled unjudged. A host that a whole allow covers, with no deny that narrows, stays a tunnel, so the cost falls only where the rules need it. No host is spliced by name: devvm already decrypts GitHub, Anthropic&amp;rsquo;s API and the agents&amp;rsquo; token endpoints for secrets, and git, the GitHub CLI and Claude Code work through it. A client that pins its certificates or ignores the VM&amp;rsquo;s CA fails its handshake, which &lt;code&gt;devvm network log&lt;/code&gt; shows as &lt;code&gt;TLS with the VM failed&lt;/code&gt;, so devvm notes that a host is now decrypted when a rule narrows it (&lt;code&gt;rule_narrows&lt;/code&gt;) rather than refusing the rule. Addresses, CIDRs and &lt;code&gt;**&lt;/code&gt; can&amp;rsquo;t narrow, because an address has no name to make a certificate for and &lt;code&gt;**&lt;/code&gt; would decrypt every host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Methods a request names besides its own.&lt;/strong&gt; Some frameworks take the method from a header, &lt;code&gt;X-HTTP-Method-Override&lt;/code&gt; and its kin, which Rack and CGI read with &lt;code&gt;_&lt;/code&gt; for &lt;code&gt;-&lt;/code&gt;, or from a &lt;code&gt;_method&lt;/code&gt; parameter. The proxy reads every override-like header (&lt;code&gt;overrideLike&lt;/code&gt;) and the query&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt;, and while a rule narrows a host by method, it refuses a request whose value isn&amp;rsquo;t exactly one method, such as a list, which servers read apart, rather than guess. Judging a &lt;code&gt;_method&lt;/code&gt; in the query, rather than refusing every request with one, keeps a &lt;code&gt;GET&lt;/code&gt; that names &lt;code&gt;GET&lt;/code&gt; working, and an allow still needs every method named to be its own. A form&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt; in a &lt;code&gt;POST&lt;/code&gt;&amp;rsquo;s body isn&amp;rsquo;t read: the proxy forwards bodies unread, so it&amp;rsquo;s judged as the &lt;code&gt;POST&lt;/code&gt; it is.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every request is judged.&lt;/strong&gt; The intercepted tunnel&amp;rsquo;s own HTTP server calls the handler for each request, HTTP/1.1 kept alive or HTTP/2, and so does each absolute-form request, so the rules and the bindings are asked for each one, with the files as they are then. A connection&amp;rsquo;s verdict and whether its requests are judged come from one read of the files (&lt;code&gt;hostRules&lt;/code&gt;). A WebSocket is judged by its upgrade request, and an upgrade to anything else, such as &lt;code&gt;h2c&lt;/code&gt;, and a &lt;code&gt;CONNECT&lt;/code&gt; inside the tunnel are refused, as the bytes after them would pass unread. A tunnel opened before a rule narrowed its host stays a tunnel until it closes, as tunnels do for every new deny, and &lt;code&gt;rule_narrows&lt;/code&gt; says so. The shared Nix cache&amp;rsquo;s own fetch from cache.nixos.org is judged as a &lt;code&gt;GET&lt;/code&gt; of the path the VM asked for, so its rules apply there too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A proxy from another binary.&lt;/strong&gt; A running proxy is the devvm binary that started it, and one from before this change reads a rule by method and path as a line that isn&amp;rsquo;t a rule: an allow it skips and a deny that denies everything. So devvm network allow, deny and rm warn, naming the VM, when they change such a rule while the VM&amp;rsquo;s proxy runs from another binary than their own (&lt;code&gt;proxy_other_binary&lt;/code&gt;, by the &lt;code&gt;devvm_sha256&lt;/code&gt; of the config it started with, and when that config or this binary can&amp;rsquo;t be read, as devvm can&amp;rsquo;t tell), and the VM&amp;rsquo;s next launch starts the proxy again. A change to a host&amp;rsquo;s rule doesn&amp;rsquo;t warn, as every binary reads it alike. The bindings file stays version 1 while every binding has no methods and no path but a prefix longer than &lt;code&gt;/&lt;/code&gt; that ends with &lt;code&gt;/&lt;/code&gt; and has no &lt;code&gt;*&lt;/code&gt;, so devvm secret set and rm, which write every VM&amp;rsquo;s file, don&amp;rsquo;t take an older proxy&amp;rsquo;s bindings away, logins included. Such a file reads alike to a proxy from after bindings gained paths; a 0.1.0 proxy ignores the path, which for the built-in bindings only widens OpenRouter&amp;rsquo;s key to all of openrouter.ai, as 0.1.0 bound it, until the VM starts again. Writing version 2 instead would cut those proxies&amp;rsquo; logins. It&amp;rsquo;s version 2 only for a binding with methods or a pattern, which such a proxy refuses, so it puts no value in rather than put one in for every method, and devvm warns about each such VM whenever it writes one, from devvm secret set, rm and use or devvm agent login &amp;ndash;api-key (&lt;code&gt;Proxy.SecretsWritten&lt;/code&gt;, &lt;code&gt;secrets_other_binary&lt;/code&gt;). A path of &lt;code&gt;/&lt;/code&gt;, which that proxy&amp;rsquo;s prefix check refused with the whole file, is no path, as it&amp;rsquo;s every path. A custom secret&amp;rsquo;s path that devvm writes is marked a pattern (&lt;code&gt;path_pattern&lt;/code&gt;), so a path saved as a prefix whose &lt;code&gt;*&lt;/code&gt; was itself is refused rather than read as a wildcard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A blocked request&lt;/strong&gt; gets &lt;code&gt;403&lt;/code&gt; and a &lt;code&gt;blocked&lt;/code&gt; event with its method and path, which devvm network log, &lt;code&gt;/blocked&lt;/code&gt; and devvm-why show. A deny&amp;rsquo;s refusal is marked refused, so no allow is suggested, and a request that no allow covers suggests the allow of the whole host, never a path, which the VM chose. Learning stays by host: devvm network lock adds whole hosts, which you then narrow, because a log of methods and paths would turn every request a VM made while it learned into a rule to review.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The floor and secrets.&lt;/strong&gt; A rule that narrows names a host, so it lifts no floor: an internal address still needs an address rule. A secret of yours narrowed by &lt;code&gt;--method&lt;/code&gt; goes in by the same matcher as an allow. A built-in secret&amp;rsquo;s or an agent&amp;rsquo;s login&amp;rsquo;s binding isn&amp;rsquo;t narrowed per VM: a deny by method and path in the VM&amp;rsquo;s own file already keeps the token from those requests, and refuses them outright rather than sending them with a placeholder, which is stricter, while narrowing the binding would need a per-VM record of known secrets and logins and a second way to the same end.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a spelling of a method or a path that a server reads as one a deny names and the matcher doesn&amp;rsquo;t; an allow letting through a request it doesn&amp;rsquo;t name; a host whose requests the rules judge reaching the far end without being judged; a request after the first on a connection going unjudged; the matcher being made slow by a VM&amp;rsquo;s path; and the bindings&amp;rsquo; methods widening a secret.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A path&amp;rsquo;s spelling past a deny&lt;/strong&gt; (case, a trailing slash, the prefix itself, a format&amp;rsquo;s suffix or a trailing dot, percent-encoding, &lt;code&gt;..&lt;/code&gt;, &lt;code&gt;//&lt;/code&gt;, &lt;code&gt;\&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;): fixed. A deny of &lt;code&gt;/gists/&lt;/code&gt; let &lt;code&gt;/gists&lt;/code&gt; through, and a deny of &lt;code&gt;/admin&lt;/code&gt; let &lt;code&gt;/admin.json&lt;/code&gt; and &lt;code&gt;/admin.&lt;/code&gt; through, which it now refuses (&lt;code&gt;TestDenyBypasses&lt;/code&gt;, &lt;code&gt;TestMatchPath&lt;/code&gt;; &lt;code&gt;FuzzDenyBypass&lt;/code&gt; checks, with a deny of &lt;code&gt;/gists/&lt;/code&gt; alone, that no path that a server could read as &lt;code&gt;/gists&lt;/code&gt; or below, decoded once or twice, with &lt;code&gt;\&lt;/code&gt; as &lt;code&gt;/&lt;/code&gt;, without &lt;code&gt;;&lt;/code&gt;&amp;rsquo;s parameters, cleaned and with its last segment&amp;rsquo;s suffix dropped, gets through). A deny of &lt;code&gt;/config.json&lt;/code&gt; let &lt;code&gt;/config.json.&lt;/code&gt; through, and every segment now matches with its trailing dots dropped too. Listed: a server that routes &lt;code&gt;/admin-x&lt;/code&gt; or &lt;code&gt;/admin~&lt;/code&gt; to &lt;code&gt;/admin&lt;/code&gt; isn&amp;rsquo;t covered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A method&amp;rsquo;s spelling past a deny:&lt;/strong&gt; fixed. The deny compared each of three override headers&amp;rsquo; whole value, so &lt;code&gt;X-HTTP-Method-Override: DELETE, GET&lt;/code&gt;, &lt;code&gt;X_HTTP_METHOD_OVERRIDE: DELETE&lt;/code&gt; and &lt;code&gt;?_method=DELETE&lt;/code&gt; got past a deny of &lt;code&gt;DELETE&lt;/code&gt;. Now every override-like header in any spelling and the query&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt; are read, each word of a list is judged, and a value that isn&amp;rsquo;t exactly one method is refused while a rule narrows the host by method. Go&amp;rsquo;s &lt;code&gt;url.ParseQuery&lt;/code&gt; skips a pair with a &lt;code&gt;;&lt;/code&gt; in it, so &lt;code&gt;?a=1;_method=DELETE&lt;/code&gt; hid its &lt;code&gt;_method&lt;/code&gt;; a query with a &lt;code&gt;;&lt;/code&gt;, or one &lt;code&gt;ParseQuery&lt;/code&gt; can&amp;rsquo;t read whole, is refused there too (&lt;code&gt;TestDenyBypasses&lt;/code&gt;, &lt;code&gt;TestAllowNarrowed&lt;/code&gt;, &lt;code&gt;TestForRequestMethods&lt;/code&gt;, and &lt;code&gt;FuzzDenyBypass&lt;/code&gt;, with a header of its choosing and an oracle that splits the raw query at &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;;&lt;/code&gt; itself). Listed: a method outside &lt;code&gt;proxy.Methods&lt;/code&gt;, such as WebDAV&amp;rsquo;s, can&amp;rsquo;t be named, so a deny of writes doesn&amp;rsquo;t refuse &lt;code&gt;PROPFIND&lt;/code&gt;, which a server that doesn&amp;rsquo;t speak WebDAV refuses itself; a &lt;code&gt;_method&lt;/code&gt; field in a &lt;code&gt;POST&lt;/code&gt;&amp;rsquo;s body, which the proxy doesn&amp;rsquo;t read, is judged as the &lt;code&gt;POST&lt;/code&gt; it is; a header of another name that a framework is set to read the method from isn&amp;rsquo;t.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An allow letting through more than it names:&lt;/strong&gt; ruled out. It matches the method as written, every method the request names besides, and only a plain path in its own case (&lt;code&gt;TestAllowNarrowed&lt;/code&gt;, &lt;code&gt;TestPathWithin&lt;/code&gt;, which the bindings share).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An allow that narrows nothing:&lt;/strong&gt; fixed. An allow by method and path for a host that a whole allow covers, such as &lt;code&gt;api.github.com&lt;/code&gt;, changed nothing, while devvm said the host was now decrypted; devvm network allow now warns that it narrows nothing, naming the VMs, with &lt;code&gt;-g&lt;/code&gt; by each VM&amp;rsquo;s own allowlist, its file, layers and shared tools included, and names the deny instead. Where the whole allow names port 443 alone, the warning says the rule narrows only port 80&amp;rsquo;s plain HTTP (&lt;code&gt;TestCoversWhole&lt;/code&gt;, &lt;code&gt;network_narrow.txtar&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two reads of the rules for one connection:&lt;/strong&gt; fixed. The &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s verdict and whether its requests are judged each read the files, so a change between them could tunnel a host whose new rules needed its requests; both now come from one read (&lt;code&gt;hostRules&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The shared Nix cache past the rules:&lt;/strong&gt; fixed. Its fetch from cache.nixos.org asked only whether the host was allowed, and now meets rules by method and path as a &lt;code&gt;GET&lt;/code&gt; of its path (&lt;code&gt;TestNixCacheRulesByPath&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A proxy or a saved secret from before this change:&lt;/strong&gt; fixed. A proxy from another binary, or one devvm can&amp;rsquo;t tell, gets a warning when a rule by method and path changes (&lt;code&gt;TestOtherBinaries&lt;/code&gt;). devvm wrote every bindings file as version 2, so a devvm secret set or rm after an upgrade took every running older proxy&amp;rsquo;s bindings away, its agents&amp;rsquo; logins included, without a word; the file is version 1 now unless a binding needs 2, which an older proxy refuses rather than put a value in for every method, and writing one for such a proxy warns, devvm agent login &amp;ndash;api-key&amp;rsquo;s write included (&lt;code&gt;TestReadBindings&lt;/code&gt;, &lt;code&gt;TestRefreshSecretsOtherBinary&lt;/code&gt;, &lt;code&gt;TestDefine&lt;/code&gt;&amp;rsquo;s path of &lt;code&gt;/&lt;/code&gt;). Checking whether an allow narrows anything after it&amp;rsquo;s written warns about a VM whose rules can&amp;rsquo;t be read rather than fail the change (&lt;code&gt;TestNarrowNotesUnreadable&lt;/code&gt;). devvm 0.1.0&amp;rsquo;s own state, frozen in the repo, is the check that none of this moves what 0.1.0 wrote: its bindings files read as version 1 and are written again byte for byte, its proxies&amp;rsquo; configs read and name the binary that started them, its grammar&amp;rsquo;s lines and verdicts are a table of their own (&lt;code&gt;TestFixtureBindings&lt;/code&gt;, &lt;code&gt;TestFixtureProxyConfig&lt;/code&gt;, &lt;code&gt;TestV010Rules&lt;/code&gt;), and its app VM takes an allow that narrows nothing, a deny by method, a launch that leaves its bindings file as 0.1.0 wrote it, and a secret by method that makes it version 2 (&lt;code&gt;fixture_v010_network.txtar&lt;/code&gt;). A custom secret&amp;rsquo;s path with a &lt;code&gt;*&lt;/code&gt; saved as a prefix is refused (&lt;code&gt;TestCustomsUnreadable&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A host whose requests the rules judge, tunneled unjudged:&lt;/strong&gt; ruled out. Its &lt;code&gt;CONNECT&lt;/code&gt; is intercepted on &lt;code&gt;:443&lt;/code&gt; and refused anywhere else and without a CA, logged as a refused block (&lt;code&gt;TestNarrowedNotDecrypted&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Requests after the first, or smuggled in one:&lt;/strong&gt; ruled out. Go&amp;rsquo;s HTTP server parses every request on the decrypted connection and calls the handler for each, HTTP/1.1 kept alive and HTTP/2 alike, and the proxy sends each to the host as a request of its own through its reverse proxy, so no bytes of the VM&amp;rsquo;s pass unparsed (&lt;code&gt;TestInterceptRules&lt;/code&gt; over both). An upgrade other than WebSocket and a &lt;code&gt;CONNECT&lt;/code&gt; inside the tunnel are refused. Listed: what a WebSocket carries after its upgrade request passes unread.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another host&amp;rsquo;s requests in the tunnel:&lt;/strong&gt; ruled out, as before: a request that names another host gets &lt;code&gt;421&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s path making matching slow:&lt;/strong&gt; ruled out. Matching is a table over the pattern&amp;rsquo;s segments, at most 32, and the path&amp;rsquo;s, so a path of 20,000 segments against several &lt;code&gt;**&lt;/code&gt; takes well under a second (&lt;code&gt;TestMatchPath&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A rule a typo turned into nothing:&lt;/strong&gt; ruled out for methods and paths, which a line that isn&amp;rsquo;t a rule can&amp;rsquo;t hold, so a deny with one is a broken deny that denies everything (&lt;code&gt;network_narrow.txtar&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A binding&amp;rsquo;s methods widening a secret:&lt;/strong&gt; ruled out. A binding goes in only where its match allows, and the lookup checks a binding&amp;rsquo;s methods against the secret&amp;rsquo;s as it&amp;rsquo;s saved (&lt;code&gt;fits&lt;/code&gt;), so a bindings file edited to drop them gets nothing (&lt;code&gt;TestForRequestMethods&lt;/code&gt;, &lt;code&gt;TestInterceptSecretMethods&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interception breaking a client:&lt;/strong&gt; listed. A tool that doesn&amp;rsquo;t trust the VM&amp;rsquo;s CA fails at a host once a rule narrows it, which devvm says when the rule is added and devvm network log shows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What an allowed request carries:&lt;/strong&gt; listed. A rule judges a request&amp;rsquo;s method, the methods it names and its path, not its body or its other headers, so a &lt;code&gt;POST&lt;/code&gt; that an allow lets through, such as GitHub&amp;rsquo;s GraphQL, carries whatever the VM sends there, and a deny of &lt;code&gt;POST&lt;/code&gt; refuses GraphQL&amp;rsquo;s reads too. A deny of &lt;code&gt;git-receive-pack&lt;/code&gt; blocks pushes over HTTPS alone, not over ssh on &lt;code&gt;github.com:22&lt;/code&gt; or through GitHub&amp;rsquo;s Git Data API.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;network&lt;/code&gt;): a host that only devvm network allow &lt;code&gt;--method GET --path&lt;/code&gt; allows, faked by the run&amp;rsquo;s company proxy, is decrypted with no secret bound to it. Two &lt;code&gt;GET&lt;/code&gt;s below the path reach it, while a &lt;code&gt;POST&lt;/code&gt; to the same path, a &lt;code&gt;GET&lt;/code&gt; elsewhere, and a &lt;code&gt;GET&lt;/code&gt; that names &lt;code&gt;POST&lt;/code&gt; in &lt;code&gt;X_HTTP_METHOD_OVERRIDE&lt;/code&gt; or in &lt;code&gt;?_method=&lt;/code&gt; get the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt;, never reach it, and are logged as &lt;code&gt;blocked&lt;/code&gt; with their method and path, which devvm network log shows. A secret of yours with &lt;code&gt;--method GET,HEAD&lt;/code&gt; goes into a &lt;code&gt;GET&lt;/code&gt; and leaves the placeholder in a &lt;code&gt;POST&lt;/code&gt; to the same host and path.&lt;/p&gt;
&lt;h2 data-hextra-search-id="transparent-mode"&gt;Transparent mode&lt;span class="hx:absolute hx:-mt-20" id="transparent-mode"&gt;&lt;/span&gt;
&lt;a href="#transparent-mode" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A confined VM&amp;rsquo;s tools that ignore the proxy settings, such as workerd under &lt;code&gt;wrangler dev&lt;/code&gt;, a static Go binary or a container made through Docker&amp;rsquo;s API, reach the VM&amp;rsquo;s proxy by the names they look up (&lt;a href="https://next.devvm.dev/docs/internals/network/#tools-that-skip-the-proxy"&gt;how&lt;/a&gt;). The design keeps three things: no DNS query and no connection leaves the VM but through its proxy, the host the proxy judges is the host it dials, and nothing new listens on the host or takes part in the backends.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;internal/proxy/transparent.go&lt;/code&gt;: the reserved target &lt;code&gt;TransparentHost&lt;/code&gt; (&lt;code&gt;transparent.devvm.proxy&lt;/code&gt;), the stand-in address &lt;code&gt;SentinelAddr&lt;/code&gt; (&lt;code&gt;198.18.0.1&lt;/code&gt;, in benchmarking&amp;rsquo;s &lt;code&gt;198.18.0.0/15&lt;/code&gt;, which clients such as workerd&amp;rsquo;s kj count as public and the floor counts as internal), &lt;code&gt;transparent&lt;/code&gt;&amp;rsquo;s &lt;code&gt;serve&lt;/code&gt;, &lt;code&gt;tls&lt;/code&gt;, &lt;code&gt;handler&lt;/code&gt; and &lt;code&gt;refusePage&lt;/code&gt;, &lt;code&gt;sniHost&lt;/code&gt;, and &lt;code&gt;policy.transparentPorts&lt;/code&gt; behind &lt;code&gt;/transparent/ports&lt;/code&gt;. &lt;code&gt;routeFor&lt;/code&gt; is the order every connection is judged in, &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s and the transparent path&amp;rsquo;s alike, and &lt;code&gt;carry&lt;/code&gt; is the one tunnel, its SNI check included. &lt;code&gt;Event.Via&lt;/code&gt; is &lt;code&gt;dns&lt;/code&gt; for the path&amp;rsquo;s events (&lt;code&gt;withVia&lt;/code&gt; for its requests). In the guest, &lt;code&gt;assets/guest/transparent.sh&lt;/code&gt; is &lt;code&gt;devvm-transparent&lt;/code&gt;, its ruleset (&lt;code&gt;render&lt;/code&gt;), its slots and its service, set up by &lt;code&gt;sync.sh&lt;/code&gt; when &lt;code&gt;netpolicy.TransparentAddr&lt;/code&gt; gives the setup the stand-in address: the VM runs confined (&lt;code&gt;backend.NetProxy&lt;/code&gt;) and its mode is on (&lt;code&gt;netpolicy.TransparentOf&lt;/code&gt;: the VM&amp;rsquo;s &lt;code&gt;net.transparent&lt;/code&gt;, else &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;transparent-proxy&lt;/code&gt;, else on). &lt;code&gt;layers/base.sh&lt;/code&gt; installs dnsmasq, socat and nftables, which changes base&amp;rsquo;s key.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Choices against the first design:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Listeners on the stand-in address, not on &lt;code&gt;127.0.77.1&lt;/code&gt;:&lt;/strong&gt; Docker&amp;rsquo;s containers reach a local address on the VM over its bridges, but a loopback one only with &lt;code&gt;route_localnet=1&lt;/code&gt;, the hole of CVE-2020-8558, which would open every loopback service of the VM to them. The port forwarder forwards only loopback and wildcard listeners, and &lt;code&gt;vmssh.dialAddr&lt;/code&gt; refuses the stand-in address by name too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;dnsmasq on the stand-in address alone:&lt;/strong&gt; a listener on &lt;code&gt;127.0.0.1:53&lt;/code&gt; could be forwarded to this machine&amp;rsquo;s loopback when you list port 53, giving the host&amp;rsquo;s programs the stand-in address for every name and putting their names in the VM&amp;rsquo;s log. A rule sends the VM&amp;rsquo;s own &lt;code&gt;127.0.0.1:53&lt;/code&gt; to dnsmasq instead, so nothing of transparent mode listens on loopback, and the forwarder never sees it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS to public servers, not &lt;code&gt;daemon.json&lt;/code&gt;:&lt;/strong&gt; Docker gives containers &lt;code&gt;8.8.8.8&lt;/code&gt; and &lt;code&gt;8.8.4.4&lt;/code&gt; when the host&amp;rsquo;s only name servers are on loopback, and an edit of &lt;code&gt;daemon.json&lt;/code&gt; would restart Docker and need undoing on the open tier. A rule sends DNS to any public address to dnsmasq, from the VM and the bridges, which also catches resolvers that tools hard-code, and so does DNS to the VM&amp;rsquo;s own name servers but loopback&amp;rsquo;s: Lima&amp;rsquo;s DHCP adds one beside &lt;code&gt;127.0.0.1&lt;/code&gt;, which systemd-resolved falls back on and Docker gives containers once it drops the loopback one, and the e2e run showed both failing without it. Other private, link-local, CGNAT and loopback addresses are left alone, so a DNS server on a container&amp;rsquo;s or the LAN&amp;rsquo;s address still answers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every other port refused, Docker&amp;rsquo;s published ports included:&lt;/strong&gt; the NAT chains run at -110, before Docker&amp;rsquo;s at -100, and give every TCP and UDP port of the stand-in address a mapping, to its listener, to dnsmasq, or to a port where nothing listens. Without that, Docker&amp;rsquo;s &lt;code&gt;DOCKER&lt;/code&gt; chain, which takes every local address but loopback, would send &lt;code&gt;db.example.com:5432&lt;/code&gt; to a container that publishes 5432, and a test suite would write into a local database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The ports from the proxy:&lt;/strong&gt; the proxy owns the policy and reads its files again when they change, so &lt;code&gt;devvm-transparent&lt;/code&gt; fetches &lt;code&gt;/transparent/ports&lt;/code&gt; every 10 seconds rather than devvm finding every command and hand edit that changes a rule.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The first bytes decide on every port:&lt;/strong&gt; HTTP and TLS each work on every redirected port, so a rule such as &lt;code&gt;api.internal.example:8080&lt;/code&gt; works for plain HTTP too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm.proxy&lt;/code&gt; reserved whole:&lt;/strong&gt; a name under it never reaches a link, a rule, a resolver or a company proxy, and neither does &lt;code&gt;CONNECT devvm.proxy:P&lt;/code&gt;, which has no endpoint; only absolute-form requests for &lt;code&gt;http://devvm.proxy/&lt;/code&gt; reach the endpoints.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never 22 or 53:&lt;/strong&gt; SSH names no host in its first bytes, and the VM&amp;rsquo;s ssh goes through &lt;code&gt;ProxyCommand&lt;/code&gt; already. 53 is the VM&amp;rsquo;s own names'.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A link&amp;rsquo;s name refused on both ways:&lt;/strong&gt; dnsmasq gives a link&amp;rsquo;s name its &lt;code&gt;/etc/hosts&lt;/code&gt; address, never the stand-in address, so only a crafted client reaches a link through the reserved target, and both the TLS and the HTTP way refuse it, so the two agree.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, on the reserved target, the guest&amp;rsquo;s rules and the setup). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Naming one host and reaching another:&lt;/strong&gt; ruled out. The host is the SNI&amp;rsquo;s, or each request&amp;rsquo;s &lt;code&gt;Host&lt;/code&gt;, and the proxy dials that host by name after &lt;code&gt;routeFor&lt;/code&gt; judged it, then checks the replayed ClientHello&amp;rsquo;s SNI again (&lt;code&gt;carry&lt;/code&gt;). An interception&amp;rsquo;s leaf names the SNI host alone, and every request whose &lt;code&gt;Host&lt;/code&gt; or &lt;code&gt;:authority&lt;/code&gt; differs gets &lt;code&gt;421&lt;/code&gt; (&lt;code&gt;TestTransparentIntercept&lt;/code&gt;). Domain fronting and ECH&amp;rsquo;s outer name are what &lt;code&gt;CONNECT&lt;/code&gt; with the password reaches already.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secrets on the wrong host, or in plain HTTP:&lt;/strong&gt; ruled out. Interception is chosen from the SNI host alone, on 443, and a plain request is always forwarded as &lt;code&gt;http://&lt;/code&gt;, which never gets a secret (&lt;code&gt;TestTransparentHTTP&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SNI and Host shapes:&lt;/strong&gt; ruled out. No SNI, an address, a trailing dot, two names, a ClientHello split across records or cut short, a name &lt;code&gt;HostOK&lt;/code&gt; refuses and a name under &lt;code&gt;devvm.proxy&lt;/code&gt; are refused before the policy (&lt;code&gt;TestTransparentSNI&lt;/code&gt;, &lt;code&gt;FuzzTransparent&lt;/code&gt;). A name with anything but printable ASCII is refused before its case is folded, so the Kelvin sign never becomes &lt;code&gt;k&lt;/code&gt;, and the same holds for &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s target and its SNI check (&lt;code&gt;TestHostsNotASCII&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Holding the proxy&amp;rsquo;s memory or slots:&lt;/strong&gt; fixed. A transparent connection counts toward the 1024 tunnels and gets 10 seconds for its first bytes. A ClientHello record longer than 16 KiB and 256 bytes is never read, and on every tunnel a ClientHello that has started must arrive whole within 10 seconds (&lt;code&gt;TestTunnelHelloDeadline&lt;/code&gt;, &lt;code&gt;TestPeekClientHelloCap&lt;/code&gt;). The &lt;code&gt;403&lt;/code&gt; page&amp;rsquo;s TLS connection and an intercepted tunnel took 1 MiB of a request&amp;rsquo;s headers, where the proxy&amp;rsquo;s own listener takes 64 KiB. With the fix, every connection that the proxy serves HTTP on takes 64 KiB, and HTTP/2 inside one asks for at most 100 requests at once, where Go&amp;rsquo;s default is 250, each a request upstream (&lt;code&gt;serveOne&lt;/code&gt;, &lt;code&gt;TestServeOneHeaderLimit&lt;/code&gt;, &lt;code&gt;TestServeOneStreamsLimit&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Requests left running, and idle connections:&lt;/strong&gt; fixed. A plain HTTP request, the transparent path&amp;rsquo;s included, went on after its client had gone, because the proxy can&amp;rsquo;t tell that from a half-close, so a VM could leave requests waiting on a host that never answers, past the connections it holds. Once its client stops sending, a request ends after a minute with nothing to pass on, while an answer that keeps coming still reaches a client that half-closed. A connection to the proxy waits at most 10 minutes between requests, and one without the password is closed after its &lt;code&gt;407&lt;/code&gt;. Only tunnels counted toward a limit, so the fix holds the proxy to at most 2048 connections of every kind at once, a request that outlives its client included, as &lt;code&gt;net/http&lt;/code&gt; closes its connection only once the handler returns (&lt;code&gt;maxConns&lt;/code&gt;). A connection counts from its first request with the password, and the ones that haven&amp;rsquo;t sent it wait in a pool of 128 where a new one closes the oldest (&lt;code&gt;maxWaiting&lt;/code&gt;), so an open VM that reaches another VM&amp;rsquo;s proxy port can&amp;rsquo;t take that VM&amp;rsquo;s room by holding connections through their 30 seconds for headers. Tunnels&amp;rsquo; HTTP/2 streams were bounded only for each tunnel, and every request upstream is a connection of its own, so 1024 tunnels could open about 100,000 connections to hosts. The proxy has at most 2048 requests upstream at once (&lt;code&gt;maxRequests&lt;/code&gt;). Each limit&amp;rsquo;s line in &lt;code&gt;proxy.log&lt;/code&gt; comes once a minute at most (&lt;code&gt;everyMinute&lt;/code&gt;). A plain &lt;code&gt;ws://&lt;/code&gt; upgrade got &lt;code&gt;502&lt;/code&gt;, because the request&amp;rsquo;s writer hid the hijack it needs, and with the fix it gets its &lt;code&gt;101&lt;/code&gt; (&lt;code&gt;TestPlainHTTPEndsWithClient&lt;/code&gt;, &lt;code&gt;TestProxyConnectionBounds&lt;/code&gt;, &lt;code&gt;TestProxyConnectionLimit&lt;/code&gt;, &lt;code&gt;TestProxyWaitingConnections&lt;/code&gt;, &lt;code&gt;TestUpstreamRequestLimit&lt;/code&gt;, &lt;code&gt;TestPlainWebSocket&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A flood of connections to another VM&amp;rsquo;s proxy:&lt;/strong&gt; listed. Connections without the password wait in their own pool, so holding them can&amp;rsquo;t take a VM&amp;rsquo;s room, but an open VM or a program on this machine that opens connections as fast as the host accepts them fills the kernel&amp;rsquo;s accept queue, and the VM&amp;rsquo;s own connections wait in it with them, or are evicted from the pool before their first request arrives. That slows the VM&amp;rsquo;s proxy for as long as the flood lasts, and ends with it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A ClientHello sent a byte, then late:&lt;/strong&gt; fixed, found in review. The deadline first made a record header that didn&amp;rsquo;t come whole read as &amp;ldquo;not TLS&amp;rdquo;, so a tunnel that sent &lt;code&gt;0x16&lt;/code&gt;, waited past it, then sent a ClientHello naming another host was carried unchecked, which the SNI check had refused before. A stream whose first byte is &lt;code&gt;0x16&lt;/code&gt; is TLS from then on: a header that doesn&amp;rsquo;t come whole, or whose version byte isn&amp;rsquo;t 3, is refused, and the far end gets nothing (&lt;code&gt;TestTunnelHelloStall&lt;/code&gt;, &lt;code&gt;FuzzClientHello&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A split ClientHello on an address&amp;rsquo;s tunnel:&lt;/strong&gt; fixed, found in review, older than transparent mode. A tunnel to an address may carry no server name, and a ClientHello that didn&amp;rsquo;t parse read as one without a name, so one split across two records, naming another host in the second, went on unchecked. Only a ClientHello that parsed whole counts now: one that doesn&amp;rsquo;t is refused, on every tunnel (&lt;code&gt;TestTunnelAddressSplitHello&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other bridges and protocols reaching Docker&amp;rsquo;s DNAT through the stand-in address:&lt;/strong&gt; fixed, found in review. The NAT chains map TCP and UDP alone, and only for &lt;code&gt;lo&lt;/code&gt;, &lt;code&gt;docker0&lt;/code&gt; and &lt;code&gt;br-*&lt;/code&gt;, so a published SCTP port, or a connection from Podman&amp;rsquo;s or LXD&amp;rsquo;s bridges, could reach a container through the stand-in address. Two filter chains at -150 drop both before any NAT chain (&lt;code&gt;TestTransparentRuleset&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s endpoints without the password:&lt;/strong&gt; fixed, found in review. socat adds the VM&amp;rsquo;s password for any client, so a container without the proxy settings reached &lt;code&gt;devvm.proxy&lt;/code&gt;&amp;rsquo;s CA, ports and Nix cache through &lt;code&gt;Host: devvm.proxy&lt;/code&gt;. On the transparent path that host reaches &lt;code&gt;/blocked&lt;/code&gt; alone (&lt;code&gt;TestTransparentHTTP&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Names under the search domain:&lt;/strong&gt; listed. dnsmasq can&amp;rsquo;t tell a single-label name the resolver extended from a name a tool names whole, so every name under this machine&amp;rsquo;s network&amp;rsquo;s search domain gets no answer through transparent mode, &lt;code&gt;git.corp.example.com&lt;/code&gt; under &lt;code&gt;corp.example.com&lt;/code&gt; included. Such a host needs the tool&amp;rsquo;s proxy settings, as its address on the LAN or a company network would anyway.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A DNS server on the VM&amp;rsquo;s &lt;code&gt;127.0.0.1:53&lt;/code&gt;:&lt;/strong&gt; listed. The rule that sends the VM&amp;rsquo;s resolver to dnsmasq takes every connection to that address and port, a forward of port 53 that the user listed included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;via&lt;/code&gt; label:&lt;/strong&gt; listed. Whether a connection came through transparent mode is the VM&amp;rsquo;s own doing, as its &lt;code&gt;User-Agent&lt;/code&gt; is, so &lt;code&gt;devvm network lock&lt;/code&gt;&amp;rsquo;s heading for such hosts is a hint, not proof.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS out of the VM:&lt;/strong&gt; ruled out. dnsmasq has no upstream, the proxy asks the policy before it resolves a name, and the &lt;code&gt;403&lt;/code&gt; page resolves nothing, so a blocked name never reaches the host&amp;rsquo;s resolver. Root that gives dnsmasq an upstream, or stops the service, meets the host&amp;rsquo;s confinement, which the e2e checks prove with the service stopped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;New exposure on the host:&lt;/strong&gt; ruled out. No listener, socket or sandbox rule is added on the host. socat&amp;rsquo;s connections are the VM&amp;rsquo;s own, to its own proxy, with its own password, which &lt;code&gt;/etc/environment&lt;/code&gt; gives every VM process already.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The listeners reached from the host or another network:&lt;/strong&gt; ruled out. Nothing listens on loopback, the forwarder refuses the stand-in address, and an input rule keeps every interface but &lt;code&gt;lo&lt;/code&gt; and Docker&amp;rsquo;s bridges off it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM&amp;rsquo;s password in arguments:&lt;/strong&gt; ruled out. The setup reads the proxy&amp;rsquo;s URL on stdin, and socat and curl read the password from root&amp;rsquo;s files, so &lt;code&gt;ps&lt;/code&gt; and the journal never show it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Containers without the proxy settings:&lt;/strong&gt; listed, within the threat model. A container made through Docker&amp;rsquo;s API, or with its proxy variables emptied, had no way out before, and now reaches what the VM&amp;rsquo;s policy allows, as every program in the VM does. &lt;code&gt;--network none&lt;/code&gt; gives a container no network, and an &lt;code&gt;--internal&lt;/code&gt; network&amp;rsquo;s containers reach nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What &lt;code&gt;/transparent/ports&lt;/code&gt; tells the VM:&lt;/strong&gt; listed. It&amp;rsquo;s the ports the VM&amp;rsquo;s rules name, the shared &lt;code&gt;~/.config/devvm/policy&lt;/code&gt;&amp;rsquo;s included, never their hosts. The VM can&amp;rsquo;t read its policy otherwise, and it can&amp;rsquo;t learn a rule&amp;rsquo;s port by trying without a host that matches it, so the list is a small disclosure that reaches nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learning:&lt;/strong&gt; listed. Tools that failed silently before, such as telemetry, now succeed on the learn tier and would be learned, so &lt;code&gt;devvm network lock&lt;/code&gt; lists the hosts that only they reached apart, under a heading of their own. A &lt;code&gt;tunnel&lt;/code&gt; event needs a dial that succeeded, so a VM can&amp;rsquo;t make learn list a host it never reached.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open start after a confined one:&lt;/strong&gt; listed. The service is enabled at boot until that launch&amp;rsquo;s setup takes it out, a few seconds later. In that window its connections reach the VM&amp;rsquo;s proxy, which is open by then, so they reach what the open tier allows anyway, and its answers have a time to live of 0, so nothing keeps them after.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A running VM&amp;rsquo;s tier changed:&lt;/strong&gt; listed, by design. The setup decides by the confinement the VM runs with, so a confined VM made open keeps transparent mode on an open proxy until its next start, which reaches what the open tier allows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unprivileged in the VM:&lt;/strong&gt; listed. dnsmasq and each socat connection&amp;rsquo;s process run as &lt;code&gt;devvm-transparent&lt;/code&gt;, while socat&amp;rsquo;s listeners stay root&amp;rsquo;s, because socat drops its user only in each connection&amp;rsquo;s process. That&amp;rsquo;s hardening inside the VM, which the threat model doesn&amp;rsquo;t rely on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;): &lt;code&gt;network&lt;/code&gt;, on macOS and on a Linux host: the service runs, the stand-in address is on &lt;code&gt;lo&lt;/code&gt;, and dnsmasq and socat listen on that address alone; every name with a dot resolves to it, IPv6 has none at once, &lt;code&gt;/etc/hosts&lt;/code&gt;&amp;rsquo; names keep theirs, and a name without a dot that isn&amp;rsquo;t there resolves to nothing, though the VM&amp;rsquo;s resolver appends this machine&amp;rsquo;s network&amp;rsquo;s search domain to it; curl without proxy settings and a static Go client with its own resolver reach github.com with its own certificate, logged &lt;code&gt;without proxy settings&lt;/code&gt;; a blocked host gets the &lt;code&gt;403&lt;/code&gt; over the VM&amp;rsquo;s CA; port 5432 of a name is refused at once and &lt;code&gt;devvm-why&lt;/code&gt; names it; a port a rule names is redirected while the rule is there and refused at once after; your own servers bind &lt;code&gt;0.0.0.0:443&lt;/code&gt; and &lt;code&gt;:80&lt;/code&gt;; the service comes back when it&amp;rsquo;s killed or its table flushed; &lt;code&gt;devvm network transparent off&lt;/code&gt; takes it out at the next launch and &lt;code&gt;on&lt;/code&gt; puts it back; open, there&amp;rsquo;s none and names resolve with Lima&amp;rsquo;s DNS; with the service stopped, direct connections, DNS to Lima&amp;rsquo;s addresses and TCP to a public server&amp;rsquo;s port 53 still fail, and with it running a public DNS server and Lima&amp;rsquo;s DNS addresses answer only with the stand-in address, TTL 0, or nothing. In a VM of the docker layer, containers without proxy settings reach github.com on the default bridge and on a network of their own, a blocked host is logged, a container reaches no other port of the stand-in address and none of its listeners directly, a container&amp;rsquo;s published 5432 isn&amp;rsquo;t reached through the stand-in address from the VM or from another container, its published 443 doesn&amp;rsquo;t take the VM&amp;rsquo;s connections, and an &lt;code&gt;--internal&lt;/code&gt; network reaches nothing. &lt;code&gt;from&lt;/code&gt;: a Debian 12 VM and an Alpine one each pass the same checks on the allowlist tier, and with the service stopped, Lima&amp;rsquo;s DNS and a public server answer nothing.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-company-proxy"&gt;A company proxy&lt;span class="hx:absolute hx:-mt-20" id="a-company-proxy"&gt;&lt;/span&gt;
&lt;a href="#a-company-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Behind a company proxy, nothing reaches the internet without going through it, so each VM&amp;rsquo;s proxy goes through it too (&lt;a href="https://next.devvm.dev/docs/internals/network/#through-a-company-proxy"&gt;how&lt;/a&gt;), and each build goes through a proxy of devvm&amp;rsquo;s for the build alone, which goes through it. The design keeps two things: the proxy still decides every request by the name the VM asked for, and the company proxy&amp;rsquo;s password reaches nothing of a VM&amp;rsquo;s or a build&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; the host&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt;, read from devvm&amp;rsquo;s environment (&lt;code&gt;backend.ReadHostProxy&lt;/code&gt;) when a VM&amp;rsquo;s proxy starts, or &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; when the environment sets neither proxy (&lt;code&gt;settings.HostProxy&lt;/code&gt;), checked (&lt;code&gt;HostProxy.Upstream&lt;/code&gt;: only &lt;code&gt;http://&lt;/code&gt; proxies), and written into the proxy&amp;rsquo;s config, &lt;code&gt;proxy.json&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt; (mode 600), as &lt;code&gt;upstream&lt;/code&gt; (&lt;code&gt;internal/proxy/upstream.go&lt;/code&gt;). &lt;code&gt;config.toml&lt;/code&gt; is a file people copy and keep with their dotfiles, so it never holds the password: its URL names the user, and the password is the &lt;code&gt;proxy&lt;/code&gt; secret (&lt;code&gt;proxy.UpstreamSecret&lt;/code&gt;), in the Keychain or devvm&amp;rsquo;s secrets folder, which the proxy looks up through &lt;code&gt;IO.Secret&lt;/code&gt; as it starts (&lt;code&gt;upstreamPassword&lt;/code&gt;), so no file of devvm&amp;rsquo;s holds it either. It&amp;rsquo;s a host-only secret (&lt;code&gt;secrets.Secret.HostOnly&lt;/code&gt;): no VM is ever bound to it. The proxy opens its own &lt;code&gt;CONNECT&lt;/code&gt; through the company proxy, by name, with &lt;code&gt;Proxy-Authorization: Basic&lt;/code&gt; from the URL, for tunnels and for the TLS connections it makes to put secrets in, which check the server against the system&amp;rsquo;s roots and the user&amp;rsquo;s CAs. Plain HTTP goes to the company proxy in absolute form. A change to the settings starts the VM&amp;rsquo;s proxy again at devvm&amp;rsquo;s next run, and an old proxy that won&amp;rsquo;t stop fails the start (&lt;code&gt;proxy_stop_failed&lt;/code&gt;) rather than run on with its old settings.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What an upstream changes:&lt;/strong&gt; the proxy resolves a name and dials the addresses it checked only when it connects directly. Through a company proxy, the company proxy resolves the name, so the floor can&amp;rsquo;t hold it to checked addresses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An address the VM asks for is judged as before, and &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;*.localhost&lt;/code&gt; and loopback and unspecified addresses never go upstream, so the floor refuses them as before unless a rule names them. A host whose last label is all digits or starts with &lt;code&gt;0x&lt;/code&gt; (&lt;code&gt;127.1&lt;/code&gt;, &lt;code&gt;2130706433&lt;/code&gt;, &lt;code&gt;0x7f000001&lt;/code&gt;) is refused as no host name (&lt;code&gt;hostOK&lt;/code&gt;), because a company proxy that reads it as &lt;code&gt;inet_aton&lt;/code&gt; does would reach an address the floor never judged.&lt;/li&gt;
&lt;li&gt;A name is refused when this machine&amp;rsquo;s resolver answers with any internal or denied address (&lt;code&gt;floorUpstream&lt;/code&gt;). The proxy looks it up absolute, as it does for a direct connection (&lt;code&gt;egress.lookupName&lt;/code&gt;), so this machine&amp;rsquo;s DNS search domain never turns &lt;code&gt;api&lt;/code&gt; into &lt;code&gt;api.corp.example.com&lt;/code&gt;, a name that no rule judged. A name this machine can&amp;rsquo;t resolve within three seconds goes upstream unjudged only when the policy names it, as itself or under &lt;code&gt;*.domain&lt;/code&gt; (&lt;code&gt;policy.byName&lt;/code&gt;). When only &lt;code&gt;**&lt;/code&gt; allows it, the proxy refuses it (&lt;code&gt;errUnresolved&lt;/code&gt;), because &lt;code&gt;**&lt;/code&gt; would otherwise send the company proxy any name the VM makes up, and the company proxy may resolve such a name to its own network&amp;rsquo;s hosts.&lt;/li&gt;
&lt;li&gt;The company proxy may still resolve a name differently, or later, than this machine did (DNS rebinding between the two lookups). It may also add its own search domain to any name it&amp;rsquo;s sent, before or after it tries the name as written, depending on its resolver. A Kubernetes pod&amp;rsquo;s resolver, for example, uses &lt;code&gt;ndots:5&lt;/code&gt;, so it tries the search domain first for any name with fewer than five dots. So a name that a rule names, such as &lt;code&gt;jenkins&lt;/code&gt;, may reach &lt;code&gt;jenkins.corp.example.com&lt;/code&gt; through it, and a name that resolves here may reach another under the company&amp;rsquo;s search domain there. A VM that controls a name under an allowed domain can choose the unjudged path: its name server can fail, or answer after the proxy&amp;rsquo;s three seconds, and then answer the company proxy with an internal address.&lt;/li&gt;
&lt;li&gt;So under a name the policy lists, a VM reaches whatever the company proxy reaches: its company&amp;rsquo;s internal hosts, and the company proxy&amp;rsquo;s own host, including this machine&amp;rsquo;s loopback when the company proxy runs on this machine (a local proxy that a VPN client runs, for example). Address denies apply only to the addresses this machine resolves. The allowlist stays the limit: a name the VM&amp;rsquo;s policy doesn&amp;rsquo;t allow never reaches the company proxy.&lt;/li&gt;
&lt;li&gt;The proxy reads at most 64 KiB of the company proxy&amp;rsquo;s answer to &lt;code&gt;CONNECT&lt;/code&gt; (&lt;code&gt;maxConnectReply&lt;/code&gt;), so an answer whose headers never end fails the request instead of filling memory.&lt;/li&gt;
&lt;li&gt;The company proxy sees every allowed host name and port, and with a CA in the user&amp;rsquo;s CA folder, it reads TLS too, as it does for this machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Credentials:&lt;/strong&gt; the company proxy&amp;rsquo;s user and password are in no process&amp;rsquo;s arguments (only the file&amp;rsquo;s path is), in no log (the event log&amp;rsquo;s &lt;code&gt;upstream&lt;/code&gt; field and the proxy&amp;rsquo;s own log name the company proxy as &lt;code&gt;host:port&lt;/code&gt;, and the URL the proxy&amp;rsquo;s HTTP transport uses has no user), and in no request but the company proxy&amp;rsquo;s own: the proxy drops the VM&amp;rsquo;s &lt;code&gt;Proxy-Authorization&lt;/code&gt; and sets the company proxy&amp;rsquo;s only for a request it sends there. The VM never sees them, not even in a refusal, which names the company proxy by &lt;code&gt;host:port&lt;/code&gt; and its status code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Builds:&lt;/strong&gt; a build runs code that isn&amp;rsquo;t devvm&amp;rsquo;s: layer scripts run third-party installers, and with &lt;code&gt;--from&lt;/code&gt;, the container image&amp;rsquo;s own shell and package manager run as root in the build VM. So a build never gets the company proxy&amp;rsquo;s settings. Behind a company proxy, each build goes through a proxy of devvm&amp;rsquo;s on the host for that build alone (&lt;code&gt;backend.ProxyStarter&lt;/code&gt;). It&amp;rsquo;s &lt;code&gt;devvm _proxy -config&lt;/code&gt; with the same config as a VM&amp;rsquo;s proxy (&lt;code&gt;proxy.Config&lt;/code&gt;): a policy file of &lt;code&gt;**&lt;/code&gt;, which allows any host on ports 80 and 443 but the host&amp;rsquo;s own and internal addresses, a new random password, the company proxy&amp;rsquo;s settings as its &lt;code&gt;upstream&lt;/code&gt;, and its &lt;code&gt;lifeline&lt;/code&gt; on the build VM&amp;rsquo;s hostagent, all in one file of mode 600. The build gets only &lt;code&gt;http://devvm:&amp;lt;password&amp;gt;@&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;&lt;/code&gt;, in each proxy variable the host sets, and the host&amp;rsquo;s &lt;code&gt;NO_PROXY&lt;/code&gt;. When the build ends, devvm stops that proxy and deletes its config, which holds the password and the company proxy&amp;rsquo;s, and a successful build&amp;rsquo;s folder goes too. The password is worthless once the proxy has stopped, and the build never sees the company proxy&amp;rsquo;s address, user or password. Without a company proxy, builds start no proxy and get no proxy settings.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima:&lt;/strong&gt; the build VM (an image&amp;rsquo;s, the tools build&amp;rsquo;s or &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion VM) reaches the proxy at &lt;code&gt;192.168.5.2&lt;/code&gt;, the host&amp;rsquo;s address on Lima&amp;rsquo;s user-mode network, with vz and with QEMU, and on macOS its Seatbelt profile allows that one port of the host&amp;rsquo;s loopback alongside its ssh port. The proxy runs on the host, so a company proxy on this machine&amp;rsquo;s loopback, such as one a VPN client runs, works for builds on macOS too. Lima&amp;rsquo;s &lt;code&gt;propagateProxyEnv&lt;/code&gt; would write the host&amp;rsquo;s proxy settings into the guest&amp;rsquo;s &lt;code&gt;/etc/environment&lt;/code&gt; between &lt;code&gt;#LIMA-START&lt;/code&gt; and &lt;code&gt;#LIMA-END&lt;/code&gt; at each boot (Lima&amp;rsquo;s &lt;code&gt;07-etc-environment.sh&lt;/code&gt;), and a stopped build VM&amp;rsquo;s disk would keep that block, so build VMs start with &lt;code&gt;propagateProxyEnv: false&lt;/code&gt;, and only a VM on Lima&amp;rsquo;s own network whose guest doesn&amp;rsquo;t name devvm&amp;rsquo;s proxy (&lt;code&gt;NetDirect&lt;/code&gt; without &lt;code&gt;Confinement.GuestProxy&lt;/code&gt;) starts with it on. Every project VM names its proxy, an open one&amp;rsquo;s included, so every project VM starts with it off, and its first start makes that change in the edit that adds its proxy to its environment. Lima also logs the proxy settings it reads, password and all, into devvm&amp;rsquo;s run log, so devvm runs &lt;code&gt;limactl&lt;/code&gt; without them, and only a start with &lt;code&gt;propagateProxyEnv&lt;/code&gt; on gets them back. Each build script gets the build proxy&amp;rsquo;s variables exported at its start, on its input with the script (&lt;code&gt;internal/backend/lima/buildproxy.go&lt;/code&gt;), and &lt;code&gt;/etc/sudoers.d/devvm-build-proxy&lt;/code&gt; keeps them for &lt;code&gt;sudo&lt;/code&gt; until the scripts end. The build proxy&amp;rsquo;s files and logs are in the build VM&amp;rsquo;s folder, in &lt;code&gt;run/builds/&amp;lt;name&amp;gt;/run/build-proxy/&lt;/code&gt; in devvm&amp;rsquo;s data folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion:&lt;/strong&gt; &lt;code&gt;oci/build.sh&lt;/code&gt; runs as root with the build proxy&amp;rsquo;s variables for crane. The container image&amp;rsquo;s own code runs only in a chroot under &lt;code&gt;env -i&lt;/code&gt;: the &lt;code&gt;/etc/os-release&lt;/code&gt; check gets &lt;code&gt;PATH&lt;/code&gt; alone, and &lt;code&gt;chroot_run&lt;/code&gt; (&lt;code&gt;bootify.sh&lt;/code&gt;, the CAs&amp;rsquo; &lt;code&gt;ca.sh&lt;/code&gt;) gets &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;HOME&lt;/code&gt;, &lt;code&gt;LC_ALL&lt;/code&gt; and the build proxy&amp;rsquo;s variables, for &lt;code&gt;bootify.sh&lt;/code&gt;&amp;rsquo;s package downloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The build&amp;rsquo;s policy is &lt;code&gt;**&lt;/code&gt; alone, so on its own the build&amp;rsquo;s proxy would refuse every name this machine can&amp;rsquo;t resolve, and where only the company proxy resolves outside names, a build would reach nothing by name. Lima&amp;rsquo;s build proxies start with &lt;code&gt;upstream_unresolved&lt;/code&gt; in their config, which sends such names on to the company proxy unjudged. The refusal would protect little there, because without a company proxy those builds are on Lima&amp;rsquo;s user-mode network and reach internal addresses directly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (Lima):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;images&lt;/code&gt;: a layer built with a fake company proxy&amp;rsquo;s password in &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and &lt;code&gt;HTTP_PROXY&lt;/code&gt; (a closed port, &lt;code&gt;NO_PROXY=*&lt;/code&gt;): its script and &lt;code&gt;sudo&lt;/code&gt; see the build&amp;rsquo;s proxy at &lt;code&gt;192.168.5.2&lt;/code&gt; with user &lt;code&gt;devvm&lt;/code&gt;, never the password, the build&amp;rsquo;s proxy is gone afterwards, and neither the image&amp;rsquo;s whole disk, nor Lima&amp;rsquo;s files for it, nor devvm&amp;rsquo;s logs hold the password;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from&lt;/code&gt;: a company proxy of the run&amp;rsquo;s own with a password, and a &lt;code&gt;--from alpine:3.21&lt;/code&gt; base, with every feature, and a layer on it: the registry, Alpine&amp;rsquo;s mirror and the layer&amp;rsquo;s own download reach the company proxy through the builds&amp;rsquo; proxies; what the layer&amp;rsquo;s commands and &lt;code&gt;sudo&lt;/code&gt; have is the build&amp;rsquo;s proxy with a password of its own; and the password is in no converted disk, image, log, build file or process&amp;rsquo;s arguments;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;network&lt;/code&gt;: a company proxy of the run&amp;rsquo;s own (a &lt;code&gt;devvm _proxy&lt;/code&gt; with a password, allowing any host): the VM&amp;rsquo;s next launch with it in devvm&amp;rsquo;s environment starts the VM&amp;rsquo;s proxy again with &lt;code&gt;-upstream&lt;/code&gt;; an allowed host goes through it by name (its event log) and the VM&amp;rsquo;s event log names it; a host the VM&amp;rsquo;s policy doesn&amp;rsquo;t allow gets &lt;code&gt;403&lt;/code&gt; and never reaches it; its password is in no process&amp;rsquo;s arguments, no log and nothing of the VM&amp;rsquo;s; the launch after, without it, starts the VM&amp;rsquo;s proxy again going directly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt; &lt;code&gt;https://&lt;/code&gt; and &lt;code&gt;socks5://&lt;/code&gt; company proxies, which devvm refuses (&lt;code&gt;upstream_proxy_scheme&lt;/code&gt;); proxy auto-configuration (PAC) files and the macOS system proxy, which devvm doesn&amp;rsquo;t read; Kerberos or NTLM authentication. An open VM goes through its proxy as every VM does, so no project VM gets the host&amp;rsquo;s settings in its &lt;code&gt;/etc/environment&lt;/code&gt;. What devvm&amp;rsquo;s redaction of Lima&amp;rsquo;s logs leaves open is under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#this-machine"&gt;your company proxy&amp;rsquo;s password&lt;/a&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="one-form-of-a-host"&gt;One form of a host&lt;span class="hx:absolute hx:-mt-20" id="one-form-of-a-host"&gt;&lt;/span&gt;
&lt;a href="#one-form-of-a-host" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every check that judges or compares a host reads it in one form, &lt;code&gt;proxy.NormHost&lt;/code&gt;&amp;rsquo;s, so a deny, a binding, a risk or a warning can never hold for one spelling of a host and miss another. &lt;code&gt;NormHost&lt;/code&gt; lowercases a host of printable ASCII, in ASCII alone, and drops its one trailing dot, unless the host is an address, whose dot can only be its IPv6 zone&amp;rsquo;s. Any other host keeps its case and its dots, and &lt;code&gt;HostOK&lt;/code&gt; refuses it, because Unicode&amp;rsquo;s case folding turns some letters into ASCII ones, such as the Kelvin sign into &lt;code&gt;k&lt;/code&gt;. A host with two trailing dots or more keeps them all, which &lt;code&gt;HostOK&lt;/code&gt; refuses, so &lt;code&gt;NormHost&lt;/code&gt; gives the same host however many times it runs, and a caller that reads a host again can&amp;rsquo;t turn &lt;code&gt;evil.test..&lt;/code&gt; into &lt;code&gt;evil.test&lt;/code&gt;. A matcher takes a &lt;code&gt;proxy.Host&lt;/code&gt;, which only &lt;code&gt;NormHost&lt;/code&gt; makes, and the structure test refuses another copy (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The shapes each reader meets.&lt;/strong&gt; Each reader has a differential fuzz target (&lt;code&gt;FuzzHostSites&lt;/code&gt; in &lt;code&gt;internal/proxy&lt;/code&gt;, and one beside each reader elsewhere), which checks it against a frozen copy of the readers that each folded and trimmed a host its own way, and allows only these differences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A rule&amp;rsquo;s host and its &lt;code&gt;!&lt;/code&gt;&lt;/strong&gt; read exactly as the frozen copy reads them, so a line is the same rule or no rule, and a line that starts with &lt;code&gt;!&lt;/code&gt; but isn&amp;rsquo;t a rule is a broken deny, which makes the policy deny everything, never a valid deny. The frozen state&amp;rsquo;s policy files, bindings and links read the same too (&lt;code&gt;TestFixtureHosts&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two trailing dots&lt;/strong&gt; in a request&amp;rsquo;s host, an SNI or a host &lt;code&gt;Allows&lt;/code&gt; or &lt;code&gt;Denies&lt;/code&gt; judges stay, where the copy drops one. The proxy answers &lt;code&gt;400&lt;/code&gt; to both, and no rule but &lt;code&gt;**&lt;/code&gt; matches either spelling, while &lt;code&gt;**&lt;/code&gt; matches both.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The policy&amp;rsquo;s own matching&lt;/strong&gt; (&lt;code&gt;rulesFor&lt;/code&gt;, &lt;code&gt;quiet&lt;/code&gt;, &lt;code&gt;byName&lt;/code&gt;) and &lt;code&gt;devvm network lock&lt;/code&gt;&amp;rsquo;s risks and ticks don&amp;rsquo;t fold a host that isn&amp;rsquo;t ASCII, where the copy folds it in Unicode. Neither meets such a host, because the proxy refuses it before the policy sees it, and the lock judges only hosts the proxy took.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Brackets&lt;/strong&gt; hold only an IPv6 address, one pair of them, as in a rule, so &lt;code&gt;HostOK&lt;/code&gt; and &lt;code&gt;Host.Addr&lt;/code&gt; take an address bare or as &lt;code&gt;[::1]&lt;/code&gt;, never with a stray bracket, and &lt;code&gt;NormHost&lt;/code&gt; keeps a dot after a bracket (&lt;code&gt;[::1].&lt;/code&gt;), so that&amp;rsquo;s no address either. A request for &lt;code&gt;[evil.com]:443&lt;/code&gt;, &lt;code&gt;[1.2.3.4]:443&lt;/code&gt;, &lt;code&gt;1.2.3.4]&lt;/code&gt; or &lt;code&gt;[[::1]]&lt;/code&gt; gets &lt;code&gt;400&lt;/code&gt;, where &lt;code&gt;net.SplitHostPort&lt;/code&gt; or a trim took the brackets off and the name or address in them was judged. An SNI in brackets is refused as no host name rather than as an address.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An IPv6 address whose zone ends in a dot&lt;/strong&gt; keeps it, so &lt;code&gt;::1%.&lt;/code&gt; is the zoned address it is, where the copy dropped the dot and left &lt;code&gt;::1%&lt;/code&gt;, an empty zone, which is no address. The proxy answers &lt;code&gt;400&lt;/code&gt; to both, and an address with a zone is never the internet&amp;rsquo;s (&lt;code&gt;proxy.Public&lt;/code&gt;), so a promisor remote at one counts as private and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registry at one isn&amp;rsquo;t public.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A host with a stray bracket around an address is an address&lt;/strong&gt;, so an MCP server there (&lt;code&gt;https://1.2.3.4]/&lt;/code&gt;, whose hostname Go&amp;rsquo;s URL parser gives as &lt;code&gt;1.2.3.4]&lt;/code&gt;) gets no binding.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A line that isn&amp;rsquo;t a rule&lt;/strong&gt;, which devvm network rm and its duplicate check compare as text, matches another line only when the two differ in nothing but the case of ASCII letters and one trailing dot, so a Kelvin sign typed for a &lt;code&gt;k&lt;/code&gt; never names the rule with the &lt;code&gt;k&lt;/code&gt;, such as the deny &lt;code&gt;!kubernetes.io&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An SNI&amp;rsquo;s trailing dot&lt;/strong&gt; on the transparent path is dropped, as a request&amp;rsquo;s is. &lt;code&gt;crypto/tls&lt;/code&gt; refuses such a ClientHello, so none reaches it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;NO_PROXY&lt;/code&gt; name that isn&amp;rsquo;t ASCII&lt;/strong&gt; matches no host, so the Kelvin sign&amp;rsquo;s &lt;code&gt;kubernetes.io&lt;/code&gt; doesn&amp;rsquo;t send &lt;code&gt;kubernetes.io&lt;/code&gt; directly, and the request goes through the company proxy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;NO_PROXY&lt;/code&gt; entry with port &lt;code&gt;0&lt;/code&gt;&lt;/strong&gt;, which no request has, sends nothing directly, as one with a port past &lt;code&gt;65535&lt;/code&gt; doesn&amp;rsquo;t, where the copy read &lt;code&gt;git.test:0&lt;/code&gt; as &lt;code&gt;git.test&lt;/code&gt; on every port (found by &lt;code&gt;FuzzNoProxy&lt;/code&gt;). Neither does an entry whose port isn&amp;rsquo;t in plain decimal, such as &lt;code&gt;git.test:080&lt;/code&gt; or &lt;code&gt;git.test:+80&lt;/code&gt;, which Go&amp;rsquo;s clients match against no request, where the copy read it as port 80.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A secret&amp;rsquo;s &lt;code&gt;--host&lt;/code&gt; or an MCP server&amp;rsquo;s host that isn&amp;rsquo;t ASCII&lt;/strong&gt; is refused, as the proxy refuses it, rather than taken as the ASCII host its letters fold into.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registry&lt;/strong&gt; isn&amp;rsquo;t on the internet when its name is one the proxy doesn&amp;rsquo;t take (&lt;code&gt;HostOK&lt;/code&gt;), such as one with anything but printable ASCII, a bracket that a trailing dot hid (&lt;code&gt;[::1].&lt;/code&gt;) or a shorthand address (&lt;code&gt;10.1&lt;/code&gt;), none of which a registry&amp;rsquo;s name is, so a registry is never more public than the copy finds it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A partial clone&amp;rsquo;s promisor remote&lt;/strong&gt; loses its trailing dot, so a warning names &lt;code&gt;example.com&lt;/code&gt; rather than &lt;code&gt;example.com.&lt;/code&gt;, and &lt;code&gt;localhost.&lt;/code&gt; or &lt;code&gt;127.0.0.1.&lt;/code&gt; counts as private, as the proxy refuses it. The Kelvin sign isn&amp;rsquo;t folded.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A remote&amp;rsquo;s ssh host&lt;/strong&gt;, which finds a VM&amp;rsquo;s alias in the ssh config, keeps its own reading, lowercased with its trailing dot kept, as ssh reads it, because it&amp;rsquo;s no host a policy judges.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-desktop"&gt;The desktop&lt;span class="hx:absolute hx:-mt-20" id="the-desktop"&gt;&lt;/span&gt;
&lt;a href="#the-desktop" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm desktop&lt;/code&gt; shows a VM&amp;rsquo;s desktop on this machine with VNC, and keeps two things: no one on this machine or the network reaches the desktop without the VM&amp;rsquo;s password, and the desktop gives the VM no new way out. Both hold whatever the VM&amp;rsquo;s own server does, because root in the VM can replace it (&lt;a href="https://next.devvm.dev/docs/internals/desktop/"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; the built-in &lt;code&gt;desktop&lt;/code&gt; layer (&lt;code&gt;assets/layers/desktop.sh&lt;/code&gt;): Xfce and TigerVNC&amp;rsquo;s &lt;code&gt;Xvnc&lt;/code&gt; from the distribution&amp;rsquo;s archive, and &lt;code&gt;/usr/local/bin/devvm-desktop&lt;/code&gt;, which starts &lt;code&gt;Xvnc&lt;/code&gt; on a socket of the VM&amp;rsquo;s user&amp;rsquo;s own (&lt;code&gt;/run/devvm-desktop/vnc.sock&lt;/code&gt;, mode 600 in a 700 folder), with no TCP port and no password, then an Xfce session. On this machine, &lt;code&gt;internal/desktop&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Relay&lt;/code&gt;, which &lt;code&gt;devvm desktop&lt;/code&gt; runs (&lt;code&gt;internal/vm/desktop.go&lt;/code&gt;): a listener on &lt;code&gt;127.0.0.1&lt;/code&gt; alone (&lt;code&gt;platform.ListenLoopback&lt;/code&gt;, without address reuse), on the port the VM&amp;rsquo;s state records (the &lt;code&gt;ports&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;host.desktop&lt;/code&gt;, chosen by &lt;code&gt;ports.Allocator&lt;/code&gt; and among &lt;code&gt;ports.Used&lt;/code&gt;), and for each viewer that passes its check, an &lt;code&gt;ssh -W&lt;/code&gt; channel to the socket through devvm&amp;rsquo;s ssh config&amp;rsquo;s entry for the VM. Only a VM made with the layer has the desktop (&lt;code&gt;image.DesktopLayer&lt;/code&gt;), because it adds about 370 MB to an image, so &lt;code&gt;base&lt;/code&gt; and the VMs without it stay that much smaller.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why devvm&amp;rsquo;s own relay, not the port forwarder:&lt;/strong&gt; the forwarder forwards every port a VM listens on from its start, on the same port number. A VNC server on a port would have been on this machine&amp;rsquo;s loopback at every start, without anyone running &lt;code&gt;devvm desktop&lt;/code&gt;, on a port another VM&amp;rsquo;s desktop or macOS&amp;rsquo;s own Screen Sharing server (5900) can have. The relay is open only while &lt;code&gt;devvm desktop&lt;/code&gt; runs, on a port of the VM&amp;rsquo;s own, and checks the password itself, which the forwarder, a byte copier, can&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The password:&lt;/strong&gt; VNC&amp;rsquo;s own authentication (RFB security type 2: DES of a 16-byte challenge, &lt;code&gt;desktop.Response&lt;/code&gt;) is what macOS&amp;rsquo;s Screen Sharing speaks to a server that isn&amp;rsquo;t a Mac, and it takes 8 characters. devvm&amp;rsquo;s are random, from 31 characters (about 40 bits), checked one at a time with a second&amp;rsquo;s wait after a wrong one, so an online guess takes thousands of years. The relay checks it before it starts any ssh, so a wrong viewer costs the VM nothing. It&amp;rsquo;s kept in the VM&amp;rsquo;s state (the &lt;code&gt;desktop&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;made.password&lt;/code&gt;, mode 600), shown only with the address (&lt;code&gt;desktop_ready&lt;/code&gt;, a message, not the run log), and never sent to the VM, so a VM can&amp;rsquo;t use it to reach its own desktop&amp;rsquo;s port. Screen Sharing gets the address alone (&lt;code&gt;open vnc://127.0.0.1:PORT&lt;/code&gt;), not the password, which would be in &lt;code&gt;open&lt;/code&gt;&amp;rsquo;s arguments where any process on this machine reads them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What keeps the VNC connection from carrying the VM out.&lt;/strong&gt; Every connection starts on this machine: a viewer connects to the relay, and the relay asks devvm&amp;rsquo;s ssh for a local channel (&lt;code&gt;-W&lt;/code&gt;) that the VM&amp;rsquo;s sshd connects to the VM&amp;rsquo;s own socket. The ssh asks for no session, agent, X11, tunnel or remote forward, and OpenSSH&amp;rsquo;s client refuses a channel the server opens unasked, as for &lt;a href="#ports-on-lima"&gt;the forwarder&lt;/a&gt;. What the VM sends back goes only to the viewer that connected. The VM&amp;rsquo;s server reaches nothing on this machine, so the VM&amp;rsquo;s tier holds as it is: the VM&amp;rsquo;s own connections still reach only its proxy, and devvm allows no new host for the desktop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The clipboard:&lt;/strong&gt; off unless &lt;code&gt;--clipboard&lt;/code&gt;. Without it, &lt;code&gt;Xvnc&lt;/code&gt; starts with &lt;code&gt;AcceptCutText&lt;/code&gt;, &lt;code&gt;SendCutText&lt;/code&gt;, &lt;code&gt;SetPrimary&lt;/code&gt; and &lt;code&gt;SendPrimary&lt;/code&gt; off, and the relay drops every &lt;code&gt;ClientCutText&lt;/code&gt; from the viewer, extended clipboard ones too (&lt;code&gt;internal/desktop/filter.go&lt;/code&gt;). It reads the viewer&amp;rsquo;s messages by their lengths (RFC 6143&amp;rsquo;s and the extensions TigerVNC offers: fences, continuous updates, desktop size, xvp, GII, QEMU&amp;rsquo;s key and audio events) and ends the connection on a type it doesn&amp;rsquo;t know, so nothing it can&amp;rsquo;t read reaches the VM. The other way, from the VM to the viewer, isn&amp;rsquo;t read: following the server&amp;rsquo;s &lt;code&gt;ServerCutText&lt;/code&gt; would mean decoding every screen update&amp;rsquo;s encoding. A VM whose server was changed can send its clipboard to the viewer, so Screen Sharing&amp;rsquo;s Use Shared Clipboard setting is what keeps it off this machine then.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The local proxy, for browsers:&lt;/strong&gt; Chrome, Chromium and Firefox ignore the password in the VM&amp;rsquo;s &lt;code&gt;HTTP_PROXY&lt;/code&gt; and ask for it on every site, so the desktop&amp;rsquo;s session uses &lt;code&gt;devvm-local-proxy&lt;/code&gt; instead (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#the-local-proxy"&gt;how&lt;/a&gt;), which the guest setup writes (&lt;code&gt;assets/guest/sync.sh&lt;/code&gt;) and &lt;code&gt;socat&lt;/code&gt; serves. It gives no program a power it lacked, because the password it adds is the one the VM&amp;rsquo;s environment already holds, and every program in the VM can read it there. What it must not do is hand the password to anything outside the VM, or send it anywhere but the VM&amp;rsquo;s proxy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Where it listens:&lt;/strong&gt; &lt;code&gt;127.0.77.1:3128&lt;/code&gt; (&lt;code&gt;proxy.LocalProxyAddr&lt;/code&gt;, &lt;code&gt;proxy.LocalProxyPort&lt;/code&gt;), on the VM&amp;rsquo;s loopback alone (&lt;code&gt;bind=&lt;/code&gt;), taking connections from &lt;code&gt;127.0.0.0/8&lt;/code&gt; alone (&lt;code&gt;range=&lt;/code&gt;). The port forwarder never forwards a server on that address (&lt;code&gt;vmssh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;dialAddr&lt;/code&gt;, &lt;code&gt;proxy.IsLocalProxyAddr&lt;/code&gt;), so a VM that forwards every port doesn&amp;rsquo;t put a proxy that needs no password on this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, where other users and programs would reach the VM&amp;rsquo;s proxy, and its secrets, without the password.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where the password goes:&lt;/strong&gt; only to the VM&amp;rsquo;s proxy, whose address is written into the script with the password, never to an address a request names. It&amp;rsquo;s in the one &lt;code&gt;Proxy-Authorization&lt;/code&gt; header the local proxy adds, after it drops the client&amp;rsquo;s, and devvm&amp;rsquo;s proxy removes that header before it forwards a request. A &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s tunnel carries nothing of the local proxy&amp;rsquo;s after its head.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Web pages:&lt;/strong&gt; a page can reach the loopback as a server, but its requests are in origin form (&lt;code&gt;GET /&lt;/code&gt;), which the local proxy refuses with &lt;code&gt;400&lt;/code&gt; before it connects anywhere. A page can&amp;rsquo;t send a &lt;code&gt;CONNECT&lt;/code&gt; or an absolute-form request line, and DNS rebinding changes only the &lt;code&gt;Host&lt;/code&gt; header, so a page can&amp;rsquo;t use the local proxy to reach the VM&amp;rsquo;s proxy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One request per connection:&lt;/strong&gt; a request that isn&amp;rsquo;t a &lt;code&gt;CONNECT&lt;/code&gt; goes with &lt;code&gt;Connection: close&lt;/code&gt;, because the local proxy reads only a connection&amp;rsquo;s first head, so no later request on the connection reaches the VM&amp;rsquo;s proxy without the password, as it would otherwise get &lt;code&gt;407&lt;/code&gt; and the browser&amp;rsquo;s prompt.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The file:&lt;/strong&gt; &lt;code&gt;/usr/local/bin/devvm-local-proxy&lt;/code&gt; holds the password, mode 700 and the VM&amp;rsquo;s user&amp;rsquo;s, which is stricter than the VM&amp;rsquo;s &lt;code&gt;/etc/environment&lt;/code&gt;, where the same password already is.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tier holds as it is: the VM&amp;rsquo;s proxy decides each request the local proxy sends, and a host the tier doesn&amp;rsquo;t allow gets its &lt;code&gt;403&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;desktop&lt;/code&gt; (Lima): a VM of base without the desktop&amp;rsquo;s programs, which &lt;code&gt;devvm desktop&lt;/code&gt; refuses (&lt;code&gt;desktop_no_layer&lt;/code&gt;); then a VM with the &lt;code&gt;desktop&lt;/code&gt; layer on the allowlist tier: the relay on &lt;code&gt;127.0.0.1&lt;/code&gt; alone, its port and password in the VM&amp;rsquo;s state; a wrong password refused, the password let in, with the VM&amp;rsquo;s ServerInit and a screen update (&lt;code&gt;TestE2EDesktop&lt;/code&gt;); &lt;code&gt;Xvnc&lt;/code&gt; on its user&amp;rsquo;s socket (700, 600) and no TCP port, the clipboard off; the password in no file of the VM&amp;rsquo;s, no run log and no host process&amp;rsquo;s arguments while &lt;code&gt;devvm desktop&lt;/code&gt; started; the self-check passed and no direct connection out, nor to the desktop&amp;rsquo;s port on this machine; the Xfce session&amp;rsquo;s proxy variables set to the local proxy, which listens on &lt;code&gt;127.0.77.1:3128&lt;/code&gt; alone, takes curl without a password to an allowed host, gives a blocked one the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt; (&lt;code&gt;CONNECT&lt;/code&gt; and plain HTTP), refuses an origin-form request with &lt;code&gt;400&lt;/code&gt;, and isn&amp;rsquo;t forwarded to this machine; root&amp;rsquo;s own server in place of &lt;code&gt;Xvnc&lt;/code&gt; (no password, its socket anyone&amp;rsquo;s, recording what reaches it): a wrong viewer never reaches it, and the viewer&amp;rsquo;s clipboard never does while its key event does; Ctrl+C closing the port; &lt;code&gt;--clipboard&lt;/code&gt; on the same port, the clipboard on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt; the VM&amp;rsquo;s clipboard sent to a viewer that takes it, by a server root changed; Screen Sharing itself, which no check drives, so its messages are the relay&amp;rsquo;s reading of the protocol; a program on this machine with the password, which reaches the desktop as you do; a program on this machine, or a VM that reaches this machine&amp;rsquo;s loopback, that keeps the relay&amp;rsquo;s 8 connections busy or keeps failing its check, which keeps viewers out for as long as it does, and gets no further; the browsers themselves, which no check drives, so that they read the session&amp;rsquo;s proxy variables rests on Chrome&amp;rsquo;s and Firefox&amp;rsquo;s documented behavior on Xfce, and the local proxy&amp;rsquo;s handling of requests on its unit test (&lt;code&gt;netpolicy&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TestLocalProxy&lt;/code&gt;) and curl.&lt;/p&gt;
&lt;h2 data-hextra-search-id="pasting-images"&gt;Pasting images&lt;span class="hx:absolute hx:-mt-20" id="pasting-images"&gt;&lt;/span&gt;
&lt;a href="#pasting-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm paste&lt;/code&gt; gets an image, a PDF, or one copied file, from this machine&amp;rsquo;s clipboard to an agent in the VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#pasting-images"&gt;how&lt;/a&gt;). It keeps four things. The VM gets the clipboard only when you run the command, and only an image, a PDF or a copied file. A copied file goes only after you say yes to its path on this machine (&lt;code&gt;paste_file_ask&lt;/code&gt;), because the clipboard can name any file of yours, such as one a web page or another program put there. Nothing the VM says reaches your clipboard. And devvm leaves no process of its own running for it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--send-file&lt;/code&gt; answers the question only for a file below the folder the VM mounts, which the VM can read already. &lt;code&gt;confirmFile&lt;/code&gt; decides with &lt;code&gt;sendFileAnswers&lt;/code&gt;: &lt;code&gt;inFolder&lt;/code&gt; compares the cleaned path that &lt;code&gt;OpenNoLinks&lt;/code&gt; opened with the folder&amp;rsquo;s physical path, and &lt;code&gt;OpenNoLinks&lt;/code&gt; must have followed no link at all, because a root-owned link below the folder, such as one a root container made on a Linux host, can lead anywhere. It never answers for a &lt;code&gt;--clone&lt;/code&gt; VM. A file anywhere else is refused where devvm can&amp;rsquo;t ask (&lt;code&gt;paste_file_outside&lt;/code&gt;), and so is one reached through a link (&lt;code&gt;paste_file_through_link&lt;/code&gt;), so a hotkey or a script can&amp;rsquo;t send a file it never showed. There&amp;rsquo;s no list of credential folders that devvm refuses outright, because it could never name every place a key is kept, and the question shows every path.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;internal/platform&lt;/code&gt;&amp;rsquo;s clipboard readers, &lt;code&gt;vm.Paste&lt;/code&gt;, and &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;paste-dir&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On macOS, &lt;code&gt;clipboard_darwin.go&lt;/code&gt; runs &lt;code&gt;osascript&lt;/code&gt; with a JavaScript for Automation script through &lt;code&gt;NSPasteboard&lt;/code&gt;. The script takes a PDF (&lt;code&gt;com.adobe.pdf&lt;/code&gt;) first, as it is, before the picture of it and the temporary file of its own that Preview puts beside it. Then it asks for file URLs alone (&lt;code&gt;readObjectsForClasses&lt;/code&gt; with &lt;code&gt;NSPasteboardURLReadingFileURLsOnlyKey&lt;/code&gt;), counts several and reports one&amp;rsquo;s path. Otherwise it writes a PNG, JPEG, GIF or WebP as it is, or a TIFF made a PNG, to a file in a private folder devvm makes and deletes, only when it&amp;rsquo;s within the cap. The copy back is &lt;code&gt;pbcopy&lt;/code&gt;. Both tools run by their paths in &lt;code&gt;/usr/bin&lt;/code&gt;, never found on &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On Linux, &lt;code&gt;clipboard_linux.go&lt;/code&gt; runs &lt;code&gt;wl-paste --list-types&lt;/code&gt; and &lt;code&gt;--type&lt;/code&gt; on Wayland, and &lt;code&gt;xclip&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TARGETS&lt;/code&gt; and &lt;code&gt;-t&lt;/code&gt; on X11, taking &lt;code&gt;application/pdf&lt;/code&gt; before a file reference and the image types. The copy back is &lt;code&gt;wl-copy&lt;/code&gt; or &lt;code&gt;xclip -i&lt;/code&gt;. Each comes from the first of &lt;code&gt;/usr/bin&lt;/code&gt;, &lt;code&gt;/bin&lt;/code&gt;, &lt;code&gt;/usr/local/bin&lt;/code&gt; and NixOS&amp;rsquo;s &lt;code&gt;/run/current-system/sw/bin&lt;/code&gt; that has it, never from &lt;code&gt;PATH&lt;/code&gt;, because &lt;code&gt;PATH&lt;/code&gt; can hold a project&amp;rsquo;s folder, such as direnv&amp;rsquo;s &lt;code&gt;PATH_add&lt;/code&gt; or &lt;code&gt;node_modules/.bin&lt;/code&gt;, and the VM writes those.&lt;/p&gt;
&lt;p&gt;Every clipboard tool runs with &lt;code&gt;exec.CommandContext&lt;/code&gt; (&lt;code&gt;clipboard_tool.go&lt;/code&gt;), and devvm reads its output, never through the run log, so the image stays out of it. Each tool is stopped after 30 seconds, as a tool waits on a program that holds the clipboard and doesn&amp;rsquo;t answer: a read gives &lt;code&gt;paste_tool_slow&lt;/code&gt;, and a copy back gives a warning. Its pipes are closed a second after it ends, as a child of its may keep them.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;vm.Paste&lt;/code&gt; (&lt;code&gt;internal/vm/paste.go&lt;/code&gt;) finds the VM as every command does, refuses a stopped one, and reads the clipboard before touching the VM. It names the file on this machine: &lt;code&gt;paste-YYYYMMDD-HHMMSS-8hex&lt;/code&gt;, then the image&amp;rsquo;s or the PDF&amp;rsquo;s extension, or the copied file&amp;rsquo;s when it&amp;rsquo;s letters and digits alone and at most 16 of them, and nothing else of the file&amp;rsquo;s name. It runs &lt;code&gt;assets/guest/paste.sh&lt;/code&gt; in the VM as &lt;code&gt;sh -c&lt;/code&gt;&amp;rsquo;s script, so nothing of it is left on disk. &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;paste-dir&lt;/code&gt; (&lt;code&gt;settings.PasteDir&lt;/code&gt;) is the folder in every VM, which each launch makes through &lt;code&gt;sync.sh&lt;/code&gt; (&lt;code&gt;DEVVM_PASTE_DIR&lt;/code&gt;), mode 700 and the user&amp;rsquo;s own.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why push, not pull.&lt;/strong&gt; A VM that pulls the clipboard on Ctrl+V, through a stand-in &lt;code&gt;xclip&lt;/code&gt; and a channel to this machine, would need three things. It would need a server of devvm&amp;rsquo;s on this machine for as long as a session lasts, and devvm runs &lt;code&gt;limactl shell&lt;/code&gt; in its own place, so no devvm process exists during a session. It would need a remote forward into the VM&amp;rsquo;s sshd, which allows them on &lt;code&gt;127.77.0.0/16&lt;/code&gt; alone, for links. And anything in the VM could read your clipboard at any moment while a session is open, a screenshot of your password manager included. With push, only the host starts the transfer, and only an image, a PDF or a file crosses. Stand-ins for &lt;code&gt;xclip&lt;/code&gt; and &lt;code&gt;wl-paste&lt;/code&gt; in the VM would reach only Claude Code and pi, because Codex and opencode read X11 or Wayland in their own process, and both already handle a pasted path.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the VM can&amp;rsquo;t do.&lt;/strong&gt; It can&amp;rsquo;t ask for the clipboard, because devvm reads it once, when you run the command. devvm asks only for a file&amp;rsquo;s reference, a PDF and image types, never text, then checks an image&amp;rsquo;s or a PDF&amp;rsquo;s bytes against the type (&lt;code&gt;http.DetectContentType&lt;/code&gt;, for which a PDF starts with &lt;code&gt;%PDF-&lt;/code&gt;). Text is never taken for a file. AppleScript&amp;rsquo;s &lt;code&gt;the clipboard as «class furl»&lt;/code&gt; makes any text a path, &lt;code&gt;/Users/you/.ssh/id_ed25519&lt;/code&gt; as it is and &lt;code&gt;hello&lt;/code&gt; as &lt;code&gt;/hello&lt;/code&gt;, so the macOS reader asks &lt;code&gt;NSPasteboard&lt;/code&gt; for file URLs alone, which text never gives. A copied file whose path can&amp;rsquo;t be found is refused (&lt;code&gt;paste_file_gone&lt;/code&gt;) rather than Finder&amp;rsquo;s icon beside it sent.&lt;/p&gt;
&lt;p&gt;It can&amp;rsquo;t write to your clipboard. The path is built on this machine from &lt;code&gt;paste-dir&lt;/code&gt; and a name devvm picks, both from a fixed set of characters, before the VM runs anything. Of a copied file&amp;rsquo;s own name only its extension is kept, letters and digits alone, because a file in the project folder is named by the VM. So what reaches your clipboard is devvm&amp;rsquo;s own path, with no space, quote or newline in it, which can&amp;rsquo;t run anything when you paste it into a terminal.&lt;/p&gt;
&lt;p&gt;It can&amp;rsquo;t keep devvm reading or waiting. The one thing devvm reads back from the VM is a count, parsed as a whole number from bounded output. Each of &lt;code&gt;paste.sh&lt;/code&gt;&amp;rsquo;s commands is stopped once it prints past 32 bytes on stdout or 4 MiB on stderr, so a VM that prints without end can&amp;rsquo;t keep devvm reading. It&amp;rsquo;s also stopped past its time, 10 minutes for &lt;code&gt;put&lt;/code&gt;, which carries up to 64 MiB, and 2 for &lt;code&gt;count&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt;, so a VM that never answers can&amp;rsquo;t keep devvm waiting. The command then fails as it does for any other failure of the script (&lt;code&gt;paste_not_sent&lt;/code&gt;, &lt;code&gt;paste_count_failed&lt;/code&gt;, &lt;code&gt;paste_rm_not_done&lt;/code&gt;). It gets no SSH agent, because the writes and counts go through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; as it is, never &lt;code&gt;target.exec&lt;/code&gt;, as the clone checks do.&lt;/p&gt;
&lt;p&gt;It can&amp;rsquo;t send a file of yours through a link. A copied file may be in the project folder, which the VM writes, so its path is cleaned, never resolved first, and opened as named following no link but the system&amp;rsquo;s. &lt;code&gt;platform.OpenNoLinks&lt;/code&gt; opens each component from its parent with &lt;code&gt;O_NOFOLLOW&lt;/code&gt;, through &lt;code&gt;golang.org/x/sys/unix&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Openat&lt;/code&gt;, because the standard library exports no &lt;code&gt;Openat&lt;/code&gt; on macOS and &lt;code&gt;internal/safefile&lt;/code&gt; is standard library only. It reads a link on the way with &lt;code&gt;Readlinkat&lt;/code&gt; and follows it only when &lt;code&gt;Fstatat&lt;/code&gt; says root owns it, and the folder&amp;rsquo;s &lt;code&gt;Fstat&lt;/code&gt; says root owns that too and neither its group nor others can write it, as for macOS&amp;rsquo;s &lt;code&gt;/tmp&lt;/code&gt;, &lt;code&gt;/var&lt;/code&gt; and &lt;code&gt;/etc&lt;/code&gt; in &lt;code&gt;/&lt;/code&gt;, for at most 40 hops. Root owning the link isn&amp;rsquo;t enough on its own, because a link of root&amp;rsquo;s can be hard-linked into a folder of yours, and in a folder only root can change, no one else can swap the link between its &lt;code&gt;Fstatat&lt;/code&gt; and its &lt;code&gt;Readlinkat&lt;/code&gt;. It never follows the file itself, and it opens it with &lt;code&gt;O_NONBLOCK&lt;/code&gt; and &lt;code&gt;O_NOCTTY&lt;/code&gt;, so a FIFO never makes devvm wait and a terminal never becomes devvm&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;A link the VM makes in a mount is the user&amp;rsquo;s on this machine, never root&amp;rsquo;s. So a link in the file&amp;rsquo;s place, a folder&amp;rsquo;s link planted before the copy or swapped in after it, and a copied folder&amp;rsquo;s reference whose trailing slash hid a link all fail (&lt;code&gt;paste_file_link&lt;/code&gt;) rather than send what they point to, and your own links do too. Every step goes through a file descriptor, so there&amp;rsquo;s no moment for a swap between a check and the open. The file opened is then checked and read as every file a VM can write is, by &lt;code&gt;internal/safefile&lt;/code&gt; (&lt;code&gt;Checked&lt;/code&gt;, then &lt;code&gt;ReadAll&lt;/code&gt;): a regular file within the cap of 64 MiB, the cap an image is held to as well.&lt;/p&gt;
&lt;p&gt;In the VM, &lt;code&gt;paste.sh&lt;/code&gt; writes with &lt;code&gt;umask 077&lt;/code&gt; to a &lt;code&gt;.part&lt;/code&gt; name and renames it, and it refuses a &lt;code&gt;paste-dir&lt;/code&gt; that&amp;rsquo;s a link, not a folder or not the user&amp;rsquo;s. Its &lt;code&gt;count&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; see only regular files at the folder&amp;rsquo;s top level with devvm&amp;rsquo;s names, never anything else in a folder that may be yours. Root in the VM can get around any check the VM runs, which gives it nothing it couldn&amp;rsquo;t do to a file in the project folder.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What&amp;rsquo;s left on this machine:&lt;/strong&gt; on Linux, &lt;code&gt;wl-copy&lt;/code&gt; or &lt;code&gt;xclip&lt;/code&gt; serves the path until you copy something else, because a Linux clipboard&amp;rsquo;s contents live in the program that copied them. It isn&amp;rsquo;t devvm&amp;rsquo;s process, and devvm runs it with no pipes on its output, because Go&amp;rsquo;s &lt;code&gt;Wait&lt;/code&gt; waits for a child that inherited them. On macOS, nothing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section): with stand-in clipboard tools in a test build&amp;rsquo;s &lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;, &lt;code&gt;devvm paste --json&lt;/code&gt; puts the copied image into the running VM, where its SHA-256 matches, mode 600 in the folder of mode 700, and the stand-in copier got the path. &lt;code&gt;devvm paste rm --force&lt;/code&gt; deletes it and leaves a file of the user&amp;rsquo;s in the folder, and a stopped VM is refused before the clipboard is read.&lt;/p&gt;
&lt;p&gt;The CLI tests (&lt;code&gt;testdata/script/paste.txtar&lt;/code&gt;, &lt;code&gt;paste_rm.txtar&lt;/code&gt;) drive the rest against the stubs: the types read, the bytes sent, each refusal, the launch&amp;rsquo;s offer and &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;paste-dir&lt;/code&gt;. On macOS, &lt;code&gt;TestReadClipPasteboard&lt;/code&gt; runs the real script against a pasteboard of the test&amp;rsquo;s own, never the clipboard. Text that&amp;rsquo;s a path or a &lt;code&gt;file://&lt;/code&gt; URL is no file, nor is a &lt;code&gt;file://&lt;/code&gt; URL as &lt;code&gt;public.url&lt;/code&gt;. A file URL with Finder&amp;rsquo;s &lt;code&gt;.icns&lt;/code&gt; icon beside it is the file, a file reference URL is resolved, two files are counted, and a file that&amp;rsquo;s gone is refused. A PNG and a TIFF are read as PNGs, beside text too. A PDF is read as it is, beside its picture and beside the temporary file a thumbnail copied in Preview names, while a file URL beside a JPEG, as Photos copies, is the file. One past the cap is refused before it&amp;rsquo;s written.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt; the real clipboard, which no automated check reads. The copies of Finder (one file URL per file, with an &lt;code&gt;.icns&lt;/code&gt; icon), Photos (a JPEG and a file URL), Preview (a PDF with a TIFF, and a thumbnail&amp;rsquo;s temporary file beside them), and Safari, Chrome and Firefox (a TIFF or a PNG) were checked by hand on macOS, and &lt;code&gt;TestReadClipPasteboard&lt;/code&gt; writes the same types to its own pasteboard, so a change in what an app copies would need checking by hand again. Also not covered: image types other than PNG, JPEG, GIF, WebP and TIFF, which devvm doesn&amp;rsquo;t read on macOS; whether macOS asks before &lt;code&gt;osascript&lt;/code&gt; reads the clipboard, which depends on the release and its privacy settings; Linux&amp;rsquo;s clipboard tools, which only the stubs stand in for; and the agents&amp;rsquo; own reading of a pasted path, which their releases change.&lt;/p&gt;
&lt;h2 data-hextra-search-id="bases-image-and-packages"&gt;Base&amp;rsquo;s image and packages&lt;span class="hx:absolute hx:-mt-20" id="bases-image-and-packages"&gt;&lt;/span&gt;
&lt;a href="#bases-image-and-packages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;base starts from the newest Ubuntu cloud image on each machine, and its packages are the newest when each key of base first builds, so devvm&amp;rsquo;s own files pin neither and need no bumps (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;how&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;packages&lt;/a&gt;). What it trusts, and where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The image:&lt;/strong&gt; Ubuntu&amp;rsquo;s cloud image key alone, pinned in devvm&amp;rsquo;s files. devvm checks the release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; signature itself, in Go, so a host without &lt;code&gt;gpgv&lt;/code&gt; checks it too, and a bad signature is refused, never passed over for an older release. The listing that names the newest release is unsigned, so a server or network that can change it can only hold devvm back to an older signed release, over HTTPS. The signed &lt;code&gt;SHA256SUMS&lt;/code&gt; names files, not its release, so such a server could also serve an older release&amp;rsquo;s files under a newer release&amp;rsquo;s name, which devvm then records as the pin; that holds base back the same way, and it makes the package check&amp;rsquo;s date stricter, not looser. The pinned SHA-256 then decides every later download.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The packages:&lt;/strong&gt; Ubuntu&amp;rsquo;s archive key, through apt in the build VM, which holds nothing but Ubuntu&amp;rsquo;s image and devvm&amp;rsquo;s own scripts while it records. A mirror only serves files, and apt checks each against the archive key, so &lt;code&gt;ubuntu-mirror&lt;/code&gt; can&amp;rsquo;t install a package Ubuntu didn&amp;rsquo;t publish. Ubuntu&amp;rsquo;s &lt;code&gt;InRelease&lt;/code&gt; files carry no &lt;code&gt;Valid-Until&lt;/code&gt;, and the build VM has no lists before, so a stale or hostile mirror, or anyone on an &lt;code&gt;http://&lt;/code&gt; path to one, can serve an older signed state of the archive. devvm refuses one older than the archive state the pinned cloud image was built from, naming the mirror (&lt;code&gt;packages_stale_mirror&lt;/code&gt;, &lt;code&gt;packages_stale&lt;/code&gt; without one): every pocket but the release&amp;rsquo;s must be dated no more than a day before the image&amp;rsquo;s release, and the release pocket no earlier than Ubuntu&amp;rsquo;s release day (&lt;code&gt;Release.Stale&lt;/code&gt;). So a recorded state is never older than the pinned image. A mirror that fell behind after the pinned release still gets recorded, so freshness past the pin&amp;rsquo;s date rests on the mirror, and on HTTPS for Ubuntu&amp;rsquo;s own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The cache:&lt;/strong&gt; a first build records what its own apt checked, and devvm checks it again on this machine before it keeps anything. The build hands back the &lt;code&gt;InRelease&lt;/code&gt; files and package lists apt used, and devvm verifies each &lt;code&gt;InRelease&lt;/code&gt; with Ubuntu&amp;rsquo;s archive key, pinned in its files, in Go (&lt;code&gt;pgp.go&lt;/code&gt;&amp;rsquo;s clearsigned messages). Each list must be one a verified &lt;code&gt;InRelease&lt;/code&gt; gives the SHA-256 and size of, and each package one a list gives the SHA-256 of, so the recording VM can&amp;rsquo;t add a package Ubuntu didn&amp;rsquo;t publish, even with root, and the set keeps the archive&amp;rsquo;s own entry for each package. devvm keeps each file under its own SHA-256 and each key&amp;rsquo;s set once. What comes back from the VM is checked for shape, hashes and size (at most 20,000 entries and 16 GiB of packages, 2 GiB of lists) before anything is kept, so a build VM can&amp;rsquo;t put a file under another file&amp;rsquo;s name, change another key&amp;rsquo;s set, or write outside the cache. A key&amp;rsquo;s set is never written again, so a later build can&amp;rsquo;t change it either. The recording VM can&amp;rsquo;t record an older version than apt would install either: the build must hand back &lt;code&gt;resolute-updates&lt;/code&gt;&amp;rsquo; and &lt;code&gt;resolute-security&lt;/code&gt;&amp;rsquo;s &lt;code&gt;InRelease&lt;/code&gt; files with lists for the recorded packages&amp;rsquo; architectures, and every non-empty list that each &lt;code&gt;InRelease&lt;/code&gt; it hands back gives for the recorded packages&amp;rsquo; architectures, and devvm refuses a package that the release pocket, &lt;code&gt;-updates&lt;/code&gt; or &lt;code&gt;-security&lt;/code&gt; lists a newer version of, ordered as &lt;code&gt;dpkg --compare-versions&lt;/code&gt; orders them (&lt;code&gt;packages_lists_missing&lt;/code&gt;, &lt;code&gt;packages_not_newest&lt;/code&gt;). apt in the build takes phased updates too, so the newest version is what it installs. A replay checks each file&amp;rsquo;s SHA-256 on this machine before it sends it, and apt in the VM checks it again against the set&amp;rsquo;s entry. Replays trust apt&amp;rsquo;s entries as recorded (&lt;code&gt;trusted=yes&lt;/code&gt; on a local repository of files devvm checked), because the archive&amp;rsquo;s signature covers the archive&amp;rsquo;s lists, not a set of packages taken from them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What it doesn&amp;rsquo;t stop:&lt;/strong&gt; anything with root in the recording VM before &lt;code&gt;apt.sh end&lt;/code&gt; (a feature&amp;rsquo;s script, a compromised pinned download) chooses which of Ubuntu&amp;rsquo;s signed packages get recorded, because the host checks that each package is the archive&amp;rsquo;s and the newest that the lists handed back have, not that apt chose it. It can record a package base doesn&amp;rsquo;t ask for, or one from &lt;code&gt;-backports&lt;/code&gt;, but never one from &lt;code&gt;-proposed&lt;/code&gt;. It can also hand back an older signed state of &lt;code&gt;-updates&lt;/code&gt; and &lt;code&gt;-security&lt;/code&gt; than the archive&amp;rsquo;s newest, dated as early as a day before the pinned image&amp;rsquo;s release, which the stale check allows, and record the newest versions of that state. Every later build of that key replays what it recorded, as the same image would. It can also change the image itself, which the image&amp;rsquo;s key doesn&amp;rsquo;t cover. &lt;code&gt;devvm rebuild base&lt;/code&gt; records anew. Packages for &lt;code&gt;--from&lt;/code&gt; bases and for layers come from their sources as they are, unpinned.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Breakage from upstream:&lt;/strong&gt; users now build from images and packages that e2e hasn&amp;rsquo;t run. If the newest image doesn&amp;rsquo;t boot, a first build tries the release before it (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;how&lt;/a&gt;), which covers a release whose kernel Lima can&amp;rsquo;t start, but not packages that break base.sh or a VM later. A scheduled build of base from the newest image and packages, on CI or the test machines, should catch a break before users do; it isn&amp;rsquo;t built yet.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="shared-tools"&gt;Shared tools&lt;span class="hx:absolute hx:-mt-20" id="shared-tools"&gt;&lt;/span&gt;
&lt;a href="#shared-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each tool version is one compressed EROFS image, loop-mounted read-only in each VM from a read-only share (&lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Measured (macOS):&lt;/strong&gt; ten tools take 0.85 GB as images (1.5 GB installed), once for every VM and mix. Start times from an image match a local disk warm (&lt;code&gt;node -e 0&lt;/code&gt; 13 ms vs 14 ms, &lt;code&gt;claude --version&lt;/code&gt; 3 ms), and are 10–30 ms slower cold. Mounting five images takes 0.15 s; VM start is unchanged.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Why images, not a shared folder:&lt;/strong&gt; tools run from a virtiofs folder were about 3× slower warm (&lt;code&gt;node -e 0&lt;/code&gt; 38 ms, &lt;code&gt;claude --version&lt;/code&gt; 30 ms), the Mac&amp;rsquo;s case-insensitive disk collided 33 file names in Python&amp;rsquo;s terminfo, and mise&amp;rsquo;s version links failed in a read-only folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Why not per-tool layers:&lt;/strong&gt; an image chain for every mix of languages and agents repeats each agent&amp;rsquo;s files in every mix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where they build:&lt;/strong&gt; a tool image is shared by every VM whose tools need its key, and its build runs whatever runs as root in its build VM, so the key alone can&amp;rsquo;t keep one VM&amp;rsquo;s base out of another VM&amp;rsquo;s tools. A glibc tool image therefore always builds in a clone of devvm&amp;rsquo;s own Ubuntu base, on every backend, even for a VM on a &lt;code&gt;--from&lt;/code&gt; Debian or Ubuntu image, whose code would otherwise run as root in the build of images that Ubuntu VMs then mount. &lt;code&gt;--from&lt;/code&gt; VMs mount those images, because the tools are their projects&amp;rsquo; own prebuilt releases, which run on any glibc new enough, and devvm still refuses a tool that needs a newer glibc than the image has (&lt;a href="https://next.devvm.dev/docs/using/from/#shared-tools-and-glibc"&gt;shared tools and glibc&lt;/a&gt;). A musl tool image can only build on Alpine, so it builds in the VM&amp;rsquo;s own &lt;code&gt;--from&lt;/code&gt; base, and its key hashes that base&amp;rsquo;s digest, so it&amp;rsquo;s only ever another VM&amp;rsquo;s on the same container image. Before it builds, devvm checks the base&amp;rsquo;s record against what the images are for, and refuses any other base (&lt;code&gt;tools_wrong_base&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;). The cost is a build of devvm&amp;rsquo;s own base for a &lt;code&gt;--from&lt;/code&gt; VM&amp;rsquo;s first glibc tools when it isn&amp;rsquo;t built yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM for each tool:&lt;/strong&gt; a tool&amp;rsquo;s installer runs as root in its build VM, and a tool image&amp;rsquo;s key hashes only its own tool&amp;rsquo;s inputs, so tools built together in one VM could write into each other&amp;rsquo;s images: through a shared work folder, a process left running until the next tool&amp;rsquo;s &lt;code&gt;mkfs.erofs&lt;/code&gt;, or root replacing &lt;code&gt;mise&lt;/code&gt; or &lt;code&gt;mkfs.erofs&lt;/code&gt; itself. A fresh folder for each tool and killing its processes wouldn&amp;rsquo;t stop root, so each tool builds in a VM of its own, with an output folder of its own, and only that tool&amp;rsquo;s image leaves it (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;). Measured on Fedora 43 (bare-metal x86_64, Lima with QEMU and KVM), building node, pnpm and bun took about 16 s in one VM and about 34 s in three, the same in two runs each, so each extra tool costs about 9 s, once for each tool version.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Why a tool that doesn&amp;rsquo;t mount fails the launch:&lt;/strong&gt; mise would otherwise download the same version into the VM on first use, which gives that VM a private copy, a download nobody asked for, and one that the VM&amp;rsquo;s tier may block, all without a word (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-share"&gt;how&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Instead of Nix:&lt;/strong&gt; Nix and NixOS were weighed as the way to deliver the shared tools and rejected, because NixOS breaks prebuilt binaries, and a Nix hidden under the tools shows through in read-only-store errors. The &lt;a href="https://next.devvm.dev/docs/internals/images/#the-nix-layer"&gt;&lt;code&gt;nix&lt;/code&gt; layer&lt;/a&gt; is separate, and you choose it. It gives a project that uses Nix a Nix of its own in its VM, with its own store and daemon, and the shared tools stay as they are beside it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-shared-nix-cache"&gt;The shared Nix cache&lt;span class="hx:absolute hx:-mt-20" id="the-shared-nix-cache"&gt;&lt;/span&gt;
&lt;a href="#the-shared-nix-cache" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;VMs with the nix layer share their downloads from cache.nixos.org through a cache that only the host fills (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;how&lt;/a&gt;). It&amp;rsquo;s the first thing that VMs share, so the design keeps two things: each VM&amp;rsquo;s Nix store stays its own, and no VM can change what another VM gets.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why a cache the host fills, not a shared store:&lt;/strong&gt; one store, or one daemon, shared between VMs is what Nix&amp;rsquo;s own store vulnerabilities break. CVE-2026-110450 (the daemon&amp;rsquo;s store corrupted through &lt;code&gt;repair&lt;/code&gt;), CVE-2026-39860 and the CVE-2024-27297 family (a fixed-output derivation that changes its output after Nix registered it) each let a client of the daemon change paths in its store, and in a shared store, every other VM would then trust those paths. A VM&amp;rsquo;s own builds are worse: a path a VM built has no signature that another VM could check, short of a key that trusts that VM, and then every VM trusts every other. A binary cache keeps the trust where Nix already has it. Each VM&amp;rsquo;s Nix fetches from the cache as from cache.nixos.org, checks cache.nixos.org&amp;rsquo;s signature and the &lt;code&gt;NarHash&lt;/code&gt; itself, and adds the path to its own store, so the cache only saves downloads.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the host checks, and what each VM checks:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The proxy (&lt;code&gt;internal/proxy/nixcache.go&lt;/code&gt;) takes only &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;HEAD&lt;/code&gt; of &lt;code&gt;nix-cache-info&lt;/code&gt;, &lt;code&gt;&amp;lt;32 nix32&amp;gt;.narinfo&lt;/code&gt; and &lt;code&gt;nar/&amp;lt;52 nix32&amp;gt;.nar&lt;/code&gt; with no suffix or &lt;code&gt;.xz&lt;/code&gt;, &lt;code&gt;.zst&lt;/code&gt; or &lt;code&gt;.bz2&lt;/code&gt;, with no query and nothing escaped (&lt;code&gt;nixPath&lt;/code&gt;, fuzzed by &lt;code&gt;FuzzNixPath&lt;/code&gt;), and &lt;code&gt;400&lt;/code&gt; for anything else. It makes up &lt;code&gt;nix-cache-info&lt;/code&gt; itself.&lt;/li&gt;
&lt;li&gt;It fetches from &lt;code&gt;https://cache.nixos.org&lt;/code&gt; alone, only when the VM&amp;rsquo;s policy allows &lt;code&gt;cache.nixos.org:443&lt;/code&gt; and, by &lt;a href="#rules-by-method-and-path"&gt;method and path&lt;/a&gt;, a &lt;code&gt;GET&lt;/code&gt; of the path the VM asked for (&lt;code&gt;policy.judge&lt;/code&gt;), through the floor or the company proxy (&lt;code&gt;dialOut&lt;/code&gt;), with the system&amp;rsquo;s roots and the user&amp;rsquo;s CAs, following no redirect, and sending only its own &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;User-Agent&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A narinfo is kept when its &lt;code&gt;StorePath&lt;/code&gt; is the path asked for, its URL is a NAR path of the pattern above, its hashes are SHA-256 in Nix&amp;rsquo;s base 32, each reference is a store path&amp;rsquo;s base name, and a &lt;code&gt;Sig&lt;/code&gt; by &lt;code&gt;cache.nixos.org-1&lt;/code&gt; (the Ed25519 key pinned in &lt;code&gt;nixKey&lt;/code&gt;) verifies over &lt;code&gt;1;StorePath;NarHash;NarSize;References&lt;/code&gt;, the references as full store paths, sorted and joined by commas (&lt;code&gt;parseNarinfo&lt;/code&gt;, against a narinfo of cache.nixos.org&amp;rsquo;s own in &lt;code&gt;internal/proxy/testdata/nix/&lt;/code&gt;). The bytes kept are cache.nixos.org&amp;rsquo;s, as they came.&lt;/li&gt;
&lt;li&gt;A narinfo&amp;rsquo;s URL must be named by its own &lt;code&gt;NarHash&lt;/code&gt; or &lt;code&gt;FileHash&lt;/code&gt;, since the URL isn&amp;rsquo;t signed. A NAR is fetched only after a narinfo this proxy checked names its URL (&lt;code&gt;nixKnown&lt;/code&gt;, at most 65536 entries), and kept only when its SHA-256 and size are that narinfo&amp;rsquo;s &lt;code&gt;FileHash&lt;/code&gt; and &lt;code&gt;FileSize&lt;/code&gt;, read through a limit of &lt;code&gt;FileSize&lt;/code&gt; plus one byte. A &lt;code&gt;HEAD&lt;/code&gt; never fetches one.&lt;/li&gt;
&lt;li&gt;Each VM&amp;rsquo;s Nix checks the signature again and the &lt;code&gt;NarHash&lt;/code&gt;, which the host can&amp;rsquo;t: the compression is xz or zstd, which aren&amp;rsquo;t in Go&amp;rsquo;s standard library, and &lt;code&gt;internal/proxy&lt;/code&gt; takes nothing else. The spike showed a VM&amp;rsquo;s Nix refuses both a narinfo with an added reference and a corrupted NAR.&lt;/li&gt;
&lt;li&gt;Files go into a temporary file in the folder (&lt;code&gt;.tmp-*&lt;/code&gt;, 600) and are renamed into place, in folders of 700. Not-found answers and errors are never kept, and the VM gets &lt;code&gt;404&lt;/code&gt;, so its Nix goes to cache.nixos.org itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The cap:&lt;/strong&gt; &lt;code&gt;nix-cache.size&lt;/code&gt;, 10 GiB when it&amp;rsquo;s off, passed in the proxy&amp;rsquo;s config as &lt;code&gt;nix_cache_max&lt;/code&gt;. Before a proxy writes a file, it takes the file&amp;rsquo;s room under an exclusive &lt;code&gt;flock&lt;/code&gt; on &lt;code&gt;.lock&lt;/code&gt; (&lt;code&gt;reserve&lt;/code&gt;), in whole 4 KiB blocks. When &lt;code&gt;.size&lt;/code&gt;, the running total, is missing or the new file would pass the cap, it counts the folder again, each file by the larger of its size and its blocks, and deletes the least recently used files, by modification time, which a hit sets, down to nine tenths of the cap. A NAR being fetched is made its full size at once and counts, but is never deleted, so a fetch that would pass the cap with them is refused. A fetch that fails gives its room back. One proxy fetches each NAR once however many requests ask for it, and at most four at once. A NAR whose &lt;code&gt;FileSize&lt;/code&gt; is over the cap isn&amp;rsquo;t fetched. devvm gc, its &lt;code&gt;--nix-cache&lt;/code&gt; and the daily retention run trim under the same lock (&lt;code&gt;TrimNixCache&lt;/code&gt;). A temporary file over an hour old is a dead proxy&amp;rsquo;s, and the next count deletes it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What stays open:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Timing and filling the cache:&lt;/strong&gt; &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;Attack vectors&lt;/a&gt; lists what one VM learns of another by how fast the cache answers, and how a VM that fills the cache to its cap pushes other VMs&amp;rsquo; paths out. Hiding the timing would mean waiting as long as a fetch on every hit, which is the saving.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Private caches&lt;/strong&gt; (Cachix, a &lt;code&gt;netrc&lt;/code&gt;) are never shared: only root in the VM can add a substituter, and Nix reaches it through the allowlist directly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Options weighed:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Nix&amp;rsquo;s local overlay store&lt;/strong&gt;, the VM&amp;rsquo;s store over a read-only lower store shared from the host. It works on Lima, but it&amp;rsquo;s still experimental in Nix 2.35, the lower store can&amp;rsquo;t change while it&amp;rsquo;s mounted, so sharing new paths means remounting, and a garbage collection by a daemon not set up for it writes whiteouts that hide lower paths from that VM for good.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Packages fetched into an image&lt;/strong&gt;, by a custom layer that runs &lt;code&gt;nix build&lt;/code&gt; while the image builds (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#sharing-a-teams-packages"&gt;the recipe&lt;/a&gt;). Clones share them on disk at no cost, but only what&amp;rsquo;s in the image, and a changed &lt;code&gt;flake.lock&lt;/code&gt; needs a rebuild.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open VMs:&lt;/strong&gt; every VM has its own proxy, an open one&amp;rsquo;s included, so open VMs share the cache through it, with the VM&amp;rsquo;s password, as confined ones do. Ruled out: a shared loopback listener without a password, because anything on the host or any VM that reaches the host&amp;rsquo;s loopback could use it; and the cache folder mounted read-only into VMs, which leaves the VM&amp;rsquo;s Nix to read the files and the host with nothing to fill it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Review&lt;/strong&gt; (the security-audit skill, on &lt;code&gt;nixcache.go&lt;/code&gt;, its callers and the VM&amp;rsquo;s setup):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;What a VM sends&lt;/strong&gt; (headers, a body, a query, an escaped path, another method): ruled out: &lt;code&gt;nixGet&lt;/code&gt; makes a request of its own from the checked path, the VM&amp;rsquo;s &lt;code&gt;User-Agent&lt;/code&gt; and path go only to its own event log, and what&amp;rsquo;s kept is cache.nixos.org&amp;rsquo;s body under a name of the pattern.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A path out of the folder&lt;/strong&gt; (&lt;code&gt;..&lt;/code&gt;, &lt;code&gt;%2e&lt;/code&gt;, a symlink): ruled out: the names hold only Nix&amp;rsquo;s base 32, which has no &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;%&lt;/code&gt;, and can&amp;rsquo;t be &lt;code&gt;.lock&lt;/code&gt;, &lt;code&gt;.size&lt;/code&gt; or &lt;code&gt;.tmp-*&lt;/code&gt;; the folder is in devvm&amp;rsquo;s data folder, which no backend mounts, so nothing in a VM can put a file or link there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Upstream elsewhere&lt;/strong&gt; (a redirect, DNS rebinding, a company proxy): ruled out: every dial is &lt;code&gt;dialOut(cache.nixos.org, 443)&lt;/code&gt;, through the floor or the company proxy as any request, &lt;code&gt;ServerName&lt;/code&gt; is fixed and no redirect is followed; the client is made after the user&amp;rsquo;s CAs are read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A NAR kept under another NAR&amp;rsquo;s name:&lt;/strong&gt; confirmed, fixed. A narinfo&amp;rsquo;s &lt;code&gt;URL&lt;/code&gt;, &lt;code&gt;FileHash&lt;/code&gt; and &lt;code&gt;FileSize&lt;/code&gt; aren&amp;rsquo;t signed, so a bad upstream (or a CA in the user&amp;rsquo;s CA folder) could pair a real narinfo with another NAR&amp;rsquo;s URL and a file of its own, and every VM would then get that file for the other NAR, which its Nix refuses, until a trim. &lt;code&gt;parseNarinfo&lt;/code&gt; takes a URL only when it&amp;rsquo;s named by the narinfo&amp;rsquo;s own &lt;code&gt;NarHash&lt;/code&gt; or &lt;code&gt;FileHash&lt;/code&gt;, and a hit whose size isn&amp;rsquo;t that of the narinfo this proxy checked is dropped and fetched again; unit-tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The cap under many proxies:&lt;/strong&gt; confirmed, fixed. Files being fetched didn&amp;rsquo;t count and were written before any room was taken, so one VM&amp;rsquo;s parallel requests could put many NARs&amp;rsquo; worth on the host&amp;rsquo;s disk past the cap, and a small narinfo takes a whole block. Now a fetch takes its room under the lock first, makes its file its full size at once, and is refused when the files being fetched leave no room (&lt;code&gt;reserve&lt;/code&gt;); sizes count whole blocks; one proxy fetches each NAR once, however many ask, and at most four at once (&lt;code&gt;fetchOnce&lt;/code&gt;); a narinfo is written under the lock; unit-tested (40 writers at once, a full cache, eight requests for one NAR).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;HEAD&lt;/code&gt; that downloads:&lt;/strong&gt; confirmed, fixed: a &lt;code&gt;HEAD&lt;/code&gt; for a NAR the cache doesn&amp;rsquo;t have answers &lt;code&gt;404&lt;/code&gt; without fetching it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parser differences&lt;/strong&gt; (spaces, &lt;code&gt;\r&lt;/code&gt;, a key twice, references twice): ruled out: they only refuse, and each VM&amp;rsquo;s Nix parses and checks the bytes again, so no narinfo the host keeps means something else to Nix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One VM learning of another:&lt;/strong&gt; timing only: hits and fetches answer with the same bytes and headers (no &lt;code&gt;Last-Modified&lt;/code&gt; or &lt;code&gt;ETag&lt;/code&gt;), events go to the VM&amp;rsquo;s own log, &lt;code&gt;/blocked&lt;/code&gt; holds none of them, and errors in the body say nothing of the host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM&amp;rsquo;s own settings:&lt;/strong&gt; ruled out: &lt;code&gt;devvm-cache.conf&lt;/code&gt; and the &lt;code&gt;!include&lt;/code&gt; line are root&amp;rsquo;s, in that VM; only root is a trusted user, and root in a VM changes only its own Nix, while the cache takes nothing from any VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory:&lt;/strong&gt; ruled out: a narinfo is read up to 1 MiB, and &lt;code&gt;nixKnown&lt;/code&gt; holds at most 65536 entries per proxy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;nix&lt;/code&gt;): the VM&amp;rsquo;s Nix has the cache first and cache.nixos.org&amp;rsquo;s key alone; &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; comes through the cache, fetched by the host into the folder (files 600, folders 700); a VM&amp;rsquo;s &lt;code&gt;PUT&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;, a URL in the path, a query and &lt;code&gt;..&lt;/code&gt; get &lt;code&gt;400&lt;/code&gt;, a NAR no checked narinfo names and a path cache.nixos.org doesn&amp;rsquo;t have get &lt;code&gt;404&lt;/code&gt;, and the host keeps none of them; a second VM gets the first&amp;rsquo;s paths as hits and fetches none; after &lt;code&gt;devvm network open&lt;/code&gt;, the open VM&amp;rsquo;s nix-daemon still goes through its proxy and keeps the cache first.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-ca-per-vm"&gt;A CA per VM&lt;span class="hx:absolute hx:-mt-20" id="a-ca-per-vm"&gt;&lt;/span&gt;
&lt;a href="#a-ca-per-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To put a secret in, a VM&amp;rsquo;s proxy shows the VM certificates from a CA that the VM trusts, and inside the VM that CA vouches for any site. So each VM has CAs of its own, and the design keeps two things: a CA&amp;rsquo;s key never leaves this machine, and no VM&amp;rsquo;s proxy can make a certificate that another VM accepts (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;trust.InitCA&lt;/code&gt;, at each launch, whatever the VM&amp;rsquo;s tier, readies the VM&amp;rsquo;s current CA and its next one in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/ca/&lt;/code&gt; (&lt;code&gt;paths.VM.CA&lt;/code&gt;): ECDSA P-256, 30 days and an hour each, the next one starting a week and an hour before the current one ends. The proxy&amp;rsquo;s config names the four files (&lt;code&gt;ca&lt;/code&gt;, &lt;code&gt;ca_key&lt;/code&gt;, &lt;code&gt;ca_next&lt;/code&gt;, &lt;code&gt;ca_next_key&lt;/code&gt;) and their certificates&amp;rsquo; SHA-256 (&lt;code&gt;ca_sha256&lt;/code&gt;, &lt;code&gt;ca_next_sha256&lt;/code&gt;), so a replaced CA starts the proxy again. The proxy signs with the next CA from an hour after its start (&lt;code&gt;ca.signer&lt;/code&gt;), and the VM&amp;rsquo;s setup installs both certificates, &lt;code&gt;devvm-proxy.crt&lt;/code&gt; and &lt;code&gt;devvm-proxy-next.crt&lt;/code&gt;, so the switch needs neither a launch nor a new proxy. The guest never fetches a CA: its trust comes only from the setup that devvm sends over ssh at each launch.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its data isolation and lifecycle companion). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One VM&amp;rsquo;s CA signing for another:&lt;/strong&gt; ruled out. Each proxy&amp;rsquo;s config is devvm&amp;rsquo;s, mode 600 in the VM&amp;rsquo;s own run folder, and names only that VM&amp;rsquo;s files, and a VM reaches no other VM&amp;rsquo;s proxy without that VM&amp;rsquo;s password. A VM trusts only the certificates its own setup sends, and the setup removes any other &lt;code&gt;devvm-*.crt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The keys reaching a VM:&lt;/strong&gt; ruled out. The setup sends the two certificates and nothing else from the folder, &lt;code&gt;/ca.pem&lt;/code&gt; serves certificates only, and no VM mounts devvm&amp;rsquo;s data folder. The CLI tests check the setup&amp;rsquo;s files for a private key, and e2e searches the VM&amp;rsquo;s &lt;code&gt;/etc&lt;/code&gt;, &lt;code&gt;/home&lt;/code&gt;, &lt;code&gt;/root&lt;/code&gt; and &lt;code&gt;/usr/local&lt;/code&gt; for each key.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Key files:&lt;/strong&gt; the folder is mode 700 and each key mode 600, written whole through a temporary file. Fixed: the proxy read the CA&amp;rsquo;s files through &lt;code&gt;tls.LoadX509KeyPair&lt;/code&gt;, which follows links and takes any mode, and it now reads them as the user&amp;rsquo;s own regular files, not links, with a key no one else may read or write, of at most 64 KiB (&lt;code&gt;loadCA&lt;/code&gt;, &lt;code&gt;readPrivate&lt;/code&gt;). On macOS each VM&amp;rsquo;s CA folder is kept out of Time Machine at each launch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Expiry and rotation:&lt;/strong&gt; a CA lasts 30 days and an hour, and each certificate it makes a day, never past the CA&amp;rsquo;s end. Listed: the next CA&amp;rsquo;s key is on disk for up to 23 days before that CA starts, so a copy of it taken then works until that CA ends, up to 53 days after the copy. A VM that isn&amp;rsquo;t opened again stays verifiable for at least 30 days less an hour after its last launch, which is the trade the successor buys.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two launches of one VM at once:&lt;/strong&gt; fixed. &lt;code&gt;InitCA&lt;/code&gt; holds the CA folder&amp;rsquo;s lock, &lt;code&gt;run/ca/lock&lt;/code&gt;, while it reads and writes the CAs, so two launches at once take turns and never leave a key and a certificate from different runs (&lt;code&gt;TestInitCATogether&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lifecycle:&lt;/strong&gt; a remake keeps the VM&amp;rsquo;s folder and its CAs. &lt;code&gt;devvm rm&lt;/code&gt;, &lt;code&gt;devvm gc --orphans&lt;/code&gt; and the deletion of a VM whose creation was interrupted delete the folder with the keys. A change of tier keeps the CAs, because every tier&amp;rsquo;s proxy signs with them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Issuer confusion:&lt;/strong&gt; fixed before it could arise: each CA&amp;rsquo;s name holds its serial, so a VM&amp;rsquo;s two CAs never share a subject, which some verifiers look issuers up by.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clock skew:&lt;/strong&gt; the switch waits an hour past the next CA&amp;rsquo;s start, so a VM whose clock is up to an hour behind still accepts the certificates.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;network&lt;/code&gt;): two confined VMs have different CAs; each VM trusts its own two and none of the other&amp;rsquo;s, and its &lt;code&gt;/etc/ssl/devvm.pem&lt;/code&gt; holds the next one; no key is anywhere in the VM, and the keys are mode 600; each proxy serves its own CAs at &lt;code&gt;/ca.pem&lt;/code&gt;, and a certificate it presents for a bound host verifies with its own VM&amp;rsquo;s CAs and not with the other&amp;rsquo;s; &lt;code&gt;devvm rm&lt;/code&gt; deletes one VM&amp;rsquo;s CAs and leaves the other&amp;rsquo;s. The switch itself is checked by unit tests (&lt;code&gt;TestNextCASigns&lt;/code&gt;, &lt;code&gt;TestInitCASwitch&lt;/code&gt;), because it happens weeks after a launch.&lt;/p&gt;
&lt;h2 data-hextra-search-id="links-between-vms"&gt;Links between VMs&lt;span class="hx:absolute hx:-mt-20" id="links-between-vms"&gt;&lt;/span&gt;
&lt;a href="#links-between-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A link lets a program in one VM, the client, reach a TCP service in another VM, the target, by name, as in &lt;code&gt;postgres://db:5432/app&lt;/code&gt;. Links work on every tier, within the tier rule below. You run &lt;code&gt;devvm link publish 5432&lt;/code&gt; in the target&amp;rsquo;s folder to offer the port to any of your VMs, and &lt;code&gt;devvm link add db 5432&lt;/code&gt; in the client&amp;rsquo;s folder to reach it as &lt;code&gt;db:5432&lt;/code&gt; and &lt;code&gt;db.devvm.internal:5432&lt;/code&gt;. A link carries its connections over ssh through the host, so it uses neither VM&amp;rsquo;s network, and the design keeps every guarantee that the tiers&amp;rsquo; confinement and port forwarding give. The review of the code checks it against the threat check below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The rules:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A link is reached only by its name.&lt;/strong&gt; The client reaches the target&amp;rsquo;s port at the link&amp;rsquo;s short name and at &lt;code&gt;NAME.devvm.internal&lt;/code&gt;, and never at its own &lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt;, so &lt;code&gt;localhost:PORT&lt;/code&gt; in the client stays the client&amp;rsquo;s own. The short name is the target&amp;rsquo;s folder part, or the name given with &lt;code&gt;--as NAME&lt;/code&gt;, and the target&amp;rsquo;s full VM name is never a hostname. &lt;code&gt;.internal&lt;/code&gt; is reserved for private use, so &lt;code&gt;NAME.devvm.internal&lt;/code&gt; names no host on the internet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The target publishes.&lt;/strong&gt; A port is reached only once the target&amp;rsquo;s folder has published it with &lt;code&gt;devvm link publish&lt;/code&gt;, which offers it to any of your VMs. Each link is still made from the client&amp;rsquo;s folder, with &lt;code&gt;devvm link add&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A client links only to a target on its own tier or a stricter one.&lt;/strong&gt; A link joins the two VMs&amp;rsquo; trust (below), so a client linked to a target on a lower tier would reach more through the target than its own tier allows: an allowlist client linked to an internet or open target would reach the internet through it. devvm checks the rule when the link is made, at each launch of the client, on every connection, and when &lt;code&gt;devvm network&lt;/code&gt; gives the target a tier lower than the client&amp;rsquo;s or the client one higher than a target&amp;rsquo;s, both of which it refuses while such a link exists (&lt;code&gt;link_tier_mismatch&lt;/code&gt;). For a client on a confined tier, on every connection the target&amp;rsquo;s tier must also be enforced as the target runs (&lt;code&gt;netpolicy.Listed&lt;/code&gt;), not only recorded in its state: &lt;code&gt;devvm network allowlist&lt;/code&gt; on a running open target takes effect at its next start, and a target whose self-check failed may reach the internet directly, so until then the connection is refused as &lt;code&gt;unenforced&lt;/code&gt;. &lt;code&gt;devvm link add&lt;/code&gt;, &lt;code&gt;devvm link publish&lt;/code&gt; of a port such a client links to, and the client&amp;rsquo;s launch warn of a running target in this state with the same check (&lt;code&gt;link_target_unenforced&lt;/code&gt;), refusing nothing, and a stopped target isn&amp;rsquo;t warned of, because its tier applies when it next starts. An open client may link to a target on any tier.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A connection never starts a VM.&lt;/strong&gt; A connection to a stopped target fails, and devvm logs why in the client&amp;rsquo;s event log, but the target stays stopped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm records links on the host,&lt;/strong&gt; in each VM&amp;rsquo;s state under &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, never in a project folder or a VM. The client&amp;rsquo;s VM gets only the names and addresses it needs, which devvm checks before it sends them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;A link joins the two VMs&amp;rsquo; trust.&lt;/strong&gt; Code in the client can often run code in the target through the target&amp;rsquo;s own service, such as Postgres&amp;rsquo;s &lt;code&gt;COPY … TO PROGRAM&lt;/code&gt;, and it then has whatever the target has: its network, the secrets its proxy puts into requests, and its project folder. devvm doesn&amp;rsquo;t try to stop that, because it&amp;rsquo;s the service&amp;rsquo;s own behavior. So a link is safe only between VMs you&amp;rsquo;d trust with each other&amp;rsquo;s reach, and &lt;code&gt;devvm link add&lt;/code&gt; says so when it makes one. The tier rule above keeps a link from widening the client&amp;rsquo;s tier.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s identity.&lt;/strong&gt; Every VM gets a random ID when devvm makes it, recorded in its state. A link records the target&amp;rsquo;s VM name and its ID when it&amp;rsquo;s made, so a VM made again in the target&amp;rsquo;s folder, which has the same name and a new ID, isn&amp;rsquo;t the linked target, and a second VM with the same folder name that appears later changes nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Which VM a link names.&lt;/strong&gt; &lt;code&gt;devvm link add TARGET PORT&lt;/code&gt; takes a VM&amp;rsquo;s full name, its ssh alias (&lt;code&gt;devvm-&amp;lt;folder&amp;gt;&lt;/code&gt;, as its state records it), a folder&amp;rsquo;s path, or a folder&amp;rsquo;s name, which is matched against the folder that each VM&amp;rsquo;s state records, so a VM whose backend cut its name still matches its whole folder name. A folder name that matches several VMs is refused, with each VM and its folder listed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The published ports&lt;/strong&gt; are in the target&amp;rsquo;s state, a list of ports and ranges as &lt;code&gt;devvm ports&lt;/code&gt; takes them, without &lt;code&gt;all&lt;/code&gt;. &lt;code&gt;devvm link unpublish&lt;/code&gt; takes ports out of the list, and a link to a port that isn&amp;rsquo;t published is refused on its next connection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An address per target.&lt;/strong&gt; Each target a client links to gets an address of its own in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, chosen when the first link to it is made and kept for every port of that target in that client, so two targets can share a port. The client listens on the target&amp;rsquo;s own port, so &lt;code&gt;devvm link add db 80&lt;/code&gt; listens on port 80. The addresses are internal and appear only on these pages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Names in the client.&lt;/strong&gt; The setup that devvm sends at each launch writes a block marked &lt;code&gt;# devvm links begin&lt;/code&gt; and &lt;code&gt;# devvm links end&lt;/code&gt; into the client&amp;rsquo;s &lt;code&gt;/etc/hosts&lt;/code&gt;, with a line &lt;code&gt;127.77.x.y NAME NAME.devvm.internal&lt;/code&gt; for each target, and replaces the block whole, writing the file in place rather than renaming over it. devvm sends the same block over ssh as root when links change on a running client, and it applies at once. No link name goes into &lt;code&gt;NO_PROXY&lt;/code&gt; or &lt;code&gt;no_proxy&lt;/code&gt;, which name the VM alone, because a running VM can&amp;rsquo;t take a new environment: HTTP clients with the VM&amp;rsquo;s proxy settings reach a link through the proxy (below). So a change of links changes no VM&amp;rsquo;s environment, restarts no daemon, and on Lima runs no &lt;code&gt;limactl edit&lt;/code&gt;, which would give the VM new ssh host keys.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The client&amp;rsquo;s sshd.&lt;/strong&gt; Every VM&amp;rsquo;s sshd allows remote forwards to &lt;code&gt;127.77.0.0/16&lt;/code&gt; alone, with one rule written when the image is built, so no link rewrites or reloads it. That&amp;rsquo;s &lt;code&gt;00-devvm.conf&lt;/code&gt; from &lt;code&gt;assets/layers/base.sh&lt;/code&gt;, which sets &lt;code&gt;AllowTcpForwarding all&lt;/code&gt;, &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; and &lt;code&gt;PermitListen 127.77.*:*&lt;/code&gt;, and keep &lt;code&gt;AllowStreamLocalForwarding local&lt;/code&gt;, &lt;code&gt;PermitTunnel no&lt;/code&gt; and &lt;code&gt;X11Forwarding no&lt;/code&gt;. Without &lt;code&gt;clientspecified&lt;/code&gt;, sshd would bind every remote forward on the VM&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;. sshd matches the address a request names against the rule as text, so &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt; and &lt;code&gt;*&lt;/code&gt; are refused, and only devvm on the host asks for these forwards, always with a numeric address. The rule is a safeguard for an honest VM, because root in the VM can change sshd, and the boundary is the host&amp;rsquo;s ssh client (below).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Low ports.&lt;/strong&gt; At each start, the setup sets &lt;code&gt;net.ipv4.ip_unprivileged_port_start&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; where it&amp;rsquo;s &lt;code&gt;1024&lt;/code&gt;, which is on Lima&amp;rsquo;s Alpine VMs, so sshd can listen on a link&amp;rsquo;s port below 1024 for the VM&amp;rsquo;s user. Lima&amp;rsquo;s Ubuntu and Debian VMs already have &lt;code&gt;0&lt;/code&gt;, so devvm leaves it there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The link session.&lt;/strong&gt; For each running client with links, a hidden command, &lt;code&gt;devvm _links&lt;/code&gt;, runs on the host as one detached process. It keeps an ssh connection of its own to the client, never the forwarder&amp;rsquo;s master, with the options of &lt;code&gt;internal/vmssh&lt;/code&gt;: &lt;code&gt;-F none&lt;/code&gt;, &lt;code&gt;BatchMode&lt;/code&gt;, the VM&amp;rsquo;s key alone (&lt;code&gt;IdentitiesOnly&lt;/code&gt;, &lt;code&gt;IdentityAgent=none&lt;/code&gt;), its pinned host key, &lt;code&gt;ForwardAgent=no&lt;/code&gt;, &lt;code&gt;ForwardX11=no&lt;/code&gt;, &lt;code&gt;Tunnel=no&lt;/code&gt;, &lt;code&gt;PermitRemoteOpen=none&lt;/code&gt;, &lt;code&gt;PermitLocalCommand=no&lt;/code&gt; and &lt;code&gt;ProxyJump=none&lt;/code&gt;. It starts that connection as a master with &lt;code&gt;ClearAllForwardings=yes&lt;/code&gt;, so the master asks for nothing at first, and adds each link with &lt;code&gt;ssh -O forward -R 127.77.x.y:PORT:&amp;lt;socket&amp;gt;&lt;/code&gt; and removes it with &lt;code&gt;ssh -O cancel&lt;/code&gt;, at its start and while the client runs. A cancel keeps the connections that are open, and the master ending drops them. Each link is its own &lt;code&gt;-O forward&lt;/code&gt;, never &lt;code&gt;ExitOnForwardFailure&lt;/code&gt; for all of them, so a link whose address a program in the client already holds fails alone, with an error naming the link (&lt;code&gt;link_port_taken&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sockets.&lt;/strong&gt; Each link&amp;rsquo;s forward ends at a unix socket on the host, mode 600 in devvm&amp;rsquo;s run folder &lt;code&gt;~/.local/share/devvm/run&lt;/code&gt; (mode 700), named by a hash of the client, the address and the port, because a socket&amp;rsquo;s path has fewer than 104 characters. The masters&amp;rsquo; control sockets are in the same folder, named by a hash of the client, and for a master to a target, of the target and its start too. A stale socket at the path is replaced, anything else there is refused, and the socket goes when its link or the process ends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each connection.&lt;/strong&gt; When a program in the client connects to a link&amp;rsquo;s address, the client&amp;rsquo;s sshd opens a channel to the host for the forward, and the host&amp;rsquo;s ssh connects it to that link&amp;rsquo;s socket. &lt;code&gt;devvm _links&lt;/code&gt; then reads the links state again and checks that the link still exists, that the target&amp;rsquo;s ID matches, that the port is published, that the tier rule holds, that the target runs as its backend says, and, for a client on a confined tier, that the target&amp;rsquo;s tier is enforced as it runs. The connections to one target share what its backend says of its run, which is whether it runs, its start and its ssh. One lookup is in flight for each target, and its answer is reused for one second (&lt;code&gt;linkRunFor&lt;/code&gt;), so a burst of 256 connections asks the backend once rather than once for each. A connection that closes while its lookup runs finds the target stopped, but that lookup isn&amp;rsquo;t kept, and the connections waiting on it look again, so they get the target&amp;rsquo;s real answer. A target that stops is noticed within that second, and the connection&amp;rsquo;s other checks, the tier&amp;rsquo;s as the target runs included, are made for each connection. That tier check asks the backend again, and a stopped VM never runs confined, so for a client on a confined tier it notices at once that the target stopped. When the backend then says the target no longer runs on the start that was looked up, the connection is refused as &lt;code&gt;link_target_stopped&lt;/code&gt;, not as &lt;code&gt;unenforced&lt;/code&gt;. It then carries the connection with &lt;code&gt;ssh -S &amp;lt;master&amp;gt; -o ProxyCommand=/usr/bin/false -W 127.0.0.1:PORT&lt;/code&gt; through a master to the target that it keeps, one per target, with the target&amp;rsquo;s key and pinned host key. The target&amp;rsquo;s sshd connects to the target&amp;rsquo;s own loopback. When the master is gone, &lt;code&gt;-S&lt;/code&gt; alone would make a connection of its own, and &lt;code&gt;ProxyCommand=/usr/bin/false&lt;/code&gt; makes that connection fail, so a channel goes through the master or nowhere. A target&amp;rsquo;s master ends when the target stops, and the next one reads the target&amp;rsquo;s known hosts again, because a VM whose Lima config changed gets new host keys when it boots. Each relay&amp;rsquo;s ssh (&lt;code&gt;-W&lt;/code&gt;) waits for the target&amp;rsquo;s sshd to end its channel, so each runs with a context of its own (&lt;code&gt;vmssh.relayConns&lt;/code&gt;, which the port forwarder&amp;rsquo;s forwards also use). The link&amp;rsquo;s removal and its master&amp;rsquo;s replacement close its connection and cancel that context under the session&amp;rsquo;s lock, which kills the ssh (&lt;code&gt;exec.CommandContext&lt;/code&gt;), and a relay that ends by itself releases its context. So a removed link&amp;rsquo;s open connections end with it, and a target that never ends a channel can&amp;rsquo;t keep the relay&amp;rsquo;s ssh process, or one of the 256, past either. A link whose address and port lead to another target at the next sync, as a link removed and another added within one second would, cuts the old target&amp;rsquo;s connections and starts a new set for the new one, and a connection accepted before that change is cut with the old set. While a link lasts, the relay&amp;rsquo;s grace (&lt;code&gt;pipeSSH&lt;/code&gt;, as for &lt;a href="#ports-on-lima"&gt;the forwarder&lt;/a&gt;) kills an ssh whose client in the client VM has closed and whose target has sent nothing for 30 seconds. devvm never starts the target. At most 256 connections are carried at once, and the next one is refused and logged. A link&amp;rsquo;s socket holds 128 connections waiting to be accepted on macOS, and the process accepts nothing while it starts an ssh, so its accept loop only accepts, and hands a burst on whole once 5 ms pass with nothing more waiting, the first has waited 50 ms, or 257 wait. Another goroutine then carries or refuses each connection in it, logging each refusal before it closes the connection, while the loop goes on accepting the next burst, and the loop waits for that goroutine only once 257 of the next burst wait. So every connection in a burst is carried or refused with &lt;code&gt;link_limit&lt;/code&gt;, and none is refused by the socket unlogged.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s entrance.&lt;/strong&gt; In a client on any tier, an HTTP client that honors &lt;code&gt;HTTP_PROXY&lt;/code&gt; sends &lt;code&gt;db:5432&lt;/code&gt; to the VM&amp;rsquo;s proxy, and the proxy is a second entrance to the same socket, so a link added while the client runs works at once without a restart. &lt;code&gt;devvm _links&lt;/code&gt; writes every link the client has, carried or not, to &lt;code&gt;links.json&lt;/code&gt; in the client&amp;rsquo;s run folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt; (mode 600, written whole) whenever they change or the file is gone, with each link&amp;rsquo;s names, address, port, target and socket. A link it doesn&amp;rsquo;t carry has no socket, and a session that ended leaves its list, so the proxy refuses those links (&lt;code&gt;502&lt;/code&gt;, &lt;code&gt;link_refused&lt;/code&gt;) instead of asking its rules, which could send &lt;code&gt;db&lt;/code&gt; to a host the host&amp;rsquo;s resolver or a company proxy finds by that name. devvm removes the list with the VM. devvm puts the path in the proxy&amp;rsquo;s config as &lt;code&gt;links&lt;/code&gt;, and its run folder, where the sockets are, as &lt;code&gt;link_sockets&lt;/code&gt;, so &lt;code&gt;internal/proxy&lt;/code&gt; stays standard library only, and the proxy reads the list for every request, after the VM&amp;rsquo;s password and before any rule, as it does for &lt;code&gt;devvm.proxy&lt;/code&gt;. It matches &lt;code&gt;CONNECT NAME:PORT&lt;/code&gt; and absolute-form &lt;code&gt;GET http://NAME:PORT/&lt;/code&gt; exactly, after one normalization: lower case, one trailing dot dropped, and &lt;code&gt;NAME.devvm.internal&lt;/code&gt; as the list names it. It takes an entry only when the entry&amp;rsquo;s socket is the one that &lt;code&gt;proxy.LinkSocket&lt;/code&gt; names from devvm&amp;rsquo;s run folder, this VM, the entry&amp;rsquo;s address and its port, which is also the name &lt;code&gt;vmssh.Links.Socket&lt;/code&gt; gives the socket. It then connects to the socket and passes the bytes as they are: no SNI check, no interception, no secret put in, even when a secret&amp;rsquo;s hosts would match, and no rule asked. An absolute-form request goes over a new connection to the socket for each request, without the proxy&amp;rsquo;s headers, and HTTPS in absolute form gets &lt;code&gt;400&lt;/code&gt;. &lt;code&gt;devvm _links&lt;/code&gt;&amp;rsquo;s checks of each connection apply to both entrances unchanged, and it logs the connection once, as &lt;code&gt;link&lt;/code&gt;. A stale entry fails there, or finds no socket, which the proxy answers with &lt;code&gt;502&lt;/code&gt; and logs as &lt;code&gt;link_refused&lt;/code&gt; (&lt;code&gt;not carried&lt;/code&gt;). The proxy also refuses any other name under &lt;code&gt;devvm.internal&lt;/code&gt;, logged as a refused block, so a long name never reaches the rules. An absolute-form request to a link ends when the client gives it up, so a target that never answers can&amp;rsquo;t hold the client&amp;rsquo;s 256 connections. Anything else not on the list meets the floor and the rules as before, so a short name the client has no link for, before its first session lists it, is the rules&amp;rsquo; to decide.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Events.&lt;/strong&gt; &lt;code&gt;devvm _links&lt;/code&gt; writes &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;link_refused&lt;/code&gt; (with why), &lt;code&gt;link_target_stopped&lt;/code&gt; and &lt;code&gt;link_limit&lt;/code&gt; events to the client&amp;rsquo;s event log, in the proxy&amp;rsquo;s JSON-lines format, with the link&amp;rsquo;s name as the host and the target VM as &lt;code&gt;target&lt;/code&gt;, so &lt;code&gt;devvm network log&lt;/code&gt; shows them. Every client gets an event log for them, whatever its tier. &lt;code&gt;devvm _links&lt;/code&gt; writes it with the proxy&amp;rsquo;s own writer, which rotates it past 10 MiB by the proxy&amp;rsquo;s rule and follows the file to its new name when the other writer rotated it, so the two writers never lose each other&amp;rsquo;s lines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The forwarder skips links.&lt;/strong&gt; The port forwarder (&lt;code&gt;vmssh.Forwarder&lt;/code&gt;) forwards a server on any loopback address of the VM&amp;rsquo;s, so it would put a link&amp;rsquo;s listener on the host&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;. It never forwards a listener whose address is in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, on any VM, so a server of the client&amp;rsquo;s own on &lt;code&gt;127.0.0.1&lt;/code&gt; with the same port is forwarded as usual. Lima&amp;rsquo;s own forwards don&amp;rsquo;t take it either, because devvm&amp;rsquo;s rules ignore every port first, and Lima&amp;rsquo;s fallback rule matches &lt;code&gt;127.0.0.1&lt;/code&gt; and the bind addresses &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;::&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;In VMs&amp;rsquo; lives.&lt;/strong&gt; A launch starts &lt;code&gt;devvm _links&lt;/code&gt; once the client runs and its setup is done, warns once for each stopped target (&lt;code&gt;link_target_stopped&lt;/code&gt;) without starting it, and skips a link whose tier rule no longer holds, with &lt;code&gt;link_tier_mismatch&lt;/code&gt;. For a client on a confined tier, it also warns once for each running target whose tier isn&amp;rsquo;t enforced (&lt;code&gt;link_target_unenforced&lt;/code&gt;). &lt;code&gt;devvm link add&lt;/code&gt; and &lt;code&gt;devvm link rm&lt;/code&gt; on a running client change its setup and its running &lt;code&gt;devvm _links&lt;/code&gt; at once, and on a stopped client they apply at its next start. &lt;code&gt;devvm stop&lt;/code&gt; stops &lt;code&gt;devvm _links&lt;/code&gt; with the client, which ends its connections and removes its sockets, and the process also ends once the client no longer runs the start it was made for, as the forwarder does, or has no links left. &lt;code&gt;devvm rm&lt;/code&gt; of a client removes its links with its state, and &lt;code&gt;devvm rm&lt;/code&gt; of a target removes every link to it from every client&amp;rsquo;s state and names the clients that lost one, deleting nothing else of theirs. &lt;code&gt;devvm link unpublish&lt;/code&gt; of a port with links names the clients that link to it. Both backends must have the link feature, which needs ssh on both VMs, and devvm checks it with &lt;code&gt;Review.Require&lt;/code&gt; when a link is made and at each launch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What keeps a link from carrying a VM out.&lt;/strong&gt; Every connection starts on the host, and neither VM&amp;rsquo;s network carries it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A confined VM reaches only its proxy and the links you made.&lt;/strong&gt; The link&amp;rsquo;s bytes travel inside ssh connections that the host opens, so no backend&amp;rsquo;s confinement changes, and the client&amp;rsquo;s own connections, including sshd&amp;rsquo;s, stay confined as before. Through its proxy, a VM reaches only the sockets of its own links: a request names a host and a port, never a socket, the proxy&amp;rsquo;s list is in the VM&amp;rsquo;s run folder, which no VM can write, and the proxy takes an entry only when its socket is the one devvm names for that VM&amp;rsquo;s link at that address and port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM can&amp;rsquo;t choose where its connections go on the host.&lt;/strong&gt; OpenSSH&amp;rsquo;s client accepts a forwarded channel only for a listener it asked for, and connects it only where it chose, which is the link&amp;rsquo;s socket. A channel the client&amp;rsquo;s sshd opens for any other address or port, or of any other kind, is refused, whatever sshd root in the client runs. The forwarder&amp;rsquo;s master asks for no remote forward, and the link session is a connection of its own, so links don&amp;rsquo;t change what &lt;a href="#ports-on-lima"&gt;the ports note&lt;/a&gt; says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other users and VMs can&amp;rsquo;t use a link.&lt;/strong&gt; Its end on the host is a unix socket of yours, mode 600 in a folder of mode 700, so no other user on the host reaches it, and neither does a VM that reaches the host&amp;rsquo;s loopback. Programs of yours on the host can connect to it, as they can already ssh into the target by the name devvm host shows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A target&amp;rsquo;s service isn&amp;rsquo;t put on the host&amp;rsquo;s localhost.&lt;/strong&gt; &lt;code&gt;-W&lt;/code&gt; reaches the target&amp;rsquo;s loopback through its sshd, and the forwarder never forwards &lt;code&gt;127.77.0.0/16&lt;/code&gt;, so a link listens nowhere on the host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each VM&amp;rsquo;s own ssh rules hold.&lt;/strong&gt; Host keys are pinned, each VM has its own key, and no agent is forwarded (&lt;code&gt;ForwardAgent=no&lt;/code&gt;, &lt;code&gt;IdentityAgent=none&lt;/code&gt;), as for the forwarder. devvm takes a client&amp;rsquo;s or a target&amp;rsquo;s ssh only as its backend gives it on the host&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;, with a user and a key, and it refuses any other address, as the ssh config&amp;rsquo;s entries do.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Why not a shared network, the proxy, or a host port:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A network shared between VMs&lt;/strong&gt; would bypass the proxy and the VMs&amp;rsquo; confinement. On Lima it needs a root helper, and QEMU can&amp;rsquo;t make one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;CONNECT&lt;/code&gt; through the proxy as the only way in&lt;/strong&gt; would work only for programs that use the VM&amp;rsquo;s proxy settings, and a raw TCP client in every VM would need a tool of devvm&amp;rsquo;s to make the connection. The proxy is a second entrance instead, for HTTP clients, beside the ssh forward that carries every link on every VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The target&amp;rsquo;s port forwarded to the host&amp;rsquo;s localhost&lt;/strong&gt; is refused by the proxy&amp;rsquo;s floor, is reached by any open VM and any program on the host, and is a port that a host program can take first.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What the prototype showed.&lt;/strong&gt; devvm&amp;rsquo;s prototype ran in the e2e sandbox, and nothing needed the link feature off:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;macOS&amp;rsquo;s ssh 10.3p1 and Linux hosts&amp;rsquo; ssh 9.6p1 and 10.2p1 accept &lt;code&gt;-R 127.77.x.y:PORT:&amp;lt;unix socket&amp;gt;&lt;/code&gt;, and &lt;code&gt;-O forward&lt;/code&gt; and &lt;code&gt;-O cancel&lt;/code&gt; work on a master started with &lt;code&gt;ClearAllForwardings=yes&lt;/code&gt;. A cancel keeps open connections, ending the master drops them, and a session keeps the &lt;code&gt;PermitListen&lt;/code&gt; it connected with.&lt;/li&gt;
&lt;li&gt;sshd 9.2p1 (Debian 12, &lt;code&gt;--from&lt;/code&gt;), 10.2p1 (Ubuntu 26.04) and 10.3p1 (Alpine), with &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; and &lt;code&gt;PermitListen&lt;/code&gt; naming one address, bind that address alone and refuse &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, other ports and port 0. The glob &lt;code&gt;127.77.*:*&lt;/code&gt; works the same way and matches the requested address as text.&lt;/li&gt;
&lt;li&gt;All of them honor &lt;code&gt;ip_unprivileged_port_start&lt;/code&gt;, which is &lt;code&gt;0&lt;/code&gt; by default on Lima&amp;rsquo;s Ubuntu and Debian VMs, and &lt;code&gt;1024&lt;/code&gt; on Lima&amp;rsquo;s Alpine VMs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SIGHUP&lt;/code&gt; keeps sessions and open connections under systemd and OpenRC. Lima&amp;rsquo;s Ubuntu VMs (an sshd per connection over vsock) read the config at every connection. sshd&amp;rsquo;s rule is written once, so links don&amp;rsquo;t depend on either.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ssh -W&lt;/code&gt; through a kept master works over Lima&amp;rsquo;s ssh, and a new master after the target restarts reads its rewritten known hosts, while Lima keeps its key. Without a master, &lt;code&gt;-S&lt;/code&gt; connects on its own unless &lt;code&gt;ProxyCommand=/usr/bin/false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;glibc 2.36 and 2.43 and musl 1.2.6 resolve &lt;code&gt;/etc/hosts&lt;/code&gt; names in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, and Go, Node 18, 22 and 24, curl, Python and libpq 15 and 18 reach &lt;code&gt;db&lt;/code&gt; and &lt;code&gt;db.devvm.internal&lt;/code&gt;. HTTP clients honor &lt;code&gt;NO_PROXY&lt;/code&gt; with &lt;code&gt;db,.devvm.internal&lt;/code&gt;, Node 22 needs the leading dot, and Node 18&amp;rsquo;s &lt;code&gt;fetch&lt;/code&gt; ignores proxies.&lt;/li&gt;
&lt;li&gt;devvm&amp;rsquo;s port forwarder put a link&amp;rsquo;s listener on the host&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;, which is why it skips &lt;code&gt;127.77.0.0/16&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The prototype didn&amp;rsquo;t run confined VMs, so the end-to-end checks do.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; OpenSSH&amp;rsquo;s client accepting forwarded channels only for listeners it asked for, and connecting each one only where it chose. It also relies on &lt;code&gt;-O forward&lt;/code&gt; and &lt;code&gt;-O cancel&lt;/code&gt; changing one master&amp;rsquo;s forwards, on &lt;code&gt;ProxyCommand=/usr/bin/false&lt;/code&gt; keeping &lt;code&gt;-S&lt;/code&gt; from connecting without its master, and on the host&amp;rsquo;s unix socket permissions. The pinned host keys are the ones the &lt;a href="#ports-on-lima"&gt;forwarder&lt;/a&gt; and &lt;a href="#ssh-into-vms"&gt;ssh&lt;/a&gt; rely on. Lima&amp;rsquo;s rules must ignore every port ahead of its fallback rule, and devvm&amp;rsquo;s state on the host must hold each link&amp;rsquo;s target, ID and port. The proxy&amp;rsquo;s entrance relies on devvm&amp;rsquo;s run folder and the VM&amp;rsquo;s being yours alone, and on the proxy checking each entry&amp;rsquo;s socket against the one it names itself from the VM, the address and the port.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; an OpenSSH release whose client accepts a channel for a listener it didn&amp;rsquo;t ask for, which the end-to-end checks would see as a host connection devvm didn&amp;rsquo;t make. A Lima release that forwards a listener on a &lt;code&gt;127.77&lt;/code&gt; address despite the rules would put a link on the host&amp;rsquo;s loopback, which the forwarder&amp;rsquo;s own skip doesn&amp;rsquo;t cover, and the end-to-end checks look for it on the host. A backend that started a target for a connection would break the rule that a connection never starts a VM, but devvm never asks a backend to start one then.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;What the client does through the target&amp;rsquo;s service.&lt;/strong&gt; A link joins the two VMs&amp;rsquo; trust, as above, and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;what a VM does through a link&lt;/a&gt; lists what that leaves open.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Programs of yours on the host&lt;/strong&gt; can connect to a link&amp;rsquo;s socket and the masters&amp;rsquo; control sockets, as they can already reach the VMs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open connections outlive an unpublished port.&lt;/strong&gt; &lt;code&gt;devvm link unpublish&lt;/code&gt; refuses the next connection, while those that are open stay until they close, the client stops or the target does, because the link itself stays. A link that goes, by &lt;code&gt;devvm link rm&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; of its target or a group&amp;rsquo;s change, ends its open connections (above). A target can&amp;rsquo;t get a tier lower than a client&amp;rsquo;s that links to it, because &lt;code&gt;devvm network&lt;/code&gt; refuses it then, so no open connection breaks the tier rule.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A program in the client can take a link&amp;rsquo;s address and port first,&lt;/strong&gt; and that link then fails with &lt;code&gt;link_port_taken&lt;/code&gt; until the program lets it go. Root in the client can also edit its own &lt;code&gt;/etc/hosts&lt;/code&gt;, which changes only what the client reaches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A link name hides a name the client would otherwise resolve,&lt;/strong&gt; such as &lt;code&gt;db&lt;/code&gt; under its search domain. devvm refuses &lt;code&gt;localhost&lt;/code&gt;, the client&amp;rsquo;s own hostname, another link&amp;rsquo;s name and anything that isn&amp;rsquo;t one DNS label.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A remote forward you ask for&lt;/strong&gt; into a VM, with &lt;code&gt;ssh -R&lt;/code&gt; through devvm&amp;rsquo;s ssh config, may bind an address in &lt;code&gt;127.77.0.0/16&lt;/code&gt; in that VM, as &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;remote forwards you add&lt;/a&gt; says. sshd matches the rule as text and then resolves what it matched, which is why a host name that begins with &lt;code&gt;127.77.&lt;/code&gt; binds whatever address it resolves to in the VM. devvm&amp;rsquo;s own forwards name addresses only.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Many connections:&lt;/strong&gt; a client can keep 256 connections busy, which refuses its own further connections and makes the host run that many ssh processes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The network rules don&amp;rsquo;t apply to links,&lt;/strong&gt; through the proxy or not, so &lt;code&gt;devvm network deny db&lt;/code&gt; doesn&amp;rsquo;t stop the link &lt;code&gt;db&lt;/code&gt;. The published ports and the policy rule between the two VMs decide a link&amp;rsquo;s connections, and &lt;code&gt;devvm link rm&lt;/code&gt; removes one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A link&amp;rsquo;s short name before its first session lists it.&lt;/strong&gt; Until &lt;code&gt;devvm _links&lt;/code&gt; has written a client&amp;rsquo;s list once, the proxy doesn&amp;rsquo;t know &lt;code&gt;db&lt;/code&gt; is a link, so a request for &lt;code&gt;db:5432&lt;/code&gt; meets the rules, and a rule such as &lt;code&gt;**&lt;/code&gt; sends it to whatever the host&amp;rsquo;s resolver finds for &lt;code&gt;db&lt;/code&gt; as a full name, such as in &lt;code&gt;/etc/hosts&lt;/code&gt;, never under its search domain, or a company proxy finds by that name. After that, the list stays until devvm removes the VM, and &lt;code&gt;NAME.devvm.internal&lt;/code&gt; is never the rules'.&lt;/li&gt;
&lt;li&gt;Linux hosts are untested.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC, data isolation and resource exhaustion companions). One row per lead, with what holds it and the end-to-end check that proves it:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;End-to-end check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A compromised client attacking the target through a link&lt;/td&gt;
&lt;td&gt;Accepted, bounded by the rules: only a published port, only on the target&amp;rsquo;s loopback, and a client only to a target on its own tier or a stricter one&lt;/td&gt;
&lt;td&gt;The link reaches the published port, while an unpublished port and a port that isn&amp;rsquo;t linked are refused, and after devvm link unpublish the next connection is refused&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A client reaching a target on a lower tier&lt;/td&gt;
&lt;td&gt;Refused when the link is made, at the client&amp;rsquo;s launch, on every connection, and by &lt;code&gt;devvm network&lt;/code&gt; giving the target a lower tier than the client&amp;rsquo;s or the client a higher one than the target&amp;rsquo;s. For a client on a confined tier, on every connection the target&amp;rsquo;s tier must also be enforced as it runs, so a target given a confined tier while running, outside its proxy until its next start, or one whose self-check failed, is refused (&lt;code&gt;unenforced&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;An allowlist client and an open target are refused by devvm link add, at launch, after &lt;code&gt;devvm network open&lt;/code&gt; on the target, and by &lt;code&gt;devvm network allowlist&lt;/code&gt; on an open client linked to such a target. A target given the allowlist tier while it runs, which devvm ls shows as unenforced, has the link&amp;rsquo;s next connection refused and logged as &lt;code&gt;unenforced&lt;/code&gt;, while its server runs, devvm link add and the client&amp;rsquo;s launch warn of it, and once restarted behind its proxy it&amp;rsquo;s reached again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root in the client opening a channel to an address or port the host didn&amp;rsquo;t ask for&lt;/td&gt;
&lt;td&gt;OpenSSH&amp;rsquo;s client refuses it and connects only to the link&amp;rsquo;s socket&lt;/td&gt;
&lt;td&gt;With the client&amp;rsquo;s sshd loosened by root (below), no host listener or connection appears that devvm didn&amp;rsquo;t make, and only the link&amp;rsquo;s socket is reached&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root in the client loosening sshd (&lt;code&gt;PermitListen any&lt;/code&gt;, &lt;code&gt;GatewayPorts yes&lt;/code&gt;, a restart)&lt;/td&gt;
&lt;td&gt;The host asks only for its links&amp;rsquo; numeric &lt;code&gt;127.77&lt;/code&gt; addresses, and what sshd binds in the client is the client&amp;rsquo;s own: root can already put a relay of its own on any of its addresses. With &lt;code&gt;GatewayPorts yes&lt;/code&gt;, sshd binds each forward on every address of the client instead, so a second link on the same port can&amp;rsquo;t bind, and a client forwarding every port would forward it, as it would root&amp;rsquo;s relay. Nothing on the host changes&lt;/td&gt;
&lt;td&gt;After root rewrites the client&amp;rsquo;s sshd config and restarts it, the link session asks only for the links&amp;rsquo; addresses and the link still works, and with &lt;code&gt;PermitListen any&lt;/code&gt; alone nothing listens on the client&amp;rsquo;s &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt; for it. With &lt;code&gt;GatewayPorts yes&lt;/code&gt; too, the link session still listens on no host TCP port and connects only to the VMs&amp;rsquo; sshd, and the check prints what the client binds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM making its proxy reach a socket that isn&amp;rsquo;t one of its own links, or another VM&amp;rsquo;s link&lt;/td&gt;
&lt;td&gt;A request names a host and a port, never a path. The list is in the VM&amp;rsquo;s run folder (mode 700), which no VM can write, at a path devvm gives the proxy in its config, and the proxy reads it only as a regular file, not a symbolic link, that only you can write. An entry counts only when its socket is the one devvm names for this VM&amp;rsquo;s link at that address and port in devvm&amp;rsquo;s run folder (&lt;code&gt;proxy.LinkSocket&lt;/code&gt;), and each proxy needs its own VM&amp;rsquo;s password&lt;/td&gt;
&lt;td&gt;The client&amp;rsquo;s proxy refuses, by &lt;code&gt;GET&lt;/code&gt; and by &lt;code&gt;CONNECT&lt;/code&gt;, a name or port it hasn&amp;rsquo;t linked, a published port it hasn&amp;rsquo;t linked, &lt;code&gt;NAME.devvm.internal.devvm.internal&lt;/code&gt;, &lt;code&gt;devvm.internal&lt;/code&gt; and a link&amp;rsquo;s &lt;code&gt;127.77&lt;/code&gt; address, and none of them reaches a link, while its own link answers. The target, on the allowlist tier and with no links, gets a refusal from its own proxy for the client&amp;rsquo;s link name. Unit tests (&lt;code&gt;internal/proxy/links_test.go&lt;/code&gt;) refuse an entry naming another VM&amp;rsquo;s socket, a socket outside the sockets&amp;rsquo; folder (one in the list&amp;rsquo;s own folder among them) or another port&amp;rsquo;s, no link without the sockets&amp;rsquo; folder, a list that&amp;rsquo;s a symbolic link, writable by others, of another version or not JSON, and a host that is a socket&amp;rsquo;s path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An HTTP client in a confined client reaching a link added while it runs&lt;/td&gt;
&lt;td&gt;The proxy reads the list for every request, before any rule, and NAME stays out of &lt;code&gt;NO_PROXY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A link added to the running client is reached at once by curl through the VM&amp;rsquo;s proxy, by &lt;code&gt;GET&lt;/code&gt; and by &lt;code&gt;CONNECT&lt;/code&gt;, &lt;code&gt;NO_PROXY&lt;/code&gt; holds only &lt;code&gt;localhost,127.0.0.1,::1&lt;/code&gt;, and the client&amp;rsquo;s boot, its init&amp;rsquo;s start and its pinned host keys are the same after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The proxy changing a link&amp;rsquo;s bytes, or putting a secret into them&lt;/td&gt;
&lt;td&gt;The link&amp;rsquo;s path tunnels the bytes as they are, before the SNI check, interception and secrets&lt;/td&gt;
&lt;td&gt;None of its own end to end. Unit tests send a ClientHello for another host and a placeholder through a link whose name and port a secret&amp;rsquo;s hosts and an allow rule match, and the socket gets them as they were sent, and an absolute-form request reaches it without &lt;code&gt;Proxy-Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An honest VM&amp;rsquo;s sshd binding a link where it shouldn&amp;rsquo;t&lt;/td&gt;
&lt;td&gt;&lt;code&gt;PermitListen 127.77.*:*&lt;/code&gt; with &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt;, written once in every VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sshd -T&lt;/code&gt; in every VM shows the settings, and &lt;code&gt;ssh -R&lt;/code&gt; from inside the client to &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt; or another range fails&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Another user&amp;rsquo;s program, or a VM, using a link&lt;/td&gt;
&lt;td&gt;A unix socket, mode 600, in a folder of mode 700, and no host TCP port&lt;/td&gt;
&lt;td&gt;The socket is mode 600 in a 700 folder, and no host TCP port carries the link&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link listener forwarded to the host&amp;rsquo;s localhost&lt;/td&gt;
&lt;td&gt;The forwarder skips &lt;code&gt;127.77.0.0/16&lt;/code&gt;, and Lima&amp;rsquo;s rules ignore every port&lt;/td&gt;
&lt;td&gt;With the client forwarding every port, nothing from a link listens on the host, while a server of the client&amp;rsquo;s own on &lt;code&gt;127.0.0.1&lt;/code&gt; with the same port is forwarded as usual (its control)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link reached on the client&amp;rsquo;s localhost&lt;/td&gt;
&lt;td&gt;Names only, numeric &lt;code&gt;127.77&lt;/code&gt; addresses&lt;/td&gt;
&lt;td&gt;Nothing from a link listens on the client&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt;, and a server of the client&amp;rsquo;s own there runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM made again in the target&amp;rsquo;s folder inheriting a link&lt;/td&gt;
&lt;td&gt;The target&amp;rsquo;s ID, recorded with the link&lt;/td&gt;
&lt;td&gt;After devvm rm of the target, the client&amp;rsquo;s link is gone and the client is named, and a VM made again in that folder isn&amp;rsquo;t linked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Many connections&lt;/td&gt;
&lt;td&gt;At most 256 at once, then refused and logged (&lt;code&gt;link_limit&lt;/code&gt;), and an accept loop that takes a burst whole before it starts any relay and goes on accepting while the burst is carried or refused, so the socket&amp;rsquo;s backlog never refuses one unlogged&lt;/td&gt;
&lt;td&gt;256 connections at once, past the socket&amp;rsquo;s backlog of 128 on macOS, are all carried, and a 257th is refused and &lt;code&gt;devvm network log&lt;/code&gt; shows &lt;code&gt;link_limit&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A target holding a relay open, so its ssh and one of the 256 stay after its link goes&lt;/td&gt;
&lt;td&gt;Each relay&amp;rsquo;s own context, which the link&amp;rsquo;s removal and its target master&amp;rsquo;s replacement cancel, killing its ssh and freeing its slot&lt;/td&gt;
&lt;td&gt;A connection that a program in the client holds open, to a target&amp;rsquo;s server that never closes one, has its relay&amp;rsquo;s ssh on this machine end after &lt;code&gt;devvm link rm&lt;/code&gt;. Unit tests check the same with an ssh stand-in that never exits, for a removed link, a replaced master and a link whose target changed, with no goroutine left under &lt;code&gt;-race&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A target filling the client&amp;rsquo;s 256 relays while its links last, by never ending the channels of connections the client&amp;rsquo;s programs have closed&lt;/td&gt;
&lt;td&gt;The relay&amp;rsquo;s grace: its ssh is killed once the client&amp;rsquo;s side has closed and the target has sent nothing for 30 seconds, or 30 seconds after the client can take nothing more. One target can still hold relays that the client&amp;rsquo;s programs keep open, which the client chooses, so there&amp;rsquo;s no cap for each target&lt;/td&gt;
&lt;td&gt;None end to end, as an honest target ends its channels. Unit tests check it with an ssh stand-in that never exits: a closed and a half-closed client&amp;rsquo;s relay end after the grace, and one the stand-in keeps answering goes on&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A program in the client taking a link&amp;rsquo;s address first&lt;/td&gt;
&lt;td&gt;Each link&amp;rsquo;s own &lt;code&gt;-O forward&lt;/code&gt;, failing alone with &lt;code&gt;link_port_taken&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A server on a link&amp;rsquo;s address and port before the link is added: that link fails with &lt;code&gt;link_port_taken&lt;/code&gt;, and another link of the client&amp;rsquo;s works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A malicious target&amp;rsquo;s answers&lt;/td&gt;
&lt;td&gt;As any server&amp;rsquo;s: they reach only the connection that asked&lt;/td&gt;
&lt;td&gt;None of its own: the target&amp;rsquo;s bytes go back over the same connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root in the client, or a malicious target, writing a line into the session&amp;rsquo;s log that reads as the session&amp;rsquo;s own, such as a false &lt;code&gt;link_port_taken&lt;/code&gt; or a hidden real one&lt;/td&gt;
&lt;td&gt;OpenSSH prints what the remote side sends, such as a disconnect&amp;rsquo;s reason, with its newlines, at the &lt;code&gt;LogLevel=ERROR&lt;/code&gt; the session&amp;rsquo;s ssh uses. So &lt;code&gt;devvm _links&lt;/code&gt; writes its ssh processes&amp;rsquo; output to its log a whole line at a time, each line behind &lt;code&gt;ssh:&lt;/code&gt;, so only the session&amp;rsquo;s own lines start with its prefix, which devvm link add and the launch read. A line in an error the session logs is indented, and the output of &lt;code&gt;ssh -O&lt;/code&gt; is joined into one line&lt;/td&gt;
&lt;td&gt;None of its own. A unit test (&lt;code&gt;internal/vmssh/links_test.go&lt;/code&gt;) runs a stub ssh that prints a disconnect&amp;rsquo;s reason holding forged lines, one of them in pieces around a line of the session&amp;rsquo;s, and the log holds only the session&amp;rsquo;s own lines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A connection starting a stopped target&lt;/td&gt;
&lt;td&gt;Never: &lt;code&gt;devvm _links&lt;/code&gt; checks the target runs and never starts it&lt;/td&gt;
&lt;td&gt;A connection to a stopped target fails, &lt;code&gt;devvm network log&lt;/code&gt; shows &lt;code&gt;link_target_stopped&lt;/code&gt;, and the target stays stopped. Restarted, it works again with its new host key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lima&amp;rsquo;s own ssh asking for remote forwards, as every VM&amp;rsquo;s sshd allows them&lt;/td&gt;
&lt;td&gt;Lima&amp;rsquo;s own ssh never asks for one, because devvm sets no reverse rule and its Lima home refuses settings it didn&amp;rsquo;t write. Every VM&amp;rsquo;s sshd allows remote forwards only on &lt;code&gt;127.77.*:*&lt;/code&gt;, so no other address binds, and on macOS a confined VM also has the hostagent&amp;rsquo;s sandbox&lt;/td&gt;
&lt;td&gt;Lima&amp;rsquo;s rules ignore every port, &lt;code&gt;sshd -T&lt;/code&gt; shows &lt;code&gt;permitlisten 127.77.*:*&lt;/code&gt;, and on a running Lima client, sshd listens on nothing but its own port and the link&amp;rsquo;s addresses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link name shadowing a real host&lt;/td&gt;
&lt;td&gt;One DNS label, never &lt;code&gt;localhost&lt;/code&gt;, the client&amp;rsquo;s hostname or another link&amp;rsquo;s, plus &lt;code&gt;NAME.devvm.internal&lt;/code&gt; under a reserved name&lt;/td&gt;
&lt;td&gt;The CLI tests refuse each, and end to end, &lt;code&gt;--as NAME&lt;/code&gt; reaches the target by that name alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Links changing on a running client&lt;/td&gt;
&lt;td&gt;&lt;code&gt;-O forward&lt;/code&gt; and &lt;code&gt;-O cancel&lt;/code&gt;, the setup over ssh, and the proxy&amp;rsquo;s list&lt;/td&gt;
&lt;td&gt;devvm link add and devvm link rm on a running client apply within seconds, through the proxy too, without a restart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two targets on one port&lt;/td&gt;
&lt;td&gt;An address per target&lt;/td&gt;
&lt;td&gt;Two targets publishing the same port are each reached by their own name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link left behind&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm stop&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; end the process and its sockets, and &lt;code&gt;gc --orphans&lt;/code&gt; finds leftovers&lt;/td&gt;
&lt;td&gt;Removing either VM leaves no &lt;code&gt;devvm _links&lt;/code&gt; process, socket or link state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Links on open and confined tiers&lt;/td&gt;
&lt;td&gt;The same mechanism on every tier&lt;/td&gt;
&lt;td&gt;The section runs with both VMs on the allowlist tier and both open, a port below 1024 such as 80 on Lima&amp;rsquo;s Alpine VMs, and &lt;code&gt;devvm network log&lt;/code&gt; shows link events on both tiers&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-hextra-search-id="groups"&gt;Groups&lt;span class="hx:absolute hx:-mt-20" id="groups"&gt;&lt;/span&gt;
&lt;a href="#groups" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A group is a named set of VMs that reach each other&amp;rsquo;s published ports by name: you run &lt;code&gt;devvm group join web&lt;/code&gt; in each VM&amp;rsquo;s folder, and every member gets a link to each port that every other member publishes. Groups are built on links alone. A group adds nothing below the link session, so every connection of a group&amp;rsquo;s link goes through the same session, sockets, proxy entrance and checks as a link made with &lt;code&gt;devvm link add&lt;/code&gt;, and everything above holds for it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The rules:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A VM is in one group at a time.&lt;/strong&gt; &lt;code&gt;devvm group join&lt;/code&gt; refuses a VM that&amp;rsquo;s in another group (&lt;code&gt;group_other&lt;/code&gt;), naming &lt;code&gt;devvm group leave&lt;/code&gt;, and &lt;code&gt;devvm group leave&lt;/code&gt; takes no name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One tier.&lt;/strong&gt; Every member of a group is on the same tier. &lt;code&gt;devvm group join&lt;/code&gt; refuses a VM whose tier differs from the members&amp;rsquo; (&lt;code&gt;group_tier_mismatch&lt;/code&gt;), and a group with a member whose network section can&amp;rsquo;t be read, and &lt;code&gt;devvm network&lt;/code&gt; is refused for a member (&lt;code&gt;group_tier_fixed&lt;/code&gt;), naming the group and &lt;code&gt;devvm group leave&lt;/code&gt;. So every link a group makes keeps the links&amp;rsquo; tier rule, and each of its connections is still checked against the states, with the target&amp;rsquo;s tier enforced as it runs, and warned of with &lt;code&gt;link_target_unenforced&lt;/code&gt; when the group makes the link.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Membership is recorded on the host,&lt;/strong&gt; in each member&amp;rsquo;s own state under &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, as &lt;code&gt;group&lt;/code&gt; and &lt;code&gt;group_as&lt;/code&gt; in its &lt;code&gt;links&lt;/code&gt; section, never in a project folder or a VM. A VM made again after &lt;code&gt;devvm rm&lt;/code&gt; gets new state with a new ID, so it&amp;rsquo;s in no group, and the links to the old VM, which record its ID, don&amp;rsquo;t apply to it. &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; keep the VM&amp;rsquo;s state, so the VM stays in its group (&lt;a href="#a-vm-made-again"&gt;a VM made again&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A group&amp;rsquo;s links are links,&lt;/strong&gt; recorded in each member&amp;rsquo;s links state with a mark of their own, so &lt;code&gt;devvm group leave&lt;/code&gt; removes only those, and &lt;code&gt;devvm link rm&lt;/code&gt; refuses them (&lt;code&gt;link_from_group&lt;/code&gt;) while they still apply. Every connection of one is also checked against membership: a group&amp;rsquo;s link applies only while its client and its target are in the same group (&lt;code&gt;ungrouped&lt;/code&gt; otherwise), so a link that a leave cut short, or a race between two devvm commands, left behind carries nothing, and &lt;code&gt;devvm link rm&lt;/code&gt; removes it. &lt;code&gt;devvm group leave&lt;/code&gt; removes the leaver&amp;rsquo;s own group links before it takes it out of the group, and running &lt;code&gt;devvm group join&lt;/code&gt; again works out every member&amp;rsquo;s links again. Each takes the client&amp;rsquo;s address for that member and the member&amp;rsquo;s name in the group: its folder part, or the name it joined with (&lt;code&gt;--as NAME&lt;/code&gt;). devvm works out a member&amp;rsquo;s group links again whenever a member joins or leaves, publishes or unpublishes a port, or adds or removes a link of its own, and it records and applies only the members whose links changed, naming the links each gains or loses (&lt;code&gt;group_links_added&lt;/code&gt;, &lt;code&gt;group_links_removed&lt;/code&gt;). A running member gets them at once, as &lt;code&gt;devvm link add&lt;/code&gt; gives them, and a stopped one at its next start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The user&amp;rsquo;s links take precedence.&lt;/strong&gt; A link made with &lt;code&gt;devvm link add&lt;/code&gt; stays as it is: a port it links gets no group link, its name names that member&amp;rsquo;s group links too, and when its name is another member&amp;rsquo;s name in the group, that member&amp;rsquo;s group links aren&amp;rsquo;t made in that client, which is warned of (&lt;code&gt;group_link_name_clash&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Names are unique in a group.&lt;/strong&gt; &lt;code&gt;devvm group join&lt;/code&gt; refuses a name another member has, as its name or its folder part (&lt;code&gt;group_name_taken&lt;/code&gt;), and &lt;code&gt;localhost&lt;/code&gt; (&lt;code&gt;group_name_host&lt;/code&gt;). It also refuses a VM whose own hostname, its folder part, is another member&amp;rsquo;s name, whether that&amp;rsquo;s the member&amp;rsquo;s folder part or the name it joined with (&lt;code&gt;group_name_hostname&lt;/code&gt;), because the name would resolve to the joining VM itself, whatever name it joins as. The refusal names the fix: the other member leaves and joins again with another name, or the project goes in a folder with another name. So no member&amp;rsquo;s name is another member&amp;rsquo;s hostname, and &lt;code&gt;groupLinks&lt;/code&gt; makes no link by such a name, or by &lt;code&gt;localhost&lt;/code&gt;, all the same.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Joins take turns.&lt;/strong&gt; Each &lt;code&gt;devvm group join&lt;/code&gt; and &lt;code&gt;devvm group leave&lt;/code&gt;, each publish and unpublish that works the members&amp;rsquo; links out again, and &lt;code&gt;devvm rm&lt;/code&gt; of a VM hold a lock on the host, &lt;code&gt;~/.local/share/devvm/groups.lock&lt;/code&gt; (&lt;code&gt;lockGroups&lt;/code&gt;), from reading the members&amp;rsquo; states to writing them. A join checks the group once before it asks to widen a parent folder&amp;rsquo;s VM, and again once it holds the lock, with the VM&amp;rsquo;s state read again, so two VMs joining at once are checked one after the other, and the second sees the first as a member. So the one tier and the names hold however the joins overlap. A devvm that waits for the lock does so under a status line (&lt;code&gt;group_waiting&lt;/code&gt;). The lock is an OS lock (&lt;code&gt;flock&lt;/code&gt;) on an open file, which the system lets go of when the process holding it ends, however it ends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm rm&lt;/code&gt; of a member takes it out of its group,&lt;/strong&gt; after &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s removal of every link to it, and the group goes with its last member.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What a group adds to the link threat check.&lt;/strong&gt; A group joins the trust of every member: code in any member can often run code in the others through the ports they publish, and then has their network, secrets and project folder. A member joining later gets that reach into every member, and they into it, without a command in their folders, so &lt;code&gt;devvm group join&lt;/code&gt; says so on every join (&lt;code&gt;group_trust&lt;/code&gt;). Nothing reaches more than the published ports on each member&amp;rsquo;s own loopback, and the one tier keeps every member&amp;rsquo;s tier whole.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Every member trusts every other,&lt;/strong&gt; which &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;what a VM does through a link&lt;/a&gt; lists.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A published range gives a link for each port in it,&lt;/strong&gt; in every other member. A wide range means as many forwards in each member and as many sockets on the host, so publish only the ports you mean the group to reach.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm link add&lt;/code&gt; or &lt;code&gt;devvm link rm&lt;/code&gt; at the same moment as a group&amp;rsquo;s change&lt;/strong&gt; can each write the same member&amp;rsquo;s links whole, because those two don&amp;rsquo;t take the groups lock, so the later write wins. A group link left that way is refused as &lt;code&gt;ungrouped&lt;/code&gt;, and the next change works the links out again from the states.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC, data isolation and resource exhaustion companions), what a group adds to the links&amp;rsquo; rows above:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;End-to-end check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A member reaching every other member&amp;rsquo;s published ports&lt;/td&gt;
&lt;td&gt;Accepted, bounded by the links&amp;rsquo; rules: only published ports, only on each member&amp;rsquo;s loopback, and said on every join (&lt;code&gt;group_trust&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Three members reach each other&amp;rsquo;s published ports by name within seconds of the last join, and a port published by a member reaches the others at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A member joining later&lt;/td&gt;
&lt;td&gt;It needs &lt;code&gt;devvm group join&lt;/code&gt; in its own folder, on the host; membership is in each member&amp;rsquo;s state on the host, which no VM writes. Every join says the group joins every member&amp;rsquo;s trust&lt;/td&gt;
&lt;td&gt;The third VM&amp;rsquo;s join gives the other two links to its published port and it links to theirs, and &lt;code&gt;group_trust&lt;/code&gt; is said&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A member reaching one on a lower tier&lt;/td&gt;
&lt;td&gt;One tier at &lt;code&gt;devvm group join&lt;/code&gt;, checked again under the groups lock, &lt;code&gt;devvm network&lt;/code&gt; refused for a member, and every connection checked as for any link&lt;/td&gt;
&lt;td&gt;An allowlist VM is refused by an open group, and an open one by an allowlist group; &lt;code&gt;devvm network allowlist&lt;/code&gt; for a member is refused. Unit tests (&lt;code&gt;TestGroupJoinsAtOnce&lt;/code&gt;) and the CLI tests join an allowlist VM and an open one at once, and only one gets in, every time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A member&amp;rsquo;s name taking over a name the user chose&lt;/td&gt;
&lt;td&gt;The user&amp;rsquo;s links take precedence, a name is unique in the group, &lt;code&gt;localhost&lt;/code&gt; is refused, and so is a VM whose own hostname is a member&amp;rsquo;s name&lt;/td&gt;
&lt;td&gt;The CLI tests refuse a taken name, another member&amp;rsquo;s folder part, &lt;code&gt;localhost&lt;/code&gt;, and a VM whose folder part is a member&amp;rsquo;s folder part or the name it joined with, and drop a member&amp;rsquo;s group links whose name one of the user&amp;rsquo;s links has&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leaving or removing a member leaving links behind&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm group leave&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; remove the group&amp;rsquo;s links in every member, and the user&amp;rsquo;s stay&lt;/td&gt;
&lt;td&gt;After &lt;code&gt;devvm group leave&lt;/code&gt;, the leaver&amp;rsquo;s and the others&amp;rsquo; group links are gone and their names don&amp;rsquo;t resolve, while a link made with &lt;code&gt;devvm link add&lt;/code&gt; still answers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A group&amp;rsquo;s link outliving its group, from a leave cut short or a race&lt;/td&gt;
&lt;td&gt;Each connection checks that the client and the target are in the same group (&lt;code&gt;ungrouped&lt;/code&gt;), and a leave removes the leaver&amp;rsquo;s group links first&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestCheckGroupLink&lt;/code&gt;) refuse a group&amp;rsquo;s link once either VM is in another group or none, and keep the user&amp;rsquo;s own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM made again inheriting membership&lt;/td&gt;
&lt;td&gt;Membership is in the VM&amp;rsquo;s own state, which &lt;code&gt;devvm rm&lt;/code&gt; deletes, so a VM made after it starts in no group. &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; keep the state, because they make the same VM again (&lt;a href="#a-vm-made-again"&gt;below&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;The CLI tests: devvm rm of a member takes it out, and the last one&amp;rsquo;s leaving removes the group&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="read-only-paths-on-linux"&gt;Read-only paths on Linux&lt;span class="hx:absolute hx:-mt-20" id="read-only-paths-on-linux"&gt;&lt;/span&gt;
&lt;a href="#read-only-paths-on-linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;macOS locks &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s hooks and config with the user-immutable flag, which Linux has only for root, so on Linux devvm makes them read-only where the VM sees them instead (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-linux-hosts"&gt;.git protection on Linux hosts&lt;/a&gt;). Lima&amp;rsquo;s &lt;code&gt;read-only-paths&lt;/code&gt; feature is native: QEMU serves the project folder over 9p from its own mount namespace, and devvm binds each path over itself there. Landlock, a FUSE layer and a 9p server of devvm&amp;rsquo;s own were ruled out: Landlock can&amp;rsquo;t make paths read-only below a folder it allows writes in, and the other two would put devvm&amp;rsquo;s code between the VM and every file of the project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; while a VM whose protection is on runs, nothing in it, root included, can write, replace, remove or rename &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s hooks, config and the rest of what&amp;rsquo;s locked, of &lt;code&gt;.git&lt;/code&gt; and of the submodules the check before its start found, or rename &lt;code&gt;.git&lt;/code&gt; and those git folders. git in the VM commits as before. Nothing changes for this machine&amp;rsquo;s own git, and nothing persists once QEMU ends. Where the host can&amp;rsquo;t do it, the start is refused, or, for a VM made there, protection is off and devvm says so at each launch. devvm reports a VM that&amp;rsquo;s on and runs without its pins, at each launch of it and at &lt;code&gt;devvm stop&lt;/code&gt;. One gap is listed, not closed: a file that a git command on this machine renames over a pinned one while the VM runs is the guest&amp;rsquo;s until it&amp;rsquo;s pinned again, and devvm names it afterwards.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a path that&amp;rsquo;s a symlink, or under one, which &lt;code&gt;mount(2)&lt;/code&gt; would follow out of the project folder; a file with another name; a host whose kernel refuses the namespace&amp;rsquo;s capabilities; a pinned file that a git command on this machine replaces while the VM runs; QEMU, or a process it starts, undoing a pin; what keeps the pins ending while QEMU runs; a pin reaching this machine&amp;rsquo;s own mounts; a VM started without devvm&amp;rsquo;s wrapper.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion&amp;rsquo;s privileged-helper and local-file classes). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A symlink at a pinned path, or above one:&lt;/strong&gt; ruled out. The check that lists the paths skips any that isn&amp;rsquo;t real (&lt;code&gt;realInDir&lt;/code&gt;), and &lt;code&gt;devvm _qemu pinned&lt;/code&gt; opens each path with &lt;code&gt;openat2&lt;/code&gt; beneath the project folder with &lt;code&gt;RESOLVE_NO_SYMLINKS&lt;/code&gt;, refuses anything but a file or a folder, and binds the descriptor it opened, never the path. A refused path stops the start (&lt;code&gt;TestRunPinned&lt;/code&gt;&amp;rsquo;s symlinked hooks folder). The VM isn&amp;rsquo;t running while QEMU&amp;rsquo;s namespace pins, so only this machine&amp;rsquo;s own programs could race the check.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The guest undoing a pin:&lt;/strong&gt; ruled out. The guest has no way into QEMU&amp;rsquo;s mount namespace, and 9p carries file operations, not mounts. A rename or removal of a mount point gets &lt;code&gt;EBUSY&lt;/code&gt;, and a write &lt;code&gt;EROFS&lt;/code&gt; (&lt;code&gt;TestRunPinned&lt;/code&gt;; e2e).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;QEMU undoing a pin:&lt;/strong&gt; ruled out for QEMU as it runs. It runs as you, with no capability in any namespace (&lt;code&gt;CapInh&lt;/code&gt;, &lt;code&gt;CapPrm&lt;/code&gt;, &lt;code&gt;CapEff&lt;/code&gt; and &lt;code&gt;CapAmb&lt;/code&gt; 0; its bounding set stays whole, which gives nothing with no new privileges) and no-new-privileges, and the pins belong to the namespace devvm made, where only &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; could unmount them. Listed: a guest that breaks out of QEMU runs as you, and can reach &lt;code&gt;.git&lt;/code&gt; through a process outside the namespace (&lt;code&gt;/proc/&amp;lt;pid&amp;gt;/root&lt;/code&gt;), as it can every file of yours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm _qemu pinned&lt;/code&gt;, which keeps &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; in the namespace:&lt;/strong&gt; ruled out as a way in. It reads only &lt;code&gt;DEVVM_QEMU_PINS&lt;/code&gt;, which devvm gives it, binds only those paths with the same checks, and ends with QEMU. The guest can make it work by filling &lt;code&gt;.git&lt;/code&gt; with files, but each burst of changes makes one look at the pins.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What keeps the pins ending while QEMU runs:&lt;/strong&gt; fixed. A separate keeper could end (an inotify limit, a misread parent) with QEMU running on, so &lt;code&gt;devvm _qemu pinned&lt;/code&gt; runs QEMU as its child, killed when it ends, and a watch it can&amp;rsquo;t set up on any of the folders refuses the start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A change to a pin that goes unrecorded:&lt;/strong&gt; fixed. &lt;code&gt;devvm _qemu pinned&lt;/code&gt; refuses the start when it can&amp;rsquo;t write the events file&amp;rsquo;s first line. An event it can&amp;rsquo;t add later goes to Lima&amp;rsquo;s log with a warning, and to the file as a mark when it can, and the check names a record that&amp;rsquo;s unreadable, holds a mark or a line that isn&amp;rsquo;t an event, or lost its first line (&lt;code&gt;git_pins_unrecorded&lt;/code&gt;). A file it can&amp;rsquo;t write at all after the start stays listed, with Lima&amp;rsquo;s log as its record.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A git command on this machine replacing &lt;code&gt;.git/config&lt;/code&gt;:&lt;/strong&gt; listed, and reported. The new file isn&amp;rsquo;t pinned until &lt;code&gt;devvm _qemu pinned&lt;/code&gt; pins it again, within milliseconds of the change, and in that window the guest can write it, put a file of its own in its place, which then gets the pin, open it for writing, a handle the pin doesn&amp;rsquo;t take back, or give it another name. A guest that loops can win that window. Each pin made again, or that can&amp;rsquo;t be, is recorded and named once the VM stops, and the watch&amp;rsquo;s sums, which run on Linux with the pins too, name a file whose contents changed. macOS&amp;rsquo;s flag has no such window.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file with another name (a hard link):&lt;/strong&gt; fixed. A bind covers one name, and the guest could write the file through another, so a regular file to pin, or one in a folder to pin, with more than one name is refused at the start (&lt;code&gt;git_pin_linked&lt;/code&gt;), and one that gets another name while the VM runs isn&amp;rsquo;t pinned again and is named.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM that&amp;rsquo;s on running without its pins:&lt;/strong&gt; fixed, reported. Each launch of a running VM and &lt;code&gt;devvm stop&lt;/code&gt; read QEMU&amp;rsquo;s mounts and name each pin it lacks, &lt;code&gt;.git&lt;/code&gt; and the git folders as mount points and the rest read-only (&lt;code&gt;git_pins_missing&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A pin reaching this machine&amp;rsquo;s mounts:&lt;/strong&gt; ruled out. The namespace&amp;rsquo;s mounts are private, and a mount namespace owned by a user namespace gets none of its pins back to its parent&amp;rsquo;s (checked on Fedora: this machine&amp;rsquo;s &lt;code&gt;mountinfo&lt;/code&gt; has none of them while the VM runs).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What&amp;rsquo;s pinned, from the guest&amp;rsquo;s index:&lt;/strong&gt; ruled out. The VM writes the index, so it can add submodules, but devvm pins only real git folders inside the project folder (&lt;code&gt;hostsafety.IsGitDir&lt;/code&gt;), so the worst it can do is make a folder of its own project read-only to itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;DEVVM_QEMU_PINS&lt;/code&gt;:&lt;/strong&gt; ruled out. devvm sets it for the start alone, &lt;code&gt;_qemu&lt;/code&gt; checks that the folder is absolute and clean and that every path is relative and below it, and devvm takes it out of QEMU&amp;rsquo;s environment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An AppArmor profile for Ubuntu:&lt;/strong&gt; ruled out for now. A profile with the &lt;code&gt;userns&lt;/code&gt; rule for devvm&amp;rsquo;s binary, in a folder you can write, would let any program running as you put itself there and get what Ubuntu&amp;rsquo;s restriction holds back, so devvm offers none, and Ubuntu with the restriction on only watches &lt;code&gt;.git&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;.git/commondir&lt;/code&gt;:&lt;/strong&gt; listed. A file has to be there to be pinned, and devvm puts nothing in &lt;code&gt;.git&lt;/code&gt; that git doesn&amp;rsquo;t, so the VM can still make one, which devvm reports at each check, as on macOS.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM started without devvm:&lt;/strong&gt; reported. &lt;code&gt;limactl start&lt;/code&gt; runs QEMU without devvm&amp;rsquo;s wrapper, so without pins, as it runs without the network confinement (&lt;code&gt;unenforced&lt;/code&gt; in &lt;code&gt;devvm ls&lt;/code&gt;), and the next launch or &lt;code&gt;devvm stop&lt;/code&gt; names its missing pins. Start VMs with devvm.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Files owned by another user:&lt;/strong&gt; listed. QEMU&amp;rsquo;s namespace maps only you, so a file in the project folder that another user owns shows as &lt;code&gt;nobody&lt;/code&gt;&amp;rsquo;s in the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section on a Linux host, run on Fedora 43 and Debian 13): QEMU runs in a namespace with &lt;code&gt;.git/config&lt;/code&gt; and &lt;code&gt;.git/hooks&lt;/code&gt; mounted read-only, with no capability and no-new-privileges; root in the VM can&amp;rsquo;t add a hook, change, replace or remove the config, rename &lt;code&gt;.git&lt;/code&gt; or move the hooks folder; git in the VM commits; &lt;code&gt;git config&lt;/code&gt; on this machine reaches the VM, and the new config is read-only in the VM again; a submodule the VM adds is named by devvm stop, nothing of the namespace outlives the stop, and the next start pins the submodule&amp;rsquo;s config but not a folder that isn&amp;rsquo;t a git folder; &lt;code&gt;devvm git-protect off&lt;/code&gt; on a running VM applies at its next start, which pins nothing; a VM left strict is on at its next launch, its &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; taken out, and pinned again, and its next stop names nothing. Unit tests: &lt;code&gt;TestRunPinned&lt;/code&gt; (a file renamed over a pinned one is pinned again and recorded; a hard link refuses the start), &lt;code&gt;TestPinsInNamespace&lt;/code&gt;, &lt;code&gt;TestKeep&lt;/code&gt; and &lt;code&gt;TestProbePin&lt;/code&gt; on a Linux host, &lt;code&gt;TestPinsOrder&lt;/code&gt;, &lt;code&gt;TestPinsRefused&lt;/code&gt;, &lt;code&gt;TestStartPins&lt;/code&gt;, &lt;code&gt;TestPins&lt;/code&gt;, &lt;code&gt;TestBindsWatch&lt;/code&gt;, &lt;code&gt;TestReportPinEvents&lt;/code&gt; (a path&amp;rsquo;s repeats in one line, each record it can&amp;rsquo;t trust named), &lt;code&gt;TestRecordPinEvent&lt;/code&gt;, &lt;code&gt;TestPinWaits&lt;/code&gt; (a folder it can&amp;rsquo;t watch fails the watch) and &lt;code&gt;TestPinsMissing&lt;/code&gt; (&lt;code&gt;.git&lt;/code&gt; not a mount point, a config not read-only).&lt;/p&gt;
&lt;h2 data-hextra-search-id="nested-repos"&gt;Nested repos&lt;span class="hx:absolute hx:-mt-20" id="nested-repos"&gt;&lt;/span&gt;
&lt;a href="#nested-repos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A folder often holds git repos of its own besides its submodules, such as a workspace of several repos with no repo at its top. Every one of them is in the VM&amp;rsquo;s mount, so &lt;code&gt;.git&lt;/code&gt; protection covers each as it covers the folder&amp;rsquo;s own repo (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#nested-repos"&gt;nested repos&lt;/a&gt;). Two other designs were weighed. Refusing such folders, or warning only, leaves the most common multi-repo layout without protection. A &lt;code&gt;--clone&lt;/code&gt; of every repo keeps the VM out of the working trees altogether, which is what a &lt;a href="#workspace-clones"&gt;workspace clone&lt;/a&gt; does for a user who doesn&amp;rsquo;t need the VM to write them, so both are built.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; in a VM made by this devvm, or one &lt;code&gt;devvm git-protect on&lt;/code&gt; set, nothing in the VM can change the hooks and config of a nested repo that a walk of the stopped VM&amp;rsquo;s folder found, with the same locks, pins and watch as the folder&amp;rsquo;s own repo, and with the same reports at each check. It holds from the check that found the repo: a repo the VM makes while it runs, or a folder of its own the VM puts in a protected repo&amp;rsquo;s place on Linux, is git&amp;rsquo;s to use on this machine until the next stopped check names it, and what the walk can&amp;rsquo;t find or the bound leaves out is named, or counted, not protected. A VM an earlier devvm made keeps protecting only its own repo until &lt;code&gt;devvm git-protect on&lt;/code&gt;, because locking a repo&amp;rsquo;s config breaks &lt;code&gt;git config&lt;/code&gt; there, which the user didn&amp;rsquo;t ask for. It&amp;rsquo;s told once.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; the walk finding the wrong folders or too many; a lock or a read outside the mount through a nested repo&amp;rsquo;s paths, which now have two bounds, the repo&amp;rsquo;s top folder and the mount; the VM hiding a nested repo behind another one&amp;rsquo;s protection; two VMs protecting one repo, where one&amp;rsquo;s unlock would take the other&amp;rsquo;s locks off; taking a strict VM&amp;rsquo;s &lt;code&gt;diff.ignoreSubmodules&lt;/code&gt; out, which unlocks a config to write it; and the cost of a check, which the VM can raise by making repos.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion&amp;rsquo;s local-file and race classes, with two independent reviews of the change, the second adversarial, which proved its two highs with real host git running a VM-planted &lt;code&gt;core.fsmonitor&lt;/code&gt;). Leads, each fixed, ruled out or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A nested repo hidden behind another&amp;rsquo;s protection:&lt;/strong&gt; fixed. The first version left a nested repo to any repo whose scan locked its git folder as a submodule&amp;rsquo;s, and the VM writes the index that names submodules, so a gitlink with a &lt;code&gt;.git&lt;/code&gt; file naming &lt;code&gt;b/.git&lt;/code&gt; hid &lt;code&gt;b&lt;/code&gt;&amp;rsquo;s own submodules and worktrees from every scan (&lt;code&gt;TestNestedGitlinkCantHide&lt;/code&gt;). The second left one to any repo whose &lt;code&gt;.git&lt;/code&gt; its git folder was below, so a &lt;code&gt;src/.git&lt;/code&gt; file naming a &lt;code&gt;.git/evil&lt;/code&gt; the VM made, or a &lt;code&gt;.git/modules/x&lt;/code&gt; whose &lt;code&gt;commondir&lt;/code&gt; leads to one, was neither locked nor named. A repo is now left to another only when its git folder is one that repo&amp;rsquo;s scan locks whole: its &lt;code&gt;.git&lt;/code&gt;, a git folder under &lt;code&gt;.git/modules&lt;/code&gt; that reads its own config, or a linked worktree whose &lt;code&gt;commondir&lt;/code&gt; leads back. Anything else is scanned on its own and named (&lt;code&gt;TestNestedIntoTopGit&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A protected nested repo made to look gone:&lt;/strong&gt; fixed. devvm took a folder for a repo by a narrower test than git&amp;rsquo;s, which also takes a &lt;code&gt;HEAD&lt;/code&gt; with a &lt;code&gt;commondir&lt;/code&gt;, and &lt;code&gt;objects&lt;/code&gt; and &lt;code&gt;refs&lt;/code&gt; that are files, so the VM could rename a protected repo&amp;rsquo;s &lt;code&gt;objects&lt;/code&gt; and &lt;code&gt;refs&lt;/code&gt;, add a &lt;code&gt;commondir&lt;/code&gt; to a git folder of its own, or rename &lt;code&gt;.git&lt;/code&gt; to &lt;code&gt;.GIT&lt;/code&gt; on macOS, or make it unreadable, and devvm dropped the repo as gone while git still used it, its pins and watch with it. The walk now takes anything named &lt;code&gt;.git&lt;/code&gt;, any case on macOS, &lt;code&gt;hostsafety.IsGitDir&lt;/code&gt; follows git&amp;rsquo;s test, and a recorded repo stays while anything is at its &lt;code&gt;.git&lt;/code&gt; (&lt;code&gt;TestNestedNotGone&lt;/code&gt;, &lt;code&gt;TestIsGitDir&lt;/code&gt;). &lt;code&gt;git_nested_gone&lt;/code&gt; is a warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A bare repo the VM makes:&lt;/strong&gt; listed, named. git takes a folder shaped like a git folder for a bare repo, and its config can name a work tree, so git run below one runs its &lt;code&gt;core.fsmonitor&lt;/code&gt;. devvm names the ones it finds, and &lt;code&gt;devvm doctor&lt;/code&gt; gives a tip until git&amp;rsquo;s &lt;code&gt;safe.bareRepository&lt;/code&gt; is &lt;code&gt;explicit&lt;/code&gt; (git 2.38 and newer), which refuses them; devvm never changes your git config.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A path outside the mount:&lt;/strong&gt; ruled out. Every lock, unlock and pin goes through &lt;code&gt;realInDir&lt;/code&gt;, which takes the mount as its bound and refuses a path with a symlink in it below the mount, so a nested repo whose folder became a symlink is reported, not locked (&lt;code&gt;TestLockNeverThroughSymlinks&lt;/code&gt;, &lt;code&gt;TestRealInDirPins&lt;/code&gt;). The walk follows no symlink and stays on the mount&amp;rsquo;s file system. The state records nested repos by local relative paths only.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two VMs, one repo:&lt;/strong&gt; fixed. On macOS both VMs set the same flag, so an unlock leaves what another VM&amp;rsquo;s protection still covers, and names that VM (&lt;code&gt;TestNestedUnlockKept&lt;/code&gt;, the &lt;code&gt;git_nested&lt;/code&gt; script&amp;rsquo;s nested VM). Unlocking a kept config for a moment, to take a strict VM&amp;rsquo;s &lt;code&gt;diff.ignoreSubmodules&lt;/code&gt; out, would let a running VM race it, so devvm skips a kept config there, and locks a config again when git can&amp;rsquo;t change it (&lt;code&gt;TestUnstrictKept&lt;/code&gt;, &lt;code&gt;TestUnstrictFails&lt;/code&gt;). The ownership check fails closed: a state that can&amp;rsquo;t be read keeps every path in the folder its state&amp;rsquo;s folder is named after, and a VMs&amp;rsquo; folder that can&amp;rsquo;t be read keeps everything (&lt;code&gt;TestGitKeeper&lt;/code&gt;). Locking and recording, and unlocking, take one host lock (&lt;code&gt;paths.Dirs.GitLock&lt;/code&gt;), so two commands at once can&amp;rsquo;t unlock what the other just locked. A repo devvm stops protecting keeps its record in &lt;code&gt;made.left&lt;/code&gt;, so its locks come off with the rest, and one that left the folder is named, as only &lt;code&gt;chflags&lt;/code&gt; reaches it then (&lt;code&gt;TestNestedLeftUnlocked&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo whose git folder is outside the folder:&lt;/strong&gt; named. Its &lt;code&gt;.git&lt;/code&gt; file is locked, and the VM can&amp;rsquo;t reach where it leads, but another project&amp;rsquo;s VM may write it, as for a submodule&amp;rsquo;s (&lt;code&gt;git_nested_gitdir_outside&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The watch hiding a change:&lt;/strong&gt; fixed. The watch records a new or gone nested repo&amp;rsquo;s sums without naming them, and it first skipped every path under such a repo&amp;rsquo;s folder, so a repo nested in it went unwatched for a check. It now skips only the paths whose deepest repo is that one (&lt;code&gt;TestRepoOf&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The bound used to hide a repo:&lt;/strong&gt; fixed. The VM can make up to 100 repos cheaply, and the walk keeps the first 100, so the count past the bound is now named at every check, with the first ten of them, not only when it grows, as the VM could keep the count and change which repos are past it. The &lt;code&gt;.git&lt;/code&gt; the walk sees where it doesn&amp;rsquo;t look for repos, which a set-id walk on Linux sees, and the folders on other disks it doesn&amp;rsquo;t enter, are counted and named.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost:&lt;/strong&gt; fixed, and listed. A scan followed gitlinks that led back to a git folder it had followed, through a symlinked folder, up to eight deep, so the VM could make it run git without end; it now follows each git folder once, and one check&amp;rsquo;s scans follow 1,000 in all, across every repo, and name a repo past that (&lt;code&gt;TestEmbeddedOnce&lt;/code&gt;, &lt;code&gt;TestScanBudget&lt;/code&gt;). A launch into a running VM scans no nested repo, so it costs what it did before them. A check scans eight repos at once, so 50 nested repos take under a second on an M3 Max, walk and locks included (&lt;code&gt;BenchmarkNestedCheck&lt;/code&gt;). Listed: the watch&amp;rsquo;s bounds grow with the repos, at most 2,000 sums for the folder&amp;rsquo;s own repo and 200 for each nested one, each file read up to 16 MiB, so a VM that fills them makes a stopped check slow; a hooks folder filled to blind the watch is named at every check (&lt;code&gt;git_watch_blind&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A nested repo&amp;rsquo;s folder renamed on Linux:&lt;/strong&gt; listed, reported. A pin makes &lt;code&gt;.git&lt;/code&gt; a mount point, which the guest can&amp;rsquo;t rename, but a nested repo&amp;rsquo;s own folder isn&amp;rsquo;t one, so the guest can rename &lt;code&gt;ws/a&lt;/code&gt;, &lt;code&gt;.git&lt;/code&gt; and all, and put another repo in its place, which git on this machine then reads until the next check names it (&lt;code&gt;git_replaced&lt;/code&gt;). Pinning every folder down to each nested repo would refuse the VM&amp;rsquo;s own moves of those folders. macOS has the same gap for every repo, the folder&amp;rsquo;s own included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo the VM makes while it runs:&lt;/strong&gt; listed, reported. devvm can&amp;rsquo;t lock what it hasn&amp;rsquo;t found, so a repo the VM clones while it runs is git&amp;rsquo;s repo for its folder from then on, shell prompts and editors included, and the VM&amp;rsquo;s until the next stopped check names it, with the config keys and hooks in it that run programs (&lt;code&gt;git_nested_appeared_runs&lt;/code&gt;), and locks it as it is. One deeper than four folders or under a skipped name is never named, only counted where a set-id walk sees it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The pins&amp;rsquo; file:&lt;/strong&gt; ruled out. A VM with many nested repos has more pins than one environment variable holds (&lt;code&gt;MAX_ARG_STRLEN&lt;/code&gt; is 128 KiB), so the start writes them to &lt;code&gt;run/git-pins.json&lt;/code&gt; in the VM&amp;rsquo;s folder, private and whole, which the VM can&amp;rsquo;t reach, and &lt;code&gt;devvm _qemu&lt;/code&gt; reads it through no symlink, capped, and checks it again (&lt;code&gt;TestPinsOrder&lt;/code&gt;, &lt;code&gt;TestPinsRefused&lt;/code&gt;). The keeper&amp;rsquo;s inotify watches are a few folders for each repo, far below the kernel&amp;rsquo;s limit for 100 repos.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section): a folder of two repos without one of its own gets a VM whose root can&amp;rsquo;t add a hook or change the config of either repo, on macOS and on a Linux host that pins; on a Linux host that can&amp;rsquo;t pin, &lt;code&gt;devvm stop&lt;/code&gt; names the config the VM changed; &lt;code&gt;devvm rm&lt;/code&gt; takes the locks off both; a repo whose &lt;code&gt;.git&lt;/code&gt; file names a git folder the VM made under the folder&amp;rsquo;s own &lt;code&gt;.git&lt;/code&gt; is named at &lt;code&gt;devvm stop&lt;/code&gt;; and a protected repo whose objects and refs the VM renamed, with a &lt;code&gt;commondir&lt;/code&gt; to a git folder of its own, or whose &lt;code&gt;.git&lt;/code&gt; it renamed to &lt;code&gt;.GIT&lt;/code&gt; on macOS, stays protected. Unit tests: &lt;code&gt;TestWalkRepos&lt;/code&gt;, &lt;code&gt;TestIsGitDir&lt;/code&gt;, &lt;code&gt;TestNestedIntoTopGit&lt;/code&gt;, &lt;code&gt;TestNestedNotGone&lt;/code&gt;, &lt;code&gt;TestScanBudget&lt;/code&gt;, &lt;code&gt;TestRunsProgram&lt;/code&gt;, &lt;code&gt;TestNestedLeftUnlocked&lt;/code&gt;, &lt;code&gt;TestGitKeeper&lt;/code&gt;, &lt;code&gt;TestBareExplicit&lt;/code&gt;, &lt;code&gt;TestNestedProtected&lt;/code&gt;, &lt;code&gt;TestNestedNoTopRepo&lt;/code&gt;, &lt;code&gt;TestNestedExistingVM&lt;/code&gt;, &lt;code&gt;TestNestedWatch&lt;/code&gt;, &lt;code&gt;TestNestedPins&lt;/code&gt;, &lt;code&gt;TestNestedGitdirInside&lt;/code&gt;, &lt;code&gt;TestKeeps&lt;/code&gt;, &lt;code&gt;TestMadeJSON&lt;/code&gt; and the 0.1.0 fixture&amp;rsquo;s tests, whose state reads as a VM whose protection covers its own repo alone.&lt;/p&gt;
&lt;h2 data-hextra-search-id="workspace-clones"&gt;Workspace clones&lt;span class="hx:absolute hx:-mt-20" id="workspace-clones"&gt;&lt;/span&gt;
&lt;a href="#workspace-clones" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm --clone&lt;/code&gt; in a folder of repos gives one VM a clone of each repo the user picks, each at its own path, so the paths between them work as on the host (&lt;a href="https://next.devvm.dev/docs/using/clone/#folders-of-repos"&gt;folders of repos&lt;/a&gt;). It extends the one-repo clone rather than adding a mode beside it: the clone section&amp;rsquo;s &lt;code&gt;repos&lt;/code&gt; lists the repos by their paths relative to the folder, and a clone of the folder&amp;rsquo;s own repo, the only kind devvm 0.1.0 made, reads as one repo at &lt;code&gt;.&lt;/code&gt; with its remote and seed in &lt;code&gt;made&lt;/code&gt;, so its state needs no migration. Every step that a one-repo clone takes for its repo, a workspace clone takes for each: the checks of &lt;code&gt;--clone&lt;/code&gt; (&lt;code&gt;checkRepoTop&lt;/code&gt;, &lt;code&gt;cloneSource&lt;/code&gt;, &lt;code&gt;gitprotect.OwnRepo&lt;/code&gt;), a remote of its own (&lt;code&gt;freeRemote&lt;/code&gt;), a copy of its branches through the VM&amp;rsquo;s own command channel to that repo&amp;rsquo;s path (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-copy-into-a-clone-vm"&gt;the copy into a clone VM&lt;/a&gt;), and at &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm clone off&lt;/code&gt;, the check of its work and the removal of its remote. The repos are found by the walk that &lt;a href="#nested-repos"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt; makes (&lt;code&gt;starter.walk&lt;/code&gt;), so the same depth, skipped folders and bound apply, and they&amp;rsquo;re recorded once, when the VM is made or at &lt;code&gt;devvm clone add&lt;/code&gt;, never at a launch.&lt;/p&gt;
&lt;p&gt;Four choices keep it small. The seed copies each repo&amp;rsquo;s refs as a one-repo clone&amp;rsquo;s seed does, every branch, tag and remote-tracking branch, so a workspace repo behaves in the VM as a repo of its own does; the seed sends one pack for each repo, so this costs about what a clone of the repo does. A repo &lt;code&gt;--clone&lt;/code&gt; can&amp;rsquo;t copy is listed and left out, never fatal, so one odd repo doesn&amp;rsquo;t stop the rest; the same holds for a repo whose three remote names are taken. The folder&amp;rsquo;s own files outside every repo are copied once and never back, as a tar the host makes from what it reads beneath the folder, so a Makefile or a compose file works in the VM without becoming a sync. And &lt;code&gt;devvm&lt;/code&gt; in one of the repos opens the folder&amp;rsquo;s VM at that repo&amp;rsquo;s path, because the VM has the repo there and mounts nothing of the host, so the finder&amp;rsquo;s reason to pass over a parent&amp;rsquo;s VM below a repo of its own, that the parent&amp;rsquo;s VM can write that repo, doesn&amp;rsquo;t hold; &lt;code&gt;--here&lt;/code&gt; still makes the repo&amp;rsquo;s own VM.&lt;/p&gt;
&lt;p&gt;rm&amp;rsquo;s check reads every repo at once: one script sent with the command (&lt;code&gt;cloneState&lt;/code&gt;, never a copy on disk) prints each repo&amp;rsquo;s branches, its status and its linked worktrees below the folder with their statuses, as length-prefixed records, so ten repos cost one ssh session, not thirty. devvm reads it as it reads anything from a VM, capped, by a parser that takes only what it asked for.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; a workspace clone&amp;rsquo;s VM gets nothing of the host but the branches the user&amp;rsquo;s repos already have, the files outside them that devvm copied once, and the shared tools and agent folders every VM gets. Nothing from the VM runs on the host, changes a ref outside a repo&amp;rsquo;s remote-tracking branches for the VM, or writes outside those repos&amp;rsquo; &lt;code&gt;.git&lt;/code&gt;. Everything the VM says, its branch names, paths and statuses, is untrusted, checked before it&amp;rsquo;s used and made printable before it&amp;rsquo;s shown.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a host file outside the folder reaching the VM through the copy, by a link, a hard link, a swap during the read or a special file; host git run in a folder the state names, or by what the VM serves; refs written outside &lt;code&gt;refs/remotes/&amp;lt;remote&amp;gt;/&lt;/code&gt;; the clone check&amp;rsquo;s answer read without a bound, or a path in it that leads out of the folder; the finder taking a VM that mounts the folder for one that doesn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion&amp;rsquo;s local-file class, and two independent adversarial reviews of the change, &amp;ldquo;the review&amp;rdquo; and &amp;ldquo;the second review&amp;rdquo; below). Leads, each fixed, ruled out or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A host file through the copy:&lt;/strong&gt; fixed. devvm first walked the folder by paths beneath an &lt;code&gt;os.Root&lt;/code&gt;, which follows a link in the middle of a path while it stays in the root, so another VM that mounts a subfolder could swap a folder there for a link to an unchosen repo, or its &lt;code&gt;.git&lt;/code&gt;, as the walk reached it, and the copy took that repo&amp;rsquo;s files and config (the adversarial review). The walk now opens each folder from its parent&amp;rsquo;s handle and checks it&amp;rsquo;s the folder it listed (&lt;code&gt;safefile.Root.OpenDir&lt;/code&gt;, &lt;code&gt;TestOpenDir&lt;/code&gt;), and opens each file by its own name in its folder, without following a link at its end, checked to be a regular file once open, and refused when it has another hard link, which could be any file on its disk (&lt;code&gt;OneLink&lt;/code&gt;). A folder shaped like a git dir, such as a bare mirror, was copied as plain files, which the review found too; it&amp;rsquo;s now left out and counted. A link is copied as a link only when its target is relative and stays in the folder, never read through. Other disks, sockets, FIFOs and devices stay on the host, and files keep their permissions without set-id bits (&lt;code&gt;TestWorkspaceFiles&lt;/code&gt;). A workspace clone copies the folder&amp;rsquo;s files, so devvm refuses the folders it refuses to mount, such as the home folder (&lt;code&gt;checkUnsafe&lt;/code&gt;). Listed: a secret the user keeps at the folder&amp;rsquo;s top, such as an &lt;code&gt;.env&lt;/code&gt;, is copied as any file is, which the docs say.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Host git in a folder the VM chose:&lt;/strong&gt; fixed. Host git runs only in the repos devvm&amp;rsquo;s state records, which only devvm writes, each at a clean path below the folder, and &lt;code&gt;repos&lt;/code&gt; passes over any other. The review found that only the seed checked a recorded repo again, so once another VM, or the user, removed a repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; or put another folder in its place, &lt;code&gt;devvm clone fetch&lt;/code&gt; and rm&amp;rsquo;s fetch wrote the VM&amp;rsquo;s objects and refs into whichever repo git found there, the folder&amp;rsquo;s own above it included. Every fetch into a repo, and devvm clone off&amp;rsquo;s undo adding its remote again, now checks first that the folder is still the top of a repo of its own (&lt;code&gt;checkRepoTop&lt;/code&gt;): &lt;code&gt;devvm clone fetch&lt;/code&gt; leaves it alone and names it, and rm and devvm clone off refuse and keep the VM (the &lt;code&gt;clone_workspace&lt;/code&gt; script). Every host git command goes through &lt;code&gt;hostgit&lt;/code&gt;, so no hook, fsmonitor, filter or &lt;code&gt;GIT_*&lt;/code&gt; of the environment runs, and the push and fetch connect to the VM alone, whatever the repo&amp;rsquo;s config says (&lt;code&gt;gitSSHCommand&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Refs from the VM:&lt;/strong&gt; ruled out. &lt;code&gt;devvm clone fetch&lt;/code&gt; fetches with &lt;code&gt;--refmap=&lt;/code&gt; and one refspec, &lt;code&gt;+refs/heads/*:refs/remotes/&amp;lt;remote&amp;gt;/*&lt;/code&gt;, so the VM&amp;rsquo;s branches land only under that repo&amp;rsquo;s remote for the VM, whose name devvm chose, and host git refuses a ref name it can&amp;rsquo;t take. rm&amp;rsquo;s fetch writes new &lt;code&gt;saved/&lt;/code&gt; branches only, never over one (&lt;code&gt;savedPrefix&lt;/code&gt;). The names devvm lists are host git&amp;rsquo;s, read back, and shown through &lt;code&gt;msg.Printable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The clone check&amp;rsquo;s answer:&lt;/strong&gt; ruled out. devvm reads at most 8 MiB, and fails the check past that or after 2 minutes; each record must be whole, of a repo asked for, and each worktree&amp;rsquo;s path clean, relative and below the folder, once, followed by its status (&lt;code&gt;TestParseCloneState&lt;/code&gt;, &lt;code&gt;TestWorktreePathPins&lt;/code&gt;). A VM that hides its work only loses its own work, which the docs say: devvm checks what the VM answers, not that it answers everything. A repo whose clone isn&amp;rsquo;t at its path in the VM first read as having nothing to check, so a clone moved in the VM went with its work without a question (the review); it&amp;rsquo;s now asked about, as uncommitted changes are (&lt;code&gt;TestCloneChangesAcrossRepos&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The finder&amp;rsquo;s carve-out:&lt;/strong&gt; ruled out. It applies only to a state whose clone section is on and a workspace, which never mounts the folder; a VM made again with the folder mounted clears that section first (&lt;code&gt;TestCoversRepo&lt;/code&gt;, the &lt;code&gt;clone_workspace&lt;/code&gt; script).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo another VM can swap:&lt;/strong&gt; fixed. A VM that mounts a subfolder holding a workspace repo, or the repo itself, can swap it for a link to another repo between devvm&amp;rsquo;s check and its push or fetch, which would send another repo&amp;rsquo;s history into the clone VM, or write the clone&amp;rsquo;s refs into another repo (the second review). devvm now refuses such a repo when it finds the repos, at &lt;code&gt;devvm clone add&lt;/code&gt; and before each push and fetch, and rm&amp;rsquo;s check runs no host git in it, naming the VM (&lt;code&gt;finder.mountsRepo&lt;/code&gt;, &lt;code&gt;stillRepo&lt;/code&gt;, the &lt;code&gt;clone_workspace_repo&lt;/code&gt; script); the check and git still race for a VM that mounts it only later, which the next command names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo with worktrees or repos of its own:&lt;/strong&gt; fixed. The second review found that a repo holding a linked worktree, as the docs&amp;rsquo; &lt;code&gt;.worktrees/NAME&lt;/code&gt; layout makes, or a repo below it, became a workspace: &lt;code&gt;--no-input&lt;/code&gt; scripts that 0.1.0 ran now refused, the worktree was copied as a repo of its own, recording a remote in the config it shares with its repo, and the folder&amp;rsquo;s own clone showed the other clones as untracked, so rm always asked. A folder that&amp;rsquo;s a repo gets its own clone unless &lt;code&gt;--repos&lt;/code&gt; is given, a linked worktree of a repo in the folder is never a repo of its own (&lt;code&gt;worktreeIn&lt;/code&gt;), each repo&amp;rsquo;s remote is chosen once the one before is added, and the folder&amp;rsquo;s own clone excludes the other clones and what the host&amp;rsquo;s &lt;code&gt;info/exclude&lt;/code&gt; names (&lt;code&gt;repoExcludes&lt;/code&gt;, &lt;code&gt;TestFindRepos&lt;/code&gt;, &lt;code&gt;TestRepoExcludes&lt;/code&gt;, the &lt;code&gt;clone_workspace_repo&lt;/code&gt; script). A folder of repos inside another repo&amp;rsquo;s working tree is refused, as its copy would take that repo&amp;rsquo;s files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Work lost to a copy that didn&amp;rsquo;t finish:&lt;/strong&gt; fixed. &lt;code&gt;devvm clone add&lt;/code&gt; records a repo before its copy, and a failed copy left it recorded and unseeded, which the command then called added, and rm passed over, so a push that reached the VM without its record went unchecked. A recorded, unseeded repo is now copied again by &lt;code&gt;devvm clone add&lt;/code&gt;, fetched when its remote is recorded, and checked by rm when its clone is in the VM (the &lt;code&gt;clone_workspace&lt;/code&gt; script&amp;rsquo;s failed add, then its retry).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The verification pass:&lt;/strong&gt; fixed. &lt;code&gt;devvm clone add .&lt;/code&gt; gave the folder&amp;rsquo;s own clone no excludes, so it showed the other clones as changes and rm always asked; it now gets every other repo&amp;rsquo;s and the host&amp;rsquo;s. A linked worktree whose repo another VM mounts wasn&amp;rsquo;t refused; devvm now checks the repo its common dir is in too (&lt;code&gt;mountingVM&lt;/code&gt;). Exclude lines took a repo&amp;rsquo;s folder name as a pattern, so &lt;code&gt;lib[2]&lt;/code&gt; wasn&amp;rsquo;t left out, and a name with a line break could write a line that left out every new folder, hiding work from rm; git&amp;rsquo;s pattern characters are now escaped, each line is anchored at both ends, and a repo whose name has a character &lt;code&gt;msg.Safe&lt;/code&gt; refuses, a line break among them, is refused (&lt;code&gt;TestRepoExcludes&lt;/code&gt; runs real git on them). A repo another VM mounts failed rm for the whole workspace; rm now reads its clone in the VM, checks every other repo, and asks before its work goes, never running host git in it. The VM&amp;rsquo;s folder never made failed the check; it now reads as every repo gone. Each repo is checked again after rm&amp;rsquo;s question, before its fetch. A retry whose push had landed sent it again, which the VM refused once its branch moved on; a repo the VM has with a commit is now left as it is, and only its remote added. The branches&amp;rsquo; bound of 10,000 is for all the repos of a check together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A worktree hidden by the bound:&lt;/strong&gt; fixed. The clone check&amp;rsquo;s script counted the worktrees outside the folder towards its 101 before leaving them out, so 101 outside ones hid a changed one inside, and rm deleted without asking, for a one-repo clone too; it counts only those inside now (&lt;code&gt;TestCloneStateScript&lt;/code&gt;). The repos&amp;rsquo; branches are capped at 10,000 in all per check, as each costs host git a lookup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost:&lt;/strong&gt; listed. The walk is &lt;code&gt;.git&lt;/code&gt; protection&amp;rsquo;s, bounded at 100 repos; the copy at 5,000 entries and 64 MiB, each file at 10 MiB. A VM can serve a pack without end, or many branches, which &lt;code&gt;devvm clone fetch&lt;/code&gt; writes into the repo until the disk is full or the user presses Ctrl+C, as &lt;code&gt;git fetch devvm&lt;/code&gt; would; a cap on what host git reads from the VM&amp;rsquo;s ssh isn&amp;rsquo;t built. The read of the clone, by rm and &lt;code&gt;devvm clone off&lt;/code&gt;, shares the bounds of the read of the agents&amp;rsquo; worktrees (&lt;code&gt;answer&lt;/code&gt;). devvm stops the VM&amp;rsquo;s command past 8 MiB and gives up past 2 minutes, so when a VM writes without end, slowly or not, or never answers, the check fails and devvm keeps the VM, and &lt;code&gt;--no-clone-check&lt;/code&gt; is the way out (&lt;code&gt;TestWorkCheckBounded&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;clone&lt;/code&gt; section): a folder of two repos and a file of its own gets one VM that mounts only the shared tools, with each repo&amp;rsquo;s clone at its path holding every branch and the folder&amp;rsquo;s file; an agent-like commit in each repo comes back with &lt;code&gt;devvm clone fetch&lt;/code&gt;, listed as one branch with both repos; &lt;code&gt;devvm clone add&lt;/code&gt; copies a third; rm without a terminal refuses with unfetched work in one repo, naming it, and keeps the VM; &lt;code&gt;--no-clone-check&lt;/code&gt; deletes it and removes every repo&amp;rsquo;s remote. Unit tests: &lt;code&gt;TestDefaultBranch&lt;/code&gt;, &lt;code&gt;TestSeedTips&lt;/code&gt;, &lt;code&gt;TestIsWorkspace&lt;/code&gt;, &lt;code&gt;TestChooseRepos&lt;/code&gt;, &lt;code&gt;TestPickRepos&lt;/code&gt;, &lt;code&gt;TestFindRepos&lt;/code&gt;, &lt;code&gt;TestWorkspaceFiles&lt;/code&gt;, &lt;code&gt;TestCloneChangesAcrossRepos&lt;/code&gt;, &lt;code&gt;TestFetchedByBranch&lt;/code&gt;, &lt;code&gt;TestCloneRepos&lt;/code&gt;, &lt;code&gt;TestFixtureClonesReadAsOneRepo&lt;/code&gt;, &lt;code&gt;TestCoversRepo&lt;/code&gt;, &lt;code&gt;TestParseCloneState&lt;/code&gt;, &lt;code&gt;TestCloneStateScript&lt;/code&gt;, &lt;code&gt;TestOpenDir&lt;/code&gt; and &lt;code&gt;TestRepoExcludes&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-vm-made-again"&gt;A VM made again&lt;span class="hx:absolute hx:-mt-20" id="a-vm-made-again"&gt;&lt;/span&gt;
&lt;a href="#a-vm-made-again" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm layer rm&lt;/code&gt; make a VM again from a new image, and &lt;code&gt;devvm update&lt;/code&gt; from its own image&amp;rsquo;s new build, while keeping devvm&amp;rsquo;s state for it and its home folder (&lt;a href="https://next.devvm.dev/docs/internals/overview/#making-a-vm-again"&gt;making a VM again&lt;/a&gt;). All three use the one remake, and three choices shape it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option B, a new disk.&lt;/strong&gt; The layer&amp;rsquo;s script never runs in the existing VM. Running it there would run a third-party installer next to the project&amp;rsquo;s files, as root, on a disk the VM&amp;rsquo;s own code has changed, and the image&amp;rsquo;s key would then describe a disk that no longer matches it. A new disk from the image keeps every VM a copy of an image whose key hashes everything in it. Taking a layer out works the same way, because a layer has no script that undoes it, and only a new disk from an image without the layer leaves nothing of it behind.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The old disk is kept until the new VM has started.&lt;/strong&gt; devvm stops the VM and renames its machine to &lt;code&gt;devvm-&amp;lt;hash&amp;gt;-old&lt;/code&gt; (&lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Rename&lt;/code&gt;, &lt;code&gt;limactl rename&lt;/code&gt; on Lima, which keeps the disk whole) before it makes the new one by the VM&amp;rsquo;s name, rather than deleting it first. So a failed create, start or home copy puts the old VM back as it was, and only a remake that got its new VM started with its home folder deletes the old disk. Every backend renames a stopped VM, so none deletes the old disk early. The aside name is no project VM&amp;rsquo;s name (&lt;code&gt;vmname.IsVM&lt;/code&gt;), which keeps it out of &lt;code&gt;devvm ls&lt;/code&gt;, the ssh config, the mounts devvm&amp;rsquo;s SSH agent checks and &lt;code&gt;devvm space&lt;/code&gt;&amp;rsquo;s strays. It&amp;rsquo;s 24 characters for every VM, two more than the shortest name a project VM can have, so in a Lima home whose path leaves room for fewer, the rename is refused (&lt;code&gt;lima_home_too_long&lt;/code&gt;) before anything else changes, and the VM stays as it was, stopped.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The VM keeps its ID.&lt;/strong&gt; A link records its target&amp;rsquo;s &lt;code&gt;id&lt;/code&gt; so that a different VM in the target&amp;rsquo;s folder, made after &lt;code&gt;devvm rm&lt;/code&gt;, never inherits the link (&lt;a href="#links-between-vms"&gt;links between VMs&lt;/a&gt;). A remake isn&amp;rsquo;t that case. The user runs it in the folder, on the host, and it keeps the VM&amp;rsquo;s name, its state, its folder and its project, so its links, its group and its published ports are the user&amp;rsquo;s choices for this project, and none of them is worth losing to a layer. A new ID would make every client&amp;rsquo;s link to the VM &lt;code&gt;replaced&lt;/code&gt;, and the user would have to add each again in every client&amp;rsquo;s folder, which gives nothing a check needs: the clients reach the same project&amp;rsquo;s published ports, on a VM the same person made again from an image devvm built. What changes is the VM&amp;rsquo;s disk and its host keys. devvm reads the new host keys from the new disk&amp;rsquo;s system files, which the home folder&amp;rsquo;s copy never reaches, as for any VM that starts, and a link session&amp;rsquo;s master to the target ends when the target stops, so the next one reads the new keys. A remake of a confined VM keeps it, with the same proxy password and salt, so the links&amp;rsquo; policy rule holds throughout.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-home-folders-copy"&gt;The home folder&amp;rsquo;s copy&lt;span class="hx:absolute hx:-mt-20" id="the-home-folders-copy"&gt;&lt;/span&gt;
&lt;a href="#the-home-folders-copy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The old VM&amp;rsquo;s home folder is the VM&amp;rsquo;s own data, which nothing on the host trusts. devvm runs &lt;code&gt;tar --one-file-system --ignore-failed-read&lt;/code&gt; in the old VM as its user, so the stream holds nothing from a mount, such as the project folder or an agent&amp;rsquo;s folder, and devvm reads it on the host with Go&amp;rsquo;s &lt;code&gt;archive/tar&lt;/code&gt; and &lt;code&gt;compress/gzip&lt;/code&gt; (&lt;code&gt;copyHome&lt;/code&gt;). Nothing unpacks it on the host. Each entry is kept or dropped there, and only what&amp;rsquo;s kept is written, gzipped again, to &lt;code&gt;home.tar.gz&lt;/code&gt; in the VM&amp;rsquo;s folder, 600 in folders that are 700:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Types:&lt;/strong&gt; regular files, folders and symlinks, and a hard link only to a regular file kept before it. Devices, FIFOs and anything else are dropped, so the new VM&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; creates none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paths:&lt;/strong&gt; each is cleaned, and one that&amp;rsquo;s absolute, has &lt;code&gt;..&lt;/code&gt; above the home folder or holds a control character is dropped, and so is the home folder&amp;rsquo;s own entry, so its mode stays the new image&amp;rsquo;s. So is any entry below a symlink kept before it, which &lt;code&gt;tar&lt;/code&gt; would follow out of the home folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modes and owners:&lt;/strong&gt; the setuid, setgid and sticky bits are dropped, and so are the entry&amp;rsquo;s owner and group, so the new VM&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; makes everything its user&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What devvm writes itself:&lt;/strong&gt; &lt;code&gt;~/.config/devvm&lt;/code&gt; (its environment, which holds the placeholders of the VM&amp;rsquo;s secrets), &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;, every agent&amp;rsquo;s login files, whichever agents the VM has, but Claude Code&amp;rsquo;s &lt;code&gt;~/.claude.json&lt;/code&gt;, whose per-folder state is history, the agents&amp;rsquo; folders that devvm links to their mounts and the files it copies from the host, all of which the new VM&amp;rsquo;s setup writes again, and &lt;code&gt;~/.cache&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm puts the file into the new VM once it has started confined, as the VM&amp;rsquo;s user, with &lt;code&gt;tar --skip-old-files&lt;/code&gt;, so a file or folder the new image put in the home folder, &lt;code&gt;~/.bashrc&lt;/code&gt; among them, stays the image&amp;rsquo;s, its metadata included, and the shell that runs &lt;code&gt;tar&lt;/code&gt; there reads only the image&amp;rsquo;s files. devvm&amp;rsquo;s setup runs after it and writes its own files again. The file is deleted once the new disk has it, when the remake is undone, and with the VM&amp;rsquo;s folder.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The home folder is as trusted as the old VM was.&lt;/strong&gt; What its code wrote there, such as a shell snippet in &lt;code&gt;~/.bashrc.d&lt;/code&gt;, a &lt;code&gt;~/.ssh/config&lt;/code&gt; entry or an agent&amp;rsquo;s settings, runs in the new VM as it would have in the old one. The new VM is the same project&amp;rsquo;s VM, with the same reach, so this is no new access, and &lt;code&gt;--clean-home&lt;/code&gt; starts from the image&amp;rsquo;s home folder instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its size isn&amp;rsquo;t bounded.&lt;/strong&gt; A VM can make its home folder as large as its disk, and the copy then takes as much room on the host, besides the old disk and the new one. A VM can already fill the host&amp;rsquo;s disk through the project folder, which it writes, so this adds no new way to do it, and devvm checks for a VM&amp;rsquo;s free space before the remake.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It&amp;rsquo;s on the host&amp;rsquo;s disk for the remake&amp;rsquo;s minutes,&lt;/strong&gt; with whatever the VM keeps in its home, such as keys or logins it made itself. The VM&amp;rsquo;s disk holds the same data in devvm&amp;rsquo;s Lima home, with the same permissions, so a backup of the data folder sees it either way.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its data isolation and lifecycle and resource exhaustion companions):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A hostile home folder writing outside the new VM&amp;rsquo;s home through &lt;code&gt;..&lt;/code&gt;, an absolute path or a symlink it planted&lt;/td&gt;
&lt;td&gt;&lt;code&gt;copyHome&lt;/code&gt; drops each, on the host, before the new VM&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; sees the stream, and that &lt;code&gt;tar&lt;/code&gt; runs as the VM&amp;rsquo;s user&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestCopyHome&lt;/code&gt;) keep files, folders, symlinks and hard links to kept files, and drop &lt;code&gt;..&lt;/code&gt;, absolute paths, control characters, devices, FIFOs, setuid bits, owners, hard links out of the home folder and entries below a symlink&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A hostile stream attacking the host&lt;/td&gt;
&lt;td&gt;It&amp;rsquo;s parsed by memory-safe stdlib readers and never unpacked on the host, and it&amp;rsquo;s written only into the VM&amp;rsquo;s own folder, which only devvm writes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestCopyHome&lt;/code&gt; refuses a stream that isn&amp;rsquo;t gzip&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;devvm&amp;rsquo;s own files or the user&amp;rsquo;s secrets carried across&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.config/devvm&lt;/code&gt;, &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;, the agents&amp;rsquo; logins and the files and folders devvm copies or links from the host are left out, and the new VM&amp;rsquo;s setup writes them again&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestCopyHome&lt;/code&gt; leaves them out, and the CLI tests check that a saved home holds &lt;code&gt;.bash_history&lt;/code&gt; without &lt;code&gt;~/.config/devvm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The old VM&amp;rsquo;s code influencing the new VM&amp;rsquo;s setup or the restore itself&lt;/td&gt;
&lt;td&gt;The restore keeps what the image put in the home folder, its folders&amp;rsquo; metadata included (&lt;code&gt;--skip-old-files&lt;/code&gt;), so the shell that runs it reads the image&amp;rsquo;s &lt;code&gt;~/.bashrc&lt;/code&gt;, and devvm&amp;rsquo;s setup runs after it&lt;/td&gt;
&lt;td&gt;The CLI tests check the restore&amp;rsquo;s command and order; e2e checks that a file in &lt;code&gt;~&lt;/code&gt; survives a remake and that the VM opens a shell afterwards&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A remake halfway losing the VM&lt;/td&gt;
&lt;td&gt;The old machine is kept aside until the new one has started with its home folder, the cleanup puts it back on any failure or interrupt before then and never deletes the new one after, and a killed devvm leaves the &lt;code&gt;remake&lt;/code&gt; section, which the next devvm finishes, while &lt;code&gt;devvm gc --orphans&lt;/code&gt; skips the VM and &lt;code&gt;devvm rm&lt;/code&gt; deletes both machines. The saved home folder goes only after the section does&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestRemakeUndo&lt;/code&gt;, &lt;code&gt;TestRemakePending&lt;/code&gt;, &lt;code&gt;TestRemakeDone&lt;/code&gt;, &lt;code&gt;TestRemakePendingChecked&lt;/code&gt;) and the CLI tests: a failed create and an interrupt put the old VM back as it was, a remake left with its old machine aside or gone is finished by the next devvm, checked again first, and one whose old machine wasn&amp;rsquo;t deleted keeps its new machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two devvms on one remake&lt;/td&gt;
&lt;td&gt;The remake lock (&lt;code&gt;run/remake.lock&lt;/code&gt;), held from finding the VM until the remake ends, with the state read again under it: a second devvm refuses (&lt;code&gt;remake_running&lt;/code&gt;) rather than finishing a remake that&amp;rsquo;s still running&lt;/td&gt;
&lt;td&gt;Unit test (&lt;code&gt;TestRemakeHeld&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Links reaching a different VM&lt;/td&gt;
&lt;td&gt;The VM keeps its ID only when its state is kept, by the user&amp;rsquo;s own remake in its folder, and a link session reads the new host keys once the target starts again&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestAddLayers&lt;/code&gt;) check every state key but the image survives, the ID included, and e2e&amp;rsquo;s &lt;code&gt;project&lt;/code&gt; section checks that a VM made again keeps its settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A parent folder&amp;rsquo;s VM made again from a subfolder&lt;/td&gt;
&lt;td&gt;Asked only in a terminal (&lt;code&gt;remake_parent_vm_ask&lt;/code&gt;), which &lt;code&gt;--force&lt;/code&gt; never answers, and refused without one&lt;/td&gt;
&lt;td&gt;The CLI tests refuse it without a terminal and keep it when the answer is no&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="a-folders-volume"&gt;A folder&amp;rsquo;s volume&lt;span class="hx:absolute hx:-mt-20" id="a-folders-volume"&gt;&lt;/span&gt;
&lt;a href="#a-folders-volume" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s state records its folder&amp;rsquo;s volume beside the folder&amp;rsquo;s device, inode and birth time, so a folder that moved while a restart gave its disk another device number keeps its VM (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;). The volume is macOS&amp;rsquo;s volume UUID, from &lt;code&gt;diskutil info -plist&lt;/code&gt; for the mount point and device read from the folder opened with no link on its path, or Linux&amp;rsquo;s &lt;code&gt;f_fsid&lt;/code&gt; on ext4, Btrfs and ZFS, read from that open folder. It&amp;rsquo;s bound to the folder&amp;rsquo;s inode and birth time, so a record that an older devvm left beside another folder names no volume.&lt;/p&gt;
&lt;p&gt;The volume tells two disks apart that each have a folder with the same inode and birth time, which happens by chance or when a copy of a disk gets a volume ID of its own. It doesn&amp;rsquo;t tell a disk from a copy that keeps the volume ID, and it isn&amp;rsquo;t a secret or a signature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Who can forge one:&lt;/strong&gt; whoever can write a volume&amp;rsquo;s metadata. On macOS that&amp;rsquo;s root, any program running as you, which can attach a disk image it made with &lt;code&gt;hdiutil&lt;/code&gt; without root and without asking, or anyone who makes a disk image, sets the UUID in its bytes and gets you to attach it. On Linux, &lt;code&gt;tune2fs -U&lt;/code&gt; and &lt;code&gt;btrfstune&lt;/code&gt; need write access to the block device, which is root&amp;rsquo;s, and a crafted image needs a loop mount, which is root&amp;rsquo;s unless your desktop lets you mount images. A crafted disk or image can set the inode and birth time too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What it gets them:&lt;/strong&gt; what a copy of the disk that keeps all three already gets. At another path, devvm offers the VM to the folder only when nothing is left at the old path and the folder is yours, and moves it only after you confirm. On a disk image or an external disk mounted with its owners ignored, as macOS mounts them by default, a folder can read as yours whoever made it, so that check holds little there. At the folder&amp;rsquo;s own path, the forged disk has to be mounted over the folder&amp;rsquo;s path, and then it gets the VM as the folder&amp;rsquo;s disk would.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What a VM can do:&lt;/strong&gt; nothing here. A VM can&amp;rsquo;t attach a disk or write a volume&amp;rsquo;s metadata on the host, and devvm reads the folder&amp;rsquo;s identity, its owner, its mount point and its device from the folder opened with no link on its path, so a link a VM puts in a folder&amp;rsquo;s place can&amp;rsquo;t pass another folder off as it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its data isolation companion):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A folder on another volume with the same inode and birth time, at the folder&amp;rsquo;s own path after a restart&lt;/td&gt;
&lt;td&gt;A renumbered folder at its own path must be on the recorded volume when both are known (&lt;code&gt;platform.KeepsVolume&lt;/code&gt;), checked when devvm finds the VM and again when the start records the new device&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestKeepsVolume&lt;/code&gt;, &lt;code&gt;TestRenumberedOnAnotherVolume&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link swapped in while devvm reads the folder&lt;/td&gt;
&lt;td&gt;The identity, owner, mount point, device and &lt;code&gt;f_fsid&lt;/code&gt; come from one folder opened with no link on its path (&lt;code&gt;platform.StatFolder&lt;/code&gt;), and &lt;code&gt;diskutil&lt;/code&gt;&amp;rsquo;s answer must name that mount point and device&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestStatFolderAndVolumeUUID&lt;/code&gt;, &lt;code&gt;TestStatFolder&lt;/code&gt;, &lt;code&gt;TestMovedFrom&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A &lt;code&gt;diskutil&lt;/code&gt; that hangs or fails&lt;/td&gt;
&lt;td&gt;A lookup within 1 or 5 seconds, none after one fails in a run, and a volume that can&amp;rsquo;t be told records no volume and matches no moved folder, while a renumbered folder at its own path is then judged by its device, inode and birth time alone, as for a state that records no volume&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestVolumeOfCache&lt;/code&gt;, &lt;code&gt;TestRecordFolder&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A disk the user mounts in its place&lt;/td&gt;
&lt;td&gt;Not held, because a disk mounted at the folder&amp;rsquo;s path with the folder&amp;rsquo;s volume ID, inode and birth time is the folder to devvm, as it is to any program&lt;/td&gt;
&lt;td&gt;Documented here and in &lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="opencodes-database-in-history-exports"&gt;opencode&amp;rsquo;s database in history exports&lt;span class="hx:absolute hx:-mt-20" id="opencodes-database-in-history-exports"&gt;&lt;/span&gt;
&lt;a href="#opencodes-database-in-history-exports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;opencode 2 keeps its sessions and its logins in one SQLite database, &lt;code&gt;~/.local/share/opencode/opencode.db&lt;/code&gt; (&lt;code&gt;opencode-&amp;lt;channel&amp;gt;.db&lt;/code&gt; for another channel&amp;rsquo;s build), in WAL mode. An export of agents&amp;rsquo; history goes to this machine and can go into another VM of the folder, so it must carry the sessions without the logins. Leaving the database out would lose opencode&amp;rsquo;s history, and opencode&amp;rsquo;s own &lt;code&gt;opencode session export&lt;/code&gt; runs opencode and its server once per session, which an export before &lt;code&gt;devvm rm&lt;/code&gt; can&amp;rsquo;t count on. devvm copies the database in the VM with the &lt;code&gt;sqlite3&lt;/code&gt; that base installs (&lt;code&gt;sqlite3&lt;/code&gt; on Debian and Ubuntu, &lt;code&gt;sqlite&lt;/code&gt; on Alpine), as the VM&amp;rsquo;s user, in a temporary folder in &lt;code&gt;~/.cache&lt;/code&gt; (&lt;code&gt;opencodeClean&lt;/code&gt;):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;VACUUM INTO&lt;/code&gt; copies the database as one snapshot, with what its &lt;code&gt;-wal&lt;/code&gt; file holds, so a login that opencode saved last, which is still only in the WAL, is in the copy and taken out with the rest.&lt;/li&gt;
&lt;li&gt;In the copy, devvm drops every trigger, so none can put a row back, and empties the tables that hold logins: opencode 2.2&amp;rsquo;s &lt;code&gt;credential&lt;/code&gt; (its logins and API keys), &lt;code&gt;account&lt;/code&gt; and &lt;code&gt;control_account&lt;/code&gt; (its console&amp;rsquo;s access and refresh tokens) and &lt;code&gt;account_state&lt;/code&gt;, the &lt;code&gt;session_share&lt;/code&gt; table of an earlier opencode (each share&amp;rsquo;s secret), and any other table whose name has &lt;code&gt;credential&lt;/code&gt;, &lt;code&gt;account&lt;/code&gt;, &lt;code&gt;auth&lt;/code&gt;, &lt;code&gt;secret&lt;/code&gt;, &lt;code&gt;token&lt;/code&gt; or &lt;code&gt;share&lt;/code&gt; in it, or that has a column such as &lt;code&gt;secret&lt;/code&gt;, &lt;code&gt;api_key&lt;/code&gt;, &lt;code&gt;access_token&lt;/code&gt; or &lt;code&gt;password&lt;/code&gt;, so a table that a later opencode adds for its logins is emptied too. It also deletes the rows of the &lt;code&gt;kv&lt;/code&gt; table whose key starts with &lt;code&gt;wellknown:config:&lt;/code&gt;, because each holds an organization&amp;rsquo;s remote config, which opencode fetched with that organization&amp;rsquo;s well-known login and which can hold the organization&amp;rsquo;s keys. opencode fetches the config again once it has the login. It also empties what would run without asking in the VM that imports the copy (&lt;code&gt;opencodeUnattended&lt;/code&gt;): opencode 2.4&amp;rsquo;s &lt;code&gt;automation&lt;/code&gt; table, each automation&amp;rsquo;s trigger and the shell command it runs, which opencode approved once, as the automation was made, and never asks about again, its &lt;code&gt;permission&lt;/code&gt; table, the requests you said always to allow in a project, its &lt;code&gt;job&lt;/code&gt; table, the subagents&amp;rsquo; jobs, and its &lt;code&gt;session_inbox&lt;/code&gt; table, a session&amp;rsquo;s queued messages, which its service starts again when it starts (&lt;code&gt;restart.ts&lt;/code&gt;), and any table whose name starts with one of those names. It sets to NULL, in every table, a column named &lt;code&gt;time_suspended&lt;/code&gt;, which marks a session whose turn the service resumes on its own, and one named &lt;code&gt;commands&lt;/code&gt;, a project&amp;rsquo;s commands, whose start command opencode runs with &lt;code&gt;bash -lc&lt;/code&gt; for each worktree it makes (&lt;code&gt;opencodeNulled&lt;/code&gt;). It drops every view, as a view in an emptied table&amp;rsquo;s name could show a renamed table&amp;rsquo;s rows, and its check fails on any table with a generated column, which &lt;code&gt;pragma_table_info&lt;/code&gt; doesn&amp;rsquo;t list. Each session&amp;rsquo;s own rules are the &lt;code&gt;permission&lt;/code&gt; column of &lt;code&gt;session_v2&lt;/code&gt;, a JSON array of rules, each with an &lt;code&gt;effect&lt;/code&gt; of allow, deny or ask, so in every table with a &lt;code&gt;permission&lt;/code&gt; column, its name in any case, devvm keeps only the deny and ask rules with a text action, and a value that isn&amp;rsquo;t such an array becomes no rules (&lt;code&gt;opencodeAllowRules&lt;/code&gt;). It writes each kept rule again from the values that &lt;code&gt;sqlite3&lt;/code&gt; read, because &lt;code&gt;sqlite3&lt;/code&gt; reads a key written twice by its first value and opencode&amp;rsquo;s &lt;code&gt;JSON.parse&lt;/code&gt; by its last, so &lt;code&gt;&amp;quot;effect&amp;quot;:&amp;quot;deny&amp;quot;,&amp;quot;effect&amp;quot;:&amp;quot;allow&amp;quot;&lt;/code&gt; would otherwise stay as an allow rule for opencode. A kept rule whose resource is missing or isn&amp;rsquo;t text gets &lt;code&gt;*&lt;/code&gt;, which matches every resource, because opencode&amp;rsquo;s rules need one. It reads that JSON only where a &lt;code&gt;CASE&lt;/code&gt; has found it valid, because &lt;code&gt;sqlite3&lt;/code&gt; may read both sides of an &lt;code&gt;AND&lt;/code&gt; and fail on text that isn&amp;rsquo;t JSON.&lt;/li&gt;
&lt;li&gt;It takes out the record of opencode&amp;rsquo;s migration that imports &lt;code&gt;auth.json&lt;/code&gt; (&lt;code&gt;20260805200742_import_legacy_credentials&lt;/code&gt;), so the opencode that next opens the copy imports the logins that devvm&amp;rsquo;s setup wrote in its own VM&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt;, as it does when it first makes its database.&lt;/li&gt;
&lt;li&gt;It turns WAL off, with &lt;code&gt;secure_delete&lt;/code&gt; on, and runs &lt;code&gt;VACUUM&lt;/code&gt;, which writes the file again, so no free page keeps a deleted row and no &lt;code&gt;-wal&lt;/code&gt; or &lt;code&gt;-journal&lt;/code&gt; file is left.&lt;/li&gt;
&lt;li&gt;It checks what &lt;code&gt;sqlite3&lt;/code&gt; printed, not only that it succeeded. Right after &lt;code&gt;VACUUM INTO&lt;/code&gt;, the copy must have as many tables as the database, and at least one. At the end, devvm counts the triggers and views, the generated columns, the rows of each table it emptied, the values left in each column it set to NULL, the rows whose &lt;code&gt;permission&lt;/code&gt; still holds anything but deny and ask rules, and the &lt;code&gt;kv&lt;/code&gt; rows it deleted, and each count must be &lt;code&gt;0&lt;/code&gt;, so a &lt;code&gt;sqlite3&lt;/code&gt; that runs nothing and prints nothing fails the check too. When a check or any step fails, the database is left out of the export and the run log says why.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The export&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; leaves out the database and its &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt; and &lt;code&gt;-journal&lt;/code&gt; files as they are, matched within opencode&amp;rsquo;s folder, and adds the copy at the database&amp;rsquo;s path (&lt;code&gt;--transform&lt;/code&gt;, which leaves symlinks&amp;rsquo; targets alone). The import does the same to an export it unpacks, in the VM, before anything reaches the home folder: it deletes the &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt; and &lt;code&gt;-journal&lt;/code&gt; files and any database that isn&amp;rsquo;t a regular file, and puts in each database&amp;rsquo;s copy, or deletes the database when the VM has no &lt;code&gt;sqlite3&lt;/code&gt; or the copy fails. Each &lt;code&gt;sqlite3&lt;/code&gt; runs with &lt;code&gt;trusted_schema&lt;/code&gt; off, so an imported database&amp;rsquo;s schema can&amp;rsquo;t call the CLI&amp;rsquo;s functions that write files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A secret that&amp;rsquo;s in a session itself,&lt;/strong&gt; such as a key you pasted into a prompt, stays in the session, as it does in Claude Code&amp;rsquo;s and Codex&amp;rsquo;s transcripts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A plugin&amp;rsquo;s own storage and a remote workspace&amp;rsquo;s binding stay.&lt;/strong&gt; opencode keeps each plugin&amp;rsquo;s storage in its &lt;code&gt;kv&lt;/code&gt; table, under the plugin&amp;rsquo;s own prefix, and each remote workspace&amp;rsquo;s binding, the record its provider needs to reconnect, in its &lt;code&gt;workspace&lt;/code&gt; table. opencode&amp;rsquo;s built-in plugins keep model catalogs and session records there, but a plugin you install, or a workspace provider, that keeps a token there takes it into the export.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM without &lt;code&gt;sqlite3&lt;/code&gt;,&lt;/strong&gt; made from an image built without it, exports and imports no opencode database, and opencode&amp;rsquo;s sessions are lost from that export.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;opencode&amp;rsquo;s own agents keep their rules.&lt;/strong&gt; A session keeps its agent, and a turn is checked against that agent&amp;rsquo;s built-in rules too, such as &lt;code&gt;explore&lt;/code&gt;&amp;rsquo;s, which allow its shell commands. With no suspended session, job or queued message, no turn starts until you send one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A host password that looks like a variable&amp;rsquo;s name or a number.&lt;/strong&gt; Settings&amp;rsquo; copies keep a value that looks like an environment variable&amp;rsquo;s name or a switch (&lt;code&gt;envName&lt;/code&gt;, &lt;code&gt;plainValue&lt;/code&gt;), so a service password set by hand in that form reached VMs as it was, with no &lt;code&gt;devvm-redacted&lt;/code&gt; for the setup&amp;rsquo;s clean-up to find; the release page says what to do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;event&lt;/code&gt; table stays as it is.&lt;/strong&gt; It holds the events that opencode&amp;rsquo;s sessions were made from, a &lt;code&gt;session.permissions&lt;/code&gt; event&amp;rsquo;s rules among them, and opencode 2.4.1 writes an event into &lt;code&gt;session_v2&lt;/code&gt; as it publishes it (its session projector), not when it opens a database, so the copy&amp;rsquo;s rules are the ones opencode reads. A later opencode that rebuilt its sessions from that table would read the allow rules again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A remake&amp;rsquo;s home folder copy&lt;/strong&gt; keeps opencode&amp;rsquo;s database with its logins, and its home key, because it&amp;rsquo;s the same VM&amp;rsquo;s data going into the same folder&amp;rsquo;s new VM (&lt;a href="#the-home-folders-copy"&gt;the home folder&amp;rsquo;s copy&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;opencode 2.4 keeps the private Ed25519 key of its home, which every machine it pairs with &lt;code&gt;opencode machine add&lt;/code&gt; trusts and which it never replaces, in a file of its own, &lt;code&gt;~/.local/state/opencode/machine/home-key&lt;/code&gt;, not in the database. The database&amp;rsquo;s &lt;code&gt;machine&lt;/code&gt; table holds each paired machine&amp;rsquo;s name and the public key it logs in to the home with, so it&amp;rsquo;s the VM&amp;rsquo;s own pairings, and the copy empties it with the login tables (&lt;code&gt;opencodeLogins&lt;/code&gt;). The key&amp;rsquo;s folder, the background service&amp;rsquo;s registration (&lt;code&gt;service.json&lt;/code&gt;, or &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; on a channel other than latest, dev, beta or next, with the service&amp;rsquo;s password, written through &lt;code&gt;&amp;lt;file&amp;gt;.&amp;lt;id&amp;gt;.tmp&lt;/code&gt;, and &lt;code&gt;&amp;lt;file&amp;gt;.pty-handoff&lt;/code&gt;, a terminal&amp;rsquo;s handoff ticket, written through &lt;code&gt;&amp;lt;file&amp;gt;.pty-handoff.&amp;lt;uuid&amp;gt;.tmp&lt;/code&gt;) and the terminals&amp;rsquo; daemons (&lt;code&gt;pty&lt;/code&gt;, their sockets and access tokens) are opencode&amp;rsquo;s &lt;code&gt;HistoryOwn&lt;/code&gt; in the agents&amp;rsquo; registry: the export leaves them out and the import never writes them, while a remake keeps them. The registrations are patterns, &lt;code&gt;service-*.json&lt;/code&gt;, &lt;code&gt;service.json.*&lt;/code&gt; and &lt;code&gt;service-*.json.*&lt;/code&gt;, which the export&amp;rsquo;s GNU &lt;code&gt;tar --exclude&lt;/code&gt; and the import&amp;rsquo;s &lt;code&gt;tar --exclude&lt;/code&gt; and its clean-up loop, a shell glob, all expand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its data isolation companion):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A key typed into opencode in the VM reaching this machine&amp;rsquo;s export&lt;/td&gt;
&lt;td&gt;The export holds only the copy, whose login tables are empty and whose file is written again by &lt;code&gt;VACUUM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestOpencodeClean&lt;/code&gt;, &lt;code&gt;TestHistoryExportRuns&lt;/code&gt;) plant a credential, an account&amp;rsquo;s tokens, a share&amp;rsquo;s secret and a later table&amp;rsquo;s key, the credential only in the WAL of an open connection, and find none of them in any byte of the copy or the export; e2e&amp;rsquo;s &lt;code&gt;network&lt;/code&gt; section plants a key with the VM&amp;rsquo;s &lt;code&gt;sqlite3&lt;/code&gt; and finds neither it nor the login&amp;rsquo;s placeholders in the export&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The WAL or journal file carrying the rows&lt;/td&gt;
&lt;td&gt;They never go into an export, and an import deletes them&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryExportRuns&lt;/code&gt; and &lt;code&gt;TestHistoryImportCleansOpencode&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An export with the logins in it reaching another VM&lt;/td&gt;
&lt;td&gt;The import makes the same copy in the VM before anything reaches its home folder, or leaves the database out&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryImportCleansOpencode&lt;/code&gt;, with and without &lt;code&gt;sqlite3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A trigger putting a row back as it&amp;rsquo;s deleted&lt;/td&gt;
&lt;td&gt;Every trigger is dropped first, and the rows are counted after&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestOpencodeClean&lt;/code&gt; plants one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A hostile VM&amp;rsquo;s export running a command, or allowing one, without asking in the VM that imports it&lt;/td&gt;
&lt;td&gt;The copy empties &lt;code&gt;automation&lt;/code&gt;, &lt;code&gt;permission&lt;/code&gt;, &lt;code&gt;job&lt;/code&gt; and &lt;code&gt;session_inbox&lt;/code&gt;, and every table whose name starts with one of those names, sets &lt;code&gt;time_suspended&lt;/code&gt; and &lt;code&gt;commands&lt;/code&gt; to NULL, keeps only the deny and ask rules of each &lt;code&gt;permission&lt;/code&gt; column, written again, drops views and refuses generated columns; the counts after must be &lt;code&gt;0&lt;/code&gt;. The export leaves out opencode&amp;rsquo;s git repositories (&lt;code&gt;snapshot&lt;/code&gt;, &lt;code&gt;repos&lt;/code&gt;, &lt;code&gt;worktree&lt;/code&gt;), and the import never writes them&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestOpencodeCleanSchema&lt;/code&gt; plants a row in each from opencode 2.4.1&amp;rsquo;s schema, an allow rule, a suspended session and a project&amp;rsquo;s commands; &lt;code&gt;TestOpencodeCleanSessionRules&lt;/code&gt; plants rules that aren&amp;rsquo;t deny or ask, a key written twice, values that aren&amp;rsquo;t rules and a column in upper case; &lt;code&gt;TestOpencodeCleanHidden&lt;/code&gt; a view and a generated column; &lt;code&gt;TestHistoryExportRuns&lt;/code&gt; and &lt;code&gt;TestHistoryImportRuns&lt;/code&gt; the git folders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;opencode&amp;rsquo;s home key reaching this machine&amp;rsquo;s export or another VM&lt;/td&gt;
&lt;td&gt;The export leaves out its &lt;code&gt;machine&lt;/code&gt; folder, &lt;code&gt;service.json&lt;/code&gt;, &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt;, their handoff and temporary files, and &lt;code&gt;pty&lt;/code&gt;, and the import never writes them, by their paths after it unpacks too; the copy of the database empties its &lt;code&gt;machine&lt;/code&gt; table, the paired machines&amp;rsquo; public keys&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryExportRuns&lt;/code&gt;, &lt;code&gt;TestHistoryImportRuns&lt;/code&gt; and &lt;code&gt;TestHistoryImportV010&lt;/code&gt; plant them; &lt;code&gt;TestOpencodeCleanSchema&lt;/code&gt; empties &lt;code&gt;machine&lt;/code&gt; from opencode 2.4.1&amp;rsquo;s schema; &lt;code&gt;TestHomeSkipsEveryLogin&lt;/code&gt; keeps them in a remake&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A hostile database&amp;rsquo;s schema running code in the VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;trusted_schema&lt;/code&gt; is off, and it runs as the VM&amp;rsquo;s user on the VM&amp;rsquo;s own files, which the export&amp;rsquo;s code could reach anyway&lt;/td&gt;
&lt;td&gt;Reviewed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="links-out-of-an-agents-folder"&gt;Links out of an agent&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="links-out-of-an-agents-folder"&gt;&lt;/span&gt;
&lt;a href="#links-out-of-an-agents-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s agent store reaches every VM with the agent: its folders are mounted read-only, its files are copied in at every launch, and the hooks, MCP servers&amp;rsquo; commands and plugins in it run in each of those VMs. So whatever &lt;code&gt;devvm agent import&lt;/code&gt; copies is something every such VM reads and runs. A link in an agent&amp;rsquo;s folder that leads out of it can lead anywhere on this machine, such as to &lt;code&gt;~/.ssh&lt;/code&gt;, to another agent&amp;rsquo;s login, or into a folder that a VM can write, such as a dotfiles repo that is also a devvm project. Following such links unasked would let a mistaken link put a secret into every VM, and let a VM that writes the folder a link leads into change what every other VM&amp;rsquo;s agent runs. That&amp;rsquo;s why the import follows no link out of an agent&amp;rsquo;s folder by default, and reads each folder through itself as an &lt;code&gt;os.Root&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#links-out-of-an-agents-folder"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Dotfiles repos keep settings as links all the same, and copying them into the store by hand is lost at the next import, so devvm follows them when you allow it, in two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;follow-links&lt;/code&gt;&lt;/strong&gt; names folders, such as &lt;code&gt;~/dotfiles&lt;/code&gt;, whose links devvm follows without asking. You choose a folder once, for every import, so devvm checks the folder as a whole: one that is, holds or is inside a refused place fails the import, because a link inside it can lead anywhere in it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--follow-links&lt;/code&gt;, or a yes to the question,&lt;/strong&gt; follows one run&amp;rsquo;s links after naming each and where it leads, so you see every target before anything is copied. Without a terminal, no link out is followed unless the flag is given, and each is named in a warning, so a script never follows a link it didn&amp;rsquo;t ask for. The folder each is read through is the link&amp;rsquo;s own target, or a linked file&amp;rsquo;s own folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whichever allows it, the same rules hold:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Resolved first, read inside.&lt;/strong&gt; devvm resolves every link on the way to the target, checks that target, then reads it through the allowed folder as a root, which it opens one folder at a time from &lt;code&gt;/&lt;/code&gt;, never through a link. A link inside what it copies is read only when it leads to a file inside the same root.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Always refused.&lt;/strong&gt; devvm never follows a link to the home folder or a folder holding it, to devvm&amp;rsquo;s config, data or Lima folders, to &lt;code&gt;~/.ssh&lt;/code&gt;, &lt;code&gt;~/.gnupg&lt;/code&gt;, &lt;code&gt;~/.aws&lt;/code&gt;, &lt;code&gt;~/Library/Keychains&lt;/code&gt;, &lt;code&gt;~/.config/devvm&lt;/code&gt;, &lt;code&gt;~/.netrc&lt;/code&gt;, &lt;code&gt;~/.config/gh&lt;/code&gt;, &lt;code&gt;~/.docker&lt;/code&gt; or &lt;code&gt;~/.kube&lt;/code&gt;, or to any agent&amp;rsquo;s logins or history, nor into one of them or to a folder holding one. The home folder holds all of them, devvm&amp;rsquo;s folders hold its CA keys, binaries and every VM&amp;rsquo;s disk, and the agents&amp;rsquo; logins and history are what the store exists to keep apart from VMs. The named folders are the places that commonly hold credentials, and the list can&amp;rsquo;t name every one, which is why the question names each target and the setting takes folders you choose.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s folder warns.&lt;/strong&gt; A target in a VM&amp;rsquo;s project folder, or a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s source folder, is followed with a warning naming the VM, because that VM can change what every VM&amp;rsquo;s agent reads from the next import on. Refusing it would refuse the common case of a dotfiles repo that you also work on in a VM, and the warning leaves the choice with you. A chain that passes through a link in a VM&amp;rsquo;s folder to a place outside it is refused, though, because the VM chose that place, and it could name any file the refused list doesn&amp;rsquo;t.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compared by identity.&lt;/strong&gt; devvm compares a target with the refused places and the VMs&amp;rsquo; folders by name and by file identity, because a Mac&amp;rsquo;s file system ignores case, so &lt;code&gt;~/.SSH&lt;/code&gt; names &lt;code&gt;~/.ssh&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copies only.&lt;/strong&gt; The store gets a copy of each file and folder, never a link, and the next import replaces or takes out each copy as it does the agent&amp;rsquo;s own files. devvm agent save still refuses a link the VM sends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounded.&lt;/strong&gt; One import copies at most 20,000 files and folders, 128 MiB and a file of 16 MiB through links, the bounds of devvm agent save, so a link to a large tree can&amp;rsquo;t fill the store.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The copy is as the target was at the import.&lt;/strong&gt; A VM that writes a followed folder later changes nothing in the store until the next import, which then copies what it wrote. The warning names that VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A refused place under another name,&lt;/strong&gt; such as a credential folder that the list doesn&amp;rsquo;t name, is copied when a link you allowed leads to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A huge folder is read before the bounds stop it.&lt;/strong&gt; devvm lists each folder whole before it counts its entries, so a folder of millions of entries costs memory on this machine before the import leaves it out.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, an independent review of the code):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A VM swapping a link into the path of an allowed folder, or into what&amp;rsquo;s being read&lt;/td&gt;
&lt;td&gt;The root is opened one folder at a time from &lt;code&gt;/&lt;/code&gt;, never through a link, and everything below it is read through it as a root, without blocking and without following a swapped-in link&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestOpenPhysical&lt;/code&gt;, &lt;code&gt;TestAgentImportNestedLinks&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM choosing the target through a link in its project folder&lt;/td&gt;
&lt;td&gt;Every link on the way is kept, and a chain through a VM&amp;rsquo;s folder to a place outside it is refused, whatever allows it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportLinkThroughProject&lt;/code&gt;; the review found it first, and it&amp;rsquo;s fixed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A refused place spelled another way, such as &lt;code&gt;~/.SSH&lt;/code&gt; on a Mac&lt;/td&gt;
&lt;td&gt;Targets are compared with the places by identity as well as by name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportRefusedOtherCase&lt;/code&gt;; the review found it first, and it&amp;rsquo;s fixed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link to a secret, a login or devvm&amp;rsquo;s own files&lt;/td&gt;
&lt;td&gt;The refused places, checked on every target and every &lt;code&gt;follow-links&lt;/code&gt; folder&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportRefusedPlaces&lt;/code&gt;, &lt;code&gt;TestAgentImportRefusedRoots&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A write outside the store&lt;/td&gt;
&lt;td&gt;Names come from real folder entries under the link&amp;rsquo;s own path, and the store&amp;rsquo;s clean-up goes through the store as a root&lt;/td&gt;
&lt;td&gt;Reviewed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A FIFO, a device, a huge or growing file, a loop&lt;/td&gt;
&lt;td&gt;Reads refuse anything but a regular file, the bounds are checked when listing and again when reading, and loops end at the bounds or the system&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportLinkBounds&lt;/code&gt;, &lt;code&gt;TestLinkSourceGrown&lt;/code&gt;, &lt;code&gt;TestLinkHops&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link followed without the user seeing it&lt;/td&gt;
&lt;td&gt;Without a terminal nothing is followed unless the flag is given, and each link followed is named&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportFollowsLinks&lt;/code&gt;, &lt;code&gt;agent_import_links&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What VMs get&lt;/td&gt;
&lt;td&gt;Copies only, mounted read-only like the rest of the store&lt;/td&gt;
&lt;td&gt;e2e&amp;rsquo;s &lt;code&gt;project&lt;/code&gt; section reads the linked skill&amp;rsquo;s copy in a VM and finds root can&amp;rsquo;t write it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="claude-codes-plugins-a-seed-and-a-folder-of-the-vms-own"&gt;Claude Code&amp;rsquo;s plugins: a seed and a folder of the VM&amp;rsquo;s own&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-plugins-a-seed-and-a-folder-of-the-vms-own"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-plugins-a-seed-and-a-folder-of-the-vms-own" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Claude Code writes into its plugins folder whenever it runs: each plugin&amp;rsquo;s data, which a plugin reaches as &lt;code&gt;${CLAUDE_PLUGIN_DATA}&lt;/code&gt;, the plugins it installs, its marketplaces&amp;rsquo; copies and their updates, its MCP bundles and its records. devvm&amp;rsquo;s agent store holds one plugins folder for every VM with Claude Code, mounted read-only, so if that folder were each VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt;, every one of those writes would fail. A plugin that keeps data would break, and no plugin could be installed in a VM. Making the store&amp;rsquo;s folder writable would fix the writes, but every VM shares it, so a VM could then change the plugins, hooks and MCP servers&amp;rsquo; commands that Claude Code runs in every other VM, and keep a foothold in each of them after you delete it. That isn&amp;rsquo;t an escape to this machine, but it breaks the line between VMs that the store&amp;rsquo;s read-only mounts hold for every other agent folder.&lt;/p&gt;
&lt;p&gt;So each VM&amp;rsquo;s plugins folder is its own, on its own disk, and the store&amp;rsquo;s folder is Claude Code&amp;rsquo;s seed, a plugins folder that Claude Code reads but never writes, which it supports for container images and CI (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-plugins"&gt;how&lt;/a&gt;). Its two variables, &lt;code&gt;CLAUDE_CODE_PLUGIN_CACHE_DIR&lt;/code&gt; and &lt;code&gt;CLAUDE_CODE_PLUGIN_SEED_DIR&lt;/code&gt;, are Claude Code&amp;rsquo;s own, so devvm patches nothing in Claude Code and copies nothing into the VM at a launch, and the seed stays one mount that every VM reads. What a VM writes stays in that VM, and what it installed reaches the store, and every VM, only through &lt;code&gt;devvm agent save&lt;/code&gt;, whose diff you read before you answer yes. The import and the save copy only the entries a seed has, the marketplaces&amp;rsquo; records, their copies and the plugins&amp;rsquo; cache, because the rest of the folder is each machine&amp;rsquo;s own. Each plugin&amp;rsquo;s data can hold its own logins, and this machine&amp;rsquo;s plugins&amp;rsquo; data in the store would reach every VM.&lt;/p&gt;
&lt;p&gt;The save never takes a plugin out of the store, because a VM&amp;rsquo;s folder holds only what that VM installed, not the store&amp;rsquo;s plugins, which it reads from the seed, so a plugin missing from it isn&amp;rsquo;t one the VM removed. Taking out what the VM&amp;rsquo;s folder lacks would empty the store of every plugin the VM didn&amp;rsquo;t install itself. The VM&amp;rsquo;s marketplaces&amp;rsquo; records join the store&amp;rsquo;s for the same reason, and only a record whose copy is in the store&amp;rsquo;s marketplaces folder joins, so the records that Claude Code made of the seed&amp;rsquo;s own marketplaces stay as the store has them, and a record can&amp;rsquo;t point other VMs elsewhere.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A marketplace in a folder on this machine&lt;/strong&gt; reaches a VM only when that folder is in the VM too, because Claude Code reads such a marketplace where it is, and a seed holds no copy of it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A plugin&amp;rsquo;s data stays in its VM.&lt;/strong&gt; A new VM, or one made from an export of another&amp;rsquo;s history, starts each plugin&amp;rsquo;s data afresh, and so does every VM after you install a plugin there, as the export leaves the VM&amp;rsquo;s plugins folder out.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A plugin installed in a VM runs in that VM&lt;/strong&gt; with whatever it does, as a plugin does on this machine. devvm keeps it from the other VMs until you save it, and the save&amp;rsquo;s diff shows what it adds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, a hostile VM writing what other VMs or this machine run):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A VM writing the store&amp;rsquo;s plugins, which every VM runs&lt;/td&gt;
&lt;td&gt;The store&amp;rsquo;s folder stays mounted read-only, and the VM&amp;rsquo;s writes go to its own folder&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestClaudePluginsSeed&lt;/code&gt;, &lt;code&gt;sync&lt;/code&gt;&amp;rsquo;s links and &lt;code&gt;own-dirs&lt;/code&gt;, e2e&amp;rsquo;s &lt;code&gt;project&lt;/code&gt; section&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A save that sends more than the seed&amp;rsquo;s entries, such as a plugin&amp;rsquo;s data&lt;/td&gt;
&lt;td&gt;The VM&amp;rsquo;s script sends only the seed&amp;rsquo;s entries, and devvm saves nothing when the stream has any other entry of the folder&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestReadSentClaudePlugins&lt;/code&gt;, &lt;code&gt;TestAgentSaveScriptClaudePlugins&lt;/code&gt;, &lt;code&gt;agent_save&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;This machine&amp;rsquo;s plugins&amp;rsquo; data reaching every VM&lt;/td&gt;
&lt;td&gt;The import copies only the seed&amp;rsquo;s entries, through links too&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportClaudePlugins&lt;/code&gt;, &lt;code&gt;agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;This machine&amp;rsquo;s plugins&amp;rsquo; data that devvm 0.1.0&amp;rsquo;s import left in the store&lt;/td&gt;
&lt;td&gt;Every start takes the store&amp;rsquo;s entries that a seed lacks out before the VM runs, from devvm&amp;rsquo;s config folder as a root, refusing a link anywhere on the path and following none among the entries, and a VM with Claude Code doesn&amp;rsquo;t start while they can&amp;rsquo;t go&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestCleanSeeds&lt;/code&gt;, &lt;code&gt;TestCleanSeedsFails&lt;/code&gt;, &lt;code&gt;fixture_v010_plugins&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM&amp;rsquo;s paths in the records it saves&lt;/td&gt;
&lt;td&gt;The records&amp;rsquo; paths to the VM&amp;rsquo;s plugins folder are renamed to the store&amp;rsquo;s, only a record whose copy is in the store&amp;rsquo;s &lt;code&gt;marketplaces&lt;/code&gt; by a clean path joins the store&amp;rsquo;s, and a records file that isn&amp;rsquo;t a JSON object is left out&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentSaveClaudePlugins&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A name in the VM&amp;rsquo;s plugins folder that the save&amp;rsquo;s script would read as a pattern&lt;/td&gt;
&lt;td&gt;It&amp;rsquo;s sent rather than excluded, and devvm refuses the save&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentSaveScriptClaudePlugins&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A plugin&amp;rsquo;s data, or what a VM installed, reaching another VM through an export&lt;/td&gt;
&lt;td&gt;The export and the import leave out the VM&amp;rsquo;s plugins folder, and the import leaves out the seed&amp;rsquo;s link&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestClaudePluginsHistory&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An export that names the VM&amp;rsquo;s plugins folder another way, such as &lt;code&gt;.claude/./plugins&lt;/code&gt;, past the import&amp;rsquo;s excludes, as the folder is writable&lt;/td&gt;
&lt;td&gt;The import refuses a name with a &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;..&lt;/code&gt; or empty part, and deletes what it leaves out by its path once unpacked. The review found it first, and it&amp;rsquo;s fixed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryImportRuns&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="the-9p-cache-on-linux"&gt;The 9p cache on Linux&lt;span class="hx:absolute hx:-mt-20" id="the-9p-cache-on-linux"&gt;&lt;/span&gt;
&lt;a href="#the-9p-cache-on-linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On a Linux host, Lima&amp;rsquo;s QEMU shares the project folder over 9p, and Lima mounts a writable 9p share with &lt;code&gt;cache=mmap&lt;/code&gt; unless the VM&amp;rsquo;s config says otherwise (read-only ones with &lt;code&gt;fscache&lt;/code&gt;). The guest kernel&amp;rsquo;s 9p client has a race in that mode, which &lt;a href="https://lore.kernel.org/all/[email protected]/" target="_blank" rel="noopener"&gt;Pierre Barre&amp;rsquo;s patch&lt;/a&gt; describes and which isn&amp;rsquo;t merged. A &lt;code&gt;stat()&lt;/code&gt; that runs while a &lt;code&gt;write()&lt;/code&gt; makes a file longer refreshes the inode from the server, which still has the old size, so the client takes that size over its own, and writeback then drops the pages past it. &lt;code&gt;fsync&lt;/code&gt; succeeds, yet the file reaches the host empty or cut to 4096 bytes. Claude Code&amp;rsquo;s Edit tool sets it off, and so can any editor or build that stats files as they&amp;rsquo;re written. macOS isn&amp;rsquo;t affected, because Lima&amp;rsquo;s &lt;code&gt;vz&lt;/code&gt; VMs mount the folder with virtiofs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mmap&lt;/code&gt; has a second bug on the guest kernel devvm&amp;rsquo;s base boots (Ubuntu 26.04&amp;rsquo;s 7.0), which doesn&amp;rsquo;t depend on timing. After a process writes a file and takes a POSIX lock or an &lt;code&gt;flock&lt;/code&gt; on it, its next read of that data returns zeros, though the host has the data and another process reads it. On such a lock, the 9p client writes the file&amp;rsquo;s pages back and drops them, and the next buffered read through netfs returns zeros. SQLite takes a shared lock at the start of each transaction, so its second transaction reads page 1 as zeros and stops with &lt;code&gt;SQLITE_NOTADB&lt;/code&gt; (&amp;ldquo;file is not a database&amp;rdquo;), in its default journal mode as in WAL mode, and Gradle&amp;rsquo;s daemon, which keeps its lock files in &lt;code&gt;.gradle/&lt;/code&gt; open across builds, fails from its second build with &amp;ldquo;Unexpected lock protocol found in lock file&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;none&lt;/code&gt;, the one mode devvm sets.&lt;/strong&gt; With &lt;code&gt;cache=none&lt;/code&gt;, the client caches neither pages nor sizes, so every write goes to the host as it&amp;rsquo;s made, no stat can roll a size back and no lock drops data. It takes away shared writable &lt;code&gt;mmap&lt;/code&gt;, which 9p allows only with writeback caching: a shared mapping of a file opened for writing fails with &lt;code&gt;EINVAL&lt;/code&gt;, even one that&amp;rsquo;s only read. That fails at once, so nothing is lost, and only programs that keep a database or an index in the folder do it: SQLite&amp;rsquo;s WAL mode, whose &lt;code&gt;-shm&lt;/code&gt; index is such a mapping, unless the connection sets &lt;code&gt;locking_mode=EXCLUSIVE&lt;/code&gt; first, which keeps the index on the heap; LMDB, which Parcel&amp;rsquo;s &lt;code&gt;.parcel-cache&lt;/code&gt; and Gatsby&amp;rsquo;s cache use; numpy&amp;rsquo;s &lt;code&gt;memmap&lt;/code&gt; in &lt;code&gt;r+&lt;/code&gt; or &lt;code&gt;w+&lt;/code&gt; mode; Java&amp;rsquo;s read-write &lt;code&gt;MappedByteBuffer&lt;/code&gt;; and the mold linker, which maps its output. Each of them works on the VM&amp;rsquo;s own disk, in its home folder or in a &lt;code&gt;--clone&lt;/code&gt; VM, faster than under any 9p mode. &lt;code&gt;mmap&lt;/code&gt; is faster than &lt;code&gt;none&lt;/code&gt; only for large sequential files, about 7 to 12 times for 1 GiB, 1.3 to 1.5 times for cargo, and within 10 to 20% for git, npm, Vite, Go and &lt;code&gt;rg&lt;/code&gt;, while the VM&amp;rsquo;s own disk is faster still by far, from about 2 times for &lt;code&gt;npm ci&lt;/code&gt; to over 20 for a cold &lt;code&gt;git status&lt;/code&gt; (measured on a Fedora 43 host). So devvm doesn&amp;rsquo;t offer &lt;code&gt;mmap&lt;/code&gt;, which would trade two ways of losing data for what the VM&amp;rsquo;s own disk does better. It doesn&amp;rsquo;t offer &lt;code&gt;loose&lt;/code&gt; or &lt;code&gt;fscache&lt;/code&gt; either: they allow the same mappings, share &lt;code&gt;mmap&lt;/code&gt;&amp;rsquo;s SQLite failure in a worse form, as the database can&amp;rsquo;t be opened again at all, and cache files&amp;rsquo; contents and metadata in the guest without asking the host, so the guest misses edits you make on this machine, which devvm&amp;rsquo;s mounted folder exists for.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Existing VMs opt in.&lt;/strong&gt; A VM made before devvm chose &lt;code&gt;none&lt;/code&gt; has no mode in its state, and its starts leave its mount&amp;rsquo;s cache as it is, so an upgrade changes nothing in how such a VM uses its folder. Each launch of such a VM warns of the risk and names &lt;code&gt;devvm mount-cache none&lt;/code&gt;, which ends the warning. &lt;code&gt;none&lt;/code&gt; is the only value the command takes, so there&amp;rsquo;s no default to choose and no &lt;code&gt;-g&lt;/code&gt; or &lt;code&gt;config.toml&lt;/code&gt; key: every new VM gets &lt;code&gt;none&lt;/code&gt;, and so does the folder &lt;code&gt;devvm clone off&lt;/code&gt; mounts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Build VMs&amp;rsquo; output folders get &lt;code&gt;none&lt;/code&gt; too.&lt;/strong&gt; The shared tools&amp;rsquo; build writes its EROFS images into a writable mount with &lt;code&gt;mkfs.erofs&lt;/code&gt;, and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion writes its disk into one with &lt;code&gt;mke2fs&lt;/code&gt;, and neither maps its output for shared writing, so &lt;code&gt;none&lt;/code&gt; takes nothing from them. The read-only mounts, agents&amp;rsquo; folders and the shared tools, keep Lima&amp;rsquo;s &lt;code&gt;fscache&lt;/code&gt;: the guest can&amp;rsquo;t write them, so the race has no write to drop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One edit.&lt;/strong&gt; The mode is a mount&amp;rsquo;s &lt;code&gt;9p: cache:&lt;/code&gt; option, which devvm compares with what &lt;code&gt;limactl list&lt;/code&gt; shows and sets only where it differs, in the start&amp;rsquo;s one &lt;code&gt;limactl edit&lt;/code&gt;, as any edit gives the VM new ssh host keys. &lt;code&gt;limactl list&lt;/code&gt; fills each mount&amp;rsquo;s other 9p and sshfs settings in, at Lima&amp;rsquo;s defaults where &lt;code&gt;lima.yaml&lt;/code&gt; sets none. A rewrite of the mounts keeps only the settings devvm knows (9p&amp;rsquo;s security model, protocol version and message size, sshfs&amp;rsquo;s cache, symlinks and SFTP driver) where they differ from Lima&amp;rsquo;s defaults, as the VM&amp;rsquo;s own, and drops the rest, so no default gets written into &lt;code&gt;lima.yaml&lt;/code&gt;, where a later Lima&amp;rsquo;s would never reach it. A setting devvm doesn&amp;rsquo;t know, such as one a later Lima adds, is dropped too, for Lima to fill in, as devvm can&amp;rsquo;t tell its default from a value someone gave: it has no YAML parser to read &lt;code&gt;lima.yaml&lt;/code&gt; itself. Editing only devvm&amp;rsquo;s own fields with &lt;code&gt;--set&lt;/code&gt; instead (&lt;code&gt;.mounts[0][&amp;quot;9p&amp;quot;].cache = &amp;quot;none&amp;quot;&lt;/code&gt;, which Lima takes) would keep everything else as it is, but a moved folder or other agents&amp;rsquo; folders would then need edits by index and by selector, which the CLI tests&amp;rsquo; limactl stub doesn&amp;rsquo;t model, so devvm rewrites the mounts whole. The defaults are the ones in the golden fixture of real Lima&amp;rsquo;s &lt;code&gt;limactl list&lt;/code&gt; (Lima 2.2), which &lt;code&gt;TestMountRoundTrip&lt;/code&gt; checks, so a later fixture that changes them fails that test; until then, a known setting whose default a later Lima changes keeps the old default through a rewrite.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The remount.&lt;/strong&gt; Lima&amp;rsquo;s cloud-init writes the new options into the guest&amp;rsquo;s &lt;code&gt;/etc/fstab&lt;/code&gt; at the boot after the edit, but systemd has mounted the folder by the old line by then, and a 9p share keeps its tag. So that start unmounts the folder and mounts it again from &lt;code&gt;/etc/fstab&lt;/code&gt; once the VM runs, with a minute&amp;rsquo;s limit and its output in the run log, then checks it with &lt;code&gt;mountpoint&lt;/code&gt; and the folder&amp;rsquo;s line of &lt;code&gt;/proc/self/mountinfo&lt;/code&gt;, which a POSIX &lt;code&gt;awk&lt;/code&gt; picks by its mount point, as &lt;code&gt;mountinfo&lt;/code&gt; escapes it (a space as &lt;code&gt;\040&lt;/code&gt;). The check is portable: it runs with any guest&amp;rsquo;s &lt;code&gt;awk&lt;/code&gt;, busybox&amp;rsquo;s too, and depends on no util-linux tool, such as &lt;code&gt;findmnt&lt;/code&gt;, but &lt;code&gt;mountpoint&lt;/code&gt;, which busybox has as well. devvm reads at most 4 KiB of the answer and only its last line, the mount visible at the folder where mounts are stacked, takes the mount&amp;rsquo;s options and its file system&amp;rsquo;s from it, refuses an answer that isn&amp;rsquo;t a &lt;code&gt;mountinfo&lt;/code&gt; line, and names any mode but &lt;code&gt;none&lt;/code&gt; and &lt;code&gt;mmap&lt;/code&gt; as unknown. The remount&amp;rsquo;s and the check&amp;rsquo;s output pipes close a second after the commands end or time out, as limactl shell&amp;rsquo;s ssh can leave a child that holds them open.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The restart.&lt;/strong&gt; A folder that isn&amp;rsquo;t mounted, one still mounted with the old mode, or a check that gets no answer gets one restart. The remount fails when something the VM started at boot holds the share, when a degraded start mounted it again by the old line, or on an Alpine guest with OpenRC, whose &lt;code&gt;mount&lt;/code&gt; after a successful &lt;code&gt;umount&lt;/code&gt; finds the share already mounted or busy. The Lima backend writes why in the run log, stops the VM under one status step, and fails the start with a &lt;code&gt;RemountError&lt;/code&gt;, and the start&amp;rsquo;s caller (&lt;code&gt;starter.start&lt;/code&gt;) starts the VM again once, all of it: a new proxy that follows the new hostagent, the &lt;code&gt;.git&lt;/code&gt; pins applied in QEMU&amp;rsquo;s new namespace, the host keys read again for the new start, and the start recorded. The caller restarts the VM, not the backend, because the proxy follows one start&amp;rsquo;s hostagent and exits when the VM stops. The guest&amp;rsquo;s &lt;code&gt;/etc/fstab&lt;/code&gt; has the new mode by then, so the restart&amp;rsquo;s boot mounts the folder with it, and that start&amp;rsquo;s &lt;code&gt;Want.CheckCache&lt;/code&gt; asks the backend for the same check without the remount. That check is the last, and nothing it finds restarts the VM again. A folder that isn&amp;rsquo;t mounted stops the VM and fails the start before its setup or shell, as an agent&amp;rsquo;s writes there would land on the VM&amp;rsquo;s disk and vanish under the share at its next mount (&lt;code&gt;mount_cache_unmounted&lt;/code&gt;, which names &lt;code&gt;devvm restart&lt;/code&gt;), and so does a check that gets no answer (&lt;code&gt;mount_cache_unchecked&lt;/code&gt;). A folder still mounted with the old mode is warned of (&lt;code&gt;mount_cache_remount_failed&lt;/code&gt;). When the restart&amp;rsquo;s stop fails, a folder still mounted with the old mode is warned of the same way and the VM goes on with its proxy, and any other failure fails the start as a stop that failed (&lt;code&gt;stop_failed&lt;/code&gt;, with the run log&amp;rsquo;s end), as the VM may still be running. The retry runs the whole start again, so the UI says each warning once a run, and the first start&amp;rsquo;s warnings aren&amp;rsquo;t repeated. An interrupt during the remount, a check or the restart&amp;rsquo;s stop, on any tier, leaves a cleanup that stops the VM, which stays until that stop returns, and an interrupt gets no restart. A known race, older than the restart, fails closed: another devvm command can start the VM between the restart&amp;rsquo;s stop and its start again, and the two starts then contend as any two starts of one VM do.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A running VM&amp;rsquo;s folder.&lt;/strong&gt; A launch into a running VM whose folder has a cache mode checks it&amp;rsquo;s a mount point, one &lt;code&gt;mountpoint -q&lt;/code&gt; over the VM&amp;rsquo;s ssh, and refuses one that isn&amp;rsquo;t (&lt;code&gt;project_unmounted&lt;/code&gt;), or whose check fails to run or gives no answer (&lt;code&gt;project_unchecked&lt;/code&gt;). The guest answers in words, as &lt;code&gt;mountpoint&lt;/code&gt;&amp;rsquo;s exit codes differ between util-linux (32) and busybox (1).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tool images built before.&lt;/strong&gt; A shared tool&amp;rsquo;s build wrote its EROFS image into a writable 9p mount with Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; before devvm chose &lt;code&gt;none&lt;/code&gt;, so an image built then could reach the share empty or cut to 4096 bytes. devvm reads each EROFS image&amp;rsquo;s superblock when it asks whether the image is built: one that ends before its superblock does (1,064 bytes), empty included, or is shorter than the block count its superblock gives, counts as not built, and the next build makes it again. A build whose output is cut short is refused (&lt;code&gt;tool_bad_output&lt;/code&gt;). It costs a 40-byte read per image, and a file that isn&amp;rsquo;t EROFS&amp;rsquo;s at all is left to the guest&amp;rsquo;s mount to refuse.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section on a Linux host): a new VM&amp;rsquo;s folder mounts with &lt;code&gt;none&lt;/code&gt;, as its state says, which &lt;code&gt;/proc/self/mountinfo&lt;/code&gt; shows as no &lt;code&gt;cache&lt;/code&gt; option at all, as the kernel leaves it out for &lt;code&gt;none&lt;/code&gt;, where it shows &lt;code&gt;cache=0x5&lt;/code&gt; for &lt;code&gt;mmap&lt;/code&gt;; 40 files written in 4 KiB extending writes with &lt;code&gt;fsync&lt;/code&gt;, while a loop stats each, all reach the host whole under &lt;code&gt;none&lt;/code&gt;; SQLite&amp;rsquo;s WAL mode fails in the folder under &lt;code&gt;none&lt;/code&gt; and its default journal works; a shared writable &lt;code&gt;mmap&lt;/code&gt; of a file there is refused with &lt;code&gt;EINVAL&lt;/code&gt;, and SQLite&amp;rsquo;s WAL with &lt;code&gt;locking_mode=EXCLUSIVE&lt;/code&gt; works and opens again; a VM whose state loses its mode, and whose &lt;code&gt;lima.yaml&lt;/code&gt; gets Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; by hand, keeps &lt;code&gt;mmap&lt;/code&gt; with its &lt;code&gt;lima.yaml&lt;/code&gt; unedited by devvm, and warns at each launch; and &lt;code&gt;devvm mount-cache none&lt;/code&gt; gives it &lt;code&gt;none&lt;/code&gt; at its next start, &lt;code&gt;devvm restart&lt;/code&gt;, which mounts the folder again, and the warning stops. The &lt;code&gt;tools&lt;/code&gt; and &lt;code&gt;from&lt;/code&gt; sections build the shared tools and &lt;code&gt;--from&lt;/code&gt; bases with their output folders under &lt;code&gt;none&lt;/code&gt;, and the &lt;code&gt;from&lt;/code&gt; section&amp;rsquo;s Alpine VM, given Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; with no mode chosen, gets &lt;code&gt;none&lt;/code&gt; from &lt;code&gt;devvm mount-cache none&lt;/code&gt; at its next start, through the restart its failed remount gets, its folder checked by the portable check. On macOS, the &lt;code&gt;project&lt;/code&gt; section checks that the folder is virtiofs and that &lt;code&gt;devvm mount-cache&lt;/code&gt; refuses the VM&amp;rsquo;s. Two things under &lt;code&gt;mmap&lt;/code&gt; are run and reported, not checked: the same loop, as the race is timing&amp;rsquo;s, which left 1 file of the 40 short in one run on Fedora 43 and none in others, and five new SQLite databases in the default journal mode, for the lock bug. The research behind dropping &lt;code&gt;mmap&lt;/code&gt; (every tool above under each mode, on a Fedora 43 host with devvm&amp;rsquo;s Ubuntu 26.04 guest) was run by hand, outside the end-to-end tests. Unit tests: &lt;code&gt;TestProjectCache&lt;/code&gt;, &lt;code&gt;TestMountRoundTrip&lt;/code&gt;, &lt;code&gt;TestStartSetsProjectCacheOnce&lt;/code&gt; (the remount&amp;rsquo;s outcomes, each failure a restart), &lt;code&gt;TestStartRechecksProjectCache&lt;/code&gt; (the restart&amp;rsquo;s check, with no second restart), &lt;code&gt;TestRemountInterrupted&lt;/code&gt;, &lt;code&gt;TestRemountRestartStop&lt;/code&gt; (the cleanup kept through the restart&amp;rsquo;s stop, and a stop that fails), &lt;code&gt;TestOptionsOfMountinfo&lt;/code&gt;, &lt;code&gt;TestMountinfoPath&lt;/code&gt; and &lt;code&gt;TestLastMount&lt;/code&gt; (real &lt;code&gt;mountinfo&lt;/code&gt; lines: 9p with and without &lt;code&gt;cache=0x5&lt;/code&gt;, stacked mounts, a path with a space) in the Lima backend, &lt;code&gt;TestCutShort&lt;/code&gt; and &lt;code&gt;TestBuiltCutShort&lt;/code&gt; in the shared tools, &lt;code&gt;TestGuestMountOptions&lt;/code&gt; in the stubs, &lt;code&gt;TestUpCacheMode&lt;/code&gt;, &lt;code&gt;TestWarnMountCache&lt;/code&gt;, &lt;code&gt;TestCacheAtNextStart&lt;/code&gt;, &lt;code&gt;TestSwitchCache&lt;/code&gt;, &lt;code&gt;TestSetMountCache&lt;/code&gt; and &lt;code&gt;TestRemountRestart&lt;/code&gt; (one start again, with a proxy of its own), &lt;code&gt;TestRemountRestartConfined&lt;/code&gt; (each start&amp;rsquo;s interrupt undo, an interrupt between the starts, a start again whose proxy fails), &lt;code&gt;TestWarnOnce&lt;/code&gt; in the UI, and the CLI tests &lt;code&gt;mount_cache&lt;/code&gt; (with the stubs&amp;rsquo; &lt;code&gt;remount-fails&lt;/code&gt;, and a policy line warned of once), &lt;code&gt;clone_switch&lt;/code&gt; and the 0.1.0 fixture, whose VMs keep &lt;code&gt;mmap&lt;/code&gt; and warn.&lt;/p&gt;
&lt;h2 data-hextra-search-id="linux-hosts-overlays-instead-of-copies"&gt;Linux hosts: overlays instead of copies&lt;span class="hx:absolute hx:-mt-20" id="linux-hosts-overlays-instead-of-copies"&gt;&lt;/span&gt;
&lt;a href="#linux-hosts-overlays-instead-of-copies" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Lima on QEMU keeps one qcow2 disk per VM, and a clone copies it (2.0 GB for &lt;code&gt;base&lt;/code&gt;). A project VM&amp;rsquo;s disk is a qcow2 overlay of its image&amp;rsquo;s instead (&lt;a href="https://next.devvm.dev/docs/internals/lima/#clones-and-overlays"&gt;details&lt;/a&gt;): 196 KB new, 12 MB after booting, the same speed except fsync writes (1.8–2.5 s vs 1.2–2.1 s per GiB). Flattening one (&lt;code&gt;qemu-img rebase -b &amp;quot;&amp;quot;&lt;/code&gt;) took 8 s, if it&amp;rsquo;s ever needed.&lt;/p&gt;
&lt;h2 data-hextra-search-id="one-binary"&gt;One binary&lt;span class="hx:absolute hx:-mt-20" id="one-binary"&gt;&lt;/span&gt;
&lt;a href="#one-binary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s own files (&lt;code&gt;assets/&lt;/code&gt; in the repo: &lt;code&gt;base.yaml&lt;/code&gt;, &lt;code&gt;prelude.sh&lt;/code&gt;, &lt;code&gt;layers/&lt;/code&gt;, &lt;code&gt;features/&lt;/code&gt;, &lt;code&gt;shared-tools/&lt;/code&gt;, &lt;code&gt;network/&lt;/code&gt;, &lt;code&gt;guest/&lt;/code&gt;, &lt;code&gt;oci/&lt;/code&gt;) are embedded in the binary (&lt;code&gt;assets.FS&lt;/code&gt;), so devvm installs, moves and upgrades as one file and can&amp;rsquo;t find a mismatched copy beside it. Code reads them from that file system; scripts reach VMs on their standard input, never by path or file mode. The binary is the only copy: no shared folder on disk holds devvm&amp;rsquo;s files, because a copy there could be edited and still be used. A VM&amp;rsquo;s proxy is devvm itself, so it reads its built-in policies from the binary (its config&amp;rsquo;s &lt;code&gt;builtin_policies&lt;/code&gt;, by name), once, and its &lt;code&gt;policies&lt;/code&gt; carry only your files. &lt;code&gt;limactl create&lt;/code&gt; reads &lt;code&gt;base.yaml&lt;/code&gt; on its standard input (&lt;code&gt;-&lt;/code&gt;). Only &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s build on Lima needs a path, because its build VM mounts the conversion&amp;rsquo;s scripts from &lt;code&gt;oci/&lt;/code&gt; read-only (root there reads them), and none of the folder&amp;rsquo;s other files, with &lt;code&gt;guest/ca.sh&lt;/code&gt; beside it when you have &lt;a href="https://next.devvm.dev/docs/internals/network/#a-companys-ca"&gt;company CAs&lt;/a&gt;. It writes them into its own temporary folder, &lt;code&gt;devvm-oci.&amp;lt;random&amp;gt;&lt;/code&gt;, beside &lt;code&gt;vm/&lt;/code&gt; and never inside it, files 600 and folders 700, and the build&amp;rsquo;s cleanup deletes the folder however the build ends. Image keys hash the embedded files, so what goes into an image is always what its key describes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvms-own-lima-home"&gt;devvm&amp;rsquo;s own Lima home&lt;span class="hx:absolute hx:-mt-20" id="devvms-own-lima-home"&gt;&lt;/span&gt;
&lt;a href="#devvms-own-lima-home" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Lima merges &lt;code&gt;_config/default.yaml&lt;/code&gt; and &lt;code&gt;override.yaml&lt;/code&gt; of its home into every VM. In &lt;code&gt;~/.lima&lt;/code&gt;, a &lt;code&gt;networks: [{vzNAT: true}]&lt;/code&gt; there gave a confined VM a second network card with a default route around its proxy (the self-check caught it), and an extra mount went unnoticed. Hence a Lima home of devvm&amp;rsquo;s own, which refuses those files and any network devvm didn&amp;rsquo;t give a VM (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;details&lt;/a&gt;). The costs: plain &lt;code&gt;limactl list&lt;/code&gt; doesn&amp;rsquo;t show devvm&amp;rsquo;s VMs, and VM names are shorter, as the path of Lima&amp;rsquo;s ssh socket has fewer than 104 characters.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-state-layout"&gt;The state layout&lt;span class="hx:absolute hx:-mt-20" id="the-state-layout"&gt;&lt;/span&gt;
&lt;a href="#the-state-layout" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm keeps its state in plain files in two folders, which &lt;a href="https://next.devvm.dev/docs/internals/overview/#state-files"&gt;State files&lt;/a&gt; describes. The layout follows a few rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One folder per VM, keyed by identity.&lt;/strong&gt; A VM&amp;rsquo;s folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, is named by the hash that ends the VM&amp;rsquo;s name, the hash of its project folder&amp;rsquo;s physical path when devvm made it. The VM&amp;rsquo;s name, its backend and its ssh alias are chosen once, when devvm makes the VM, and recorded in its state, so devvm finds a folder&amp;rsquo;s VM by the state that records the folder, first by the path&amp;rsquo;s hash, then reads the name and the backend from the state. A folder that moves keeps its VM, whose state records the new path while its name and folder stay (&lt;a href="https://next.devvm.dev/docs/internals/overview/#a-moved-folder"&gt;a moved folder&lt;/a&gt;). A backend&amp;rsquo;s limit on names, or another VM taking the same folder name, never changes which VM a folder finds. Every file devvm keeps for a VM is in its folder, so deleting a VM stops what runs for it, removes what it has outside the folder, and then deletes the folder whole, and &lt;code&gt;devvm space&lt;/code&gt; and &lt;code&gt;devvm gc&lt;/code&gt; count folders. A list of a VM&amp;rsquo;s files, kept in each place that deletes or counts them, would drift, and one of those places would miss a file. Only sockets stay outside, in &lt;code&gt;run/&lt;/code&gt; and named by hashes, because a socket&amp;rsquo;s path has fewer than 104 characters.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The folder says who writes a file.&lt;/strong&gt; &lt;code&gt;~/.config/devvm&lt;/code&gt; holds what you write, and devvm never rewrites a file of yours there: it changes single lines of &lt;code&gt;policy&lt;/code&gt; and keeps the rest, comments included, and it writes the folder&amp;rsquo;s &lt;code&gt;version&lt;/code&gt;. Everything devvm writes is in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;. A default comes from a flag, then &lt;code&gt;config.toml&lt;/code&gt;, then &lt;code&gt;settings.json&lt;/code&gt;, then devvm&amp;rsquo;s own, and a command that would save a default that &lt;code&gt;config.toml&lt;/code&gt; sets refuses, naming the file and the key, because the saved value would never apply.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two formats.&lt;/strong&gt; What you edit is TOML, read strictly, so a typo stops the command and devvm names the file and the line, rather than the key being ignored. What only devvm writes is JSON, through &lt;code&gt;encoding/json&lt;/code&gt;, and devvm ignores fields it doesn&amp;rsquo;t know, so a newer devvm&amp;rsquo;s additions don&amp;rsquo;t stop an older one. A change that an older devvm would read wrongly goes through the layout version instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One section per package.&lt;/strong&gt; &lt;code&gt;vm.json&lt;/code&gt; has the core fields every VM has, and each package that keeps something of a VM&amp;rsquo;s owns one section of it, with its own type, so &lt;code&gt;internal/state&lt;/code&gt; imports none of them. Each section keeps what you asked for apart from what devvm made, which sits under &lt;code&gt;made&lt;/code&gt;, so a value is never stored twice under two names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The lock rule.&lt;/strong&gt; Each change to a VM&amp;rsquo;s state holds that VM&amp;rsquo;s lock, reads the file again, and writes it once, so a command&amp;rsquo;s changes land together, and reads take no lock, because each write renames a whole file over the old one. A command holds at most one VM&amp;rsquo;s lock at a time. A change across VMs, such as removing every link to a VM being deleted, lets go of the first VM&amp;rsquo;s lock, then takes each other VM&amp;rsquo;s lock in turn and reads its state again before writing it. The claims lock is taken only after a VM&amp;rsquo;s own lock, never before, so no two devvms can each wait for the lock the other holds. Test builds and the tests check this order as each lock is taken (&lt;code&gt;internal/state&lt;/code&gt;&amp;rsquo;s &lt;code&gt;held&lt;/code&gt;): a second VM&amp;rsquo;s lock, a VM&amp;rsquo;s lock under the claims lock, or a lock the same goroutine holds already panics, naming both locks, before it waits. The check is per goroutine. It follows the locks each goroutine holds, by the goroutine&amp;rsquo;s number, which it reads from the goroutine&amp;rsquo;s stack, so two goroutines that each hold one VM&amp;rsquo;s lock pass, and a goroutine that a change starts while it holds a lock isn&amp;rsquo;t checked against that lock. A release build checks nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A layout version.&lt;/strong&gt; Each folder records its layout version in &lt;code&gt;version&lt;/code&gt;. A newer devvm that changes the layout raises it and adds a migration from the version before, an older layout is migrated before a command runs, and a newer one is refused, because this devvm would read it wrongly. &lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; lists every file and folder a confined VM, a port, a link and a secret leaves, so a change to the layout changes a listing and fails the test until someone decides whether it needs a new version (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#changing-the-state-layout"&gt;changing the state layout&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm&amp;rsquo;s own files stay in the binary,&lt;/strong&gt; as &lt;a href="#one-binary"&gt;one binary&lt;/a&gt; describes, so neither folder holds a copy of &lt;code&gt;assets/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Why not a database.&lt;/strong&gt; SQLite or bbolt would give transactions, but either one is a new dependency, and devvm builds without cgo, so SQLite would mean a large pure-Go port. State would also stop being files that you can read with &lt;code&gt;cat&lt;/code&gt; or &lt;code&gt;jq&lt;/code&gt;, back up, and check by hand. Files written whole and renamed into place, with an OS file lock for each VM, give what devvm needs: one writer to a VM at a time, and readers that never see half a file.&lt;/p&gt;
&lt;h2 data-hextra-search-id="where-secret-values-live"&gt;Where secret values live&lt;span class="hx:absolute hx:-mt-20" id="where-secret-values-live"&gt;&lt;/span&gt;
&lt;a href="#where-secret-values-live" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm handles values that let whoever holds them act as you or as a VM: a VM&amp;rsquo;s proxy password, a build proxy&amp;rsquo;s, the company proxy&amp;rsquo;s password, the secrets you save and the keys and tokens in agents&amp;rsquo; login files. Each one lives in a few places, and only there: the Keychain or the secret&amp;rsquo;s file in &lt;code&gt;~/.local/share/devvm/secrets/&lt;/code&gt;, the proxy&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt;, the VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt; for its proxy password, the agent store&amp;rsquo;s login files, the proxy&amp;rsquo;s memory for the values it caches, and the VM&amp;rsquo;s own proxy settings for its password, which the VM must send. In devvm&amp;rsquo;s code, each such value is a &lt;code&gt;redact.Secret&lt;/code&gt; from the moment it&amp;rsquo;s read until the place it&amp;rsquo;s used, except for the two that &lt;strong&gt;Not covered&lt;/strong&gt; names (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#secrets-in-the-code"&gt;secrets in the code&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Printing never shows the value.&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt;, &lt;code&gt;GoString&lt;/code&gt; and &lt;code&gt;Format&lt;/code&gt; write &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; for every verb, so a &lt;code&gt;%v&lt;/code&gt; of a struct in an error, a log line in the proxy&amp;rsquo;s own log or a line of devvm&amp;rsquo;s run log can&amp;rsquo;t hold it. &lt;code&gt;fmt&lt;/code&gt; can&amp;rsquo;t call &lt;code&gt;Format&lt;/code&gt; on a value in an unexported field, and prints such a field as it is, so the value is behind a pointer, and the field shows only its address. The run log&amp;rsquo;s own redaction, &lt;code&gt;redact.String&lt;/code&gt;, still takes proxy keys and URL passwords out of the output of the commands devvm runs, which no type can reach.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encoding fails rather than writing a stand-in.&lt;/strong&gt; &lt;code&gt;MarshalJSON&lt;/code&gt; and &lt;code&gt;MarshalText&lt;/code&gt; return &lt;code&gt;redact.ErrEncode&lt;/code&gt;. A &lt;code&gt;MarshalJSON&lt;/code&gt; that wrote &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; would look safe, but a struct written to the file that should hold the value, such as &lt;code&gt;proxy.json&lt;/code&gt; or &lt;code&gt;vm.json&lt;/code&gt;, would then lose it, and a VM would lose its proxy or you your login, with no error. A file that holds a value has a wire type of its own instead, which writes the value as a string, so the two kinds of file can&amp;rsquo;t be confused.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;There&amp;rsquo;s no &lt;code&gt;LogValue&lt;/code&gt;.&lt;/strong&gt; devvm has no &lt;code&gt;log/slog&lt;/code&gt; logging, so a &lt;code&gt;slog.LogValuer&lt;/code&gt; would have no caller, and &lt;code&gt;Format&lt;/code&gt; already covers the proxy&amp;rsquo;s &lt;code&gt;log.Logger&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;Reveal&lt;/code&gt; is the one way to the value,&lt;/strong&gt; and forbidigo refuses every call to it outside tests, so each place that uses a value carries a &lt;code&gt;//nolint:forbidigo&lt;/code&gt; with its reason: the proxy&amp;rsquo;s password check, the headers it puts values in, the company proxy&amp;rsquo;s credentials, the VM&amp;rsquo;s CA key as it signs, its config file and the broker&amp;rsquo;s frames to its child; the secrets&amp;rsquo; store, which writes the Keychain and the file; the VM&amp;rsquo;s proxy URL and &lt;code&gt;vm.json&lt;/code&gt;; and &lt;code&gt;internal/agentlogin&lt;/code&gt;&amp;rsquo;s login files, refreshes and claims. A new use is a choice someone made, with its reason on the line, which the review sees. The structure test refuses a struct that embeds a &lt;code&gt;Secret&lt;/code&gt;, which would take on its &lt;code&gt;Reveal&lt;/code&gt;, and an interface that declares &lt;code&gt;Reveal() string&lt;/code&gt;, through which a value could pass without a call forbidigo sees.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The wire types keep each file&amp;rsquo;s bytes as they were, so a frozen release&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt; writes back byte for byte (&lt;code&gt;TestV010ProxyConfigs&lt;/code&gt;), its &lt;code&gt;Sum&lt;/code&gt; doesn&amp;rsquo;t change and no running VM&amp;rsquo;s proxy starts again for an upgrade. An agent&amp;rsquo;s login file stays the agent&amp;rsquo;s own format, read and written as a map so that fields devvm doesn&amp;rsquo;t know are kept, and a key or token is a &lt;code&gt;redact.Secret&lt;/code&gt; once it leaves the map, through a lookup, a refresh or a capture.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered.&lt;/strong&gt; The company proxy&amp;rsquo;s URLs as your environment gives them, &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and &lt;code&gt;HTTP_PROXY&lt;/code&gt;, can hold a password, and they stay strings, because devvm passes them on as they are, to &lt;code&gt;proxy.json&lt;/code&gt; and to the programs it runs on the host. So do the URLs &lt;code&gt;proxy.Upstream.WithPassword&lt;/code&gt; returns, which hold the saved password for devvm&amp;rsquo;s own clients and the programs it runs. The VM&amp;rsquo;s proxy URL, which holds its password, is a string too, because it goes into the VM&amp;rsquo;s Lima config and environment, where the VM needs it. &lt;code&gt;redact.String&lt;/code&gt; and &lt;code&gt;redact.In&lt;/code&gt; take the passwords in such URLs out of devvm&amp;rsquo;s run log and Lima&amp;rsquo;s logs (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#this-machine"&gt;your company proxy&amp;rsquo;s password&lt;/a&gt;). Two values are strings by design:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Keychain&amp;rsquo;s value,&lt;/strong&gt; which &lt;code&gt;platform.KeychainGet&lt;/code&gt; returns and &lt;code&gt;KeychainSet&lt;/code&gt; takes as a string, because &lt;code&gt;internal/platform&lt;/code&gt; imports no devvm package. &lt;code&gt;secrets.Store&lt;/code&gt; makes it a &lt;code&gt;Secret&lt;/code&gt; at once in &lt;code&gt;saved&lt;/code&gt;, and reveals it only for &lt;code&gt;KeychainSet&lt;/code&gt; in &lt;code&gt;save&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm desktop&amp;rsquo;s VNC password,&lt;/strong&gt; 8 characters that you must see to type into a VNC viewer. devvm keeps it in the desktop section of &lt;code&gt;vm.json&lt;/code&gt; and shows it in &lt;code&gt;desktop_ready&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-proxys-broker"&gt;The proxy&amp;rsquo;s broker&lt;span class="hx:absolute hx:-mt-20" id="the-proxys-broker"&gt;&lt;/span&gt;
&lt;a href="#the-proxys-broker" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s proxy reads every byte the VM sends out, and it runs as you, with your Keychain, your files and every socket of yours. A bug in it that a VM could drive, such as a parser that a crafted request takes over or a path that leads out of its folder, would reach all of that. So &lt;code&gt;devvm _proxy&lt;/code&gt; is split in two: a broker, which keeps what only the host should do and stays unconfined, and a child, which reads the VM&amp;rsquo;s network and can be confined. The design keeps four things. A child that a VM takes over holds nothing of this machine&amp;rsquo;s beyond what it held for that VM. It can&amp;rsquo;t make the broker act for another VM, another secret or another file. It connects to no address that the VM&amp;rsquo;s rules and the floor refuse, such as this machine&amp;rsquo;s loopback, except for what a company proxy reaches for it. And the VM&amp;rsquo;s connections stay the child&amp;rsquo;s. Of each request, only the host name it looks up and the address it connects to cross to the broker, which opens the connection and hands it to the child, so no byte that the connection carries passes through the broker. Of a request&amp;rsquo;s own bytes, only a login&amp;rsquo;s token exchange reaches the broker, as captures in the broker below describe. &lt;a href="https://next.devvm.dev/docs/internals/processes/#a-vms-proxy"&gt;Processes&lt;/a&gt; describes the two processes as they run, and this note is their design, with its threat check. On macOS the child runs under Seatbelt, and on Linux it confines itself with Landlock and a seccomp filter (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;), and on both its sandbox refuses it every connection of its own, so the broker looks up each name and opens each connection that the child asks for, once its own policy and floor allow the address.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why a broker, and not values handed over at the start:&lt;/strong&gt; the proxy looks each bound value up when a request needs it, in the Keychain, devvm&amp;rsquo;s secrets folder or an agent&amp;rsquo;s login file, which it refreshes on the host when it&amp;rsquo;s due (&lt;a href="https://next.devvm.dev/docs/internals/network/#how-the-proxy-puts-them-in"&gt;how the proxy puts them in&lt;/a&gt;). A login&amp;rsquo;s value changes with each refresh, and the proxy keeps it for 30 seconds, and any other value for 5 minutes. The proxy also saves the logins that a VM makes, and writes the VM&amp;rsquo;s bindings again. Values handed over once would be stale within the minute, and the child would need to write the store of logins. So the broker runs beside the child for as long as it does, and answers its questions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What runs where:&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Side&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The VM&amp;rsquo;s proxy port, every request and tunnel, the rules and the floor, the SNI check, interception, putting values into headers, transparent mode, &lt;code&gt;devvm.proxy&lt;/code&gt;&amp;rsquo;s endpoints, and the bounds on what a VM makes the proxy hold (&lt;code&gt;maxConns&lt;/code&gt; and &lt;code&gt;admit&lt;/code&gt;, &lt;code&gt;maxConnects&lt;/code&gt;, &lt;code&gt;maxRequests&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;child&lt;/td&gt;
&lt;td&gt;they read the VM&amp;rsquo;s bytes, which is what the child is for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The event log, &lt;code&gt;network.jsonl&lt;/code&gt;, and the child&amp;rsquo;s own lines in &lt;code&gt;proxy.log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;child&lt;/td&gt;
&lt;td&gt;each request logs an event, so a hop to the broker would sit on every request&amp;rsquo;s path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The shared Nix cache, its fetches and its files&lt;/td&gt;
&lt;td&gt;child&lt;/td&gt;
&lt;td&gt;its fetches go through the floor and the company proxy as the VM&amp;rsquo;s requests do, and each VM&amp;rsquo;s Nix checks what it gets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The company proxy as the requests&amp;rsquo; upstream, with its credentials&lt;/td&gt;
&lt;td&gt;child, with the &lt;code&gt;proxy&lt;/code&gt; secret&amp;rsquo;s value from the broker&lt;/td&gt;
&lt;td&gt;the company proxy takes its password with each plain HTTP request, so whatever sends those requests holds it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Looking up a name, and opening a TCP connection to an address or to the company proxy&lt;/td&gt;
&lt;td&gt;broker, which hands the connection to the child, and judges each address again with its own policy and floor&lt;/td&gt;
&lt;td&gt;a sandbox can&amp;rsquo;t tell this machine&amp;rsquo;s loopback, its own addresses and the LAN apart from the internet as a rule changes (below), so the child&amp;rsquo;s sandbox refuses it every connection of its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Each value&amp;rsquo;s lookup: the Keychain through &lt;code&gt;security&lt;/code&gt;, devvm&amp;rsquo;s secrets folder, an agent&amp;rsquo;s login file and its OAuth refresh (&lt;code&gt;IO.Secret&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;they need the Keychain and your files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Capturing logins: the token request to the endpoint, its reply, saving the login and writing the bindings again (&lt;code&gt;IO.Capture&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;the endpoint&amp;rsquo;s reply holds the login&amp;rsquo;s real tokens, its refresh token among them, which never enter the child&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The SSH agent&amp;rsquo;s relay, its socket and its connections to the agent&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;its filter is the guarantee, and a child with the agent&amp;rsquo;s socket could send the agent anything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Holding the backend&amp;rsquo;s logs to their cap (&lt;code&gt;IO.KeepLogs&lt;/code&gt;, &lt;code&gt;Config.VMLogs&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;they&amp;rsquo;re in Lima&amp;rsquo;s folder for the VM, beside its disk and its &lt;code&gt;lima.yaml&lt;/code&gt;, which a child must never write&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Connecting to a link&amp;rsquo;s socket&lt;/td&gt;
&lt;td&gt;broker, which hands the connection to the child&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s run folder holds every VM&amp;rsquo;s link sockets and agents&amp;rsquo; relays, and the ssh masters&amp;rsquo; control sockets, each a way into a VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Finding a request&amp;rsquo;s host in the links&amp;rsquo; list&lt;/td&gt;
&lt;td&gt;child, checked again by the broker&lt;/td&gt;
&lt;td&gt;the child decides for each request whether it&amp;rsquo;s for a link, before any rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;proxy.json&lt;/code&gt;, the CAs&amp;rsquo; files, the lifeline, the status file and the pid file&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;the child gets what it needs of them over the socket, so it needs no read of the VM&amp;rsquo;s run folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The files that change while the proxy runs: the policy files, the bindings file and the links&amp;rsquo; list&lt;/td&gt;
&lt;td&gt;the child looks at them, the broker reads them&lt;/td&gt;
&lt;td&gt;below&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;The files that change.&lt;/strong&gt; The proxy reads each of these files again when its modification time, size or inode changes, which it checks with a &lt;code&gt;stat&lt;/code&gt; on every request. The child keeps that check, because Landlock leaves &lt;code&gt;stat&lt;/code&gt; unrestricted and Seatbelt can allow it alone (&lt;code&gt;file-read-metadata&lt;/code&gt;), and asks the broker for the file only when it has changed. The broker reads the file with the proxy&amp;rsquo;s usual checks, its owner, its mode, at most 1 MiB, and a symbolic link followed or refused as each file allows, and returns its bytes with the stamp of the file it read. The child parses them and keeps that stamp, so a change still applies to the next request, and an unchanged file costs no hop. Both write &lt;code&gt;proxy.log&lt;/code&gt;, each line saying which side wrote it. A rotation takes the file&amp;rsquo;s lock and checks its size again, as the event log&amp;rsquo;s does, so the two writers rotate it once, and the broker reads, copies and empties the file through the descriptor it was given, never by its path.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The folders the child writes are the VM&amp;rsquo;s.&lt;/strong&gt; A child that a VM takes over can put anything in the folders it writes, so the unconfined code that later opens them reads them as it reads a file a VM can write. The child may create only regular files there. On Linux it never gets Landlock&amp;rsquo;s rights to make a link, a FIFO, a socket, a device or a folder, and the Nix cache&amp;rsquo;s &lt;code&gt;nar/&lt;/code&gt; folder is made before it confines itself. On macOS its profile refuses creating anything but a regular file, and hard links, which the follow-up checks there. devvm, &lt;code&gt;devvm _links&lt;/code&gt;, &lt;code&gt;devvm network log&lt;/code&gt;, &lt;code&gt;devvm network lock&lt;/code&gt;, the port forwarder, the link session, devvm gc&amp;rsquo;s trim of the Nix cache and the cache&amp;rsquo;s lock open, rename, empty, change and delete files in those folders through &lt;code&gt;internal/safefile&lt;/code&gt;, never following a link and taking only a regular file with one link that&amp;rsquo;s yours, or through an &lt;code&gt;os.Root&lt;/code&gt; of the folder. The broker makes the cache&amp;rsquo;s &lt;code&gt;nar/&lt;/code&gt; folder and sets both folders&amp;rsquo; modes the same way (&lt;code&gt;makeNixFolders&lt;/code&gt;), deleting anything at &lt;code&gt;nar/&lt;/code&gt; that isn&amp;rsquo;t a folder, a link as itself, and making a folder in its place, which its log warns of, so its &lt;code&gt;chmod&lt;/code&gt; never reaches a folder of yours. A confined child can&amp;rsquo;t leave a link there, so this is for one that runs without Landlock or Seatbelt. So a link that a child leaves where &lt;code&gt;proxy.log&lt;/code&gt;, &lt;code&gt;network.jsonl&lt;/code&gt;, &lt;code&gt;links.log&lt;/code&gt;, &lt;code&gt;ports.log&lt;/code&gt; or &lt;code&gt;nar/&lt;/code&gt; was never leads devvm to your files, and a FIFO there never hangs a command. A build&amp;rsquo;s child writes &lt;code&gt;events.jsonl&lt;/code&gt; and &lt;code&gt;proxy.log&lt;/code&gt; in a &lt;code&gt;logs/&lt;/code&gt; folder of its own inside the build proxy&amp;rsquo;s folder, apart from its config, its policy and its status file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the child needs,&lt;/strong&gt; which what confines it holds it to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its descriptors:&lt;/strong&gt; standard input from the null device, &lt;code&gt;proxy.log&lt;/code&gt; as its output and its error output, the socket to the broker as descriptor 3, and the VM&amp;rsquo;s proxy port&amp;rsquo;s listener, which the broker opened, as descriptor 4.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its environment:&lt;/strong&gt; &lt;code&gt;TZ&lt;/code&gt;, &lt;code&gt;SSL_CERT_FILE&lt;/code&gt; and &lt;code&gt;SSL_CERT_DIR&lt;/code&gt; when devvm has them, so the roots it trusts on Linux are the proxy&amp;rsquo;s usual ones, and &lt;code&gt;GODEBUG&lt;/code&gt;, to which it adds &lt;code&gt;updatemaxprocs=0&lt;/code&gt;, so Go&amp;rsquo;s runtime doesn&amp;rsquo;t read its cgroup&amp;rsquo;s CPU limit again as it runs. It gets nothing else, so it never sees a token in the environment of the shell that started devvm, or the status file&amp;rsquo;s name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Files to read and write:&lt;/strong&gt; the VM&amp;rsquo;s logs folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;, where it creates, appends to, reads, empties and renames its two logs and takes the event log&amp;rsquo;s lock, which &lt;code&gt;devvm _links&lt;/code&gt; takes too, and for a VM with the nix layer, the shared Nix cache, &lt;code&gt;cache/nix-cache/&lt;/code&gt; and its &lt;code&gt;nar/&lt;/code&gt; folder, where it creates, writes, reads, lists, deletes and renames regular files, from the top folder into &lt;code&gt;nar/&lt;/code&gt; among them, and takes &lt;code&gt;.lock&lt;/code&gt;. A build&amp;rsquo;s child writes its own &lt;code&gt;logs/&lt;/code&gt; folder instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Files to look at only:&lt;/strong&gt; the policy files, the bindings file and the links&amp;rsquo; list, with &lt;code&gt;stat&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What the system gives it:&lt;/strong&gt; what a Go program reads to start, the system&amp;rsquo;s roots, its time zone, and the host&amp;rsquo;s own addresses. On Linux, it loads the roots and its time zone before it confines itself. On macOS, &lt;code&gt;crypto/x509&lt;/code&gt; asks &lt;code&gt;trustd&lt;/code&gt; through &lt;code&gt;com.apple.trustd.agent&lt;/code&gt;, after CoreFoundation looks at the metadata of the program&amp;rsquo;s folder for its bundle. The floor reads the host&amp;rsquo;s addresses every 30 seconds (&lt;code&gt;hostAddrs&lt;/code&gt;), through a netlink route socket on Linux and the route &lt;code&gt;sysctl&lt;/code&gt; on macOS. It needs no resolver, because the broker looks up its names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The network:&lt;/strong&gt; no connection of its own. It accepts on its listener, reads and writes the connections it accepted and those that the broker hands it, and on Linux binds its netlink route socket, which reaches the kernel alone. It sends no UDP, and it listens on nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nothing else:&lt;/strong&gt; no read of your home folder or of devvm&amp;rsquo;s data, config or run folders, no Keychain, no unix socket but its own two descriptors, no Lima folder, no signal to another process, no tracing, and no fork or &lt;code&gt;exec&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The floor fails open if it reads no addresses for the host, because &lt;code&gt;hostAddrs&lt;/code&gt; then refuses none of them, so the child&amp;rsquo;s check after it confines itself needs a read of the host&amp;rsquo;s addresses that isn&amp;rsquo;t empty, and a later read that fails keeps the last good one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The protocol.&lt;/strong&gt; The broker makes one unix stream socketpair, close-on-exec from the start (&lt;code&gt;SOCK_CLOEXEC&lt;/code&gt; on Linux, and &lt;code&gt;syscall.ForkLock&lt;/code&gt; held with &lt;code&gt;CloseOnExec&lt;/code&gt; on macOS), so no program the broker runs, such as &lt;code&gt;security&lt;/code&gt;, holds an end, and the child&amp;rsquo;s end is its descriptor 3. Each message is a frame: a 4-byte big-endian length, then a JSON object of at most 2 MiB with its &lt;code&gt;type&lt;/code&gt;, its &lt;code&gt;id&lt;/code&gt; and its fields, which the reader decodes refusing unknown fields. Bytes, such as a file, a body or a header&amp;rsquo;s value, cross as &lt;code&gt;[]byte&lt;/code&gt;, which JSON holds in base64, so &lt;code&gt;encoding/json&lt;/code&gt; never changes bytes that aren&amp;rsquo;t UTF-8 and a 1 MiB file takes about 1.4 MiB of a frame. Every read is a &lt;code&gt;recvmsg&lt;/code&gt; with room for one descriptor, and a read whose control data was cut short (&lt;code&gt;MSG_CTRUNC&lt;/code&gt;) breaks the rules. Each read asks for no more than the bytes left in its frame, and the writer sends each frame whole under one lock, with its descriptor on the frame&amp;rsquo;s first bytes, so a descriptor always arrives with the frame it belongs to. The broker&amp;rsquo;s first frame is &lt;code&gt;start&lt;/code&gt;, with the protocol&amp;rsquo;s version, 1, the SHA-256 of the broker&amp;rsquo;s own executable, which the broker reads first thing as it starts, and everything the child runs with, as the start below says. The child answers &lt;code&gt;ready&lt;/code&gt;, with the same version, the SHA-256 of its own executable, which it reads before it confines itself on Linux and through its profile on macOS, the address it serves and how it&amp;rsquo;s confined, or &lt;code&gt;failed&lt;/code&gt;, with why. After that only the child asks, and the broker answers each request with a frame of the same &lt;code&gt;id&lt;/code&gt;, in any order:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request&lt;/th&gt;
&lt;th&gt;What the child sends&lt;/th&gt;
&lt;th&gt;What the broker answers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;value&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a binding&amp;rsquo;s kind, agent and name (&lt;code&gt;valueKey&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;the value and when the broker looked it up, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;file&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a watched file&amp;rsquo;s number in the start&amp;rsquo;s list&lt;/td&gt;
&lt;td&gt;the file&amp;rsquo;s bytes and the stamp it read, or that it&amp;rsquo;s missing or refused, and why&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;link&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a request&amp;rsquo;s host and port&lt;/td&gt;
&lt;td&gt;a connection to the link&amp;rsquo;s socket, as the frame&amp;rsquo;s one descriptor (&lt;code&gt;SCM_RIGHTS&lt;/code&gt;), or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;token&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a captured request&amp;rsquo;s host, its clean path, method and query, its headers, at most 64 KiB, and its body, at most 64 KiB (&lt;code&gt;captureRequestMax&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;the reply the VM gets, its status and its few headers, and the agent whose login it was, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lookup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a host name, absolute, with its one trailing dot&lt;/td&gt;
&lt;td&gt;its addresses, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dial&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an address and a port, or which company proxy, &lt;code&gt;https&lt;/code&gt; or &lt;code&gt;http&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a TCP connection to it, as the frame&amp;rsquo;s one descriptor, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cancel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the ID of a &lt;code&gt;lookup&lt;/code&gt; or a &lt;code&gt;dial&lt;/code&gt; it gave up on, as the frame&amp;rsquo;s own&lt;/td&gt;
&lt;td&gt;nothing of its own: that request ends with an error&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Only a &lt;code&gt;lookup&lt;/code&gt; and a &lt;code&gt;dial&lt;/code&gt; can be cancelled, with a &lt;code&gt;cancel&lt;/code&gt; frame of the request&amp;rsquo;s ID, below. A value&amp;rsquo;s lookup and a token exchange run to their 20 seconds whatever happens to the VM&amp;rsquo;s request, so the broker keeps a value it looked up for the next request. The child stops waiting for a reply once its request has ended, drops the reply when it comes, and holds the request&amp;rsquo;s place under its type&amp;rsquo;s cap until then, so it never has more under way than the broker allows, and it closes a link&amp;rsquo;s or a dial&amp;rsquo;s connection that it no longer wants. A reply that wouldn&amp;rsquo;t fit in a frame is sent as an error instead, so no request waits for one that never comes, and the few headers a token&amp;rsquo;s reply keeps are 1 KiB each at most. An error reaches the child as one of a few codes, &lt;code&gt;not_found&lt;/code&gt;, &lt;code&gt;refused&lt;/code&gt;, &lt;code&gt;busy&lt;/code&gt;, &lt;code&gt;too_long&lt;/code&gt; or &lt;code&gt;failed&lt;/code&gt;, or for a &lt;code&gt;lookup&lt;/code&gt;, &lt;code&gt;no_such_host&lt;/code&gt;, &lt;code&gt;timeout&lt;/code&gt; or &lt;code&gt;temporary&lt;/code&gt;, which the child turns back into the resolver&amp;rsquo;s error that its block&amp;rsquo;s reason and its second try need, and the broker&amp;rsquo;s own log keeps its text, which can name a lookup&amp;rsquo;s or an endpoint&amp;rsquo;s details. The broker&amp;rsquo;s start frame has the start&amp;rsquo;s deadline to be written, so a child that never reads can&amp;rsquo;t hold the broker either.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bounds, and failing closed.&lt;/strong&gt; The broker serves one &lt;code&gt;value&lt;/code&gt; at a time, as the proxy&amp;rsquo;s lookups go one at a time, at most 8 &lt;code&gt;token&lt;/code&gt;s at once, as &lt;code&gt;captureReads&lt;/code&gt; allows, 4 &lt;code&gt;file&lt;/code&gt;s, 256 &lt;code&gt;link&lt;/code&gt;s, which is the link session&amp;rsquo;s own cap on a client&amp;rsquo;s connections, 256 &lt;code&gt;lookup&lt;/code&gt;s and 1024 &lt;code&gt;dial&lt;/code&gt;s, as many as the child&amp;rsquo;s tunnels at once (&lt;code&gt;maxConnects&lt;/code&gt;). It answers a request past its cap with an error, which a child that keeps the same caps never gets, because the broker gives a request&amp;rsquo;s place back as its reply starts to go, before the child can send the next. A reply that waits for the socket keeps its place, so a child that stops reading holds no more of the broker&amp;rsquo;s answers than the caps. It keeps each value it looked up for as long as the proxy keeps it, so a child that asks again and again makes the broker look a binding up at most once in 30 seconds or 5 minutes, and on macOS run &lt;code&gt;security&lt;/code&gt; that often. It keeps a failed lookup for 5 seconds, so a child can&amp;rsquo;t make it run &lt;code&gt;security&lt;/code&gt; or try a refresh back to back. The child keeps a value only until the broker&amp;rsquo;s lookup is that old, so no value is kept longer than the broker keeps it. The broker keeps its own watch on the bindings file, the links&amp;rsquo; list and the policy files, as the proxy does (&lt;code&gt;watched&lt;/code&gt;), looking at the first two on every &lt;code&gt;value&lt;/code&gt;, &lt;code&gt;link&lt;/code&gt; and &lt;code&gt;token&lt;/code&gt; request, and at the policy files on every &lt;code&gt;dial&lt;/code&gt;, whatever the child asks, so a binding or a link that devvm takes away is gone for the next request, and a change to the bindings file drops the broker&amp;rsquo;s values and its failed lookups, as it drops the proxy&amp;rsquo;s values, so a secret set right after a failure goes in at the next request. Some frames end the pair: one over 2 MiB, one that isn&amp;rsquo;t JSON or has a type or a field that the version doesn&amp;rsquo;t know, a second &lt;code&gt;start&lt;/code&gt;, a reply to no request, a frame that carries a descriptor from the child, and a &lt;code&gt;ready&lt;/code&gt; whose version or executable&amp;rsquo;s SHA-256 differs. The child takes a descriptor only with a &lt;code&gt;link&lt;/code&gt; or &lt;code&gt;dial&lt;/code&gt; reply that says it carries one, and closes any other. For each, the broker stops the child, logs the rule the frame broke but never its bytes, and exits, and the VM has no network until devvm starts its proxy again. A request that the broker refuses, such as one for a binding that isn&amp;rsquo;t in the file, gets an error instead, which the child handles as it handles a failed lookup. No value goes in, a capture gets &lt;code&gt;502&lt;/code&gt;, a link gets &lt;code&gt;link_refused&lt;/code&gt;, a name that the broker can&amp;rsquo;t look up gets the block of any name that doesn&amp;rsquo;t resolve, and a connection that the broker refuses or can&amp;rsquo;t open gets &lt;code&gt;connect failed&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Naming nothing but its own VM&amp;rsquo;s.&lt;/strong&gt; Every request names something in the broker&amp;rsquo;s own config, which is one VM&amp;rsquo;s, so the child can&amp;rsquo;t reach another VM&amp;rsquo;s binding, any other secret or any file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;value&lt;/code&gt;:&lt;/strong&gt; the broker finds the key in its own read of the bindings file that its config names, and looks the value up with its own copy of that binding, never the child&amp;rsquo;s, so the binding&amp;rsquo;s &lt;code&gt;id&lt;/code&gt; and its methods are checked as for any binding (&lt;code&gt;fits&lt;/code&gt;). A key that the file doesn&amp;rsquo;t hold now gets an error, the company proxy&amp;rsquo;s secret&amp;rsquo;s included, which no binding names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;file&lt;/code&gt;:&lt;/strong&gt; a number in the broker&amp;rsquo;s list, which is the bindings file, the links&amp;rsquo; list and the policy files in the config&amp;rsquo;s order, so no path crosses the socket.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;link&lt;/code&gt;:&lt;/strong&gt; the broker finds the host and port in its own read of the links&amp;rsquo; list (&lt;code&gt;links.find&lt;/code&gt;), and connects to &lt;code&gt;LinkSocket&lt;/code&gt; of its run folder, its VM, the entry&amp;rsquo;s address and its port, only for an address in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, trying a few times for a full backlog as the proxy does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;token&lt;/code&gt;:&lt;/strong&gt; the broker finds the endpoints in its own &lt;code&gt;captures&lt;/code&gt; that the host, the path and the method match, which gives the agents, refuses a request that matches none, and puts in the VM&amp;rsquo;s name itself (&lt;code&gt;Exchange.VM&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;lookup&lt;/code&gt;:&lt;/strong&gt; the broker takes only a host name in the proxy&amp;rsquo;s own form (&lt;code&gt;NormHost&lt;/code&gt;, &lt;code&gt;HostOK&lt;/code&gt;), with its trailing dot, and no address, and looks it up as the proxy does, so a child learns no more than it could ask this machine&amp;rsquo;s resolver.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;dial&lt;/code&gt;:&lt;/strong&gt; the broker connects to an address only once its own read of the VM&amp;rsquo;s policy files and its own read of the host&amp;rsquo;s addresses allow it, as the floor does, and to a company proxy only at the address of its own config.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Captures in the broker.&lt;/strong&gt; For a captured request, the child does what the proxy does for any request up to the request&amp;rsquo;s body. It judges the host and the request by the VM&amp;rsquo;s rules, intercepts it and reads the body. Then it sends the request in &lt;code&gt;token&lt;/code&gt;. The broker runs &lt;code&gt;IO.Capture&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Request&lt;/code&gt;, and sends the request to the endpoint&amp;rsquo;s host from its own config, on port 443, through the company proxy when there is one, and trusting the system&amp;rsquo;s roots and &lt;code&gt;upstream_cas&lt;/code&gt;, as an OAuth refresh does. It reads the reply, runs &lt;code&gt;Response&lt;/code&gt; and returns what the VM gets. The broker does what the proxy does with a captured request. It drops a &lt;code&gt;1xx&lt;/code&gt;, refuses an upgrade, leaves gzip to Go&amp;rsquo;s transport, sends the VM&amp;rsquo;s headers on without the hop-by-hop ones and &lt;code&gt;Proxy-Authorization&lt;/code&gt;, takes a successful reply of at most 1 MiB and returns only &lt;code&gt;keepHeaders&lt;/code&gt;&amp;rsquo; headers with it. It returns an error reply as it is, up to the same 1 MiB, rather than streaming it through, and gives one that&amp;rsquo;s longer a &lt;code&gt;502&lt;/code&gt;. An error reply to a request whose body &lt;code&gt;Request&lt;/code&gt; changed comes back as its OAuth error code alone (&lt;code&gt;errorReply&lt;/code&gt;). The child logs the &lt;code&gt;login&lt;/code&gt; event, naming the agent that the broker returned, and &lt;code&gt;guard&lt;/code&gt; stays in the child, for the host&amp;rsquo;s other replies. So the real tokens in an endpoint&amp;rsquo;s reply, a new login&amp;rsquo;s refresh token among them, and the &lt;code&gt;id_token&lt;/code&gt; that &lt;code&gt;Request&lt;/code&gt; puts into Codex&amp;rsquo;s API-key exchange, never enter the child, and a child can&amp;rsquo;t save tokens that the endpoint didn&amp;rsquo;t issue.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Connections through the broker.&lt;/strong&gt; The child judges each request as the proxy does, by the VM&amp;rsquo;s rules, then the floor, which looks the name up and keeps the addresses that aren&amp;rsquo;t internal or that a rule names. It asks the broker for each lookup, and then for a connection to each address it kept, one at a time, as the proxy dials them, or for a connection to the company proxy when one applies. The broker answers a &lt;code&gt;dial&lt;/code&gt; for an address only when that address passes its own copy of the floor&amp;rsquo;s check: no deny names it, and it&amp;rsquo;s neither internal nor this machine&amp;rsquo;s own, or a rule names it, by the broker&amp;rsquo;s own read of the VM&amp;rsquo;s built-in policies, its policy files, which it looks at on every &lt;code&gt;dial&lt;/code&gt;, and the host&amp;rsquo;s addresses, which it reads every 30 seconds, or the config says the VM is open. Then it connects over TCP, with the proxy&amp;rsquo;s 15-second timeout, and hands the connection to the child as it hands a link&amp;rsquo;s. So a child that a VM takes over connects to this machine&amp;rsquo;s loopback, its own addresses and the private and link-local ranges only where a rule names the address, as the VM does, and it reaches the internet as the VM does. Two ways stay open, as they do for the VM: a company proxy, which the child speaks to with its password and which reaches whatever it reaches, this machine&amp;rsquo;s loopback included when it runs on this machine, and a host on this machine&amp;rsquo;s network whose address is public, such as a neighbour&amp;rsquo;s global IPv6 address, which the floor counts as the internet.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A rule applies from the next connection.&lt;/strong&gt; &lt;code&gt;devvm network allow 127.0.0.1:5432&lt;/code&gt; changes the policy file, the child sees its new stamp at the next request and asks for it, and the broker&amp;rsquo;s own look at the file at the &lt;code&gt;dial&lt;/code&gt; that follows sees it too. A rule taken away is gone for the broker&amp;rsquo;s next &lt;code&gt;dial&lt;/code&gt; as well, so a connection opened as a rule goes may fail, but never one that no rule allowed. The broker also looks at its own copy of the policy files at each &lt;code&gt;file&lt;/code&gt; request for one of them, so its copy is never older than what it gave the child, but in the moment between the two looks. A rule for a name, such as &lt;code&gt;localhost:5432&lt;/code&gt;, judges the name, and the floor needs a rule for the address too, such as &lt;code&gt;127.0.0.1:5432&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Which addresses:&lt;/strong&gt; the broker judges each address as the floor does, unmapped, so an IPv4-mapped &lt;code&gt;::ffff:127.0.0.1&lt;/code&gt; is &lt;code&gt;127.0.0.1&lt;/code&gt;, a NAT64 or 6to4 address is judged by the IPv4 address in it, &lt;code&gt;::1&lt;/code&gt; and every address in &lt;code&gt;127.0.0.0/8&lt;/code&gt; are loopback, and &lt;code&gt;0.0.0.0&lt;/code&gt; and &lt;code&gt;::&lt;/code&gt;, which reach this machine&amp;rsquo;s own services, are internal. It refuses an address with a zone, such as &lt;code&gt;fe80::1%en0&lt;/code&gt;, which no rule can name, and a port outside 1 to 65535.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy:&lt;/strong&gt; the child asks for &lt;code&gt;https&lt;/code&gt;&amp;rsquo;s or &lt;code&gt;http&lt;/code&gt;&amp;rsquo;s, and the broker connects to the address in its own config, by name, through the system&amp;rsquo;s resolver, so a company proxy on this machine&amp;rsquo;s loopback, such as a VPN client&amp;rsquo;s, works, and the child can name no other address that way. The child still speaks &lt;code&gt;CONNECT&lt;/code&gt; and plain HTTP to it, with its password, so the company proxy, not the broker, decides where those go.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The host&amp;rsquo;s addresses:&lt;/strong&gt; the broker reads them before it starts the child, and a read that fails or finds none fails the start, as the child&amp;rsquo;s own check does, and a later read that fails keeps the last good one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A request given up on:&lt;/strong&gt; the child sends &lt;code&gt;cancel&lt;/code&gt; with a &lt;code&gt;lookup&lt;/code&gt;&amp;rsquo;s or a &lt;code&gt;dial&lt;/code&gt;&amp;rsquo;s ID once the VM&amp;rsquo;s request has ended, or a lookup&amp;rsquo;s own deadline has passed, and the broker ends that lookup or connection, answers it with an error and frees its place, so slots that a VM&amp;rsquo;s abandoned requests held don&amp;rsquo;t fill the caps. A &lt;code&gt;cancel&lt;/code&gt; gets no answer of its own, and one for an ID that isn&amp;rsquo;t under way is dropped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lookups:&lt;/strong&gt; the broker looks each name up through this machine&amp;rsquo;s resolver, as the proxy does, so the child sends no DNS, and a resolver on this machine&amp;rsquo;s loopback, such as systemd-resolved&amp;rsquo;s &lt;code&gt;127.0.0.53&lt;/code&gt; or a &lt;code&gt;dnsmasq&lt;/code&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt;, answers the broker. The child sends no UDP at all.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What doesn&amp;rsquo;t change:&lt;/strong&gt; the open tier&amp;rsquo;s broker allows every address, as the floor does there. Transparent mode&amp;rsquo;s connections, the Nix cache&amp;rsquo;s fetches and the connections that put a value in go through the same &lt;code&gt;dial&lt;/code&gt;. A link&amp;rsquo;s connection is the broker&amp;rsquo;s already, through its &lt;code&gt;link&lt;/code&gt; request, and a capture&amp;rsquo;s token request is the broker&amp;rsquo;s own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sandboxes:&lt;/strong&gt; on macOS the child&amp;rsquo;s profile allows no network out at all, neither TCP nor UDP to any address, nor any unix socket, and Seatbelt checks every &lt;code&gt;connect&lt;/code&gt; and every send with an address, while writes on a connection it accepted or was handed need no rule. On Linux, Landlock from ABI 4 refuses every TCP &lt;code&gt;connect&lt;/code&gt;, and from ABI 10 every UDP bind and send, as the child&amp;rsquo;s ruleset handles those rights and allows no port, and the seccomp filter refuses the child every socket but a netlink route socket, &lt;code&gt;connect&lt;/code&gt; and &lt;code&gt;socketpair&lt;/code&gt; outright, and &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; on &lt;code&gt;sendto&lt;/code&gt;, &lt;code&gt;sendmsg&lt;/code&gt; and &lt;code&gt;sendmmsg&lt;/code&gt;, because TCP Fast Open connects a socket as it sends, and the listener, once a &lt;code&gt;shutdown&lt;/code&gt; has closed it, is a TCP socket that could connect again. A filter reads only a call&amp;rsquo;s arguments, never what they point to, and these checks need nothing else, so no other thread of the child can change what the filter checked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Without the sandbox:&lt;/strong&gt; a child that runs unconfined, or on a Linux kernel without seccomp filters, still asks the broker for every connection, but nothing stops a child that a VM took over from connecting itself, so its confinement says so (&lt;code&gt;partial&lt;/code&gt; with &lt;code&gt;no-seccomp&lt;/code&gt;, or &lt;code&gt;none&lt;/code&gt;), and devvm doctor warns of it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The &lt;code&gt;Secret&lt;/code&gt; type on the socket.&lt;/strong&gt; The frames are the third kind of file that holds values, after &lt;code&gt;proxy.json&lt;/code&gt; and &lt;code&gt;vm.json&lt;/code&gt;, so they get wire types of their own, as those files have (&lt;a href="#where-secret-values-live"&gt;where secret values live&lt;/a&gt;). The start&amp;rsquo;s password, the company proxy&amp;rsquo;s password, the CAs&amp;rsquo; keys, and a &lt;code&gt;value&lt;/code&gt; or &lt;code&gt;token&lt;/code&gt; reply&amp;rsquo;s value each cross as a string in a wire struct. Only the protocol&amp;rsquo;s encoder fills that string, with &lt;code&gt;Reveal&lt;/code&gt; and its &lt;code&gt;//nolint:forbidigo&lt;/code&gt; on the line, and the decoder makes it a &lt;code&gt;redact.Secret&lt;/code&gt; at once. Nothing logs a frame, and an error names only its type and the rule it broke. The company proxy&amp;rsquo;s URLs from the environment cross as strings, as they are in &lt;code&gt;proxy.json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The start:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;devvm starts the broker as it starts the proxy, &lt;code&gt;devvm _proxy -config FILE&lt;/code&gt;, detached, with its output in &lt;code&gt;proxy.log&lt;/code&gt;, and waits up to 5 seconds for its status file.&lt;/li&gt;
&lt;li&gt;The broker reads the config, looks up the company proxy&amp;rsquo;s password when the config names the &lt;code&gt;proxy&lt;/code&gt; secret, reads the CAs&amp;rsquo; files, listens on the VM&amp;rsquo;s proxy port, starts the agent&amp;rsquo;s relay and the keeping of the backend&amp;rsquo;s logs, and makes the socketpair.&lt;/li&gt;
&lt;li&gt;It starts the child, devvm&amp;rsquo;s own binary with the arguments &lt;code&gt;_proxy-child -for FILE&lt;/code&gt;, through &lt;code&gt;daemon.Spawn&lt;/code&gt;, which gains the descriptors to pass (&lt;code&gt;ExtraFiles&lt;/code&gt;) and an environment that its caller chooses. On Linux it runs &lt;code&gt;/proc/self/exe&lt;/code&gt;, which is its own file even once an upgrade has replaced the file at its path. &lt;code&gt;-for&lt;/code&gt; names the config only so the child can be told apart, and the child never opens it. Once the child runs, the broker closes its own copies of the listener and of the child&amp;rsquo;s end of the socketpair.&lt;/li&gt;
&lt;li&gt;It sends &lt;code&gt;start&lt;/code&gt;, which also says how the broker started the child, under Seatbelt or unconfined and why. The child checks the executable&amp;rsquo;s SHA-256 against its own, makes its server from the start, opens its logs and the Nix cache, loads the system&amp;rsquo;s roots and its time zone, checks that it can read the host&amp;rsquo;s addresses, confines itself where its platform does that in the process, checks that the confinement holds by opening its broker&amp;rsquo;s config, which it must be refused, and answers &lt;code&gt;ready&lt;/code&gt; with how it&amp;rsquo;s confined.&lt;/li&gt;
&lt;li&gt;Within 4 seconds of its own start, the broker writes the child&amp;rsquo;s pid file, &lt;code&gt;run/proxy-child.pid&lt;/code&gt;, and how it&amp;rsquo;s confined, &lt;code&gt;run/proxy.confined&lt;/code&gt;, which devvm doctor reads only while the broker runs, and which &lt;code&gt;Proxy.Stop&lt;/code&gt; removes with the pid file, and then the status file with its own pid and the address (&lt;code&gt;daemon.Ready&lt;/code&gt;), which is what devvm waits for. The status keeps the address alone, which devvm compares with the config&amp;rsquo;s. When the child answers &lt;code&gt;failed&lt;/code&gt;, or doesn&amp;rsquo;t answer in time, the broker stops it and exits with the reason in &lt;code&gt;proxy.log&lt;/code&gt;, so devvm reports &lt;code&gt;proxy_start_failed&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;The end.&lt;/strong&gt; The two end together, and neither starts the other again:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The lifeline is the broker&amp;rsquo;s.&lt;/strong&gt; When the VM&amp;rsquo;s hostagent ends, the broker closes the socket, and the child closes its listener first, then closes its connections, waits up to 5 seconds for its handlers as the proxy does, and exits. The broker waits for it, and kills it a second past that, then removes the agent&amp;rsquo;s socket and exits.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm stop&lt;/code&gt;&amp;rsquo;s &lt;code&gt;SIGTERM&lt;/code&gt;&lt;/strong&gt; reaches the broker through its pid file. The broker sends the child &lt;code&gt;SIGTERM&lt;/code&gt; through its &lt;code&gt;daemon.Handle&lt;/code&gt;, which ends it at once, as &lt;code&gt;SIGTERM&lt;/code&gt; ends the proxy, and kills it if it hasn&amp;rsquo;t ended within a second, inside the 2 seconds that devvm waits before its own &lt;code&gt;SIGKILL&lt;/code&gt;. So a stop ends both, and the next start finds the port free.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A broker that ends any other way,&lt;/strong&gt; &lt;code&gt;SIGKILL&lt;/code&gt; included, leaves the socket closed, because nothing else holds its end, and the child reads its end, closes its listener and exits. The child reads the socket for as long as it runs, so this needs no signal. A child that a VM has taken over can ignore the socket&amp;rsquo;s end, so on Linux the broker also starts the child with &lt;code&gt;PR_SET_PDEATHSIG&lt;/code&gt; set to &lt;code&gt;SIGKILL&lt;/code&gt;, from a goroutine that holds its thread (&lt;code&gt;runtime.LockOSThread&lt;/code&gt;) until the child is reaped, because Linux ties that signal to the thread that started the child rather than its process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A child that ends,&lt;/strong&gt; crashed or killed, ends the broker, which logs how it ended and removes the agent&amp;rsquo;s socket. Neither starts the other again, so a child that fails at once can&amp;rsquo;t loop, and the VM has no network until devvm&amp;rsquo;s next command starts its proxy again, as after a proxy&amp;rsquo;s crash.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Finding them.&lt;/strong&gt; To devvm, the broker is the proxy. Its pid file, its status file and its arguments, &lt;code&gt;_proxy -config FILE&lt;/code&gt;, which &lt;code&gt;daemon.Proc&lt;/code&gt; matches, stay as they are. The broker signals the child through the &lt;code&gt;daemon.Handle&lt;/code&gt; that &lt;code&gt;Spawn&lt;/code&gt; returned, which reaps it. devvm also finds the child as a &lt;code&gt;daemon.Proc&lt;/code&gt;, by &lt;code&gt;run/proxy-child.pid&lt;/code&gt; and its arguments, &lt;code&gt;_proxy-child -for&lt;/code&gt; and the VM&amp;rsquo;s config, so &lt;code&gt;Proxy.Stop&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop a child that outlived its broker, checking its arguments before each signal as they do for every background process. The broker writes that pid file only once the child said it&amp;rsquo;s ready, after &lt;code&gt;sandbox-exec&lt;/code&gt; has run it, so the arguments are already the child&amp;rsquo;s own. Its arguments don&amp;rsquo;t contain &lt;code&gt;_proxy -config&lt;/code&gt;, so every pattern that finds a VM&amp;rsquo;s proxy finds only the broker. The testscript runner&amp;rsquo;s &lt;code&gt;pkill -f&lt;/code&gt; of &lt;code&gt;_proxy -config&lt;/code&gt; in the sandbox ends the brokers and so their children, and the runner also ends &lt;code&gt;_proxy-child -for&lt;/code&gt; in the sandbox, in case a test killed a broker in a way that kept its child. The end-to-end checks find the child by &lt;code&gt;[_]proxy-child -for&lt;/code&gt; and the config, and a check that a proxy is gone checks both.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The build proxy&lt;/strong&gt; is the same broker and child, which &lt;code&gt;backend.ProxyStarter&lt;/code&gt; starts and stops through its &lt;code&gt;daemon.Handle&lt;/code&gt;, and which ends the child as &lt;code&gt;devvm stop&lt;/code&gt; does. Its broker has no secrets, captures, links, agent or backend logs to keep, so it only looks up the &lt;code&gt;proxy&lt;/code&gt; secret when &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s company proxy names one, and follows the build VM&amp;rsquo;s lifeline. Its child writes &lt;code&gt;events.jsonl&lt;/code&gt; and &lt;code&gt;proxy.log&lt;/code&gt; in the build proxy&amp;rsquo;s &lt;code&gt;logs/&lt;/code&gt; folder and reads nothing else, so the end-to-end checks that look for a build&amp;rsquo;s logs look there. One way for both keeps one code path, and a build runs code that devvm trusts no more than a VM&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Upgrades.&lt;/strong&gt; The config doesn&amp;rsquo;t change. &lt;code&gt;proxy.json&lt;/code&gt; keeps its fields and &lt;code&gt;ConfigVersion&lt;/code&gt; stays 1, so every release&amp;rsquo;s frozen configs still read and write back byte for byte (&lt;code&gt;TestV010ProxyConfigs&lt;/code&gt;), and the implementation starts a broker and its child on each of them. A proxy that a devvm before the split started runs as one process until the VM&amp;rsquo;s next launch, which starts it again because its config&amp;rsquo;s &lt;code&gt;devvm_sha256&lt;/code&gt; differs, as every upgrade does, so a running VM keeps its network through the upgrade. An older devvm that stops a VM&amp;rsquo;s proxy after a downgrade finds the broker by the same pid file and arguments, and the child ends with it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Confining the child.&lt;/strong&gt; Two follow-ups hold the child to what it needs, as listed above, and where a platform can&amp;rsquo;t, the child runs unconfined, says so in &lt;code&gt;ready&lt;/code&gt;, the broker logs a warning and writes it to &lt;code&gt;run/proxy.confined&lt;/code&gt;, and devvm doctor warns of it for each running VM. The child says how it&amp;rsquo;s confined in one line of words from a fixed set, its level, &lt;code&gt;full&lt;/code&gt;, &lt;code&gt;partial&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;, then what confines it, and for a child that isn&amp;rsquo;t fully confined, why (&lt;code&gt;proxy.Confinement&lt;/code&gt;, in &lt;code&gt;internal/proxy/confine.go&lt;/code&gt;), which the broker refuses unless it parses, so devvm never prints what a child wrote (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt; has the table). Both follow-ups share it, the check that the confinement holds (&lt;code&gt;checkConfined&lt;/code&gt;, which opens the broker&amp;rsquo;s config) and the hook where the child confines itself in the process (&lt;code&gt;confineSelf&lt;/code&gt;, by platform), which on Linux calls &lt;code&gt;internal/landlock&lt;/code&gt; and turns what it got into the line (&lt;code&gt;landlockConfinement&lt;/code&gt;), and which &lt;code&gt;confineChild&lt;/code&gt; bounds to 2 seconds (&lt;code&gt;confineWait&lt;/code&gt;). The child gets the hook through &lt;code&gt;IO&lt;/code&gt;&amp;rsquo;s &lt;code&gt;confine&lt;/code&gt;, which &lt;code&gt;ChildMain&lt;/code&gt; sets, so a test&amp;rsquo;s child in the test&amp;rsquo;s own process confines nothing, and a confinement that fails, rather than one the kernel can&amp;rsquo;t give, fails the start. Each follow-up&amp;rsquo;s start fits in the broker&amp;rsquo;s 4 seconds, so a sandbox that refuses what the child needs fails the start rather than hang it, and on macOS a broker and its child under Seatbelt are ready in about 40 ms, or 350 ms for the first start of a binary that macOS hasn&amp;rsquo;t run before.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;macOS, with Seatbelt:&lt;/strong&gt; the broker starts the child through &lt;code&gt;/usr/bin/sandbox-exec -p PROFILE&lt;/code&gt;, with a profile that denies everything by default, so the child is confined from its first instruction, and the profile is an argument, never a file on disk. &lt;code&gt;internal/seatbelt&lt;/code&gt; owns it (&lt;code&gt;ChildProfile&lt;/code&gt;), with the quoting and the real paths that Lima&amp;rsquo;s hostagent&amp;rsquo;s profile uses too, and the broker gets it through &lt;code&gt;proxy.IO.Seatbelt&lt;/code&gt;, which only &lt;code&gt;devvm _proxy&lt;/code&gt; on macOS sets, because &lt;code&gt;internal/proxy&lt;/code&gt; imports the standard library alone. The profile imports the system&amp;rsquo;s &lt;code&gt;dyld-support.sb&lt;/code&gt;, the rules that Apple keeps for starting a program, so dyld and the system&amp;rsquo;s libraries in their cryptexes load as Apple changes them. It allows &lt;code&gt;exec&lt;/code&gt; and reading of devvm&amp;rsquo;s binary by its real path alone, which &lt;code&gt;sandbox-exec&lt;/code&gt; needs to run it and the child needs for its SHA-256, and the metadata of its folder, which CoreFoundation looks at for the program&amp;rsquo;s bundle before Security checks a certificate. It allows reading &lt;code&gt;/usr/lib&lt;/code&gt; and &lt;code&gt;/System/Library&lt;/code&gt; and the time zone, and the metadata of the links on the way, &lt;code&gt;/etc&lt;/code&gt;, &lt;code&gt;/var&lt;/code&gt; and &lt;code&gt;/tmp&lt;/code&gt;, because a sandboxed lookup through a link needs it. It allows reading and writing in its folders, making only regular files there (&lt;code&gt;vnode-type REGULAR-FILE&lt;/code&gt;), no hard link anywhere (&lt;code&gt;file-link&lt;/code&gt;), no folder removed, and no change to a file&amp;rsquo;s flags, ACL, owner, set-id bits or extended attributes, so the broker makes the Nix cache&amp;rsquo;s folders before the child starts. It allows &lt;code&gt;file-read-metadata&lt;/code&gt; alone on the watched files, on their targets when they&amp;rsquo;re links, and on every link on the way to any of its files and folders (&lt;code&gt;seatbelt.Links&lt;/code&gt;), the mach services &lt;code&gt;com.apple.trustd&lt;/code&gt; and &lt;code&gt;com.apple.trustd.agent&lt;/code&gt;, reading &lt;code&gt;sysctl&lt;/code&gt; but its &lt;code&gt;kern.proc&lt;/code&gt; names, and signals to itself. It allows no network out at all, to any address or unix socket, and accepting on its listener, and reading and writing the connections it accepted and those that the broker handed it, need no rule. It allows no bind, no fork, no look at another process (&lt;code&gt;process-info&lt;/code&gt;, the process list), and none of the Keychain&amp;rsquo;s services. The list of what the child needs came from the sandbox&amp;rsquo;s own log of what it refused (&lt;code&gt;log show --predicate 'eventMessage CONTAINS &amp;quot;devvm(&amp;quot;'&lt;/code&gt;), and the profile leaves refused what the child does without: &lt;code&gt;com.apple.logd&lt;/code&gt;, &lt;code&gt;com.apple.system.notification_center&lt;/code&gt;, &lt;code&gt;com.apple.system.opendirectoryd.libinfo&lt;/code&gt;, &lt;code&gt;/Library/Preferences/com.apple.networkd.plist&lt;/code&gt;, &lt;code&gt;/etc/passwd&lt;/code&gt;, &lt;code&gt;/dev/fd&lt;/code&gt;, the interfaces&amp;rsquo; link addresses (&lt;code&gt;net.link.addr&lt;/code&gt;), &lt;code&gt;AF_SYSTEM&lt;/code&gt; sockets and the binds that the system&amp;rsquo;s network code tries. &lt;code&gt;crypto/x509&lt;/code&gt;&amp;rsquo;s checks don&amp;rsquo;t need &lt;code&gt;com.apple.SecurityServer&lt;/code&gt;, which the profile never allows. A watched file whose link points elsewhere after the start gets its &lt;code&gt;stat&lt;/code&gt; refused, which the child takes as a file to ask the broker for at every request (&lt;code&gt;watched.get&lt;/code&gt;), so a change still applies to the next request. The broker starts the child again unconfined, within the same 4 seconds, only when &lt;code&gt;sandbox-exec&lt;/code&gt; failed before devvm&amp;rsquo;s code ran, which the child&amp;rsquo;s end shows: it ended before it answered, with &lt;code&gt;sandbox-exec&lt;/code&gt;&amp;rsquo;s own exit status, 65 for a profile it refused or 71 for a program it couldn&amp;rsquo;t run, or killed by &lt;code&gt;SIGABRT&lt;/code&gt; or &lt;code&gt;SIGKILL&lt;/code&gt;, as dyld aborts a program that the profile refuses what it needs to load, which the broker decides before its own stop of the child. A ready that names a sandbox the broker didn&amp;rsquo;t start the child under breaks the protocol&amp;rsquo;s rules (&lt;code&gt;Confinement.fits&lt;/code&gt;). &lt;code&gt;ChildProfile&lt;/code&gt; refuses a path that isn&amp;rsquo;t absolute or that is the root, as resolved. A missing &lt;code&gt;sandbox-exec&lt;/code&gt; starts it unconfined too. Anything else fails the start, so nothing a VM left in the child&amp;rsquo;s folders can turn a confined start into an unconfined one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux, with Landlock:&lt;/strong&gt; the child sets &lt;code&gt;no_new_privs&lt;/code&gt; on every thread and restricts itself (&lt;code&gt;landlock_restrict_self&lt;/code&gt;, through &lt;code&gt;syscall.AllThreadsSyscall&lt;/code&gt;, or with ABI 8&amp;rsquo;s &lt;code&gt;TSYNC&lt;/code&gt; where the kernel has it) before it reads a byte of the VM&amp;rsquo;s, and the files it opened before then are its logs and the Nix cache. It keeps the rights above on its folders, to make regular files alone, binds and connects no TCP port (ABI 4), binds and sends no UDP (ABI 10), scopes abstract unix sockets and signals to itself (ABI 6), and connects to no named unix socket (ABI 9). Landlock&amp;rsquo;s network rules match only ports, so they can refuse the child an address only by refusing it every connection, which is what the child needs, and the seccomp filter refuses the same on every kernel, TCP Fast Open included, which Landlock&amp;rsquo;s check of &lt;code&gt;connect&lt;/code&gt; doesn&amp;rsquo;t see. It reads no file outside its folders, because it needs no resolver. The Nix cache renames a NAR&amp;rsquo;s temporary file from its top folder into &lt;code&gt;nar/&lt;/code&gt;, which Landlock allows only from ABI 2 (&lt;code&gt;REFER&lt;/code&gt;), so the floor is ABI 2, unless the cache makes each temporary file in the folder that its file goes to. A child on a kernel below ABI 4 or 6 is partly confined, which it says in &lt;code&gt;ready&lt;/code&gt; and devvm doctor reports. A kernel at ABI 6 or 7 without Landlock&amp;rsquo;s erratum 2, which lets a process&amp;rsquo;s threads signal each other across the domains each made in turn, would refuse the signals that &lt;code&gt;syscall.AllThreadsSyscall&lt;/code&gt; sends each thread and hang the start, so there the child leaves signals unscoped and says so (&lt;code&gt;landlock-signals&lt;/code&gt;). A kernel without Landlock, or at ABI 1, confines no files, and the child runs with the seccomp filter alone and says so (&lt;code&gt;partial seccomp no-landlock&lt;/code&gt;), which devvm doctor warns of: the VM keeps its network rather than lose it on such a kernel. &lt;code&gt;internal/landlock&lt;/code&gt; (&lt;code&gt;Self&lt;/code&gt;) does all of it, with the standard library alone, behind its own build tags, as the proxy can&amp;rsquo;t import &lt;code&gt;internal/platform&lt;/code&gt;, and checks after confining that the child lists its folders and fails to list &lt;code&gt;/&lt;/code&gt; and to read &lt;code&gt;/etc/hosts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux, with seccomp:&lt;/strong&gt; no Landlock ABI can refuse the child an address, a kernel before ABI 9 can&amp;rsquo;t refuse it a named unix socket, and one before ABI 4 can&amp;rsquo;t refuse it a port, so the child also installs a seccomp filter on every thread (&lt;code&gt;SECCOMP_FILTER_FLAG_TSYNC&lt;/code&gt;) that refuses &lt;code&gt;socket&lt;/code&gt; for every family but a netlink route socket (&lt;code&gt;AF_NETLINK&lt;/code&gt; with &lt;code&gt;NETLINK_ROUTE&lt;/code&gt;), &lt;code&gt;socketpair&lt;/code&gt;, &lt;code&gt;connect&lt;/code&gt;, &lt;code&gt;listen&lt;/code&gt;, &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; on &lt;code&gt;sendto&lt;/code&gt;, &lt;code&gt;sendmsg&lt;/code&gt; and &lt;code&gt;sendmmsg&lt;/code&gt;, &lt;code&gt;socketcall&lt;/code&gt;, and &lt;code&gt;io_uring_setup&lt;/code&gt;, &lt;code&gt;io_uring_enter&lt;/code&gt; and &lt;code&gt;io_uring_register&lt;/code&gt;, whose operations would pass a filter of system calls. It kills the child for a system call of any architecture but its own, and on amd64 for the x32 numbers, so the 32-bit calls can&amp;rsquo;t get around it. &lt;code&gt;socketcall&lt;/code&gt; is a 32-bit call alone, so the check of the architecture is what refuses it. The filter also refuses &lt;code&gt;ptrace&lt;/code&gt;, &lt;code&gt;process_vm_readv&lt;/code&gt;, &lt;code&gt;process_vm_writev&lt;/code&gt; and &lt;code&gt;pidfd_getfd&lt;/code&gt;, which Landlock restricts to the child&amp;rsquo;s own domain but nothing does on a kernel without it, and which would let the child read the memory, or take the descriptors, of another process of yours, such as an ssh master. Changed in review, it refuses what Landlock doesn&amp;rsquo;t restrict at any ABI: a file&amp;rsquo;s mode, owner, extended attributes and times changed by its path (&lt;code&gt;chmod&lt;/code&gt;, &lt;code&gt;fchmodat&lt;/code&gt;, &lt;code&gt;fchmodat2&lt;/code&gt;, &lt;code&gt;chown&lt;/code&gt;, &lt;code&gt;lchown&lt;/code&gt;, &lt;code&gt;fchownat&lt;/code&gt;, the six &lt;code&gt;xattr&lt;/code&gt; calls, &lt;code&gt;utime&lt;/code&gt;, &lt;code&gt;utimes&lt;/code&gt;, &lt;code&gt;futimesat&lt;/code&gt;, and &lt;code&gt;utimensat&lt;/code&gt; with a path), &lt;code&gt;truncate&lt;/code&gt;, which Landlock restricts only from ABI 3, the kernel&amp;rsquo;s keyrings (&lt;code&gt;add_key&lt;/code&gt;, &lt;code&gt;request_key&lt;/code&gt;, &lt;code&gt;keyctl&lt;/code&gt;), another process&amp;rsquo;s limits and scheduling (&lt;code&gt;prlimit64&lt;/code&gt; on another pid, &lt;code&gt;setpriority&lt;/code&gt;, &lt;code&gt;ioprio_set&lt;/code&gt; and the four &lt;code&gt;sched_set&lt;/code&gt; calls), watches that would tell it of files outside its folders (&lt;code&gt;inotify_init&lt;/code&gt;, &lt;code&gt;inotify_init1&lt;/code&gt;, &lt;code&gt;inotify_add_watch&lt;/code&gt;, &lt;code&gt;fanotify_init&lt;/code&gt;, &lt;code&gt;fanotify_mark&lt;/code&gt;), and what the child never does: &lt;code&gt;execve&lt;/code&gt; and &lt;code&gt;execveat&lt;/code&gt;, &lt;code&gt;fork&lt;/code&gt;, &lt;code&gt;vfork&lt;/code&gt; and a &lt;code&gt;clone&lt;/code&gt; that isn&amp;rsquo;t a thread, a namespace (&lt;code&gt;unshare&lt;/code&gt;, &lt;code&gt;setns&lt;/code&gt;, a &lt;code&gt;clone&lt;/code&gt; with a namespace&amp;rsquo;s flag), &lt;code&gt;bpf&lt;/code&gt;, &lt;code&gt;userfaultfd&lt;/code&gt; and &lt;code&gt;perf_event_open&lt;/code&gt;, with &lt;code&gt;clone3&lt;/code&gt; refused as &lt;code&gt;ENOSYS&lt;/code&gt;, as its flags are behind a pointer. The calls on a descriptor the child opened stay (&lt;code&gt;fchmod&lt;/code&gt;, &lt;code&gt;fchown&lt;/code&gt;, &lt;code&gt;ftruncate&lt;/code&gt;, &lt;code&gt;utimensat&lt;/code&gt; without a path), and the Nix cache marks a file used through its descriptor. The review&amp;rsquo;s own check: the filter&amp;rsquo;s interpreter, and &lt;code&gt;TestSelf&lt;/code&gt; on Fedora 43 (ABI 11), Ubuntu 26.04 (ABI 8) and Debian 13 (ABI 6), where Go&amp;rsquo;s runtime still starts new threads under it. The child needs none of these, as the broker looks up its names and opens its connections. Once confined, the child checks that it can&amp;rsquo;t make a unix or an IPv4 socket, nor &lt;code&gt;connect&lt;/code&gt; or send with &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; on any socket, which the filter refuses before the kernel looks at the descriptor. The filter is classic BPF written out by hand (&lt;code&gt;internal/landlock&lt;/code&gt;&amp;rsquo;s &lt;code&gt;filter&lt;/code&gt;), a unit test runs its bytes in an interpreter of its own for amd64 and arm64, and a test&amp;rsquo;s child confines itself under it on the Linux test hosts and in CI&amp;rsquo;s &lt;code&gt;nocgo&lt;/code&gt; job (&lt;code&gt;TestSelf&lt;/code&gt;). A kernel without seccomp leaves the filter out, and the child says so (&lt;code&gt;no-seccomp&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Performance.&lt;/strong&gt; The path of the VM&amp;rsquo;s requests is the child&amp;rsquo;s alone: no request, tunnel or byte in them crosses the socket. The child asks the broker only for a value that its cache doesn&amp;rsquo;t hold, at most once for each binding in 30 seconds or 5 minutes, for a watched file after it changed, for each connection to a link, which is a new connection for each plain HTTP request to a link, for each token request, and for each lookup and each connection that a request opens upstream. Those last two add a round trip on the socketpair to each lookup and each connection, a JSON frame each way and a descriptor, which is small beside a lookup&amp;rsquo;s or a TCP handshake&amp;rsquo;s own time, and a kept-alive connection or a tunnel costs it once. A start costs one more process and its &lt;code&gt;exec&lt;/code&gt;, and each VM&amp;rsquo;s proxy takes a second Go process&amp;rsquo;s memory: on an Apple silicon Mac, an idle broker and its child each take about 19 MB resident.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Options weighed:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Values handed to the child at the start:&lt;/strong&gt; ruled out, above.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The child reading the changing files itself:&lt;/strong&gt; it would need to read the VM&amp;rsquo;s run folder and devvm&amp;rsquo;s config folder. Landlock keeps a rule for a file on that file itself, so a file that devvm replaces whole would lose it, and only a rule on the folder would hold. Asking the broker after a change keeps the check on each request without a hop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker sending changes to the child as they happen:&lt;/strong&gt; the broker would have to watch each file, and the standard library can only poll, so a change would wait for the next poll, while with the stamp&amp;rsquo;s check it applies to the next request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker speaking to the company proxy and handing over the tunnel:&lt;/strong&gt; that would keep the company proxy&amp;rsquo;s password out of the child for tunnels, but the company proxy takes it with each plain HTTP request, which would put the broker on that path, parsing what the child sends. So the broker opens the TCP connection to the company proxy alone, and the child speaks to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Seatbelt refusing &lt;code&gt;localhost:*&lt;/code&gt; alone, with the broker connecting to loopback only:&lt;/strong&gt; Seatbelt&amp;rsquo;s network filter names a host only as &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;localhost&lt;/code&gt;, so the child would still reach this machine&amp;rsquo;s own LAN addresses, where a server that listens on every address answers, such as Docker&amp;rsquo;s published ports, and the LAN, and whether &lt;code&gt;localhost&lt;/code&gt; covers all of &lt;code&gt;127.0.0.0/8&lt;/code&gt;, &lt;code&gt;0.0.0.0&lt;/code&gt; and the mapped forms is Apple&amp;rsquo;s to say. A profile that allows nothing out, with the broker judging every address, holds for all of them, and keeps one way for both systems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;seccomp&amp;rsquo;s user notification on Linux,&lt;/strong&gt; with the broker as the supervisor of &lt;code&gt;connect&lt;/code&gt;, &lt;code&gt;sendto&lt;/code&gt; and &lt;code&gt;sendmsg&lt;/code&gt;: the broker would read the address from the child&amp;rsquo;s memory, which another thread of the child can change after the read, so it could never let the call go on, and would make every connection itself and put it in the child (&lt;code&gt;SECCOMP_IOCTL_NOTIF_ADDFD&lt;/code&gt;), which costs what the &lt;code&gt;dial&lt;/code&gt; request does. Reading the child&amp;rsquo;s memory needs &lt;code&gt;ptrace&lt;/code&gt;&amp;rsquo;s access, which Yama&amp;rsquo;s &lt;code&gt;ptrace_scope&lt;/code&gt; 2 or 3 refuses, the broker couldn&amp;rsquo;t tell a TCP socket from a UDP one without taking it (&lt;code&gt;pidfd_getfd&lt;/code&gt;, the same access), the listener&amp;rsquo;s descriptor would have to come from the child, which the protocol refuses, and &lt;code&gt;ADDFD&lt;/code&gt; needs Linux 5.9. The filter on arguments works on every kernel with seccomp filters, with no access to the child&amp;rsquo;s memory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A network namespace for the child with nothing but its own loopback,&lt;/strong&gt; with the broker dialing every connection: it costs what the &lt;code&gt;dial&lt;/code&gt; request does, it needs an unprivileged user namespace, which Ubuntu&amp;rsquo;s AppArmor restricts from 24.04 and other systems turn off, and which the child&amp;rsquo;s filter refuses (&lt;code&gt;unshare&lt;/code&gt;), so the broker would have to make it. The filter refuses the same connections without a namespace.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker signing the interception&amp;rsquo;s certificates:&lt;/strong&gt; the child already sees every byte of its VM&amp;rsquo;s traffic, so the VM&amp;rsquo;s CA key gives it nothing more, and no other VM trusts that CA.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The agent&amp;rsquo;s relay in the child, through a connection from the broker:&lt;/strong&gt; that connection would carry whatever the child sends, so the broker would have to filter it, which is the relay&amp;rsquo;s whole job.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A process each for the relay, the logs and the lookups:&lt;/strong&gt; each would be unconfined, as the broker is, so more processes would add lifecycles but no boundary.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its local IPC, protocols, data isolation and resource exhaustion companions, on this design, and an independent review of it against today&amp;rsquo;s code, whose findings are folded in). Leads, each ruled out by the design, changed in review, or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The child naming another VM&amp;rsquo;s binding, another secret or a file:&lt;/strong&gt; ruled out. Each request is a key, a number, a host and port, or an endpoint that the broker resolves in its own config and its own reads of its VM&amp;rsquo;s files, and no path, VM name or binding crosses the socket.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The values bound to its VM:&lt;/strong&gt; listed. A child that a VM takes over can ask for every value that its VM&amp;rsquo;s bindings file names, such as a secret of yours, a GitHub token or an agent&amp;rsquo;s access token, and use it anywhere the child reaches, while the VM itself holds only placeholders. It gets no other VM&amp;rsquo;s value, no value that isn&amp;rsquo;t bound to its VM, and no login&amp;rsquo;s refresh token.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy&amp;rsquo;s password:&lt;/strong&gt; listed. The child holds it, as the proxy does, because the company proxy takes it with each plain HTTP request, so a child that a VM takes over can send it anywhere it reaches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its VM&amp;rsquo;s password and CAs:&lt;/strong&gt; listed. The child holds its VM&amp;rsquo;s password and both CAs&amp;rsquo; keys, which only that VM trusts, and it already sees all of that VM&amp;rsquo;s traffic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forged token reply:&lt;/strong&gt; ruled out. The broker gets the endpoint&amp;rsquo;s reply itself, over TLS that it checks, from the host in its own config, so a child can&amp;rsquo;t save tokens that the endpoint didn&amp;rsquo;t issue. Listed: a real exchange of a code that the VM got for an account of its own saves that account&amp;rsquo;s login for every VM with the agent, as a VM can do without the proxy taken over (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A binding or link that devvm took away:&lt;/strong&gt; changed in review. The broker read the bindings file and the links&amp;rsquo; list only when the child asked for them, which a child that a VM takes over never does, so a secret unbound or deleted, or a link removed, stayed within its reach. The broker now looks at both on every request that uses them, and drops its values when the bindings file changes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flooding the broker:&lt;/strong&gt; listed. Frames have a cap, each request type has a cap on how many run at once, the broker&amp;rsquo;s cache holds a lookup to once a binding in 30 seconds or 5 minutes, a failed lookup is kept for 5 seconds (changed in review, as a failure wasn&amp;rsquo;t kept, so a child could make the broker run &lt;code&gt;security&lt;/code&gt; or try a refresh back to back), and a frame that breaks a rule ends the pair. A child can still run up to 8 token exchanges at once with your login, one after another, as a VM can, and make the broker write a line in &lt;code&gt;proxy.log&lt;/code&gt; for each connection it refuses or can&amp;rsquo;t open, which pushes older lines out of the log&amp;rsquo;s rotation, as the child&amp;rsquo;s own lines can.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker&amp;rsquo;s own parsing:&lt;/strong&gt; listed. The broker still reads bytes that a VM chooses, in four bounded places: the child&amp;rsquo;s frames, at most 2 MiB each, which &lt;code&gt;encoding/json&lt;/code&gt; decodes, the agent&amp;rsquo;s relay&amp;rsquo;s messages, at most 256 KiB each, read by their length and type alone, the backend&amp;rsquo;s logs, which it scans for passwords, and a token request and its reply, at most 64 KiB and 1 MiB, which &lt;code&gt;internal/agentlogin&lt;/code&gt; parses as the proxy&amp;rsquo;s process does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The network:&lt;/strong&gt; changed, and listed. The rules and the floor were the child&amp;rsquo;s own code, and the sandboxes allowed it TCP and UDP to any address, so a child that a VM took over reached this machine&amp;rsquo;s loopback, its own LAN addresses and the LAN, such as your dev servers, Docker&amp;rsquo;s published ports and other VMs&amp;rsquo; proxies, whatever the rules said. A profile can&amp;rsquo;t follow a rule that applies from the next connection, and Landlock and a seccomp filter can&amp;rsquo;t refuse an address, so the sandboxes now refuse the child every connection of its own, and the broker, which judges each address with its own read of the policy files and the host&amp;rsquo;s addresses, opens each one for it. Listed: the child still reaches any public address on the internet, as an open VM&amp;rsquo;s proxy does, over TCP alone, and an address that a rule names. Changed in review, the note no longer says the LAN is out of reach: the floor counts a host on this machine&amp;rsquo;s network whose address is public as the internet, such as a printer&amp;rsquo;s or a NAS&amp;rsquo;s global IPv6 address on most networks with IPv6, or any host on a network of public IPv4 addresses, so the child, as the VM, reaches those, and the floor counting this machine&amp;rsquo;s own networks as internal is a change of its own, for the VM as much as the child. The child reaches no unix socket, so neither the ssh masters&amp;rsquo; control sockets, nor &lt;code&gt;docker.sock&lt;/code&gt;, nor an SSH agent.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;dial&lt;/code&gt; and &lt;code&gt;lookup&lt;/code&gt; requests:&lt;/strong&gt; ruled out, and listed. A &lt;code&gt;dial&lt;/code&gt; names an address and a port, which the broker judges as the floor does before it connects, or a company proxy of its own config, and nothing else, so a child can&amp;rsquo;t make the broker connect where the floor refuses, nor reach a unix socket, nor send UDP through it. A &lt;code&gt;lookup&lt;/code&gt; takes a host name alone, and the broker returns its addresses, which the child could ask this machine&amp;rsquo;s resolver for, split DNS, &lt;code&gt;/etc/hosts&lt;/code&gt; and &lt;code&gt;.local&lt;/code&gt; names included. Listed: a child can make the broker look up any name, which carries data out in the name as a VM&amp;rsquo;s own lookups through the proxy can, and hold 256 lookups and 1024 connections under way at once, each for at most its timeout, as it could hold them itself before. Changed in review: a lookup or a connection that the child gave up on held its place until its timeout, so a VM whose requests went away while DNS or IPv6 hung could fill the caps, and now the child cancels it. The broker logged a line for each failed lookup and connection, which a VM that asks for one refused address after another drives, and now it logs at most 20 a minute, then one that says it stops, as the child does for the lookups it gives up on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The connections the child holds:&lt;/strong&gt; changed in review, and listed. The caps count a connection only while it opens, and Go raises a process&amp;rsquo;s limit on open files to its hard limit, so a child could keep every connection the broker handed it and use up this machine&amp;rsquo;s ports for outgoing connections. The child now lowers its own limit, soft and hard, to 8448 files before it confines itself, four times &lt;code&gt;maxConns&lt;/code&gt; and room for its logs and the Nix cache, so it holds at most that many, which a process can&amp;rsquo;t raise again. Listed: that lowers the risk but doesn&amp;rsquo;t remove it, as macOS gives out its outgoing ports from one range of 16,384 for every process, so a few children that VMs took over, or one on a busy machine, could still use them up.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A connection connected again:&lt;/strong&gt; ruled out. A child holds connected TCP sockets, those it accepted and those the broker handed it, and its listener. On Linux, the filter refuses &lt;code&gt;connect&lt;/code&gt;, which could otherwise disconnect a TCP socket (&lt;code&gt;AF_UNSPEC&lt;/code&gt;) and connect it elsewhere, and &lt;code&gt;MSG_FASTOPEN&lt;/code&gt;, which would connect the listener once a &lt;code&gt;shutdown&lt;/code&gt; has closed it. On macOS, Seatbelt checks every &lt;code&gt;connect&lt;/code&gt; and every &lt;code&gt;sendto&lt;/code&gt; with an address against the profile, which allows none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A rule as it changes:&lt;/strong&gt; ruled out, and listed. The child and the broker each read the policy files when their stamp changes, and the broker looks at them at each &lt;code&gt;dial&lt;/code&gt;, after the child&amp;rsquo;s own look, so a rule that the child saw is one the broker sees. A rule taken away as a connection opens makes that connection fail, which fails closed. Changed in review: the broker&amp;rsquo;s copy and what it gave the child were two reads, and a file that keeps its last rules when it can&amp;rsquo;t be read, as a policy file does, could leave the broker&amp;rsquo;s copy older than the child&amp;rsquo;s, with a rule the child no longer had, so the broker now looks at its copy at each &lt;code&gt;file&lt;/code&gt; request for a policy file too. Listed: a file that changes and can&amp;rsquo;t be read between those two looks, which only you can make happen, still leaves the broker&amp;rsquo;s copy a version behind until the file reads again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy:&lt;/strong&gt; listed. A child that a VM takes over can connect to the company proxy of its config, wherever it is, loopback included, and send it what it likes with the password it holds, as the proxy does: &lt;code&gt;CONNECT&lt;/code&gt; and plain HTTP to any host and port, which the company proxy, not the floor, decides on, so it reaches whatever the company proxy reaches, this machine&amp;rsquo;s loopback included when the company proxy runs here. The broker speaking &lt;code&gt;CONNECT&lt;/code&gt; itself would keep tunnels to the floor, but plain HTTP takes the password with each request, so the child would still hold it and reach the same through &lt;code&gt;http&lt;/code&gt;&amp;rsquo;s company proxy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other processes&amp;rsquo; details:&lt;/strong&gt; changed in review. The first profile allowed every &lt;code&gt;sysctl&lt;/code&gt; and &lt;code&gt;process-info&lt;/code&gt;, so a child could list your processes and read their paths and arguments, a token on a command line among them. The profile now denies &lt;code&gt;process-info&lt;/code&gt; for any process but the child, the process list, and &lt;code&gt;sysctl&lt;/code&gt;&amp;rsquo;s &lt;code&gt;kern.proc&lt;/code&gt; names. macOS answers &lt;code&gt;kern.procargs2&lt;/code&gt;, a process&amp;rsquo;s arguments, to a sandboxed process only for the processes of its own process group, and the child is alone in a session of its own (&lt;code&gt;daemon.Spawn&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Setsid&lt;/code&gt;), so it&amp;rsquo;s refused every other process&amp;rsquo;s, its broker&amp;rsquo;s included, which &lt;code&gt;TestChildProfileConfines&lt;/code&gt; checks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Changing the shared folders&amp;rsquo; files:&lt;/strong&gt; changed in review. The first profile allowed every write in the child&amp;rsquo;s folders, so a child could set a flag such as &lt;code&gt;uchg&lt;/code&gt; on a file in the shared Nix cache, or remove its &lt;code&gt;nar/&lt;/code&gt; folder, and stop every VM&amp;rsquo;s cache and devvm gc&amp;rsquo;s trim from changing it. The profile now refuses changing a file&amp;rsquo;s flags, ACL, owner, set-id bits and extended attributes, and removing a folder, and leaves the mode and times, which the child changes. A child can still delete or rewrite the cache&amp;rsquo;s files, as the disk&amp;rsquo;s row says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The seccomp filter&amp;rsquo;s way around:&lt;/strong&gt; changed in review. A filter of &lt;code&gt;socket&lt;/code&gt; alone lets a child reach a unix socket through the 32-bit system calls (&lt;code&gt;socketcall&lt;/code&gt;, or the x32 numbers) or through &lt;code&gt;io_uring&lt;/code&gt;, which doesn&amp;rsquo;t pass the filter, and before ABI 9 that filter is all that keeps the ssh masters&amp;rsquo; control sockets from it. The filter now kills any other architecture&amp;rsquo;s calls and refuses &lt;code&gt;socketcall&lt;/code&gt; and &lt;code&gt;io_uring&lt;/code&gt;, on every thread.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The folders the child writes:&lt;/strong&gt; changed in review. A child that a VM takes over could leave a link or a FIFO in its logs folder or the Nix cache, and devvm opened &lt;code&gt;proxy.log&lt;/code&gt; again by its path at the next start, copied and emptied it by its path at each rotation, opened &lt;code&gt;links.log&lt;/code&gt; and &lt;code&gt;ports.log&lt;/code&gt;, read the event log, and trimmed the cache through &lt;code&gt;nar/&lt;/code&gt;, each following the link. That would have written the VM&amp;rsquo;s bytes into a file of yours, copied one into the log the child reads, emptied or deleted yours, or hung a command on a FIFO. The child now makes regular files alone, and devvm opens everything in those folders through &lt;code&gt;internal/safefile&lt;/code&gt; or an &lt;code&gt;os.Root&lt;/code&gt;, never following a link, and rotates &lt;code&gt;proxy.log&lt;/code&gt; through its descriptor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The disk:&lt;/strong&gt; listed. Only the child&amp;rsquo;s own code bounds its logs and the shared Nix cache, so a child that a VM takes over can fill the disk, write what it likes into its VM&amp;rsquo;s logs, which devvm network log and devvm network lock read, replace &lt;code&gt;links.log&lt;/code&gt; and &lt;code&gt;ports.log&lt;/code&gt; with files of its own, so the link session&amp;rsquo;s report after a start can show warnings it forged or miss real ones, and write what it likes into the cache. Each VM&amp;rsquo;s Nix checks a cached NAR against cache.nixos.org&amp;rsquo;s signature and its &lt;code&gt;NarHash&lt;/code&gt;, so the other VMs fetch such a NAR again rather than trust it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Nix cache&amp;rsquo;s lock and its names:&lt;/strong&gt; changed in review, and listed. A child that held &lt;code&gt;.lock&lt;/code&gt; forever would have hung every other VM&amp;rsquo;s &lt;code&gt;/nix/&lt;/code&gt; requests and devvm gc&amp;rsquo;s trim, so each takes the lock with a deadline of a few seconds, trying it without blocking, and past it answers &lt;code&gt;404&lt;/code&gt; or skips the trim and says so. A child can still slow the cache down by holding the lock, and list the store paths that other VMs fetched.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The logs&amp;rsquo; locks:&lt;/strong&gt; changed in review, and listed. The broker and its child share &lt;code&gt;proxy.log&lt;/code&gt;&amp;rsquo;s lock, and the child and &lt;code&gt;devvm _links&lt;/code&gt; the event log&amp;rsquo;s, so a child that held one for ever would have stopped the broker at its next line, and the broker logged before it closed the socket when the hostagent ended, so the pair would have outlived the VM. Now the broker closes the socket and starts its kill&amp;rsquo;s timer before it logs anything, and every writer tries each log&amp;rsquo;s lock without blocking for at most 200 ms, then writes its line without the lock or skips the rotation. A child can still make each of the broker&amp;rsquo;s lines wait that long, and make a rotation lose the lines written as it copies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A log made huge:&lt;/strong&gt; changed in review, and listed. A rotation of &lt;code&gt;proxy.log&lt;/code&gt; read the whole file into memory, so a child that made it huge, or sparse at a terabyte, could have made the broker run out of memory and write as much. Now a rotation copies at most the last twice its limit, 20 MiB, from a line&amp;rsquo;s start, streamed into its copy. A child can still fill the disk, as the disk&amp;rsquo;s row says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What &lt;code&gt;stat&lt;/code&gt; shows:&lt;/strong&gt; listed. Landlock doesn&amp;rsquo;t restrict &lt;code&gt;stat&lt;/code&gt;, so a child that a VM takes over on Linux learns whether any file of yours exists, its size and when it changed, though not what it holds. Changed: it read every file below &lt;code&gt;/etc&lt;/code&gt; that you can, which its resolver needed, and now that the broker looks up its names, it reads none. On macOS the profile refuses &lt;code&gt;stat&lt;/code&gt; outside the child&amp;rsquo;s files, but a refused path answers &lt;code&gt;EPERM&lt;/code&gt; and a missing one &lt;code&gt;ENOENT&lt;/code&gt;, so a child there learns whether a path exists, though nothing else of it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The services the profile allows on macOS:&lt;/strong&gt; listed, and changed. A child that a VM takes over can ask &lt;code&gt;trustd&lt;/code&gt; to check certificates, which reads your trust settings, and that holds no secret of yours and isn&amp;rsquo;t the Keychain. &lt;code&gt;trustd&lt;/code&gt; can fetch a missing issuer&amp;rsquo;s certificate or an OCSP answer from the URL in a certificate, from its own unconfined process, which a review raised as a way to send a request to loopback or the LAN. Checked: a leaf whose issuer was missing and whose issuer, OCSP and CRL URLs named a server on this machine&amp;rsquo;s loopback or its LAN address made &lt;code&gt;trustd&lt;/code&gt; fetch nothing, through Go&amp;rsquo;s verifier under the profile and without it, and through &lt;code&gt;security verify-cert&lt;/code&gt;, which allows network fetches, with revocation required or not, on macOS 27. Listed: when it fetches is Apple&amp;rsquo;s to change, and the worst it could do is a request, whose answer the child never sees, to loopback or the LAN. The profile allowed mDNSResponder&amp;rsquo;s socket for the resolver, so a child could browse the local network&amp;rsquo;s Bonjour services, announce services of its own there, and register any &lt;code&gt;.local&lt;/code&gt; record it liked (&lt;code&gt;DNSServiceRegisterRecord&lt;/code&gt;), and now that the broker looks up its names, the profile allows no unix socket. &lt;code&gt;com.apple.trustd.agent&lt;/code&gt; also takes changes to your trust settings, which macOS asks your password for through its authorization services (&lt;code&gt;com.apple.authd&lt;/code&gt;), and the profile allows neither those nor &lt;code&gt;com.apple.SecurityServer&lt;/code&gt;, so a child can&amp;rsquo;t trust a CA of its own. devvm&amp;rsquo;s tests didn&amp;rsquo;t try such a change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A confined start made unconfined:&lt;/strong&gt; ruled out, and changed in review. The broker starts the child again unconfined only for a failure of &lt;code&gt;sandbox-exec&lt;/code&gt; itself, an exit status of its own or &lt;code&gt;SIGABRT&lt;/code&gt; or &lt;code&gt;SIGKILL&lt;/code&gt; before the child answered, which comes before devvm&amp;rsquo;s code runs and reads nothing of a VM&amp;rsquo;s, so a child that a VM took over, or what it left in its folders, can&amp;rsquo;t make the next start unconfined. The broker counted any signal, after its own stop of a child that hadn&amp;rsquo;t answered in time, so a child that hung, which its stop then ended with &lt;code&gt;SIGTERM&lt;/code&gt;, counted as the sandbox&amp;rsquo;s failure. It now decides before its stop, only for a child that had already ended, and only for those two signals. Listed: a program of yours that kills the child in that moment makes the start unconfined, which the proxy&amp;rsquo;s log and devvm doctor say. A child that fails after that, such as on a planted file, or that hangs, fails the start, which leaves the VM without a network until its next start, as before.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A child that claims more:&lt;/strong&gt; changed in review. The broker took any confinement the child&amp;rsquo;s ready named, so a child could say &lt;code&gt;full seatbelt&lt;/code&gt; when the broker had started it unconfined. The broker now refuses a ready that names a sandbox it didn&amp;rsquo;t start the child under, or another than the one it did (&lt;code&gt;Confinement.fits&lt;/code&gt;), which ends the pair.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other processes:&lt;/strong&gt; ruled out where the child is confined. Landlock scopes signals to the child (ABI 6) and lets it trace only processes in its own domain, and the profile allows signals only to itself. Listed: on a Linux kernel before ABI 6, or at ABI 6 or 7 without erratum 2, a child that a VM takes over can signal any process of yours, which devvm doctor warns of. Changed in review: Landlock&amp;rsquo;s scope of signals doesn&amp;rsquo;t cover a process&amp;rsquo;s limits or scheduling, and a review killed another process from a fully confined child on ABI 8 by setting its &lt;code&gt;RLIMIT_CPU&lt;/code&gt; to 1 with &lt;code&gt;prlimit64&lt;/code&gt;, so the seccomp filter refuses &lt;code&gt;prlimit64&lt;/code&gt; on any pid but the child&amp;rsquo;s own (0), and &lt;code&gt;setpriority&lt;/code&gt;, &lt;code&gt;ioprio_set&lt;/code&gt;, &lt;code&gt;sched_setaffinity&lt;/code&gt;, &lt;code&gt;sched_setscheduler&lt;/code&gt;, &lt;code&gt;sched_setparam&lt;/code&gt; and &lt;code&gt;sched_setattr&lt;/code&gt; outright. The seccomp filter refuses &lt;code&gt;ptrace&lt;/code&gt;, &lt;code&gt;process_vm_readv&lt;/code&gt;, &lt;code&gt;process_vm_writev&lt;/code&gt; and &lt;code&gt;pidfd_getfd&lt;/code&gt; on every kernel, but on a kernel without Landlock the child can still open &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/mem&lt;/code&gt; and &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/fd/&lt;/code&gt; of another process of yours, unless the kernel&amp;rsquo;s Yama restricts tracing (&lt;code&gt;ptrace_scope&lt;/code&gt; 1 or more, Ubuntu&amp;rsquo;s default), and so read its memory and its files. Changed in review: the broker sets itself undumpable (&lt;code&gt;PR_SET_DUMPABLE&lt;/code&gt; 0), so its own memory and descriptors, which hold the VM&amp;rsquo;s secrets, are root&amp;rsquo;s alone there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A port of another VM&amp;rsquo;s:&lt;/strong&gt; changed in review, and ruled out where the seccomp filter or Seatbelt holds. Before ABI 4, Landlock can&amp;rsquo;t refuse the child a port, so a child could bind another VM&amp;rsquo;s proxy port while that proxy starts again, and take that VM&amp;rsquo;s password from its requests. The seccomp filter refuses &lt;code&gt;listen&lt;/code&gt;, and now every new socket but a netlink route socket, so the child has no socket to bind, as the ones it holds are bound already, and the profile refuses a bind on macOS. Listed: without either, the child can still bind such a port, so that VM&amp;rsquo;s proxy fails to start until it&amp;rsquo;s free again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No confinement, or part of it:&lt;/strong&gt; listed. Where Landlock or Seatbelt isn&amp;rsquo;t there, the child runs with the broker&amp;rsquo;s access, and the split then only keeps the lookups, the captures, the relay and the logs&amp;rsquo; keeping out of the code that reads the VM&amp;rsquo;s network. Without the seccomp filter, or on macOS without Seatbelt, a child that a VM took over can also connect anywhere itself, loopback included. A kernel below ABI 4 or 6 confines the child in part, which &lt;code&gt;ready&lt;/code&gt;, &lt;code&gt;run/proxy.confined&lt;/code&gt; and devvm doctor say. Changed in review: ABI 6, 7 and 8 with the seccomp filter and scoped signals count as full, as the filter refuses every unix socket that ABI 9 would refuse by path, and every connection and datagram of the child&amp;rsquo;s own, which ABI 10 would refuse only for UDP, so doctor warns of nothing that a user could close. On macOS, &lt;code&gt;sandbox-exec&lt;/code&gt; is deprecated, and if macOS drops it, or it fails to start the child, the child runs unconfined, and the proxy&amp;rsquo;s log and devvm doctor say so, so the VM keeps its network.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The floor without the host&amp;rsquo;s addresses:&lt;/strong&gt; changed in review. A confinement that refused the read of the host&amp;rsquo;s addresses would have left the floor with none, and so let the VM reach this machine&amp;rsquo;s own public addresses. The child&amp;rsquo;s check after it confines itself needs a read that isn&amp;rsquo;t empty, and a later read that fails keeps the last good one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Descriptors and the environment:&lt;/strong&gt; ruled out. The child inherits only its four descriptors, the socketpair is close-on-exec so no other program holds an end, the child closes any descriptor that a frame brings that it didn&amp;rsquo;t ask for, and it gets only &lt;code&gt;TZ&lt;/code&gt;, &lt;code&gt;SSL_CERT_FILE&lt;/code&gt;, &lt;code&gt;SSL_CERT_DIR&lt;/code&gt; and &lt;code&gt;GODEBUG&lt;/code&gt; from the environment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The pid and status files:&lt;/strong&gt; ruled out. The child can&amp;rsquo;t write the run folder, the status file&amp;rsquo;s name isn&amp;rsquo;t in its environment, and the status names the broker&amp;rsquo;s pid, which &lt;code&gt;daemon.Proc&lt;/code&gt; checks, so a child that a VM takes over can&amp;rsquo;t make devvm signal another process. The broker writes the child&amp;rsquo;s pid file, and devvm checks the child&amp;rsquo;s arguments before it signals it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A child that outlives its broker, or starts again:&lt;/strong&gt; ruled out, changed in review. The child ends when it reads the socket&amp;rsquo;s end, which a killed broker leaves because no other process holds it, and the broker ends with its child, and neither starts the other. A stop gave the broker 2 seconds and the child&amp;rsquo;s close took up to 6, so a child could have kept the port and its old config as the next start began. Now &lt;code&gt;SIGTERM&lt;/code&gt; ends the child within a second, and devvm finds a child that outlived its broker by its pid file and stops it. Listed: a child that a VM has taken over can ignore the socket&amp;rsquo;s end and change its own arguments, which &lt;code&gt;daemon.Proc&lt;/code&gt; then doesn&amp;rsquo;t match, so devvm leaves it alone. On Linux &lt;code&gt;PR_SET_PDEATHSIG&lt;/code&gt; kills it with its broker, but on macOS such a child outlives a broker that was killed, confined, with its VM&amp;rsquo;s values and port, and the VM&amp;rsquo;s next start reports its proxy&amp;rsquo;s port as taken.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A binary that changed under the broker:&lt;/strong&gt; changed in review. The protocol&amp;rsquo;s version alone can&amp;rsquo;t tell two builds apart, so the start and the answer carry each side&amp;rsquo;s executable&amp;rsquo;s SHA-256, and a child from another build fails the start, and the VM&amp;rsquo;s next launch starts the pair again. On Linux the child is the broker&amp;rsquo;s own file anyway.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file that changes between its stamp and its read:&lt;/strong&gt; ruled out. The child keeps the stamp of the file that the broker read, so a write after that read changes the stamp, and the child asks again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory and CPU:&lt;/strong&gt; listed. A child that a VM takes over can use memory and CPU without a bound, as the proxy can.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; that the implementation adds, in &lt;code&gt;network&lt;/code&gt;, &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;nix&lt;/code&gt;, &lt;code&gt;images&lt;/code&gt;, &lt;code&gt;tools&lt;/code&gt; and &lt;code&gt;from&lt;/code&gt;: a VM&amp;rsquo;s proxy runs as a broker and a child, with the child&amp;rsquo;s arguments and descriptors above and no environment but the four variables. A bound secret goes in, a login is captured from the fake token endpoint, a link connects and the Nix cache fills, each through the child. &lt;code&gt;devvm stop&lt;/code&gt; leaves neither process, and the next launch starts on the same port at once. A symbolic link, a FIFO and a hard link planted in the VM&amp;rsquo;s logs folder and the Nix cache lead no command of devvm&amp;rsquo;s, the next start or a rotation to their targets, and hang none. A broker killed with &lt;code&gt;SIGKILL&lt;/code&gt; takes its child with it within a second, a child killed takes its broker and the agent&amp;rsquo;s socket with it, and nothing starts again until the next launch. A build behind a company proxy goes through a broker and a child, and both are gone after the build. The two follow-ups add the checks that the confined child can&amp;rsquo;t read a file in the home folder, reach the Keychain or connect to a unix socket, on each platform. On Linux, &lt;code&gt;network&lt;/code&gt; checks that the VM&amp;rsquo;s proxy says Landlock in &lt;code&gt;run/proxy.confined&lt;/code&gt;, and that the child&amp;rsquo;s &lt;code&gt;/proc&lt;/code&gt; entry shows &lt;code&gt;no_new_privs&lt;/code&gt; and a seccomp filter, and &lt;code&gt;TestSelf&lt;/code&gt;, in &lt;code&gt;internal/landlock&lt;/code&gt;, runs its test binary again as a child that confines itself, which writes, renames and lists in its folder, reads the host&amp;rsquo;s addresses and writes to a TCP connection it held before, and is refused a file outside its folder, &lt;code&gt;/etc/hosts&lt;/code&gt;, listing &lt;code&gt;/&lt;/code&gt;, its own executable, a folder, a link and a FIFO in its folder, a unix socket that stands in for an ssh master&amp;rsquo;s, a socketpair, a listen, an IPv4 and an IPv6 socket, a netlink socket of another family than routes, connecting a TCP socket it held before to a loopback server, &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; from its listener once a &lt;code&gt;shutdown&lt;/code&gt; has closed it, from ABI 4 a bind and from ABI 6 a signal to its parent. By hand, devvm&amp;rsquo;s release build ran a broker whose child was confined on Ubuntu 26.04 (AppArmor, ABI 8), Fedora 43 (SELinux, ABI 11), Debian 13 (ABI 6) and Ubuntu 26.04 on arm64, served a request, refused a blocked host and reached the Nix cache&amp;rsquo;s endpoint. On macOS, &lt;code&gt;network&lt;/code&gt; checks that the VM&amp;rsquo;s proxy says &lt;code&gt;full seatbelt&lt;/code&gt; in &lt;code&gt;run/proxy.confined&lt;/code&gt;, which means the child started under &lt;code&gt;sandbox-exec&lt;/code&gt; and its own check held, and &lt;code&gt;TestChildProfileConfines&lt;/code&gt;, in &lt;code&gt;internal/seatbelt&lt;/code&gt;, runs its test binary again under the child&amp;rsquo;s profile, which writes a regular file in its folder, renames it, changes its mode, removes it, looks at its policy file, and writes to a TCP connection it was handed and to one it accepted on a listener it was handed, and is refused a link, a folder, a FIFO and a hard link there, changing a file&amp;rsquo;s flags, removing a folder, reading its policy file, reading or looking at a file outside, opening the broker&amp;rsquo;s config, connecting to a unix socket, connecting over TCP to a loopback server on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; or to any other address, sending UDP, running a program, listening on a port, signalling its parent and listing the processes. The broker&amp;rsquo;s judgment is unit tests: a &lt;code&gt;dial&lt;/code&gt; to a loopback port that no rule names is refused, &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; alike, and so is one to this machine&amp;rsquo;s own address, while one that a rule names connects, from the &lt;code&gt;dial&lt;/code&gt; after the rule is written, and not after it&amp;rsquo;s gone, and the open tier&amp;rsquo;s broker connects to any. &lt;code&gt;FuzzBrokerFrames&lt;/code&gt; sends the broker any &lt;code&gt;lookup&lt;/code&gt; and &lt;code&gt;dial&lt;/code&gt;, and checks that it looks up only a host name and connects only where its own floor allows, and the in-process tests run the whole proxy with every lookup and connection through the broker. By hand, devvm&amp;rsquo;s release build ran a broker whose child was confined, and a helper under the child&amp;rsquo;s profile was refused &lt;code&gt;~/.zshrc&lt;/code&gt;, &lt;code&gt;~/.ssh&lt;/code&gt;, &lt;code&gt;~/Library/Keychains&lt;/code&gt; and the login keychain&amp;rsquo;s file, &lt;code&gt;~/.local/share/devvm&lt;/code&gt; and &lt;code&gt;~/.config/devvm&lt;/code&gt;, running &lt;code&gt;security&lt;/code&gt;, and an ssh master&amp;rsquo;s control socket, and reached example.com. The fallback and its limits are unit tests (&lt;code&gt;TestStartChildSandbox&lt;/code&gt;), as a broken &lt;code&gt;sandbox-exec&lt;/code&gt; can&amp;rsquo;t be made on a real Mac.&lt;/p&gt;
&lt;h2 data-hextra-search-id="failed-attempts"&gt;Failed attempts&lt;span class="hx:absolute hx:-mt-20" id="failed-attempts"&gt;&lt;/span&gt;
&lt;a href="#failed-attempts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Claude&amp;rsquo;s host login in VMs:&lt;/strong&gt; on macOS it&amp;rsquo;s in the Keychain, which can&amp;rsquo;t be shared. VMs get a login made in a VM instead, which the VM&amp;rsquo;s proxy captures. The first token saved by hand was the code the browser shows, so &lt;code&gt;devvm secret set claude&lt;/code&gt; refuses one without the &lt;code&gt;sk-ant-oat01-&lt;/code&gt; prefix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;krunkit (Lima on libkrun) to return freed memory:&lt;/strong&gt; it didn&amp;rsquo;t visibly return any.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Debian&amp;rsquo;s cloud kernel for &lt;code&gt;--from&lt;/code&gt;:&lt;/strong&gt; on arm64 it has no &lt;code&gt;gpio_keys&lt;/code&gt;, so it ignored Lima&amp;rsquo;s stop request; Lima hard-killed the VM after 30 s, and node, bun and dockerd in the image came out corrupted. On x86_64 it has no 9p, so on a Linux host every mount of the VM&amp;rsquo;s was an empty folder: Lima mounts them with &lt;code&gt;nofail&lt;/code&gt;, and the shared tools&amp;rsquo; build failed at its first &lt;code&gt;cd&lt;/code&gt;. &lt;code&gt;--from&lt;/code&gt; uses the generic kernel on both. With it, a Debian VM on QEMU first booted with its network card named &lt;code&gt;enp0s4&lt;/code&gt;, which cloud-init couldn&amp;rsquo;t rename to Lima&amp;rsquo;s &lt;code&gt;eth0&lt;/code&gt; once the card was up, so the VM got no ssh host keys. Debian&amp;rsquo;s kernel command line has &lt;code&gt;net.ifnames=0&lt;/code&gt;, which keeps the name &lt;code&gt;eth0&lt;/code&gt; from the start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every layer as a Docker build stage, flattened:&lt;/strong&gt; it worked, but each image became its own full disk (3.7 GB for &lt;code&gt;node&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared read-only layers:&lt;/strong&gt; each Docker layer as an EROFS file, stacked as &lt;code&gt;/&lt;/code&gt; with overlayfs over each VM&amp;rsquo;s own disk by an initramfs of devvm&amp;rsquo;s own. It worked (&lt;code&gt;node&lt;/code&gt; took 1.0 GB of layers instead of a 1.8 GB disk), but devvm owned the boot path (the initramfs, an exit initramfs for clean shutdowns, kernel extraction), and cold program starts were 10–50 ms slower. Shared tools, and overlays on Linux, give the same savings without it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A read-only mount for &lt;code&gt;.git/hooks&lt;/code&gt; in the VM:&lt;/strong&gt; root in the VM can unmount it and write hooks through the project mount underneath. Locking &lt;code&gt;.git&lt;/code&gt; itself (&lt;code&gt;uappnd&lt;/code&gt;) breaks git, and a locked placeholder &lt;code&gt;.git/commondir&lt;/code&gt; makes git fail. Hence &lt;code&gt;chflags uchg&lt;/code&gt; on hooks and config on macOS, plus detection, and on Linux read-only binds in QEMU&amp;rsquo;s own namespace, which the VM can&amp;rsquo;t reach (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;details&lt;/a&gt;, &lt;a href="#read-only-paths-on-linux"&gt;read-only paths on Linux&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keeping git on this machine out of submodules the VM adds (strict):&lt;/strong&gt; &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; in the locked &lt;code&gt;.git/config&lt;/code&gt;, which &lt;code&gt;devvm git-protect strict&lt;/code&gt; sets in devvm 0.1.0 and 0.1.1-rc.1, can&amp;rsquo;t hold. The VM writes &lt;code&gt;.gitmodules&lt;/code&gt;, whose &lt;code&gt;ignore&lt;/code&gt; line beats it, and git reads the index&amp;rsquo;s or &lt;code&gt;HEAD&lt;/code&gt;&amp;rsquo;s copy when the working tree has none. &lt;code&gt;git add -A&lt;/code&gt;, &lt;code&gt;-u&lt;/code&gt; and &lt;code&gt;.&lt;/code&gt; enter a submodule whatever the settings say, &lt;code&gt;git diff-index&lt;/code&gt;, &lt;code&gt;git diff-files&lt;/code&gt; and &lt;code&gt;git describe --dirty&lt;/code&gt; enter one that &lt;code&gt;.gitmodules&lt;/code&gt; doesn&amp;rsquo;t name, &lt;code&gt;git fetch&lt;/code&gt; and &lt;code&gt;git pull&lt;/code&gt; recurse into one that fetched commits move, and &lt;code&gt;--ignore-submodules&lt;/code&gt; on the command line beats config. A per-name &lt;code&gt;submodule.&amp;lt;name&amp;gt;.ignore&lt;/code&gt; holds only for the name the VM picks, and locking &lt;code&gt;.gitmodules&lt;/code&gt; would put a file in the working tree and leave checkouts across it stale on macOS. The submodule&amp;rsquo;s own config runs either way, because the git that the host&amp;rsquo;s git starts in it reads that config, and no setting refuses it. Only &lt;code&gt;--clone&lt;/code&gt; keeps the VM&amp;rsquo;s code away from git on this machine, so &lt;code&gt;devvm git-protect strict&lt;/code&gt; is a usage error that names &lt;code&gt;devvm clone on&lt;/code&gt;, and a VM left strict is &lt;code&gt;on&lt;/code&gt; from its next check that finds it stopped (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#vms-that-were-strict"&gt;VMs that were strict&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A root helper for Linux&amp;rsquo;s immutable attribute:&lt;/strong&gt; a helper with &lt;code&gt;CAP_LINUX_IMMUTABLE&lt;/code&gt;, installed with sudo, could lock &lt;code&gt;.git&lt;/code&gt; as macOS&amp;rsquo;s flag does, but it would put a privileged program on every host that the VM&amp;rsquo;s repo could aim at. QEMU&amp;rsquo;s own namespace needs no privilege.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kernel extraction trying gzip first:&lt;/strong&gt; Ubuntu&amp;rsquo;s arm64 kernel is an EFI executable with a zstd payload.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;mke2fs -d&lt;/code&gt; from a tarball:&lt;/strong&gt; it needed libarchive and a UTF-8 locale. A directory works.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="things-learned"&gt;Things learned&lt;span class="hx:absolute hx:-mt-20" id="things-learned"&gt;&lt;/span&gt;
&lt;a href="#things-learned" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima &lt;code&gt;vz&lt;/code&gt; never returns freed guest memory to the Mac.&lt;/strong&gt; sbx returns it with a VM monitor of its own; libkrun has &lt;code&gt;MADV_FREE&lt;/code&gt;, with a stronger fix still an open PR.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;APFS clones&lt;/strong&gt; cost nothing until written, and &lt;code&gt;du&lt;/code&gt; overcounts them: real use was 5.5 GB where &lt;code&gt;du&lt;/code&gt; said 12.7 GB.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lima locks each additional disk to one running VM,&lt;/strong&gt; so images shared across VMs go through a shared folder (virtiofs on macOS, 9p on Linux) and are loop-mounted from it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read-only mounts are enforced by the host:&lt;/strong&gt; even root in the VM can&amp;rsquo;t write to them, but root can unmount a nested one and reach what&amp;rsquo;s underneath.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Codex and opencode refreshing their OAuth logins in a VM can rotate the token and sign the host out.&lt;/strong&gt; On every tier the VM holds only placeholders, and devvm refreshes the logins on the host when the proxy asks it for their values (&lt;code&gt;internal/agentlogin&lt;/code&gt;). Codex decodes &lt;code&gt;id_token&lt;/code&gt;&amp;rsquo;s claims and the access token&amp;rsquo;s &lt;code&gt;exp&lt;/code&gt; without checking signatures, so placeholders are unsigned JWTs with the real account claims and a far-off &lt;code&gt;exp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On macOS, a socket in transit over &lt;code&gt;SCM_RIGHTS&lt;/code&gt; can lose the data it held&lt;/strong&gt; and read as ended when the same process closes, at that moment, a unix socket that still holds descriptors no one received. It fails closed, as an ended connection. The broker and its child close such a socket only as the pair ends, and the test that reads a handed-over link&amp;rsquo;s data asks for the link once more when it reads empty.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A process passes the files it was given on to the processes it starts,&lt;/strong&gt; unless they&amp;rsquo;re marked close-on-exec. Go marks only the files it opens itself, so a terminal, an editor or a test harness that gives devvm another one (a pty on descriptor 3, the end of a pipe) would have it held by devvm&amp;rsquo;s proxy, its port forwarder and Lima&amp;rsquo;s processes, which keep that terminal or pipe open for as long as they run. So devvm marks every file it was given past standard input, output and error close-on-exec as it starts, and keeps them open itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No existing tool&lt;/strong&gt; gives Lima Dockerfile-style layers with sharing at run time; nerdbox and Kata do it on VM runtimes of their own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where devvm fits,&lt;/strong&gt; next to sbx and Colima: sbx puts agents first; devvm gives a full Linux VM per project, with agents optional.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="open-work-and-risks"&gt;Open work and risks&lt;span class="hx:absolute hx:-mt-20" id="open-work-and-risks"&gt;&lt;/span&gt;
&lt;a href="#open-work-and-risks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;User-facing limits are in &lt;a href="https://next.devvm.dev/docs/using/limits/"&gt;Known limits&lt;/a&gt;, and what devvm leaves open is in &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/"&gt;Attack vectors&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt;:&lt;/strong&gt; a moved tag is noticed only at the next build, not when listing images; devvm doesn&amp;rsquo;t log in to registries, so private images work only through Docker; registries over plain HTTP (&lt;code&gt;localhost:5000&lt;/code&gt;) aren&amp;rsquo;t supported.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alpine:&lt;/strong&gt; &lt;code&gt;rc-status&lt;/code&gt; as a normal user shows &lt;code&gt;acpid&lt;/code&gt; and &lt;code&gt;syslog&lt;/code&gt; as crashed, as their pid files are root&amp;rsquo;s (&lt;code&gt;sudo rc-status&lt;/code&gt; is clean).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free-space floors:&lt;/strong&gt; the free space devvm wants before each build and new VM (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#free-space"&gt;free space&lt;/a&gt;) is set by Lima&amp;rsquo;s own package, and for shared tool images in &lt;code&gt;internal/backend/disk.go&lt;/code&gt;, where the comments give what each number was measured from. The measurements are free space, read with statfs before, during and after each step, in e2e runs on macOS with Lima &lt;code&gt;vz&lt;/code&gt;, and for shared tool images also with devvm&amp;rsquo;s data folder on a tmpfs of its own on Linux. On Linux hosts, Lima&amp;rsquo;s numbers add a copy of base&amp;rsquo;s disk to an image&amp;rsquo;s and a tools build&amp;rsquo;s, but they haven&amp;rsquo;t been measured there yet. A &lt;code&gt;--from&lt;/code&gt; base converts its image in the host&amp;rsquo;s temporary folder, which devvm doesn&amp;rsquo;t check, because on Linux that&amp;rsquo;s often a small tmpfs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workspace clones:&lt;/strong&gt; each repo&amp;rsquo;s seed is copied one after another, so a folder of many big repos takes a copy per repo; copies in parallel, bounded, aren&amp;rsquo;t built. A repo made in the VM stays there until the user clones it out by hand, and nothing of the folder&amp;rsquo;s own files comes back (&lt;a href="#workspace-clones"&gt;workspace clones&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;x86_64 hosts&lt;/strong&gt; are untested on real hardware; on Intel Macs, &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s kernel is untested with &lt;code&gt;vz&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux hosts:&lt;/strong&gt; the QEMU wrapper depends on the shape of Lima&amp;rsquo;s &lt;code&gt;-netdev user,id=net0,…&lt;/code&gt; argument. If Lima changes it, the wrapper refuses to start QEMU rather than run it unrestricted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network tiers, not built:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;approving blocked hosts as they&amp;rsquo;re hit.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Claude Code&amp;rsquo;s login is captured on a path Anthropic doesn&amp;rsquo;t document.&lt;/strong&gt; devvm reads Claude Code&amp;rsquo;s token endpoint, its client ID, its requests and replies and the &lt;code&gt;.credentials.json&lt;/code&gt; format from Claude Code 2.1&amp;rsquo;s bundle, and refreshes the login on the host as Claude Code would (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;). A release that changes any of them can break the login in VMs, or the host&amp;rsquo;s refresh, without warning. The &lt;code&gt;network&lt;/code&gt; end-to-end section drives the real Claude Code&amp;rsquo;s &lt;code&gt;claude auth login&lt;/code&gt; against a fake endpoint, so a change to its requests fails that section, and a Claude Code token from &lt;code&gt;claude setup-token&lt;/code&gt;, which Anthropic documents, stays the fallback.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network tiers, risks of the mechanism:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sandbox-exec&lt;/code&gt; is deprecated. If Apple removes it, macOS needs another way to confine the hostagent: an egress filter upstream (gvisor-tap-vsock#609 and #631; Lima&amp;rsquo;s &lt;code&gt;hostLoopback: false&lt;/code&gt;, lima#5581), a user-v2 daemon of devvm&amp;rsquo;s own (lima#5464), or QEMU with the Linux mechanism on macOS too (it works there, slower than &lt;code&gt;vz&lt;/code&gt;). The self-check catches it breaking silently.&lt;/li&gt;
&lt;li&gt;VMs started outside devvm (&lt;code&gt;limactl start&lt;/code&gt;, &lt;code&gt;limactl shell&lt;/code&gt; starting a stopped VM, Lima&amp;rsquo;s start at login) aren&amp;rsquo;t confined: devvm reports them &lt;code&gt;unenforced&lt;/code&gt;. An &lt;code&gt;override.yaml&lt;/code&gt; setting a dead &lt;code&gt;HTTPS_PROXY&lt;/code&gt; might harden this (untested).&lt;/li&gt;
&lt;li&gt;A Lima upgrade that adds a hostagent connection fails closed: the start hangs until Lima gives up (10 minutes in the experiment). devvm should time-box the start and say it&amp;rsquo;s the sandbox. That includes unix sockets: the profile allows only those in the VM&amp;rsquo;s Lima folder and the forwarded agent&amp;rsquo;s. Allowing every unix socket would let a compromised hostagent reach &lt;code&gt;docker.sock&lt;/code&gt; or another ssh agent.&lt;/li&gt;
&lt;li&gt;Tunnels the proxy doesn&amp;rsquo;t read are decided by the &lt;code&gt;CONNECT&lt;/code&gt; host and checked against the TLS server name, so domain fronting through a shared CDN may still reach other hosts (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;attack vectors&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Settings and files</title><link>https://next.devvm.dev/docs/using/settings/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/settings/</guid><description>
&lt;p&gt;devvm writes nothing into your project folders. It keeps the settings you edit in &lt;code&gt;~/.config/devvm&lt;/code&gt; and everything it writes itself in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, and it reads a few environment variables. &lt;a href="#your-settings"&gt;Your settings&lt;/a&gt; lists the files you edit, &lt;a href="https://next.devvm.dev/docs/using/space/#devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;/a&gt; lists the ones devvm writes, and &lt;a href="https://next.devvm.dev/docs/internals/overview/#state-files"&gt;Overview&lt;/a&gt; explains how devvm keeps them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="your-settings"&gt;Your settings&lt;span class="hx:absolute hx:-mt-20" id="your-settings"&gt;&lt;/span&gt;
&lt;a href="#your-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;~/.config/devvm&lt;/code&gt; (&lt;code&gt;$XDG_CONFIG_HOME/devvm&lt;/code&gt;) holds what you edit, and it&amp;rsquo;s the only folder of devvm&amp;rsquo;s that you should change by hand. devvm never rewrites a file of yours there. It reads &lt;code&gt;config.toml&lt;/code&gt; and your own layers and CAs, it creates a new layer&amp;rsquo;s files when you run &lt;code&gt;devvm layer new&lt;/code&gt;, it changes single lines of &lt;code&gt;policy&lt;/code&gt; when you add or remove a rule for every VM, and it writes &lt;code&gt;version&lt;/code&gt; when the folder has none and when it changes its folders to a newer layout.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;th&gt;Written by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the defaults that new VMs get and the &lt;a href="#retention"&gt;retention settings&lt;/a&gt;, which win over what devvm&amp;rsquo;s commands save, the &lt;a href="https://next.devvm.dev/docs/safety/network/#behind-a-company-proxy"&gt;company proxy&lt;/a&gt; and an &lt;a href="#an-ubuntu-mirror"&gt;Ubuntu mirror&lt;/a&gt; (&lt;a href="#configtoml"&gt;config.toml&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your &lt;a href="https://next.devvm.dev/docs/safety/network/#changing-rules"&gt;network rules&lt;/a&gt; for every VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm network allow -g&lt;/code&gt;, &lt;code&gt;deny -g&lt;/code&gt;, &lt;code&gt;rm -g&lt;/code&gt;, or you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;layers/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your own &lt;a href="https://next.devvm.dev/docs/using/customizing/#your-own-layers"&gt;layers&lt;/a&gt; and their allowlists&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm layer new&lt;/code&gt;, then you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agents/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your agents&amp;rsquo; settings in &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;, one folder for each agent&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm agent import&lt;/code&gt;, &lt;code&gt;devvm agent save&lt;/code&gt;, or you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ca/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your &lt;a href="#a-companys-ca"&gt;company&amp;rsquo;s CA certificates&lt;/a&gt;, which VMs and builds trust&lt;/td&gt;
&lt;td&gt;you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-newer-devvm-changed-devvms-folders"&gt;layout version&lt;/a&gt;, which says how devvm keeps its files here&lt;/td&gt;
&lt;td&gt;devvm, when it&amp;rsquo;s missing or older&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Edit the files in &lt;code&gt;~/.config/devvm&lt;/code&gt;, and never edit the ones in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;. devvm writes those itself and rewrites them whole, so a change you make there can be lost, or can stop devvm from reading the file. To set a default by hand, put it in &lt;code&gt;config.toml&lt;/code&gt; instead.&lt;/p&gt;
&lt;p&gt;Upgrading devvm keeps this folder as it is. Back it up, such as in a dotfiles repo, to keep your settings and layers.&lt;/p&gt;
&lt;h2 data-hextra-search-id="configtoml"&gt;config.toml&lt;span class="hx:absolute hx:-mt-20" id="configtoml"&gt;&lt;/span&gt;
&lt;a href="#configtoml" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;~/.config/devvm/config.toml&lt;/code&gt; sets the defaults that new VMs get, the retention settings, the company proxy, an Ubuntu mirror, the release check, transparent mode, the API keys that VMs get as they are and the folders that &lt;code&gt;devvm agent import&lt;/code&gt; follows links into, in a file you write by hand. devvm reads it and never writes it. Every key is optional, and devvm has no &lt;code&gt;config.toml&lt;/code&gt; until you write one. This example sets every key:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The network tier new VMs get: open, internet, allowlist or none.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;network&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;allowlist&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The ports new VMs forward: all, none, or ports and ranges.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;ports&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;5173,8000-8010&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The features base gets, in the order they run, or [] for none.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;cli-tools&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;fzf&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;omb&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The coding agents new VMs get, or [] for none.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;agents&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;claude&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;codex&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The layers new VMs get, bottom first, or [] for none.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;layers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;docker&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# A mirror of Ubuntu&amp;#39;s archive that base&amp;#39;s first build tries first.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;ubuntu-mirror&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://mirror.example.com/ubuntu-ports&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Whether a launch checks once a day for a newer devvm release.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;release-check&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Whether confined VMs send tools that ignore the proxy settings to their proxy.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;transparent-proxy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The folder in every VM that devvm paste puts images and files in.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;paste-dir&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/tmp/devvm-paste&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The folders devvm agent import follows links into without asking.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;follow-links&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;~/dotfiles&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# New VMs&amp;#39; CPUs, and their memory and disk in GiB.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;cpus&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;memory&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;disk&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# What devvm deletes on its own, with the keys devvm retention takes.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;retention&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;logs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;runs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;90d&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;unused-age&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;30d&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;orphans&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;30d&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;nix-cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;20G&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The company proxy, when the shell you run devvm in sets none.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;https&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://[email protected]:8080&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;http&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://[email protected]:8080&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;no-proxy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;localhost,.example.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Providers whose API keys an agent&amp;#39;s VMs get as they are.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pass-keys&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;opencode&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ollama&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;pi&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ollama&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Each key takes what its command takes:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;What it takes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;network&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a tier, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;, as &lt;code&gt;devvm network -g&lt;/code&gt; sets it (&lt;a href="https://next.devvm.dev/docs/safety/network/#choosing-a-tier"&gt;choosing a tier&lt;/a&gt;), and never &lt;code&gt;learn&lt;/code&gt;, because each VM &lt;a href="https://next.devvm.dev/docs/safety/network/#learning-the-hosts-a-vm-needs"&gt;learns the hosts it needs&lt;/a&gt; on its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;all&lt;/code&gt;, &lt;code&gt;none&lt;/code&gt; or a list, as &lt;code&gt;devvm ports -g&lt;/code&gt; takes it (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size-and-ports"&gt;size and ports&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;features&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/customizing/#choosing-features"&gt;features&lt;/a&gt; that base gets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="#coding-agents-for-new-vms"&gt;coding agents&lt;/a&gt; that new VMs get&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;layers&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="#layers-for-new-vms"&gt;layers&lt;/a&gt; that new VMs get, bottom first&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cpus&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a whole number, as &lt;code&gt;devvm size -g&lt;/code&gt; takes it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;memory&lt;/code&gt;, &lt;code&gt;disk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a number of GiB, such as &lt;code&gt;8&lt;/code&gt;, &lt;code&gt;8.5&lt;/code&gt; or &lt;code&gt;&amp;quot;8G&amp;quot;&lt;/code&gt;, as &lt;code&gt;devvm size -g&lt;/code&gt; takes them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the &lt;code&gt;[retention]&lt;/code&gt; keys&lt;/td&gt;
&lt;td&gt;the &lt;a href="#retention"&gt;retention settings&lt;/a&gt;, with a duration such as &lt;code&gt;&amp;quot;90d&amp;quot;&lt;/code&gt; or a size such as &lt;code&gt;&amp;quot;20G&amp;quot;&lt;/code&gt; in quotes, and a count as a number&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;follow-links&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folders whose files &lt;code&gt;devvm agent import&lt;/code&gt; copies through a link out of an agent&amp;rsquo;s folder without asking, each an absolute path or one that starts with &lt;code&gt;~/&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#links-out-of-an-agents-folder"&gt;links out of an agent&amp;rsquo;s folder&lt;/a&gt;), which no command saves&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &lt;code&gt;[proxy]&lt;/code&gt; table is the &lt;a href="https://next.devvm.dev/docs/safety/network/#behind-a-company-proxy"&gt;company proxy&lt;/a&gt; that every VM&amp;rsquo;s proxy, builds and devvm&amp;rsquo;s own downloads go through when the shell you run devvm in sets neither &lt;code&gt;HTTPS_PROXY&lt;/code&gt; nor &lt;code&gt;HTTP_PROXY&lt;/code&gt;, whatever the VM&amp;rsquo;s tier. No VM gets the company proxy&amp;rsquo;s settings itself. That shell&amp;rsquo;s settings win over the whole table. &lt;code&gt;https&lt;/code&gt; and &lt;code&gt;http&lt;/code&gt; take what &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and &lt;code&gt;HTTP_PROXY&lt;/code&gt; take, an &lt;code&gt;http://&lt;/code&gt; URL or &lt;code&gt;host:port&lt;/code&gt;, and &lt;code&gt;no-proxy&lt;/code&gt; takes what &lt;code&gt;NO_PROXY&lt;/code&gt; takes. A URL never holds a password, and devvm refuses one that does, so put only the user in it and save the password with &lt;code&gt;devvm secret set proxy&lt;/code&gt;. No command saves the proxy, so it&amp;rsquo;s only ever in &lt;code&gt;config.toml&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;[pass-keys]&lt;/code&gt; table names, for an agent, the providers whose API keys its VMs get as they are, which devvm otherwise keeps on this machine because the VM&amp;rsquo;s proxy can&amp;rsquo;t put them in, such as a local model server&amp;rsquo;s. Every VM with the agent gets a change at its next launch, and no command saves the table, so it&amp;rsquo;s only ever in &lt;code&gt;config.toml&lt;/code&gt;. This is what it takes and refuses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It takes &lt;code&gt;opencode&lt;/code&gt; and &lt;code&gt;pi&lt;/code&gt;, each with a list of the agent&amp;rsquo;s provider IDs as its &lt;code&gt;auth.json&lt;/code&gt; names them, in lower case, such as &lt;code&gt;[&amp;quot;ollama&amp;quot;]&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#codex-and-opencode-logins"&gt;opencode logins&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#pi-logins"&gt;pi logins&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm refuses another agent, a name that isn&amp;rsquo;t a provider&amp;rsquo;s ID and a repeat (&lt;code&gt;config.toml&lt;/code&gt; names the line).&lt;/li&gt;
&lt;li&gt;A provider whose key the VM&amp;rsquo;s proxy puts in (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt;) never needs the table, because the proxy puts its key in without it. When the table lists one all the same, the VM gets that key&amp;rsquo;s placeholder from its next launch on, not the key, and devvm notes at each launch that you can take the provider out. A VM that got such a key as it was before then may still hold copies of it, which keep working, so make a new key when you don&amp;rsquo;t trust that VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="an-ubuntu-mirror"&gt;An Ubuntu mirror&lt;span class="hx:absolute hx:-mt-20" id="an-ubuntu-mirror"&gt;&lt;/span&gt;
&lt;a href="#an-ubuntu-mirror" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;ubuntu-mirror&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://mirror.example.com/ubuntu-ports&amp;#34;&lt;/span&gt; &lt;span class="c"&gt;# in ~/.config/devvm/config.toml&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;ubuntu-mirror&lt;/code&gt; is a mirror of Ubuntu&amp;rsquo;s archive, such as one your company or university runs, which the first build of base gets its packages from before it tries Ubuntu&amp;rsquo;s own. It must mirror the archive for this machine&amp;rsquo;s architecture: &lt;code&gt;archive.ubuntu.com/ubuntu&lt;/code&gt; on an Intel or AMD machine, or &lt;code&gt;ports.ubuntu.com/ubuntu-ports&lt;/code&gt; on an Apple silicon Mac or another arm64 machine. Give it as an &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt; address without a user, a query or spaces, and devvm refuses anything else (&lt;code&gt;config.toml&lt;/code&gt; names the line). A package that the mirror doesn&amp;rsquo;t have, or a mirror that doesn&amp;rsquo;t answer, falls back to Ubuntu&amp;rsquo;s archive for that file.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;What it can&amp;rsquo;t do:&lt;/strong&gt; a mirror can&amp;rsquo;t give base a package that Ubuntu didn&amp;rsquo;t publish, because apt and devvm both check every list and package against Ubuntu&amp;rsquo;s archive key. A mirror that&amp;rsquo;s behind can still serve old lists, and devvm refuses lists more than a day older than the Ubuntu cloud image base starts from, names the mirror and keeps none of the build&amp;rsquo;s packages (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#base-gets-old-package-lists"&gt;old package lists&lt;/a&gt;). A mirror that fell behind after that image&amp;rsquo;s date can still give base packages older than Ubuntu&amp;rsquo;s, so set only a mirror you trust to keep up (&lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What uses it:&lt;/strong&gt; only the first build of each base, because a later build of the same base installs the packages devvm kept from that first build (&lt;a href="https://next.devvm.dev/docs/using/images/#base"&gt;base&lt;/a&gt;). VMs don&amp;rsquo;t use it, and neither do layers or a &lt;code&gt;--from&lt;/code&gt; base.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where it&amp;rsquo;s set:&lt;/strong&gt; no command saves it, so it&amp;rsquo;s only ever in &lt;code&gt;config.toml&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="the-paste-folder"&gt;The paste folder&lt;span class="hx:absolute hx:-mt-20" id="the-paste-folder"&gt;&lt;/span&gt;
&lt;a href="#the-paste-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;paste-dir&lt;/code&gt; is the folder in every VM that &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#pasting-images"&gt;devvm paste&lt;/a&gt; puts images, PDFs and copied files in, &lt;code&gt;/tmp/devvm-paste&lt;/code&gt; unless you set it. Each launch makes the folder in the VM when it&amp;rsquo;s missing, mode 700 and the VM&amp;rsquo;s user&amp;rsquo;s own. It leaves a folder that&amp;rsquo;s there as it is, so a folder of your own, such as &lt;code&gt;/home/USER/pastes&lt;/code&gt; where &lt;code&gt;USER&lt;/code&gt; is your user in the VM, keeps its mode and its other files. A launch warns, and goes on, when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;what&amp;rsquo;s at the path is a symbolic link, isn&amp;rsquo;t a folder or isn&amp;rsquo;t the VM&amp;rsquo;s user&amp;rsquo;s, and devvm paste then refuses the folder;&lt;/li&gt;
&lt;li&gt;it can&amp;rsquo;t make the folder, as under a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It&amp;rsquo;s one fixed path for every VM so that you can allow it once in an agent&amp;rsquo;s settings. Give it as an absolute path without a trailing slash, made of letters, digits and &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt; and &lt;code&gt;-&lt;/code&gt;, and devvm refuses anything else (&lt;code&gt;config.toml&lt;/code&gt; names the line), because the path goes into a shell in the VM and onto your clipboard. A change applies to each VM at its next launch, which makes the new folder, and devvm paste uses the new folder at once. No command saves it, so it&amp;rsquo;s only ever in &lt;code&gt;config.toml&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-release-check"&gt;The release check&lt;span class="hx:absolute hx:-mt-20" id="the-release-check"&gt;&lt;/span&gt;
&lt;a href="#the-release-check" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When you run devvm in a terminal, it checks at most once a day for a newer devvm release, and when one is out it says so in one line before it opens the VM, naming the release, the version you have and devvm upgrade. devvm never installs anything on its own, so you upgrade with &lt;a href="https://next.devvm.dev/docs/using/upgrading/#upgrading"&gt;devvm upgrade&lt;/a&gt; when you choose to. &lt;code&gt;release-check = false&lt;/code&gt; turns the check off, and so does setting &lt;code&gt;DEVVM_NO_RELEASE_CHECK=1&lt;/code&gt; in the environment, as CI can. &lt;code&gt;release-check&lt;/code&gt; must be &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;, and devvm refuses anything else (&lt;code&gt;config.toml&lt;/code&gt; names the line). No command saves it, so it&amp;rsquo;s only ever in &lt;code&gt;config.toml&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The check never announces a prerelease, unless Homebrew&amp;rsquo;s &lt;code&gt;devvm-rc&lt;/code&gt; formula installed devvm, which follows prereleases and announces a newer prerelease or release, whichever is newest (&lt;a href="https://next.devvm.dev/docs/using/upgrading/#trying-a-prerelease"&gt;trying a prerelease&lt;/a&gt;). It never makes devvm wait, and &lt;code&gt;devvm doctor&lt;/code&gt; shows what it found last. devvm says nothing without a terminal, with &lt;code&gt;--no-input&lt;/code&gt;, for a devvm built from its source, or for a copy that neither the install script nor Homebrew installed, which devvm upgrade can&amp;rsquo;t upgrade. &lt;a href="https://next.devvm.dev/docs/internals/install/#the-release-check"&gt;The release check&lt;/a&gt; explains what the check reads and when its line shows a new release.&lt;/p&gt;
&lt;h3 data-hextra-search-id="transparent-mode"&gt;Transparent mode&lt;span class="hx:absolute hx:-mt-20" id="transparent-mode"&gt;&lt;/span&gt;
&lt;a href="#transparent-mode" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On every tier but open, devvm sends a tool that ignores the proxy settings to the VM&amp;rsquo;s proxy by the names it looks up, which is &lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt;. It&amp;rsquo;s on unless you turn it off. &lt;code&gt;transparent-proxy = false&lt;/code&gt; turns it off for every VM that has no setting of its own, and &lt;code&gt;devvm network transparent on&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt; gives one VM its own, which comes first. A change applies at each VM&amp;rsquo;s next launch. &lt;code&gt;transparent-proxy&lt;/code&gt; must be &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;, and devvm refuses anything else (&lt;code&gt;config.toml&lt;/code&gt; names the line). No command saves it, so it&amp;rsquo;s only ever in &lt;code&gt;config.toml&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="where-a-default-comes-from"&gt;Where a default comes from&lt;span class="hx:absolute hx:-mt-20" id="where-a-default-comes-from"&gt;&lt;/span&gt;
&lt;a href="#where-a-default-comes-from" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For each default, devvm uses the first of these that sets it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A flag for one VM, such as &lt;code&gt;--ports&lt;/code&gt; or &lt;code&gt;--cpus&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;config.toml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;What devvm&amp;rsquo;s commands saved: &lt;code&gt;devvm setup&lt;/code&gt;, &lt;code&gt;devvm size -g&lt;/code&gt;, &lt;code&gt;devvm ports -g&lt;/code&gt;, &lt;code&gt;devvm network -g&lt;/code&gt; and &lt;code&gt;devvm retention&lt;/code&gt; save in &lt;code&gt;~/.local/share/devvm/settings.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;devvm&amp;rsquo;s own default.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A command that would save a default that &lt;code&gt;config.toml&lt;/code&gt; sets refuses, names the file and the key, and changes nothing, because the value in &lt;code&gt;config.toml&lt;/code&gt; would still win. To change that default, edit it in &lt;code&gt;config.toml&lt;/code&gt;, or delete it there to let devvm&amp;rsquo;s commands set it again. In a terminal, &lt;code&gt;devvm setup&lt;/code&gt; doesn&amp;rsquo;t ask about what &lt;code&gt;config.toml&lt;/code&gt; sets, and it says so.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm size -g&lt;/code&gt;, &lt;code&gt;devvm ports -g&lt;/code&gt;, &lt;code&gt;devvm network -g&lt;/code&gt; and &lt;code&gt;devvm retention&lt;/code&gt; show where each value came from, after a &lt;code&gt;#&lt;/code&gt;. They show &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s path for a value from &lt;code&gt;config.toml&lt;/code&gt;, &lt;code&gt;devvm: settings.json&lt;/code&gt; for one that a command saved, and &lt;code&gt;devvm: default&lt;/code&gt; for devvm&amp;rsquo;s own:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ devvm ports -g
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;5173,8000-8010 &lt;span class="c1"&gt;# /Users/you/.config/devvm/config.toml&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ devvm network -g
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;allowlist &lt;span class="c1"&gt;# devvm: default&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With &lt;code&gt;--json&lt;/code&gt;, the same commands add &lt;code&gt;source&lt;/code&gt;, or &lt;code&gt;sources&lt;/code&gt; for each value of &lt;code&gt;devvm size -g&lt;/code&gt; and &lt;code&gt;devvm retention&lt;/code&gt;, which is &lt;code&gt;config.toml&lt;/code&gt;, &lt;code&gt;settings.json&lt;/code&gt; or &lt;code&gt;built-in&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="when-devvm-cant-read-it"&gt;When devvm can&amp;rsquo;t read it&lt;span class="hx:absolute hx:-mt-20" id="when-devvm-cant-read-it"&gt;&lt;/span&gt;
&lt;a href="#when-devvm-cant-read-it" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm reads all of &lt;code&gt;config.toml&lt;/code&gt; each time it needs a default, and it checks every key and value. A key it doesn&amp;rsquo;t know, such as a typo, a value that a key can&amp;rsquo;t take, and a file that isn&amp;rsquo;t TOML each stop the command, and devvm names the file and the line. Fix the line, and run the command again. &lt;code&gt;config.toml&lt;/code&gt; has no key for the backend, because every new VM runs on &lt;a href="https://next.devvm.dev/docs/backends/lima/"&gt;Lima&lt;/a&gt;, so a &lt;code&gt;backend&lt;/code&gt; key stops the command as an unknown key.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-setup"&gt;devvm setup&lt;span class="hx:absolute hx:-mt-20" id="devvm-setup"&gt;&lt;/span&gt;
&lt;a href="#devvm-setup" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm setup&lt;/code&gt; chooses what new VMs get. In a terminal, it asks five questions, each starting from the current choice, and saves each answer in &lt;code&gt;~/.local/share/devvm/settings.json&lt;/code&gt;, as the command for that setting saves it. It skips a question that &lt;a href="#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; answers, saying so, and it refuses a flag that would change what &lt;code&gt;config.toml&lt;/code&gt; sets.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;a href="https://next.devvm.dev/docs/using/customizing/#choosing-features"&gt;features&lt;/a&gt; that base gets.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://next.devvm.dev/docs/using/ports-size/#choosing-new-vms-size"&gt;CPUs and memory&lt;/a&gt; that new VMs get, as &lt;code&gt;devvm size -g&lt;/code&gt; saves them.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt; that new VMs get, as &lt;code&gt;devvm network -g&lt;/code&gt; saves it: &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt;, which is the default, or &lt;code&gt;none&lt;/code&gt;. Each new VM&amp;rsquo;s summary shows that tier, and when you customize the VM in a terminal, devvm asks for its tier, with Enter keeping the one the summary showed (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;). &lt;code&gt;--network TIER&lt;/code&gt; chooses for one VM and wins over the saved choice.&lt;/li&gt;
&lt;li&gt;The &lt;a href="#coding-agents-for-new-vms"&gt;coding agents&lt;/a&gt; that new VMs get.&lt;/li&gt;
&lt;li&gt;The &lt;a href="#layers-for-new-vms"&gt;layers&lt;/a&gt; that new VMs get.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup &lt;span class="c1"&gt;# asks all five questions&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --features fzf,omb &lt;span class="c1"&gt;# base&amp;#39;s features, without asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --features none &lt;span class="c1"&gt;# base gets no features&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --agents claude,codex &lt;span class="c1"&gt;# new VMs&amp;#39; coding agents, without asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --layers docker &lt;span class="c1"&gt;# new VMs&amp;#39; layers, without asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm setup&lt;/code&gt; has three flags of its own, and each one chooses without asking anything. &lt;code&gt;--features LIST&lt;/code&gt; chooses base&amp;rsquo;s features, as a comma-separated list or &lt;code&gt;none&lt;/code&gt; for none, and devvm refuses an empty &lt;code&gt;--features ''&lt;/code&gt;. &lt;code&gt;--agents LIST&lt;/code&gt; chooses new VMs&amp;rsquo; coding agents in the same way, and &lt;code&gt;--layers LIST&lt;/code&gt; chooses new VMs&amp;rsquo; layers. With any of the flags, what the flags leave out stays as it is. Without a terminal and without flags, &lt;code&gt;devvm setup&lt;/code&gt; asks nothing and keeps base&amp;rsquo;s features, saving every feature when none was chosen yet. To change new VMs&amp;rsquo; size without asking, use &lt;code&gt;devvm size -g&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#choosing-new-vms-size"&gt;choosing new VMs&amp;rsquo; size&lt;/a&gt;), and to change their network tier, use &lt;code&gt;devvm network -g&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#choosing-a-tier"&gt;choosing a tier&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="coding-agents-for-new-vms"&gt;Coding agents for new VMs&lt;span class="hx:absolute hx:-mt-20" id="coding-agents-for-new-vms"&gt;&lt;/span&gt;
&lt;a href="#coding-agents-for-new-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The coding agents you choose in &lt;code&gt;devvm setup&lt;/code&gt; are the ones a new VM gets unless you choose others for it. The summary devvm shows before it makes the VM names each of them as coming from devvm setup, and when you customize the VM, they&amp;rsquo;re checked in the list (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;). &lt;code&gt;--agents&lt;/code&gt; chooses others for one VM. The choice is for new VMs only, so a VM that exists keeps its agents, and &lt;code&gt;devvm tools&lt;/code&gt; changes them.&lt;/p&gt;
&lt;p&gt;devvm asks for them on its first run in a terminal, together with the size and base&amp;rsquo;s features, until you&amp;rsquo;ve chosen them. Until then, and when you choose &lt;code&gt;none&lt;/code&gt;, new VMs get no agents by default. &lt;code&gt;devvm setup --agents claude,codex&lt;/code&gt; and &lt;code&gt;devvm setup --agents none&lt;/code&gt; choose them without asking, and devvm refuses a name that isn&amp;rsquo;t an agent&amp;rsquo;s, suggesting the closest.&lt;/p&gt;
&lt;h3 data-hextra-search-id="layers-for-new-vms"&gt;Layers for new VMs&lt;span class="hx:absolute hx:-mt-20" id="layers-for-new-vms"&gt;&lt;/span&gt;
&lt;a href="#layers-for-new-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The layers you choose in &lt;code&gt;devvm setup&lt;/code&gt; are the ones every new VM gets unless you choose others for it. They can be devvm&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;built-in layers&lt;/a&gt;, &lt;code&gt;desktop&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;nix&lt;/code&gt;, and &lt;a href="https://next.devvm.dev/docs/using/customizing/#your-own-layers"&gt;your own&lt;/a&gt;, which is how you give every new VM an extra of your own (&lt;a href="https://next.devvm.dev/docs/using/customizing/#extras-of-your-own"&gt;extras of your own&lt;/a&gt;). The summary devvm shows before it makes a new VM names each of them as coming from devvm setup. When you customize the VM in a terminal, they&amp;rsquo;re already chosen under Layers in the list, and you can leave any of them out of that VM (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --layers docker,desktop &lt;span class="c1"&gt;# every new VM gets docker, with desktop on top&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --layers none &lt;span class="c1"&gt;# new VMs get no layers&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --layers nix &lt;span class="c1"&gt;# this VM gets nix alone, not setup&amp;#39;s layers&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --layers none &lt;span class="c1"&gt;# this VM gets no layers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm setup --layers&lt;/code&gt; takes the layers bottom first, in the order the image&amp;rsquo;s name joins them, so &lt;code&gt;--layers docker,desktop&lt;/code&gt; gives new VMs the image &lt;code&gt;docker+desktop&lt;/code&gt;. It refuses a name that isn&amp;rsquo;t a layer&amp;rsquo;s, suggesting the closest, and changes nothing. Until you choose some, new VMs get no layers by default, and devvm doesn&amp;rsquo;t ask for them on its first run. In a terminal, &lt;code&gt;devvm setup&lt;/code&gt; asks for them last, after the coding agents. To set them by hand, use the &lt;code&gt;layers&lt;/code&gt; key in &lt;a href="#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt;, which &lt;code&gt;devvm setup --layers&lt;/code&gt; then refuses to change.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--layers&lt;/code&gt; on &lt;code&gt;devvm&lt;/code&gt; is the exact list of one VM&amp;rsquo;s layers, so it replaces setup&amp;rsquo;s layers, and &lt;code&gt;--layers none&lt;/code&gt; makes a VM without any. A &lt;code&gt;devcontainer.json&lt;/code&gt;&amp;rsquo;s layers go on top of setup&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/"&gt;&lt;code&gt;devcontainer.json&lt;/code&gt;&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;The choice is for new VMs only. A VM that exists keeps the layers it was made with, and &lt;code&gt;devvm setup&lt;/code&gt; says so when it saves the choice. To give that VM more layers, run &lt;code&gt;devvm layer add&lt;/code&gt; in its folder (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;), and to take some out, &lt;code&gt;devvm layer rm&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/images/#taking-layers-out-of-a-vm"&gt;taking layers out of a VM&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When a layer of yours that you chose in &lt;code&gt;devvm setup&lt;/code&gt; has no script in &lt;code&gt;~/.config/devvm/layers&lt;/code&gt;, such as after you delete it, a new VM is made without it, and devvm warns, naming the layer. Run &lt;code&gt;devvm setup --layers&lt;/code&gt; to choose the layers again. When the VM&amp;rsquo;s backend can&amp;rsquo;t run a layer you chose, such as &lt;code&gt;docker&lt;/code&gt; on a backend without Docker&amp;rsquo;s engine, devvm makes no VM and names the layer. Then choose other layers for that VM with &lt;code&gt;--layers&lt;/code&gt;, or change new VMs&amp;rsquo; layers with &lt;code&gt;devvm setup --layers&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="retention"&gt;Retention&lt;span class="hx:absolute hx:-mt-20" id="retention"&gt;&lt;/span&gt;
&lt;a href="#retention" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm keeps what it makes until you delete it, and the retention settings tell it to delete some of it on its own. Every setting is off until you set it, so first run &lt;code&gt;devvm space&lt;/code&gt; to see what each one would free: its &lt;code&gt;RETAIN&lt;/code&gt; column shows each setting that&amp;rsquo;s on, beside the row it applies to, with what it would delete now (&lt;a href="https://next.devvm.dev/docs/using/space/#devvm-space"&gt;devvm space&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm space &lt;span class="c1"&gt;# see what each setting would free&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm retention &lt;span class="c1"&gt;# show every setting&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm retention history.age&lt;span class="o"&gt;=&lt;/span&gt;90d tools.unused-age&lt;span class="o"&gt;=&lt;/span&gt;30d &lt;span class="c1"&gt;# set some&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm retention history.age&lt;span class="o"&gt;=&lt;/span&gt;off &lt;span class="c1"&gt;# turn one off&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --retention &lt;span class="c1"&gt;# gc as usual, then apply them now&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm retention&lt;/code&gt; shows every setting and its value, and &lt;code&gt;off&lt;/code&gt; for each one that isn&amp;rsquo;t set. &lt;code&gt;devvm retention KEY=VALUE...&lt;/code&gt; sets them, and &lt;code&gt;devvm retention KEY=off&lt;/code&gt; turns one off, for example &lt;code&gt;devvm retention history.age=90d tools.unused-age=30d&lt;/code&gt;. devvm refuses a key or value it doesn&amp;rsquo;t know, and a key with no value such as &lt;code&gt;history.age=&lt;/code&gt;, and then it writes nothing. devvm saves the settings in &lt;code&gt;~/.local/share/devvm/settings.json&lt;/code&gt;. The &lt;code&gt;[retention]&lt;/code&gt; table of &lt;a href="#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt; sets them too, and a setting there wins over the saved one, so &lt;code&gt;devvm retention&lt;/code&gt; refuses to change it. Each line that &lt;code&gt;devvm retention&lt;/code&gt; shows ends with where its value came from, after a &lt;code&gt;#&lt;/code&gt;. When devvm can&amp;rsquo;t read a file that sets them, it names the file, and the line for &lt;code&gt;config.toml&lt;/code&gt;, and applies none of them.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;What devvm deletes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;logs.runs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;run logs&lt;/a&gt; beyond the newest this many, which is 20 when it&amp;rsquo;s off, and older ones past 256 MiB together whatever it is&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;history.age&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;exports of agents&amp;rsquo; history&lt;/a&gt; written this long ago or more, such as &lt;code&gt;90d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;history.count&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the exports of agents&amp;rsquo; history beyond the newest this many&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tools.unused-age&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the current shared tools that no VM has had for this long, counted from when devvm first found that no VM has them. While a VM is being made or is getting new shared tools, retention deletes none of them in that run, because that VM may not list the tools it picked yet, and it still applies the other settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;orphans.age&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what devvm keeps for VMs that their backend no longer has, once their state hasn&amp;rsquo;t changed for this long, as &lt;code&gt;devvm gc --orphans&lt;/code&gt; does&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nix-cache.size&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/toolchains/#nix-projects"&gt;shared Nix cache&lt;/a&gt;&amp;rsquo;s least recently used files, while it takes more than this, such as &lt;code&gt;20G&lt;/code&gt;; it&amp;rsquo;s 10 GiB when it&amp;rsquo;s off&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Written as&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;an age&lt;/td&gt;
&lt;td&gt;a &lt;a href="https://next.devvm.dev/docs/using/command-line/#flags-and-values"&gt;duration&lt;/a&gt;, a whole number of minutes, hours, days or weeks&lt;/td&gt;
&lt;td&gt;&lt;code&gt;30m&lt;/code&gt;, &lt;code&gt;12h&lt;/code&gt;, &lt;code&gt;30d&lt;/code&gt; or &lt;code&gt;2w&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a size&lt;/td&gt;
&lt;td&gt;a whole number of &lt;code&gt;K&lt;/code&gt;, &lt;code&gt;M&lt;/code&gt;, &lt;code&gt;G&lt;/code&gt; or &lt;code&gt;T&lt;/code&gt;, each 1024 of the one before, as &lt;code&gt;devvm space&lt;/code&gt; shows them&lt;/td&gt;
&lt;td&gt;&lt;code&gt;500M&lt;/code&gt; or &lt;code&gt;20G&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;When they apply:&lt;/strong&gt; devvm applies the settings at the start of a command, at most once a day, except for &lt;code&gt;orphans.age&lt;/code&gt;, which needs to ask each backend about its VMs, so only &lt;code&gt;devvm gc --retention&lt;/code&gt; applies it. &lt;code&gt;devvm gc --retention&lt;/code&gt; applies all of them at once. When two devvms start at once, only one of them applies the settings, and when it deletes something, devvm says what in one line.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Nix cache&amp;rsquo;s size:&lt;/strong&gt; the shared Nix cache also keeps to its size while VMs fill it, because a VM&amp;rsquo;s proxy deletes the cache&amp;rsquo;s least recently used files before a new file would take it past that size. A size you set applies to each VM from its next start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What it never deletes:&lt;/strong&gt; retention never deletes a VM, an image, a shared tool that any VM&amp;rsquo;s state lists, or anything in the backends&amp;rsquo; own caches, which only &lt;code&gt;devvm gc --caches&lt;/code&gt; frees. In &lt;code&gt;cache/&lt;/code&gt;, the folder in &lt;a href="https://next.devvm.dev/docs/using/space/#devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;/a&gt; that holds what devvm makes again when it needs it, retention deletes only the shared Nix cache&amp;rsquo;s files.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="devvm-retention-json"&gt;devvm retention &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-retention-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-retention-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm retention --json&lt;/code&gt; prints the settings as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. &lt;code&gt;settings&lt;/code&gt; has every key with its value as you wrote it, and &lt;code&gt;off&lt;/code&gt; for each one that isn&amp;rsquo;t set. &lt;code&gt;sources&lt;/code&gt; has every key with where its value came from: &lt;code&gt;config.toml&lt;/code&gt;, &lt;code&gt;settings.json&lt;/code&gt; for one that &lt;code&gt;devvm retention&lt;/code&gt; saved, or &lt;code&gt;built-in&lt;/code&gt; for one that&amp;rsquo;s off. With &lt;code&gt;--json&lt;/code&gt; the command only shows, so devvm refuses a &lt;code&gt;KEY=VALUE&lt;/code&gt; with it.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;settings&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;history.age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;90d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;history.count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;off&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;logs.runs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;off&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;nix-cache.size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;off&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;orphans.age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;off&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tools.unused-age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;30d&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sources&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;history.age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;config.toml&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;history.count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;built-in&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;logs.runs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;built-in&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;nix-cache.size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;built-in&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;orphans.age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;built-in&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tools.unused-age&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;settings.json&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="a-companys-ca"&gt;A company&amp;rsquo;s CA&lt;span class="hx:absolute hx:-mt-20" id="a-companys-ca"&gt;&lt;/span&gt;
&lt;a href="#a-companys-ca" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Some company networks inspect TLS through a proxy, such as Zscaler or Netskope, that shows its own certificates, signed by the company&amp;rsquo;s certificate authority (CA). This machine trusts that CA, but VMs and the VMs that devvm builds images in don&amp;rsquo;t, so their TLS connections fail. To make them trust it, put the CA&amp;rsquo;s certificate in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir -p ~/.config/devvm/ca
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp company-root.pem ~/.config/devvm/ca/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm reads every &lt;code&gt;*.pem&lt;/code&gt; and &lt;code&gt;*.crt&lt;/code&gt; file in that folder each time you open a VM, each time it builds an image and each time it resolves the shared tools&amp;rsquo; versions, and it leaves other files alone. A file can hold one certificate or several, in PEM, the text form that starts with &lt;code&gt;-----BEGIN CERTIFICATE-----&lt;/code&gt;. devvm accepts only CA certificates, and it sends only the certificates it read out of a file, never the rest of the file. It refuses the whole folder, naming the file, in these cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Anything else in a file,&lt;/strong&gt; such as a private key, a certificate devvm can&amp;rsquo;t read or a certificate that isn&amp;rsquo;t a CA&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A link:&lt;/strong&gt; a &lt;code&gt;*.pem&lt;/code&gt; or &lt;code&gt;*.crt&lt;/code&gt; file that is a link, or a folder that is one, because a link into a project folder would let that project&amp;rsquo;s VM replace the CA that every VM, build and proxy trusts. devvm doesn&amp;rsquo;t follow links there, so copy each certificate into the folder rather than linking to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file it can&amp;rsquo;t read,&lt;/strong&gt; or a folder it can&amp;rsquo;t read.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These trust the CAs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Every project VM,&lt;/strong&gt; in its system&amp;rsquo;s store, from its next launch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every build VM,&lt;/strong&gt; for an image or for shared tools. devvm takes them out of a build VM before the image is finished, so images never keep them, and adding or removing a CA rebuilds nothing. A layer script of yours that copies the system&amp;rsquo;s CA bundle somewhere else does keep that copy (&lt;a href="https://next.devvm.dev/docs/internals/images/#a-companys-ca-in-builds"&gt;a company&amp;rsquo;s CA in builds&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM&amp;rsquo;s proxy,&lt;/strong&gt; on every &lt;a href="https://next.devvm.dev/docs/safety/network/"&gt;network tier&lt;/a&gt;, for the connections it makes itself, the refresh of a coding agent&amp;rsquo;s login included, which the proxy makes on this machine when the login is due, so a company proxy that inspects TLS doesn&amp;rsquo;t make the refresh fail.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ubuntu&amp;rsquo;s cloud image,&lt;/strong&gt; which devvm looks up and downloads on this machine to build base. The lookup and the download trust these CAs as well as this machine&amp;rsquo;s own store, and when this machine doesn&amp;rsquo;t trust the server&amp;rsquo;s certificate, devvm says so and names this folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm&amp;rsquo;s own mise,&lt;/strong&gt; which devvm downloads once to resolve the shared tools&amp;rsquo; versions on this machine. That download trusts these CAs as well as this machine&amp;rsquo;s own store, and on Linux so does that mise. On macOS, mise trusts them for most of its connections, but the part of it that checks where each tool&amp;rsquo;s release was built trusts only the CAs that macOS trusts, which Keychain Access shows. So on macOS, a company&amp;rsquo;s CA that mise needs has to be there too, where a Mac that your company manages usually has it already. When mise doesn&amp;rsquo;t trust a server&amp;rsquo;s certificate, devvm says so and names this folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm&amp;rsquo;s other connections from this machine, such as checking an image&amp;rsquo;s registry, trust this machine&amp;rsquo;s own store, as your other programs here do. When you take a certificate out of the folder, VMs stop trusting it at their next launch, and stores that copy the system&amp;rsquo;s CAs, such as Java&amp;rsquo;s &lt;code&gt;cacerts&lt;/code&gt;, drop it too.&lt;/p&gt;
&lt;p&gt;Most tools read the system&amp;rsquo;s store, among them apt, apk, curl, git and Python&amp;rsquo;s &lt;code&gt;ssl&lt;/code&gt; module. For those that don&amp;rsquo;t, every VM&amp;rsquo;s environment points them at it:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NODE_EXTRA_CA_CERTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc/ssl/devvm.pem&lt;/code&gt;, which holds only devvm&amp;rsquo;s CAs and is empty when there are none&lt;/td&gt;
&lt;td&gt;Node, npm and Bun&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SSL_CERT_FILE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc/ssl/certs/ca-certificates.crt&lt;/code&gt;, the system&amp;rsquo;s bundle&lt;/td&gt;
&lt;td&gt;Go programs, and Rust programs that read the system&amp;rsquo;s roots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;REQUESTS_CA_BUNDLE&lt;/code&gt;, &lt;code&gt;PIP_CERT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the system&amp;rsquo;s bundle&lt;/td&gt;
&lt;td&gt;Python&amp;rsquo;s &lt;code&gt;requests&lt;/code&gt; and pip, which use their own CA list otherwise&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UV_SYSTEM_CERTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;uv&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A CA in the folder can read every TLS connection a VM makes, as it can this machine&amp;rsquo;s, so put only CAs there that you trust as much as this machine does. &lt;a href="https://next.devvm.dev/docs/internals/network/#a-companys-ca"&gt;How it works › Network tiers&lt;/a&gt; explains how the CAs reach VMs, and &lt;a href="https://next.devvm.dev/docs/internals/images/#a-companys-ca-in-builds"&gt;Images and caching&lt;/a&gt; how builds use them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvms-state"&gt;devvm&amp;rsquo;s state&lt;span class="hx:absolute hx:-mt-20" id="devvms-state"&gt;&lt;/span&gt;
&lt;a href="#devvms-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;~/.local/share/devvm&lt;/code&gt; (&lt;code&gt;$XDG_DATA_HOME/devvm&lt;/code&gt;) holds what devvm makes and keeps for you, and devvm writes everything in it, so don&amp;rsquo;t edit it by hand. It holds the defaults that &lt;code&gt;devvm setup&lt;/code&gt;, &lt;code&gt;devvm size -g&lt;/code&gt;, &lt;code&gt;devvm ports -g&lt;/code&gt;, &lt;code&gt;devvm network -g&lt;/code&gt; and &lt;code&gt;devvm retention&lt;/code&gt; save in &lt;code&gt;settings.json&lt;/code&gt;, below &lt;a href="#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt;&amp;rsquo;s, and a folder for each VM in &lt;code&gt;vms/&lt;/code&gt;, with the VM&amp;rsquo;s state, its own allowlist and its network logs. It also holds the images and the shared tools, the &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;run logs&lt;/a&gt;, the agents&amp;rsquo; history that &lt;code&gt;devvm history export&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; save, the &lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;ssh config&lt;/a&gt; for your VMs, and devvm&amp;rsquo;s own Lima home (&lt;code&gt;lima/&lt;/code&gt;), where the Lima backend&amp;rsquo;s VMs and images live. &lt;a href="https://next.devvm.dev/docs/using/space/#devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;/a&gt; lists each file and folder in it, with how each one is cleaned up.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On Linux hosts this folder also holds your &lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;secrets&lt;/a&gt;, in files under &lt;code&gt;secrets/&lt;/code&gt; that only you can read, so keep that in mind when you back it up. On macOS they&amp;rsquo;re in the Keychain.&lt;/li&gt;
&lt;li&gt;devvm&amp;rsquo;s Lima home is its own, whatever &lt;code&gt;LIMA_HOME&lt;/code&gt; says, so Lima settings meant for other VMs never reach devvm&amp;rsquo;s. Set &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; to move it, for example to a sandbox or to a shorter path. When devvms with data folders of their own share one Lima home, don&amp;rsquo;t build shared tools or run &lt;code&gt;devvm gc&lt;/code&gt; in two of them at once, because each can delete a build VM that another is still using (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Only you can read devvm&amp;rsquo;s files, in either folder, because each time devvm runs, it makes both folders yours alone (&lt;a href="https://next.devvm.dev/docs/using/space/#devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;/a&gt;). When devvm can&amp;rsquo;t read one of its files, it names the file and the line (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-file-devvm-cant-read"&gt;a file devvm can&amp;rsquo;t read&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="project-folders-devvm-refuses"&gt;Project folders devvm refuses&lt;span class="hx:absolute hx:-mt-20" id="project-folders-devvm-refuses"&gt;&lt;/span&gt;
&lt;a href="#project-folders-devvm-refuses" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM mounts its project folder read-write, so devvm refuses to make a VM for a folder that would give the VM more than the project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Your home folder and devvm&amp;rsquo;s folders,&lt;/strong&gt; and any folder that holds one: your home folder, &lt;code&gt;~/.config/devvm&lt;/code&gt;, &lt;code&gt;~/.local/share/devvm&lt;/code&gt; or devvm&amp;rsquo;s Lima home.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A folder inside one of devvm&amp;rsquo;s own folders,&lt;/strong&gt; because a VM there could rewrite the scripts that every image build runs, or the files that devvm runs on this machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another name for one of these folders.&lt;/strong&gt; devvm compares the folders themselves, not only their names, so on a Mac, where a name&amp;rsquo;s case doesn&amp;rsquo;t count, &lt;code&gt;~/.Config/devvm&lt;/code&gt; is refused as &lt;code&gt;~/.config/devvm&lt;/code&gt; is.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When devvm refuses a folder, make the VM in a project folder inside it, or keep the project somewhere else. A &lt;a href="https://next.devvm.dev/docs/using/clone/"&gt;&lt;code&gt;--clone&lt;/code&gt;&lt;/a&gt; VM mounts nothing from the folder, so devvm doesn&amp;rsquo;t refuse its folder.&lt;/p&gt;
&lt;div class="devvm-callout devvm-callout-warning"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 1h1v1H5ZM4 2h1v1H4ZM6 2h1v1H6ZM4 3h1v1H4ZM6 3h1v1H6ZM3 4h1v1H3ZM7 4h1v1H7ZM3 5h1v1H3ZM5 5h1v1H5ZM7 5h1v1H7ZM2 6h1v1H2ZM5 6h1v1H5ZM8 6h1v1H8ZM2 7h1v1H2ZM5 7h1v1H5ZM8 7h1v1H8ZM1 8h1v1H1ZM9 8h1v1H9ZM1 9h1v1H1ZM5 9h1v1H5ZM9 9h1v1H9ZM0 10h1v1H0ZM10 10h1v1H10ZM0 11h11v1H0Z"/&gt;&lt;/svg&gt; Warning&lt;/p&gt;&lt;p&gt;If you mean to give the VM the whole folder, pass &lt;code&gt;--unsafe-folder&lt;/code&gt; when you make the VM, and devvm warns you that the VM gets read-write access to it (&lt;a href="https://next.devvm.dev/docs/internals/security/#only-the-project-folder"&gt;only the project folder&lt;/a&gt;).&lt;/p&gt;&lt;/div&gt;&lt;p&gt;A folder inside a coding agent&amp;rsquo;s folder on this machine, such as a skill you work on in &lt;code&gt;~/.claude/skills&lt;/code&gt;, or one that holds an agent&amp;rsquo;s folder, such as &lt;code&gt;~/.pi&lt;/code&gt;, isn&amp;rsquo;t refused, but devvm warns at each launch, because code in the VM can change that agent&amp;rsquo;s settings on this machine. Keep such a project somewhere else unless you trust what runs in its VM.&lt;/p&gt;
&lt;h2 data-hextra-search-id="colors"&gt;Colors&lt;span class="hx:absolute hx:-mt-20" id="colors"&gt;&lt;/span&gt;
&lt;a href="#colors" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In a terminal, devvm colors the labels and links around its messages, while the messages&amp;rsquo; own text stays in your terminal&amp;rsquo;s usual color. The tables that devvm ls, devvm images, devvm space and devvm doctor print are colored too, and their columns line up the same with colors or without:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Color&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;the values a message fills in, such as a VM&amp;rsquo;s name, a path, a port or a count, so they stand out from the words around them&lt;/td&gt;
&lt;td&gt;bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;an error&amp;rsquo;s &lt;code&gt;devvm:&lt;/code&gt; label&lt;/td&gt;
&lt;td&gt;red&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a warning&amp;rsquo;s &lt;code&gt;devvm:&lt;/code&gt; label&lt;/td&gt;
&lt;td&gt;yellow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a doc link&lt;/td&gt;
&lt;td&gt;blue and underlined&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the &lt;code&gt;==&amp;gt;&lt;/code&gt; before what devvm did&lt;/td&gt;
&lt;td&gt;bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the end of the run log that devvm prints when a step fails, the log&amp;rsquo;s latest line on the status line, and each line that &lt;code&gt;-v&lt;/code&gt; shows&lt;/td&gt;
&lt;td&gt;dim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the mark a slow step leaves when it&amp;rsquo;s done&lt;/td&gt;
&lt;td&gt;green&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;each table&amp;rsquo;s header row and the totals row&lt;/td&gt;
&lt;td&gt;bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a state that&amp;rsquo;s good, such as current, Running or native&lt;/td&gt;
&lt;td&gt;green&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a state that needs your attention, such as stale, unused, Stopped or emulated&lt;/td&gt;
&lt;td&gt;yellow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a state that says something is wrong, such as an unenforced tier or an unreviewed emulation&lt;/td&gt;
&lt;td&gt;red&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;digests, image keys and a feature a backend doesn&amp;rsquo;t have, which devvm doctor lists as none&lt;/td&gt;
&lt;td&gt;dim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;names, paths, sizes and counts in a table&lt;/td&gt;
&lt;td&gt;your terminal&amp;rsquo;s usual color&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;devvm uses only your terminal&amp;rsquo;s 16 base colors, so your theme picks shades that read well on its background, light or dark. It never sets a background color.&lt;/p&gt;
&lt;p&gt;devvm decides for standard output and standard error apart, and colors one only when it&amp;rsquo;s a terminal, so output you pipe or redirect to a file stays plain, tables included. What a command prints with &lt;code&gt;--json&lt;/code&gt; is plain even in a terminal, and the run log is never colored. These environment variables change when devvm colors, and the first one that applies decides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;NO_COLOR&lt;/code&gt;, set to anything but an empty value, turns colors off.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FORCE_COLOR&lt;/code&gt; or &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt;, set to anything but &lt;code&gt;0&lt;/code&gt;, turns them on even when the output isn&amp;rsquo;t a terminal.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TERM=dumb&lt;/code&gt; turns them off.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="environment"&gt;Environment&lt;span class="hx:absolute hx:-mt-20" id="environment"&gt;&lt;/span&gt;
&lt;a href="#environment" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NO_COLOR&lt;/code&gt;, &lt;code&gt;FORCE_COLOR&lt;/code&gt;, &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;turn devvm&amp;rsquo;s colors off, or on when the output isn&amp;rsquo;t a terminal (&lt;a href="#colors"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;move devvm&amp;rsquo;s own Lima home (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_FROM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the container image that the base of new VMs and builds starts from when there&amp;rsquo;s no &lt;code&gt;--from&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/from/"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_NO_TOOL_CHECK=1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;don&amp;rsquo;t check for newer shared tools once a day (&lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_NO_RELEASE_CHECK=1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;don&amp;rsquo;t check for a newer devvm release once a day (&lt;a href="#the-release-check"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the Keychain service devvm saves and reads secrets in, instead of &lt;code&gt;devvm&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the Claude Code token that VMs get, over the saved Claude Code login, whichever it is (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Lima</title><link>https://next.devvm.dev/docs/internals/lima/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/lima/</guid><description>
&lt;p&gt;This page explains how devvm runs its VMs on Lima: the Lima home it keeps them in, how it builds images and clones VMs from them, what it sets in each VM&amp;rsquo;s config, how it confines VMs and builds, and how it forwards their ports. &lt;a href="https://next.devvm.dev/docs/backends/lima/"&gt;Lima&lt;/a&gt; covers what you need to run it, &lt;code&gt;devvm limactl&lt;/code&gt; and Lima&amp;rsquo;s limits.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-lima-home-of-its-own"&gt;A Lima home of its own&lt;span class="hx:absolute hx:-mt-20" id="a-lima-home-of-its-own"&gt;&lt;/span&gt;
&lt;a href="#a-lima-home-of-its-own" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Lima merges &lt;code&gt;_config/default.yaml&lt;/code&gt; and &lt;code&gt;_config/override.yaml&lt;/code&gt; from its home into every VM it creates or starts. A network you set there for your own VMs would give a devvm VM a second network card with a route around its proxy, and an extra mount set there would go unnoticed. So devvm keeps its VMs in a Lima home of their own, &lt;code&gt;~/.local/share/devvm/lima&lt;/code&gt;, whatever &lt;code&gt;LIMA_HOME&lt;/code&gt; says (&lt;a href="https://next.devvm.dev/docs/backends/lima/#devvms-lima-home"&gt;devvm&amp;rsquo;s Lima home&lt;/a&gt; says what that means for you).&lt;/p&gt;
&lt;p&gt;devvm refuses to start a VM while that home holds either file (&lt;code&gt;lima_global_config&lt;/code&gt;), and it refuses a VM that has a network devvm didn&amp;rsquo;t give it (&lt;code&gt;vm_has_networks&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;devvm runs &lt;code&gt;limactl&lt;/code&gt; from its own data folder. When a config is invalid, Lima writes &lt;code&gt;lima.REJECTED.yaml&lt;/code&gt; into the folder it runs in, and a project folder belongs to the VM to write.&lt;/p&gt;
&lt;h2 data-hextra-search-id="clones-and-overlays"&gt;Clones and overlays&lt;span class="hx:absolute hx:-mt-20" id="clones-and-overlays"&gt;&lt;/span&gt;
&lt;a href="#clones-and-overlays" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An image is a stopped VM in devvm&amp;rsquo;s Lima home, named &lt;code&gt;devvm-img-&amp;lt;key&amp;gt;&lt;/code&gt;. devvm makes base&amp;rsquo;s from Ubuntu&amp;rsquo;s cloud image with &lt;code&gt;base.yaml&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#bases-size"&gt;base&amp;rsquo;s size&lt;/a&gt; as &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; and &lt;code&gt;--disk&lt;/code&gt;, and &lt;code&gt;--mount-none&lt;/code&gt;, and it gives &lt;code&gt;limactl create&lt;/code&gt; the template on its standard input (&lt;code&gt;-&lt;/code&gt;), from the binary, so no copy of &lt;code&gt;base.yaml&lt;/code&gt; is on disk. With &lt;code&gt;--from&lt;/code&gt;, it makes base&amp;rsquo;s from the converted disk instead, and boots its kernel and initrd directly (&lt;a href="https://next.devvm.dev/docs/internals/images/#how-its-converted"&gt;details&lt;/a&gt;). A layer&amp;rsquo;s image is a clone of its parent&amp;rsquo;s, also made with &lt;code&gt;--mount-none&lt;/code&gt;, so a build mounts nothing from the host. A project VM is a clone of its image&amp;rsquo;s VM, which devvm makes while the image is stopped.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;macOS:&lt;/strong&gt; the clone&amp;rsquo;s disk is an APFS copy-on-write copy. It shares the image&amp;rsquo;s blocks until the VM writes them, so &lt;code&gt;du&lt;/code&gt; overcounts it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux:&lt;/strong&gt; Lima&amp;rsquo;s disks are qcow2 files, and a clone would be a full copy. So a project VM&amp;rsquo;s disk is a qcow2 overlay of its image&amp;rsquo;s, readable only by you, which shares the image&amp;rsquo;s blocks and holds only the VM&amp;rsquo;s changes. An image&amp;rsquo;s disk is read-only once it&amp;rsquo;s built, and devvm can&amp;rsquo;t delete an image while VMs&amp;rsquo; disks are overlays of it (&lt;code&gt;image_in_use&lt;/code&gt;). devvm reads each VM disk&amp;rsquo;s backing file with &lt;code&gt;qemu-img info -U&lt;/code&gt;, which shares the disk with the QEMU of a running VM, because that QEMU&amp;rsquo;s write lock refuses &lt;code&gt;qemu-img info&lt;/code&gt; otherwise.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="what-devvm-sets-on-a-vm"&gt;What devvm sets on a VM&lt;span class="hx:absolute hx:-mt-20" id="what-devvm-sets-on-a-vm"&gt;&lt;/span&gt;
&lt;a href="#what-devvm-sets-on-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm sets these in each VM&amp;rsquo;s Lima config:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mounts:&lt;/strong&gt; the project folder (read-write), agents&amp;rsquo; folders (read-only), and the shared tools at &lt;code&gt;/mnt/devvm-tools&lt;/code&gt; (read-only). Each folder but the tools is mounted at its host path. devvm mounts nothing else, and it leaves out the home folder that Lima&amp;rsquo;s templates mount. On macOS, where Lima runs VMs with &lt;code&gt;vz&lt;/code&gt;, the project folder&amp;rsquo;s mount names the folder by the device and inode that devvm recorded when it made the VM, or recorded again at a start after a boot numbered the folder&amp;rsquo;s disk anew, as &lt;code&gt;location: /.vol/&amp;lt;device&amp;gt;/&amp;lt;inode&amp;gt;&lt;/code&gt; with &lt;code&gt;mountPoint&lt;/code&gt; set to the folder&amp;rsquo;s path. macOS&amp;rsquo;s &lt;code&gt;/.vol&lt;/code&gt; opens a folder by its device and inode, so Virtualization.framework shares the folder devvm made the VM for, wherever that folder is when the VM starts, and never follows a link put at its path (&lt;a href="https://next.devvm.dev/docs/internals/overview/#an-existing-vm"&gt;an existing VM&lt;/a&gt;). Virtualization.framework then serves the share by the path the folder had at the start, so a folder moved back while the VM runs answers &amp;ldquo;Operation not permitted&amp;rdquo; in the VM until its next start. QEMU&amp;rsquo;s 9p on Linux has nothing like &lt;code&gt;/.vol&lt;/code&gt;, so there the mount is by the folder&amp;rsquo;s path, with the cache mode the VM&amp;rsquo;s state records as its &lt;code&gt;9p: cache:&lt;/code&gt; option: &lt;code&gt;none&lt;/code&gt; for a new VM, and nothing for a VM whose mode nobody chose, which keeps Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-9p-cache-on-linux"&gt;why&lt;/a&gt;). The read-only mounts keep Lima&amp;rsquo;s &lt;code&gt;fscache&lt;/code&gt;, and a build VM&amp;rsquo;s writable output folder gets &lt;code&gt;none&lt;/code&gt;. The start that changes a VM&amp;rsquo;s cache mode mounts its folder again once the VM runs, because the guest mounted it with the old options before cloud-init wrote the new ones into its &lt;code&gt;/etc/fstab&lt;/code&gt;, and it then checks the mount: a folder left unmounted fails the start (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-9p-cache-on-linux"&gt;why&lt;/a&gt;). A start that rewrites the mounts, for a folder that moved, another cache mode or other agents&amp;rsquo; folders, keeps each mount&amp;rsquo;s settings that devvm doesn&amp;rsquo;t set, such as its other 9p and sshfs options, where they differ from Lima&amp;rsquo;s defaults, and leaves the defaults out for Lima to fill in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ssh:&lt;/strong&gt; agent forwarding on or off, and the host port, which Lima always listens on at &lt;code&gt;127.0.0.1&lt;/code&gt;. devvm chooses the port and records it, so no other VM&amp;rsquo;s forwarded ports take it. It chooses only from the 17 ports on which every browser engine refuses every request, navigations and WebSockets included, which are the Fetch standard&amp;rsquo;s bad ports from 1024 up that Chromium also blocks (1719, 1720, 1723, 2049, 3659, 4045, 5060, 5061, 6000, 6566, 6665 to 6669, 6697 and 10080). Fetch also lists 4190 and 6679, but Chromium&amp;rsquo;s own list lacks them, and Chrome loads pages on them. Root in a VM can make what answers on its ssh port speak HTTP, and cookies ignore the port, so on any other port a page opened as &lt;code&gt;http://localhost:PORT&lt;/code&gt; would reach a server the VM controls with the cookies of the apps you use on &lt;code&gt;localhost&lt;/code&gt;, even in a VM that forwards no ports. So at most 17 VMs run at once, and a start past that fails, naming the VMs whose ports are in use (&lt;code&gt;ports_ssh_limit&lt;/code&gt;, or &lt;code&gt;ports_ssh_limit_all&lt;/code&gt; when they have all 17), or saying that VMs starting or building, ports a running VM lists to forward, or other programs on this machine have them all (&lt;code&gt;ports_ssh_limit_others&lt;/code&gt;). devvm&amp;rsquo;s other host ports, a VM&amp;rsquo;s proxy port and desktop port, are never one of these, and one an older devvm chose moves at the VM&amp;rsquo;s next start. A VM that forwards every port never forwards one of the 17 either. A VM that lists one does forward it, whatever set the list, and &lt;code&gt;devvm ports&lt;/code&gt; and each launch warn of it (&lt;code&gt;ports_ssh_listed&lt;/code&gt;), and while that VM runs, it keeps the port from VMs&amp;rsquo; ssh, as any program on this machine that holds one does. A stopped VM keeps its port at its next start while it&amp;rsquo;s free, and gets another when another program on the host has it, on any address, when the VM lists it to forward, when another start or a build holds it, when a VM that runs lists it, or when it isn&amp;rsquo;t one of the 17, because an older devvm chose it. A new port is one no VM&amp;rsquo;s state records, or else one a stopped VM&amp;rsquo;s state records, which that VM gives up, getting another at its own next start. A build VM&amp;rsquo;s port is never the one its clone kept from its image while another is free. The start&amp;rsquo;s one &lt;code&gt;limactl edit&lt;/code&gt; sets a new port, and the VM&amp;rsquo;s host keys are pinned again, as at every start. A start holds its port, kept or new, for a minute, in &lt;code&gt;run/ports.ssh-hold&lt;/code&gt; in the VM&amp;rsquo;s folder, so that no other start or build takes it before its backend binds it as the start begins. The hold lasts only that minute, so a start whose backend takes longer than that to bind the port can lose it to another start that chooses it then. The slower start then fails, and starting it again gives it another port. A running VM keeps its port until its next start, even one an older devvm chose, and each launch warns of the running VMs still on such a port (&lt;code&gt;ports_ssh_old&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ports:&lt;/strong&gt; none, because Lima&amp;rsquo;s own forwards are off and devvm&amp;rsquo;s forwarder forwards the VM&amp;rsquo;s ports instead (&lt;a href="#ports"&gt;below&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Size:&lt;/strong&gt; CPUs, memory and disk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Guest environment:&lt;/strong&gt; Lima&amp;rsquo;s &lt;code&gt;env:&lt;/code&gt;, which Lima writes to &lt;code&gt;/etc/environment&lt;/code&gt; at every boot. On every tier it holds the VM&amp;rsquo;s proxy&amp;rsquo;s address and its settings, and Lima doesn&amp;rsquo;t pass the host&amp;rsquo;s proxy settings in. A confined VM reaches the proxy as Lima&amp;rsquo;s host address on macOS and as QEMU&amp;rsquo;s &lt;code&gt;guestfwd&lt;/code&gt; address on Linux, and an open VM reaches it at Lima&amp;rsquo;s host address on both, which is this machine&amp;rsquo;s loopback as Lima&amp;rsquo;s network has it, with &lt;code&gt;host.lima.internal&lt;/code&gt; added to its &lt;code&gt;NO_PROXY&lt;/code&gt;. &lt;code&gt;limactl edit&lt;/code&gt; sets the proxy&amp;rsquo;s URL with a stand-in for the password (&lt;code&gt;devvm-proxy-password&lt;/code&gt;), and devvm then replaces the stand-in in the VM&amp;rsquo;s &lt;code&gt;lima.yaml&lt;/code&gt;, which it rewrites with mode 600, so the password is in no process&amp;rsquo;s arguments. Its &lt;code&gt;NO_PROXY&lt;/code&gt; and &lt;code&gt;no_proxy&lt;/code&gt; name the VM alone, and never its &lt;a href="https://next.devvm.dev/docs/contributing/design/#links-between-vms"&gt;links&lt;/a&gt;, which its HTTP clients reach through the proxy, so links never change it. A start runs &lt;code&gt;limactl edit&lt;/code&gt; only when the environment differs from the one the VM has, because it compares them first. That edit gives the VM new ssh host keys at its next boot, as any edit does, and devvm forgets a VM&amp;rsquo;s host keys at every start and pins them again once it runs, so devvm&amp;rsquo;s ssh config, its own connections and your editors keep working.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proxy settings and DNS:&lt;/strong&gt; Lima&amp;rsquo;s &lt;code&gt;propagateProxyEnv&lt;/code&gt;, which writes this machine&amp;rsquo;s proxy settings into the guest, is on only for a VM on Lima&amp;rsquo;s own network without devvm&amp;rsquo;s proxy, so they never reach a VM that goes through devvm&amp;rsquo;s proxy. A VM confined to its proxy has Lima&amp;rsquo;s host resolver off (&lt;code&gt;hostResolver.enabled: false&lt;/code&gt;) and &lt;code&gt;dns: [&amp;quot;127.0.0.1&amp;quot;]&lt;/code&gt;, because its names resolve in the proxy (&lt;a href="#confinement"&gt;confinement&lt;/a&gt;). An open VM keeps Lima&amp;rsquo;s own resolver and DNS.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Lima changes only a stopped VM&amp;rsquo;s config, so a change you make while the VM runs applies at its next start. When devvm makes a VM, the clone gets its mounts, agent forwarding, ssh port, ports rules and environment, and devvm then edits the VM&amp;rsquo;s size where it differs from its image&amp;rsquo;s. Each start of a stopped VM compares the VM&amp;rsquo;s config, as &lt;code&gt;limactl list&lt;/code&gt; shows it, with what the VM&amp;rsquo;s state asks for and with how the VM starts. That covers its size, its project folder&amp;rsquo;s path, which changes once the folder moved (&lt;a href="https://next.devvm.dev/docs/internals/overview/#a-moved-folder"&gt;a moved folder&lt;/a&gt;), on macOS the device and inode its mount names, which change in that same edit once a boot gave the folder&amp;rsquo;s disk another device number, and on Linux its cache mode where one was chosen, its agents&amp;rsquo; folders, its agent forwarding, its ssh port, its environment, Lima&amp;rsquo;s proxy settings (&lt;code&gt;propagateProxyEnv&lt;/code&gt;), its DNS (&lt;code&gt;hostResolver&lt;/code&gt; and &lt;code&gt;dns&lt;/code&gt;) and its ports rules. devvm then changes whatever differs in one &lt;code&gt;limactl edit&lt;/code&gt;, and runs none when nothing does, because each edit gives the VM new ssh host keys at its next boot. Lima can&amp;rsquo;t shrink a disk, so a start that asks for a smaller disk than the VM has fails before it changes anything (&lt;code&gt;disk_shrink&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;devvm leaves Lima&amp;rsquo;s &lt;code&gt;mountInotify&lt;/code&gt; off, so file watchers in the VM see only the changes made in the VM (&lt;a href="https://next.devvm.dev/docs/backends/lima/#file-watchers"&gt;file watchers&lt;/a&gt;). With it on, Lima&amp;rsquo;s hostagent watches the project folder on the host and, for each change there, changes the file&amp;rsquo;s times in the guest as root, which raises an inotify event for the guest&amp;rsquo;s watchers. The hostagent can&amp;rsquo;t tell the VM&amp;rsquo;s own writes from the host&amp;rsquo;s, so it does this to every file the VM writes too, and on macOS the guest then sees such a file as root&amp;rsquo;s for a moment. A command that writes a file and then changes its mode fails in that moment, and in a test on macOS, &lt;code&gt;git init&lt;/code&gt; in the project folder failed 13 times in 30 with it on and never with it off. Lima also passes on no deletions, and it marks the setting as experimental.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-shells-colors"&gt;A shell&amp;rsquo;s colors&lt;span class="hx:absolute hx:-mt-20" id="a-shells-colors"&gt;&lt;/span&gt;
&lt;a href="#a-shells-colors" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm opens a VM&amp;rsquo;s shell, and runs an agent&amp;rsquo;s login, with &lt;code&gt;limactl shell&lt;/code&gt;, which asks ssh to send your terminal&amp;rsquo;s &lt;code&gt;COLORTERM&lt;/code&gt;. That request never reaches the VM, because the session goes over the ssh connection that Lima shares between all of a VM&amp;rsquo;s sessions, which was opened without it (&lt;a href="https://github.com/lima-vm/lima/issues/2208" target="_blank" rel="noopener"&gt;lima-vm/lima#2208&lt;/a&gt;). Closing that connection would end every session and the VM&amp;rsquo;s SSH agent relay with it, so devvm sets &lt;code&gt;COLORTERM&lt;/code&gt; in the command it runs in the VM instead. It passes only &lt;code&gt;truecolor&lt;/code&gt; and &lt;code&gt;24bit&lt;/code&gt;, the two values that say a terminal shows 24-bit color, and it quotes them for the VM&amp;rsquo;s shell. Quoting alone would make any value safe, but devvm sends a VM only values it knows. It passes nothing for any other value or when &lt;code&gt;COLORTERM&lt;/code&gt; isn&amp;rsquo;t set, and then the shell starts as &lt;code&gt;limactl shell&lt;/code&gt; starts it by itself.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-stopped-vms-shell"&gt;A stopped VM&amp;rsquo;s shell&lt;span class="hx:absolute hx:-mt-20" id="a-stopped-vms-shell"&gt;&lt;/span&gt;
&lt;a href="#a-stopped-vms-shell" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every &lt;code&gt;limactl shell&lt;/code&gt; that devvm runs says &lt;code&gt;--start=false&lt;/code&gt;. In a terminal, &lt;code&gt;limactl shell&lt;/code&gt; of a stopped VM asks whether to start it, and the question&amp;rsquo;s default is yes, but that start skips every check of devvm&amp;rsquo;s own start. A VM on a confined tier would run unconfined, without its proxy, and any VM would mount whatever is at the project folder&amp;rsquo;s path, a folder that replaced it included, and Lima would make the folder again if it&amp;rsquo;s gone. So a VM that stops while devvm works with it, such as one whose guest shut itself down, makes devvm&amp;rsquo;s shell or command fail, and devvm&amp;rsquo;s next launch starts it with every check.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-commands-output"&gt;A command&amp;rsquo;s output&lt;span class="hx:absolute hx:-mt-20" id="a-commands-output"&gt;&lt;/span&gt;
&lt;a href="#a-commands-output" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm closes the output of each command that it runs in a VM, apart from a shell and an image build&amp;rsquo;s steps, a second after the command ends or its time limit runs out, because the ssh that &lt;code&gt;limactl shell&lt;/code&gt; runs can leave a process behind that holds the output open. So a VM can&amp;rsquo;t keep devvm waiting past a command&amp;rsquo;s time limit, and a command whose output was cut short that way fails.&lt;/p&gt;
&lt;h2 data-hextra-search-id="confinement"&gt;Confinement&lt;span class="hx:absolute hx:-mt-20" id="confinement"&gt;&lt;/span&gt;
&lt;a href="#confinement" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM on a confined tier, internet, allowlist or none, reaches nothing but its proxy on the host, which applies its tier&amp;rsquo;s rules, and even root in the VM can&amp;rsquo;t get around that. Direct connections, DNS, UDP and connections to the host&amp;rsquo;s own services fail at once, while forwarded ports, mounts and ssh keep working. &lt;a href="https://next.devvm.dev/docs/internals/processes/"&gt;Processes&lt;/a&gt; has what the hostagent and the QEMU wrapper hold, write and wait for (&lt;a href="https://next.devvm.dev/docs/internals/processes/#limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/processes/#the-qemu-wrapper-and-its-keeper"&gt;the QEMU wrapper&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;On each host, the VM&amp;rsquo;s traffic passes through one process that devvm confines:&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 465px; --devvm-diagram-width: 562px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 562 465" width="562" height="465" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="d67d260dfe3038c13--title" aria-describedby="d67d260dfe3038c13--desc"&gt;&lt;title id="d67d260dfe3038c13--title"&gt;The process that confines a VM's traffic&lt;/title&gt;&lt;desc id="d67d260dfe3038c13--desc"&gt;On Linux, the VM's traffic goes through QEMU, with restrict=on, which reaches only its proxy at 192.168.5.4:3128. On macOS, it goes through its Lima hostagent, which is sandboxed, so it reaches only its ssh port, its proxy, its Lima sockets and its SSH agent, and everything else is denied.&lt;/desc&gt;&lt;g class="pele-clusters"&gt;&lt;g class="pele-cluster" data-id="mac"&gt;&lt;rect x="310.32" y="8" width="165.09" height="245" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="346.59" y="31.4" text-anchor="middle"&gt;macOS&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-cluster" data-id="linux"&gt;&lt;rect x="8" y="26" width="174" height="227" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="44.27" y="49.4" text-anchor="middle"&gt;Linux&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_vm2_q_0"&gt;&lt;path d="M95,108L95,146"/&gt;&lt;path class="pele-marker" d="M95,153L91.64,145L98.36,145Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_q_proxy_0"&gt;&lt;path d="M95,213L95,354"/&gt;&lt;path class="pele-marker" d="M95,361L91.64,353L98.36,353Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_vm1_ha_0"&gt;&lt;path d="M392.86,90L392.86,128"/&gt;&lt;path class="pele-marker" d="M392.86,135L389.5,127L396.22,127Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_ha_ok_0"&gt;&lt;path d="M384.86,213L384.86,331Q384.86,343 372.86,343L302.7,343Q294.45,343 294.45,351.25L294.45,354"/&gt;&lt;path class="pele-marker" d="M294.45,361L291.09,353L297.81,353Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_ha_no_0"&gt;&lt;path d="M400.86,213L400.86,259Q400.86,271 412.86,271L479.27,271Q491.27,271 491.27,283L491.27,354" stroke-dasharray="3 4"/&gt;&lt;path class="pele-marker" d="M491.27,361L487.91,353L494.63,353Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_q_proxy_0"&gt;&lt;rect x="19.73" y="291" width="150.55" height="32" rx="3" fill="var(--_bg)"/&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="95" y="303.2"&gt;only to&lt;/tspan&gt;&lt;tspan x="95" y="319.2"&gt;192.168.5.4:3128&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_ha_ok_0"&gt;&lt;rect x="349.68" y="298" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="384.86" y="311.2" text-anchor="middle"&gt;allowed&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_ha_no_0"&gt;&lt;rect x="460.55" y="298" width="61.45" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="491.27" y="311.2" text-anchor="middle"&gt;denied&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="vm2" transform="translate(95,85.5)"&gt;&lt;rect x="-44.73" y="-22.5" width="89.45" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the VM&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="q" transform="translate(95,183)"&gt;&lt;rect x="-67" y="-30" width="134" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;QEMU,&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;restrict=on&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="proxy" transform="translate(95,383.5)"&gt;&lt;rect x="-58.09" y="-22.5" width="116.18" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;its proxy&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="vm1" transform="translate(392.86,67.5)"&gt;&lt;rect x="-44.73" y="-22.5" width="89.45" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the VM&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="ha" transform="translate(392.86,174)"&gt;&lt;rect x="-62.55" y="-39" width="125.09" height="78" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-13.1"&gt;its Lima&lt;/tspan&gt;&lt;tspan x="0" y="4.9"&gt;hostagent,&lt;/tspan&gt;&lt;tspan x="0" y="22.9"&gt;sandboxed&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="ok" transform="translate(294.45,409)"&gt;&lt;rect x="-89.27" y="-48" width="178.55" height="96" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-22.1"&gt;its ssh port&lt;/tspan&gt;&lt;tspan x="0" y="-4.1"&gt;its proxy&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;its Lima sockets&lt;/tspan&gt;&lt;tspan x="0" y="31.9"&gt;its SSH agent&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="no" transform="translate(491.27,391)"&gt;&lt;rect x="-62.55" y="-30" width="125.09" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;everything&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;else&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;On macOS, devvm starts the VM&amp;rsquo;s Lima process, its hostagent, under a macOS sandbox. That&amp;rsquo;s &lt;code&gt;sandbox-exec&lt;/code&gt; with a Seatbelt profile, &lt;code&gt;sandbox.sb&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The profile lets the process connect to the VM&amp;rsquo;s ssh port and its proxy on the host&amp;rsquo;s loopback, to the unix sockets in the VM&amp;rsquo;s Lima folder (ssh&amp;rsquo;s control socket and the VM&amp;rsquo;s network), and to the socket of the ssh agent the VM forwards, which is its proxy&amp;rsquo;s relay of your agent or devvm&amp;rsquo;s own (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;). It connects nowhere else, so other sockets on the host, such as Docker&amp;rsquo;s, stay out of the hostagent&amp;rsquo;s reach. The profile limits only the network, so a compromised hostagent can still write your files, and through them run code as you.&lt;/li&gt;
&lt;li&gt;The profile lets the process listen only on the VM&amp;rsquo;s ssh port, over TCP, and on unix sockets in the VM&amp;rsquo;s Lima folder, so it can&amp;rsquo;t open a port of the VM&amp;rsquo;s on the host even if Lima ignored its rules (&lt;a href="#ports"&gt;ports&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Names resolve in the proxy, so Lima&amp;rsquo;s own DNS server for the VM is off, and the guest&amp;rsquo;s DNS points at &lt;code&gt;127.0.0.1&lt;/code&gt;, which only &lt;a href="https://next.devvm.dev/docs/internals/network/#tools-that-skip-the-proxy"&gt;transparent mode&lt;/a&gt; answers, inside the VM, with no upstream. Without it, nothing listens there, and a lookup through the system&amp;rsquo;s resolver, such as the ones &lt;code&gt;getent&lt;/code&gt; and curl make, asks &lt;code&gt;127.0.0.1&lt;/code&gt; itself (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-resolver"&gt;the VM&amp;rsquo;s resolver&lt;/a&gt;) and fails at once on macOS and on a Linux host alike. The guest reaches the proxy at &lt;code&gt;192.168.5.2&lt;/code&gt;, which is the host as Lima&amp;rsquo;s network sees it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On Linux, Lima starts every VM&amp;rsquo;s QEMU through a wrapper that devvm writes (&lt;code&gt;~/.local/share/devvm/run/qemu/&lt;/code&gt;) and that runs devvm. It runs QEMU in a namespace that makes &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s hooks and config read-only, for a VM whose &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-linux-hosts"&gt;.git protection&lt;/a&gt; is on. For a confined VM, the wrapper adds QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt; to Lima&amp;rsquo;s network, so no traffic goes in or out but Lima&amp;rsquo;s own forwards. It also adds one address, &lt;code&gt;192.168.5.4:3128&lt;/code&gt;, which QEMU connects to the VM&amp;rsquo;s proxy through a process for each connection, at most 256 at once (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-qemu-wrapper-and-its-keeper"&gt;the QEMU wrapper&lt;/a&gt;). If Lima&amp;rsquo;s QEMU arguments aren&amp;rsquo;t the shape devvm expects, with one &lt;code&gt;-netdev user,id=net0,…&lt;/code&gt; and no other network, the wrapper refuses to start QEMU (&lt;code&gt;qemu_refused&lt;/code&gt;), so QEMU never runs unrestricted. DNS points at &lt;code&gt;127.0.0.1&lt;/code&gt; in the guest, which only transparent mode answers, and without it lookups fail at once.&lt;/p&gt;
&lt;p&gt;An open VM isn&amp;rsquo;t confined: on macOS its hostagent runs without a profile, and on Linux the wrapper runs QEMU with Lima&amp;rsquo;s network as Lima gives it, without &lt;code&gt;restrict=on&lt;/code&gt; and without the &lt;code&gt;guestfwd&lt;/code&gt;, as it does for a build with the internet. Its guest reaches its proxy at &lt;code&gt;192.168.5.2&lt;/code&gt; and the proxy&amp;rsquo;s own port on both hosts, because Lima&amp;rsquo;s user-mode network, vz&amp;rsquo;s and QEMU&amp;rsquo;s alike, reaches the host&amp;rsquo;s loopback at that address. Its &lt;code&gt;NO_PROXY&lt;/code&gt; adds &lt;code&gt;host.lima.internal&lt;/code&gt; and &lt;code&gt;192.168.5.2&lt;/code&gt;, which the proxy on the host couldn&amp;rsquo;t resolve as the VM does, Lima&amp;rsquo;s DNS stays on, so names resolve in the VM, and &lt;code&gt;propagateProxyEnv&lt;/code&gt; is off, so the guest gets no proxy settings of the host&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;A process can&amp;rsquo;t leave its sandbox, so devvm records the hostagent it started (&lt;code&gt;started&lt;/code&gt; in the VM&amp;rsquo;s run folder) and checks that the VM still runs on it (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt;). A VM started another way, such as with &lt;code&gt;limactl start&lt;/code&gt;, runs unconfined, and &lt;code&gt;devvm ls&lt;/code&gt; shows it as &lt;code&gt;unenforced&lt;/code&gt;. The VM&amp;rsquo;s proxy follows the hostagent&amp;rsquo;s pid file (&lt;code&gt;ha.pid&lt;/code&gt; in the VM&amp;rsquo;s Lima folder) and exits with it. devvm writes the record only once &lt;code&gt;limactl start&lt;/code&gt; returns, while the hostagent runs on its own from early in the start, so an interrupt during the start stops the VM (&lt;a href="https://next.devvm.dev/docs/internals/network/#how-long-a-proxy-runs"&gt;how long a proxy runs&lt;/a&gt;). Interrupted before the hostagent answers, the VM is one Lima reports as &lt;code&gt;Broken&lt;/code&gt;, which &lt;code&gt;limactl stop&lt;/code&gt; refuses, so devvm stops a broken VM with &lt;code&gt;limactl stop --force&lt;/code&gt;. A hostagent that runs without its driver yet is still starting QEMU, which writes its pid file only once it runs, and that can take seconds on a slow host, such as one with nested virtualization. Stopped with &lt;code&gt;--force&lt;/code&gt; then, the hostagent would go and the QEMU it started would run on without it, so devvm waits up to 30 seconds for the driver first and then stops the VM as Lima reports it. A VM whose QEMU still runs without its hostagent holds its disk, so no new QEMU can start on it, and a start stops such a VM with &lt;code&gt;--force&lt;/code&gt; first.&lt;/p&gt;
&lt;p&gt;Builds are also confined, because they run code devvm didn&amp;rsquo;t write. On macOS a build&amp;rsquo;s Lima process runs under a profile that reaches either the internet but not the host&amp;rsquo;s loopback, where other VMs&amp;rsquo; proxies and dev servers listen, or nothing at all. Behind a company proxy, a build with the internet also reaches one port of the host&amp;rsquo;s loopback, its own proxy&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/contributing/design/#a-company-proxy"&gt;a company proxy&lt;/a&gt;). On Linux only a build with no network is confined. QEMU can&amp;rsquo;t keep the internet while dropping the host&amp;rsquo;s loopback, so other builds reach services on the host&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;. Builds forward no ports. A build with the internet reaches your LAN on both hosts, this machine&amp;rsquo;s own address on it included, because the macOS profile keeps only the loopback from it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sandbox-exec&lt;/code&gt; is deprecated. If macOS drops it, devvm needs another way to confine the hostagent, and until then the self-check catches a VM that runs unconfined.&lt;/p&gt;
&lt;h2 data-hextra-search-id="ports"&gt;Ports&lt;span class="hx:absolute hx:-mt-20" id="ports"&gt;&lt;/span&gt;
&lt;a href="#ports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s forwarder forwards a Lima VM&amp;rsquo;s ports by the rules that &lt;a href="https://next.devvm.dev/docs/internals/ports/"&gt;Port forwarding&lt;/a&gt; sets out. On Lima this is an emulation, and it&amp;rsquo;s reviewed (&lt;a href="https://next.devvm.dev/docs/contributing/design/#ports-on-lima"&gt;design&lt;/a&gt;). devvm doesn&amp;rsquo;t use Lima&amp;rsquo;s own forwards because they listen with &lt;code&gt;SO_REUSEADDR&lt;/code&gt;, and on macOS such a forward takes &lt;code&gt;127.0.0.1:PORT&lt;/code&gt; while a program on the host has &lt;code&gt;*:PORT&lt;/code&gt;, along with that program&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; connections.&lt;/p&gt;
&lt;p&gt;So Lima forwards nothing. Each VM&amp;rsquo;s &lt;code&gt;portForwards&lt;/code&gt; are rules that ignore every guest port, TCP and UDP, on &lt;code&gt;127.0.0.1&lt;/code&gt; (which also covers &lt;code&gt;::1&lt;/code&gt;), &lt;code&gt;0.0.0.0&lt;/code&gt; and &lt;code&gt;::&lt;/code&gt;. Lima&amp;rsquo;s own ssh is its VM driver&amp;rsquo;s forward, not a rule, so it keeps working. devvm sets the rules when it makes the VM, and a start sets them again only where they differ, because any change gives the VM new ssh host keys at its next boot. On macOS, a confined VM doesn&amp;rsquo;t rely on the rules alone, because its sandbox refuses the Lima process every port but its ssh port (&lt;a href="#confinement"&gt;confinement&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Which ports a VM forwards is in the VM&amp;rsquo;s state, which devvm&amp;rsquo;s forwarder reads, so &lt;code&gt;devvm ports&lt;/code&gt; changes the state and never the VM&amp;rsquo;s Lima config, and the backend never hears of them. &lt;a href="https://next.devvm.dev/docs/internals/ports/#its-process-and-files"&gt;Its process and files&lt;/a&gt; lists the forwarder&amp;rsquo;s files and its log.&lt;/p&gt;
&lt;p&gt;The forwarder isn&amp;rsquo;t Lima&amp;rsquo;s, and it runs only for project VMs. What Lima gives it is how to reach a running VM: Lima&amp;rsquo;s ssh port on this machine&amp;rsquo;s loopback, Lima&amp;rsquo;s user, and Lima&amp;rsquo;s key (&lt;code&gt;_config/user&lt;/code&gt; in devvm&amp;rsquo;s Lima home), which every VM there authorizes. The forwarder connects there with the host keys devvm pinned for the VM&amp;rsquo;s current start, which the VM&amp;rsquo;s ssh config checks too. Its lifeline is the VM&amp;rsquo;s hostagent&amp;rsquo;s pid file (&lt;code&gt;ha.pid&lt;/code&gt;), so it ends when the hostagent does, and &lt;code&gt;devvm rm&lt;/code&gt; deletes its files.&lt;/p&gt;</description></item><item><title>Working on a clone</title><link>https://next.devvm.dev/docs/using/clone/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/clone/</guid><description>
&lt;p&gt;&lt;code&gt;devvm --clone&lt;/code&gt; gives the VM its own clone of the repo instead of mounting your folder, so nothing in the VM can touch your working tree or &lt;code&gt;.git&lt;/code&gt;. Use it when you don&amp;rsquo;t trust what runs in the VM, such as an agent working unattended, and on Linux hosts that can&amp;rsquo;t lock &lt;code&gt;.git&lt;/code&gt;, such as Ubuntu 23.10 and newer, where devvm only names what changed after the fact (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#when-linux-cant-lock"&gt;when Linux can&amp;rsquo;t lock&lt;/a&gt;). On Linux hosts it&amp;rsquo;s also the way to use SQLite in WAL mode, or a program that maps its files for writing, such as LMDB or the mold linker, in the repo, because those fail in the 9p share that VMs there mount the folder with, while the clone is on the VM&amp;rsquo;s own disk, which is also far faster (&lt;a href="https://next.devvm.dev/docs/backends/lima/#programs-that-map-files-for-writing"&gt;programs that map files&lt;/a&gt;). &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#files-the-vm-writes"&gt;Files the VM writes&lt;/a&gt; lists what &lt;code&gt;--clone&lt;/code&gt; keeps away from this machine.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --clone &lt;span class="c1"&gt;# create the VM, copy your repo into it and open a shell in its clone&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone fetch &lt;span class="c1"&gt;# later, on this machine, fetch the VM&amp;#39;s work as devvm/&amp;lt;branch&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git log -p main..devvm/main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 437px; --devvm-diagram-width: 393px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-sequence" viewBox="0 0 393 437" width="393" height="437" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="sequence" aria-labelledby="d6df95569119c229f--title" aria-describedby="d6df95569119c229f--desc"&gt;&lt;title id="d6df95569119c229f--title"&gt;A clone's life&lt;/title&gt;&lt;desc id="d6df95569119c229f--desc"&gt;devvm --clone copies your repo into the VM, where you or an agent commit. devvm clone fetch brings the VM's commits into your repo as a devvm/ branch, for you to review and merge. devvm rm looks for commits not fetched and fetches them into a saved/devvm/ branch, then deletes the VM and removes its remote.&lt;/desc&gt;&lt;g transform="translate(64.09,8)"&gt;&lt;g class="pele-lifelines" fill="none" stroke="var(--_b)"&gt;&lt;path class="pele-lifeline" data-id="R" d="M0,41V421"/&gt;&lt;path class="pele-lifeline" data-id="V" d="M238.91,41V421"/&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge pele-message" data-id="i0"&gt;&lt;path d="M0,95H231.91"/&gt;&lt;path class="pele-marker" d="M238.91,95L230.91,98.36L230.91,91.64Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i2"&gt;&lt;path d="M238.91,197H7"/&gt;&lt;path class="pele-marker" d="M0,197L8,193.64L8,200.36Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i4"&gt;&lt;path d="M0,299H231.91"/&gt;&lt;path class="pele-marker" d="M238.91,299L230.91,302.36L230.91,295.64Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge pele-message" data-id="i5"&gt;&lt;path d="M238.91,347H7"/&gt;&lt;path class="pele-marker" d="M0,347L8,343.64L8,350.36Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="i0"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="119.45" y="71.2"&gt;devvm --clone copies&lt;/tspan&gt;&lt;tspan x="119.45" y="87.2"&gt;your repo&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i2"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="119.45" y="173.2"&gt;devvm clone fetch gives&lt;/tspan&gt;&lt;tspan x="119.45" y="189.2"&gt;devvm/&amp;lt;branch&amp;gt;&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i4"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="119.45" y="275.2"&gt;devvm rm looks for&lt;/tspan&gt;&lt;tspan x="119.45" y="291.2"&gt;commits not fetched&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="i5"&gt;&lt;text text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="119.45" y="323.2"&gt;fetched into&lt;/tspan&gt;&lt;tspan x="119.45" y="339.2"&gt;saved/devvm/&amp;lt;branch&amp;gt;&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-notes" font-size="14" fill="var(--_a)" stroke="var(--_b)"&gt;&lt;g class="pele-note" data-id="i1"&gt;&lt;rect x="157.64" y="105" width="162.55" height="44" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" stroke="none" fill="var(--_fg)" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="238.91" y="123.2"&gt;you or an agent&lt;/tspan&gt;&lt;tspan x="238.91" y="139.2"&gt;commit in the VM&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-note" data-id="i3"&gt;&lt;rect x="-54.55" y="207" width="109.09" height="44" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" stroke="none" fill="var(--_fg)" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="225.2"&gt;review,&lt;/tspan&gt;&lt;tspan x="0" y="241.2"&gt;then merge&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-note" data-id="i6"&gt;&lt;rect x="-16" y="357" width="270.91" height="44" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" stroke="none" fill="var(--_fg)" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="119.45" y="375.2"&gt;the VM is deleted,&lt;/tspan&gt;&lt;tspan x="119.45" y="391.2"&gt;and its remote removed&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-actor pele-actor-participant" data-id="R"&gt;&lt;rect x="-56.09" y="0" width="112.18" height="41" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="25.4" text-anchor="middle"&gt;Your repo&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-actor pele-actor-participant" data-id="V"&gt;&lt;rect x="160.55" y="0" width="156.73" height="41" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="238.91" y="25.4" text-anchor="middle"&gt;The VM's clone&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;When the folder holds several repos, such as a &lt;code&gt;frontend&lt;/code&gt; and a &lt;code&gt;backend&lt;/code&gt; beside each other, &lt;code&gt;devvm --clone&lt;/code&gt; gives the VM a clone of each repo you choose, at the same paths as on this machine (&lt;a href="#folders-of-repos"&gt;folders of repos&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="requirements"&gt;Requirements&lt;span class="hx:absolute hx:-mt-20" id="requirements"&gt;&lt;/span&gt;
&lt;a href="#requirements" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;The folder is the top folder of a git repo that has at least one commit, or it&amp;rsquo;s a folder of repos (&lt;a href="#folders-of-repos"&gt;folders of repos&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;The repo is the folder&amp;rsquo;s own, or the folder is a worktree that &lt;code&gt;git worktree add&lt;/code&gt; made. devvm refuses a &lt;code&gt;.git&lt;/code&gt; that points into another repo, because the copy would take that repo&amp;rsquo;s branches into the VM. That includes a &lt;code&gt;.git&lt;/code&gt; file that isn&amp;rsquo;t a worktree&amp;rsquo;s, such as a submodule&amp;rsquo;s, which &lt;code&gt;devvm --clone&lt;/code&gt; in its parent repo&amp;rsquo;s folder copies (&lt;a href="#submodules"&gt;submodules&lt;/a&gt;), a worktree whose link back to this folder doesn&amp;rsquo;t match, a &lt;code&gt;commondir&lt;/code&gt; that leads to another repo, and objects or refs that are symlinks, or that sit in a folder that is one. devvm also refuses a repo that borrows objects from another repo through &lt;code&gt;objects/info/alternates&lt;/code&gt;. To use such a repo, run &lt;code&gt;git repack -a -d&lt;/code&gt; in it, then delete that file.&lt;/li&gt;
&lt;li&gt;The repo has no &lt;code&gt;info/grafts&lt;/code&gt; file, which gives some commits other parents than their own, because devvm copies each commit with its own parents. &lt;code&gt;git replace --convert-graft-file&lt;/code&gt; turns the file into replace refs, which git supports in its place. devvm copies each commit&amp;rsquo;s real parents even then, so the history the grafts cut off has to be in the repo on this machine.&lt;/li&gt;
&lt;li&gt;git is installed on this machine. The VM&amp;rsquo;s images already have it. A repo that names its objects with SHA-256 also needs git 2.29 or newer in the VM, which devvm&amp;rsquo;s images have. An image you made with &lt;code&gt;--from&lt;/code&gt; might not, and then devvm stops before it copies anything and names the VM&amp;rsquo;s git version.&lt;/li&gt;
&lt;li&gt;No other VM mounts the folder, such as the VM of a folder it&amp;rsquo;s in. Code in that VM could swap the repo under the git commands devvm runs here as it copies your branches, so devvm refuses &lt;code&gt;--clone&lt;/code&gt; and &lt;code&gt;devvm clone on&lt;/code&gt; there and names that VM. Delete that VM, or move the repo out of its folder.&lt;/li&gt;
&lt;li&gt;You choose &lt;code&gt;--clone&lt;/code&gt; when the VM is created, and once a VM is a &lt;code&gt;--clone&lt;/code&gt; VM you don&amp;rsquo;t need to pass &lt;code&gt;--clone&lt;/code&gt; again. devvm refuses &lt;code&gt;--clone&lt;/code&gt; for an existing VM that mounts its folder, and &lt;code&gt;devvm clone on&lt;/code&gt; switches that VM instead (&lt;a href="#switching-a-vm-that-exists"&gt;switching a VM that exists&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="whats-copied"&gt;What&amp;rsquo;s copied&lt;span class="hx:absolute hx:-mt-20" id="whats-copied"&gt;&lt;/span&gt;
&lt;a href="#whats-copied" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;From this machine, the VM mounts only the shared tools and its &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;agents&amp;rsquo; config folders&lt;/a&gt;. Once the VM is running, devvm creates a repo in it at the same path as your folder and copies your repo into it, so &lt;code&gt;git status&lt;/code&gt;, &lt;code&gt;git log&lt;/code&gt; and &lt;code&gt;git stash list&lt;/code&gt; in the VM&amp;rsquo;s clone show what they show here. What goes into the VM:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Every local branch,&lt;/strong&gt; your &lt;code&gt;saved/devvm/*&lt;/code&gt; branches included, which hold a deleted VM&amp;rsquo;s work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every tag,&lt;/strong&gt; an annotated one staying annotated, and your notes and replace refs. Refs are the repo&amp;rsquo;s data, so what a tool keeps in them goes too, such as an agent tool that stores its transcripts in git notes or branches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The remote-tracking branches of your remotes,&lt;/strong&gt; such as &lt;code&gt;origin/main&lt;/code&gt;, with &lt;code&gt;origin/HEAD&lt;/code&gt; still pointing at its branch. That includes the branches of another private repo that you fetched as a remote.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What you have checked out,&lt;/strong&gt; your current branch or, when HEAD is detached, the same commit, detached, and your shell opens there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your uncommitted changes.&lt;/strong&gt; What you&amp;rsquo;ve staged is staged in the VM, and what you haven&amp;rsquo;t is changed in its working tree, deleted files and files added with &lt;code&gt;git add -N&lt;/code&gt; included. Each working copy goes as it is, but only a regular file or a symbolic link, where git tracks one of those.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A rebase, a merge, a cherry-pick, a revert or a bisect&lt;/strong&gt; that you&amp;rsquo;re in the middle of (&lt;a href="#an-operation-in-progress"&gt;an operation in progress&lt;/a&gt;), and your repo&amp;rsquo;s &lt;code&gt;info/exclude&lt;/code&gt;, &lt;code&gt;info/sparse-checkout&lt;/code&gt; and &lt;code&gt;info/attributes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your stash,&lt;/strong&gt; each entry with its message and the commits it was made on, at most your 1,000 newest, and devvm names the rest. An entry made with &lt;code&gt;git stash -u&lt;/code&gt; holds untracked files, so those files reach the VM inside it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your repo&amp;rsquo;s own settings,&lt;/strong&gt; such as its remotes, its hooks as they are and your &lt;code&gt;user.name&lt;/code&gt; (&lt;a href="#the-settings"&gt;the settings&lt;/a&gt;), each &lt;a href="#submodules"&gt;submodule&lt;/a&gt; you&amp;rsquo;ve initialised, and the content of your &lt;a href="#git-lfs"&gt;Git LFS&lt;/a&gt; files.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What stays on this machine:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Untracked and ignored files,&lt;/strong&gt; such as &lt;code&gt;.env&lt;/code&gt; and &lt;code&gt;node_modules&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anything that isn&amp;rsquo;t a tracked file of its kind any more.&lt;/strong&gt; A tracked file that you turned into a folder is missing in the VM, nothing in that folder goes, and devvm names it. A file whose folder is a symbolic link here goes as deleted, as git sees it, never as the file the link leads to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An embedded repo&amp;rsquo;s contents,&lt;/strong&gt; and an uninitialised submodule&amp;rsquo;s. Its folder is empty in the VM, without its &lt;code&gt;.git&lt;/code&gt;, its own changes or its untracked files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The change you haven&amp;rsquo;t committed to a filtered file,&lt;/strong&gt; one that goes through a git filter, such as git-crypt&amp;rsquo;s or Git LFS&amp;rsquo;s. The file goes as git stores it, because devvm&amp;rsquo;s git runs no filter, though &lt;code&gt;git-lfs&lt;/code&gt; in the VM then checks a Git LFS file out with its content (&lt;a href="#git-lfs"&gt;Git LFS&lt;/a&gt;), and devvm names it as one that may differ, because without the filter devvm can&amp;rsquo;t tell whether it changed. Such a file that you deleted is deleted in the VM too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your edits to a file marked with &lt;code&gt;git update-index --skip-worktree&lt;/code&gt;,&lt;/strong&gt; which git hides and which are often local settings or secrets. The file goes as git&amp;rsquo;s index has it, and devvm names it. A file marked &lt;code&gt;--assume-unchanged&lt;/code&gt; also goes as the index has it, and a sparse checkout&amp;rsquo;s files outside it stay out of the VM, as they&amp;rsquo;re out of your working tree.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A stash entry made with &lt;code&gt;git stash --all&lt;/code&gt;,&lt;/strong&gt; which may hold ignored files, such as &lt;code&gt;.env&lt;/code&gt;. devvm can&amp;rsquo;t tell such an entry from a &lt;code&gt;-u&lt;/code&gt; one for sure, so it keeps back any entry that may be one, such as one whose untracked files your &lt;code&gt;.gitignore&lt;/code&gt; ignores, now or when you made it, and it names each one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another devvm VM&amp;rsquo;s work,&lt;/strong&gt; the remote-tracking branches of its remote, such as an older &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s &lt;code&gt;devvm/*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Refs outside those namespaces,&lt;/strong&gt; such as &lt;code&gt;refs/original/&lt;/code&gt;, where &lt;code&gt;git filter-branch&lt;/code&gt; keeps what it rewrote. So does &lt;code&gt;ORIG_HEAD&lt;/code&gt;, with any commit that only it still reaches, such as one a reset took back, except during &lt;code&gt;git am&lt;/code&gt;, whose &lt;code&gt;--abort&lt;/code&gt; needs it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your global git config,&lt;/strong&gt; and every setting of your repo that &lt;a href="#the-settings"&gt;the settings&lt;/a&gt; doesn&amp;rsquo;t list, such as &lt;code&gt;credential.helper&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm copies all this without &lt;code&gt;git push&lt;/code&gt;, over the same channel that carries every other command devvm runs in the VM, so the copy goes to that VM alone, and no setting in your repo&amp;rsquo;s config, such as a &lt;code&gt;url.*.insteadOf&lt;/code&gt; that rewrites the VM&amp;rsquo;s URL, can send it anywhere else. It also takes a shallow clone, which gets its shallow history in the VM, and a repo that names its objects with SHA-256, which gets a SHA-256 repo there (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-copy-into-a-clone-vm"&gt;how the copy works&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-working-tree-in-the-copy"&gt;the working tree&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-state-in-the-copy"&gt;the state&lt;/a&gt;). A partial clone, which &lt;code&gt;git clone --filter&lt;/code&gt; makes, gets the objects it has, and the VM&amp;rsquo;s git fetches the rest from its remote when a command needs one, where the VM&amp;rsquo;s network policy and credentials let it (&lt;a href="#a-partial-clone"&gt;a partial clone&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-git-worktree"&gt;A git worktree&lt;span class="hx:absolute hx:-mt-20" id="a-git-worktree"&gt;&lt;/span&gt;
&lt;a href="#a-git-worktree" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When the folder is a git worktree, devvm copies what&amp;rsquo;s published and the worktree&amp;rsquo;s own work: its branch, that branch&amp;rsquo;s upstream, if it has one, the repo&amp;rsquo;s default branch, the remote-tracking branches and the tags. It leaves the repo&amp;rsquo;s other local branches on this machine, because they&amp;rsquo;re other worktrees&amp;rsquo; work, and it says so. The default branch is the branch &lt;code&gt;origin/HEAD&lt;/code&gt; points to, else &lt;code&gt;main&lt;/code&gt;, else &lt;code&gt;master&lt;/code&gt;, whichever the repo has, so you can rebase onto it or diff against it in the VM. The worktree&amp;rsquo;s VM gets no stash, because the stash is the whole repo&amp;rsquo;s, not the worktree&amp;rsquo;s, and none of the submodules (&lt;a href="#submodules"&gt;submodules&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="an-operation-in-progress"&gt;An operation in progress&lt;span class="hx:absolute hx:-mt-20" id="an-operation-in-progress"&gt;&lt;/span&gt;
&lt;a href="#an-operation-in-progress" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When you&amp;rsquo;re in the middle of a rebase, a merge, a cherry-pick, a revert or a bisect, the VM&amp;rsquo;s clone is in the middle of it too, so you or an agent can go on with it there. Resolve a conflict, then go on as you would here:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git rebase --continue &lt;span class="c1"&gt;# in the VM&amp;#39;s clone, for a rebase&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git commit &lt;span class="c1"&gt;# for a merge&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git cherry-pick --continue &lt;span class="c1"&gt;# for a cherry-pick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A rebase started with &lt;code&gt;--autostash&lt;/code&gt; brings its autostashed changes back in the VM. When the rest of a rebase or a cherry-pick names a commit that the VM won&amp;rsquo;t have, devvm names it, as that step will fail there (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-state-in-the-copy"&gt;the state in the copy&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-settings"&gt;The settings&lt;span class="hx:absolute hx:-mt-20" id="the-settings"&gt;&lt;/span&gt;
&lt;a href="#the-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Your repo&amp;rsquo;s own settings go too, from its &lt;code&gt;.git/config&lt;/code&gt; and, when git keeps settings for each worktree, as &lt;code&gt;git sparse-checkout&lt;/code&gt; does, from the worktree&amp;rsquo;s &lt;code&gt;config.worktree&lt;/code&gt;, never from your global config or a file they include (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-settings-in-the-copy"&gt;the settings in the copy&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Its remotes, so &lt;code&gt;git fetch origin&lt;/code&gt; and &lt;code&gt;git pull&lt;/code&gt; work in the VM wherever its network policy reaches the remote and it has the credentials the remote needs:
&lt;ul&gt;
&lt;li&gt;Each URL goes as git resolves it, after any &lt;code&gt;url.*.insteadOf&lt;/code&gt;, without the user name, password, query or fragment of an &lt;code&gt;http&lt;/code&gt; or &lt;code&gt;https&lt;/code&gt; URL, any of which can hold a token, and without the password of an &lt;code&gt;ssh&lt;/code&gt; URL, whose user name goes.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;file://&lt;/code&gt; URL or a path goes as it is, though it names a folder on this machine that the VM can&amp;rsquo;t reach.&lt;/li&gt;
&lt;li&gt;When git pushes somewhere else, because of a push URL or a &lt;code&gt;url.*.pushInsteadOf&lt;/code&gt;, the push URLs go too, cleaned the same way.&lt;/li&gt;
&lt;li&gt;A remote whose URL is of any other kind, such as &lt;code&gt;git://&lt;/code&gt; or &lt;code&gt;ext::&lt;/code&gt;, or a scp-like URL that may hold a token, stays on this machine, and devvm names it. A push URL of those kinds, or one that reaches a devvm VM, stays too, and when none of a remote&amp;rsquo;s push URLs goes, &lt;code&gt;git push&lt;/code&gt; in the VM pushes to the remote&amp;rsquo;s URL, and devvm says so.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The upstream of each branch the copy sends, the submodules&amp;rsquo; URLs, cleaned as a remote&amp;rsquo;s, and their &lt;code&gt;active&lt;/code&gt;, &lt;code&gt;branch&lt;/code&gt; and &lt;code&gt;update&lt;/code&gt; settings, but an &lt;code&gt;update&lt;/code&gt; that runs a command.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;core.sparseCheckout&lt;/code&gt;, &lt;code&gt;core.sparseCheckoutCone&lt;/code&gt; and &lt;code&gt;index.sparse&lt;/code&gt;, so a sparse checkout is one in the VM too.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;core.hooksPath&lt;/code&gt; when it&amp;rsquo;s a folder inside the repo, such as husky&amp;rsquo;s, as the setting alone. The hooks in that folder are files of your working tree, so the tracked ones reach the VM with the checkout, and the untracked ones, such as husky&amp;rsquo;s &lt;code&gt;_&lt;/code&gt; folder, stay here, as every untracked file does, until a tool in the VM makes them, such as &lt;code&gt;npm install&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The repo&amp;rsquo;s own &lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt;, so a commit in the VM has your name on it.&lt;/li&gt;
&lt;li&gt;Its hooks, as they are, the secrets in them included, so a hook that calls a tool only this machine has fails in the VM, as it would on a new machine. Only the files named as git&amp;rsquo;s hooks go, each a regular file of at most 1 MiB and 16 MiB in all, from the repo&amp;rsquo;s hooks folder, and only when git here runs them, which it doesn&amp;rsquo;t once a &lt;code&gt;core.hooksPath&lt;/code&gt; is set, in the repo or in your global config. A hook that&amp;rsquo;s a link, a folder or bigger stays and is named, and so do the hooks of a &lt;code&gt;core.hooksPath&lt;/code&gt; outside the repo. devvm also names a hooks folder that&amp;rsquo;s missing, a link or unreadable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every other setting stays on this machine, such as &lt;code&gt;credential.helper&lt;/code&gt;, &lt;code&gt;http.extraHeader&lt;/code&gt;, &lt;code&gt;core.sshCommand&lt;/code&gt;, aliases and filters. Your remotes&amp;rsquo; URLs are real, though, so when the VM may use your GitHub token, which its proxy puts into requests to &lt;code&gt;github.com&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/network/#secrets"&gt;secrets&lt;/a&gt;), and its network policy reaches GitHub, code in the VM can push to &lt;code&gt;origin&lt;/code&gt; there. To keep a VM from pushing to GitHub or changing anything through its API:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network deny github.com --path &lt;span class="s1"&gt;&amp;#39;/*/*/git-receive-pack&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;# no git push over HTTPS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network deny api.github.com --method POST,PUT,PATCH,DELETE &lt;span class="c1"&gt;# no changes through GitHub&amp;#39;s API&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="submodules"&gt;Submodules&lt;span class="hx:absolute hx:-mt-20" id="submodules"&gt;&lt;/span&gt;
&lt;a href="#submodules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each submodule you&amp;rsquo;ve initialised here, nested ones too, gets a clone of its own in the VM, at its path, copied as the repo is, at the commit you have checked out in it, so &lt;code&gt;git submodule status&lt;/code&gt; in the VM shows what it shows here:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git submodule status --recursive &lt;span class="c1"&gt;# in the VM&amp;#39;s clone, as on this machine&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Its repo here gets a &lt;code&gt;devvm&lt;/code&gt; remote for the VM, chosen as the repo&amp;rsquo;s is, so &lt;code&gt;devvm clone fetch&lt;/code&gt; fetches each submodule&amp;rsquo;s branches into it, and &lt;code&gt;devvm rm&lt;/code&gt; checks each one for work you haven&amp;rsquo;t fetched (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#submodules-in-the-copy"&gt;how the copy works&lt;/a&gt;). The rest:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One you remove or deinitialise here later:&lt;/strong&gt; devvm remembers each submodule it copied, so &lt;code&gt;devvm rm&lt;/code&gt; names it as one it can&amp;rsquo;t check, and asks before the VM goes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One you haven&amp;rsquo;t initialised,&lt;/strong&gt; with &lt;code&gt;git submodule update --init&lt;/code&gt;, stays an empty folder in the VM, as it is here, and so does one you initialise after the copy, or in a VM made before devvm copied submodules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One that devvm can&amp;rsquo;t copy,&lt;/strong&gt; such as one whose &lt;code&gt;.git&lt;/code&gt; doesn&amp;rsquo;t lead to its own git folder inside the repo&amp;rsquo;s, stays on this machine, with its own submodules, and devvm names it, while the rest of the copy goes on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A git worktree&amp;rsquo;s VM&lt;/strong&gt; gets none of its submodules, which devvm names.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="git-lfs"&gt;Git LFS&lt;span class="hx:absolute hx:-mt-20" id="git-lfs"&gt;&lt;/span&gt;
&lt;a href="#git-lfs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Every VM has &lt;code&gt;git-lfs&lt;/code&gt;, and the copy sets up its filter in each clone it makes, so a repo that uses Git LFS works in its clone as it does here. A VM that mounts its folder gets no filter, so its LFS files are the pointers git stores. &lt;code&gt;devvm clone fetch&lt;/code&gt; brings back the LFS objects of the VM&amp;rsquo;s work too:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git lfs ls-files &lt;span class="c1"&gt;# in the VM&amp;#39;s clone: the files, with their content&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone fetch &lt;span class="c1"&gt;# on this machine: the VM&amp;#39;s branches and their LFS objects&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Into the VM,&lt;/strong&gt; the copy sends the LFS objects that the files you have checked out point to, when your repo has them, and &lt;code&gt;git-lfs&lt;/code&gt; in the VM checks those files out with their content. One that isn&amp;rsquo;t what its pointer names stays on this machine, and devvm names it, and when your repo keeps its objects outside &lt;code&gt;.git&lt;/code&gt;, with &lt;code&gt;lfs.storage&lt;/code&gt;, none go and devvm says so. A file whose object your repo hasn&amp;rsquo;t fetched stays a pointer in the VM, as &lt;code&gt;git lfs pull&lt;/code&gt; would fetch it, where the VM&amp;rsquo;s network policy and credentials let it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Back from the VM,&lt;/strong&gt; when &lt;code&gt;devvm clone fetch&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm clone off&lt;/code&gt; brings the VM&amp;rsquo;s work back, devvm also brings the LFS objects that the work&amp;rsquo;s pointers name and your repo lacks, each checked against its pointer before it goes into your repo, without &lt;code&gt;git-lfs&lt;/code&gt; running on this machine. A plain &lt;code&gt;git fetch devvm&lt;/code&gt; brings none, but &lt;code&gt;devvm clone fetch&lt;/code&gt; later brings those of the commits it fetched too, even once you&amp;rsquo;ve merged them. When the objects come to more than 2 GiB, devvm asks first, and without a terminal it refuses. One that the VM&amp;rsquo;s clone lacks, or that isn&amp;rsquo;t what its pointer names, stays out, and devvm names it. Before the VM goes, &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; name the LFS objects that only the VM&amp;rsquo;s clone has and ask, and an object they couldn&amp;rsquo;t bring back keeps the VM (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#git-lfs-in-the-copy"&gt;how it works&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="a-partial-clone"&gt;A partial clone&lt;span class="hx:absolute hx:-mt-20" id="a-partial-clone"&gt;&lt;/span&gt;
&lt;a href="#a-partial-clone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When the VM&amp;rsquo;s network policy blocks the remote a partial clone fetches its missing objects from, devvm names the remote&amp;rsquo;s host, and on the allowlist tier you let the VM reach it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network allow github.com&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A remote reached over ssh:&lt;/strong&gt; devvm names the host with its port, such as &lt;code&gt;github.com:22&lt;/code&gt;, which you allow as it&amp;rsquo;s named.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The none tier:&lt;/strong&gt; move the VM to the allowlist tier with &lt;code&gt;devvm network allowlist&lt;/code&gt; first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The internet tier:&lt;/strong&gt; devvm names a host that one of your deny rules blocks, or that&amp;rsquo;s a private address, which that tier never reaches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What the VM can&amp;rsquo;t reach or doesn&amp;rsquo;t get:&lt;/strong&gt; devvm also names a remote that&amp;rsquo;s on this machine, a &lt;code&gt;file://&lt;/code&gt; URL or a path, a remote that stays here because its URL is of a kind devvm doesn&amp;rsquo;t copy, and a branch or tag that points to an object the clone never fetched, which the VM&amp;rsquo;s clone doesn&amp;rsquo;t get.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Fetching the VM&amp;rsquo;s work back needs every object that work names, and git in the VM never fetches a missing object just to send it, so when the work names one the clone lacks, such as a file restored from an old commit, &lt;code&gt;devvm clone fetch&lt;/code&gt; fails and says so. In the VM&amp;rsquo;s clone, run a command that reads the work&amp;rsquo;s objects, which fetches the missing ones from the remote, then fetch again from this machine:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git show agent/search &lt;span class="c1"&gt;# in the VM&amp;#39;s clone, for each commit of the work&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone fetch &lt;span class="c1"&gt;# then on this machine&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="a-copy-that-didnt-finish"&gt;A copy that didn&amp;rsquo;t finish&lt;span class="hx:absolute hx:-mt-20" id="a-copy-that-didnt-finish"&gt;&lt;/span&gt;
&lt;a href="#a-copy-that-didnt-finish" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the copy fails, for example because the VM can&amp;rsquo;t be reached or its disk is full, devvm copies again in full the next time you run it in the folder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="c1"&gt;# in the folder, to copy again&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The VM&amp;rsquo;s repo counts as copied only once the whole copy is done, so a copy that stopped part way never leaves a clone that devvm thinks is complete. &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; check a clone whose copy didn&amp;rsquo;t finish as they check any other, so its commits and changes are never lost without a question (&lt;a href="#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;). A copy that runs again keeps what the VM did meanwhile, and devvm names what it kept:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A branch that has commits from the VM&lt;/strong&gt; stays as it is instead of moving to this machine&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HEAD stays where the VM put it&lt;/strong&gt; when the VM checked out something else, such as a branch of its own, or moved its detached HEAD. That includes the case where you switched this repo between a branch and a detached HEAD since the copy that didn&amp;rsquo;t finish. Your uncommitted changes, and a rebase or other operation in progress, would then apply to something else, so they stay on this machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file in the clone&amp;rsquo;s folder that the VM wrote&lt;/strong&gt; stays as it is, even where you have a change of your own. devvm names it when it&amp;rsquo;s at a path you changed or deleted, or when it differs from what you&amp;rsquo;ve staged, and &lt;code&gt;git status&lt;/code&gt; in the VM shows it as changed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Running devvm in the folder again is also how a VM that an older devvm made, whose copy failed, gets its clone. An older devvm made every VM&amp;rsquo;s repo with SHA-1 object names. When such a VM&amp;rsquo;s copy failed and your repo uses SHA-256, its empty repo can&amp;rsquo;t take your commits, so devvm asks before it deletes that empty repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; and makes it again. Only the repo is made again, never the VM. Without a terminal devvm leaves it and says what to run, which is devvm in a terminal, or devvm rm, then &lt;code&gt;devvm --clone&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-remote"&gt;The remote&lt;span class="hx:absolute hx:-mt-20" id="the-remote"&gt;&lt;/span&gt;
&lt;a href="#the-remote" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm adds a git remote for the VM to your repo. It&amp;rsquo;s named &lt;code&gt;devvm&lt;/code&gt;, or &lt;code&gt;devvm-&amp;lt;folder&amp;gt;&lt;/code&gt; if &lt;code&gt;devvm&lt;/code&gt; is already taken, or the VM&amp;rsquo;s full name if both are. The remote&amp;rsquo;s URL is the VM&amp;rsquo;s full name followed by the clone&amp;rsquo;s path, so git connects through devvm&amp;rsquo;s ssh config, and fetching needs two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Your &lt;code&gt;~/.ssh/config&lt;/code&gt; needs devvm&amp;rsquo;s &lt;code&gt;Include&lt;/code&gt; line (&lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;SSH access by name&lt;/a&gt;). devvm offers to add it when it creates the clone, and again when you run &lt;code&gt;devvm host&lt;/code&gt; or &lt;code&gt;devvm code&lt;/code&gt;. Until the line is there, or when devvm had no terminal to ask in, fetch with &lt;code&gt;GIT_SSH_COMMAND='ssh -F ~/.local/share/devvm/ssh_config' git fetch devvm&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The VM must be running. A stopped VM has no SSH entry, so &lt;code&gt;git fetch&lt;/code&gt; fails because it can&amp;rsquo;t resolve the name. Run &lt;code&gt;devvm&lt;/code&gt; or &lt;code&gt;devvm host&lt;/code&gt; in the folder first.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="fetching-the-vms-work"&gt;Fetching the VM&amp;rsquo;s work&lt;span class="hx:absolute hx:-mt-20" id="fetching-the-vms-work"&gt;&lt;/span&gt;
&lt;a href="#fetching-the-vms-work" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;git fetch devvm&lt;/code&gt; in the repo fetches the VM&amp;rsquo;s branches as &lt;code&gt;devvm/&amp;lt;branch&amp;gt;&lt;/code&gt;, as for any remote. &lt;code&gt;devvm clone fetch&lt;/code&gt; does the same for every repo the VM has a clone of, which is one repo here, or each repo of a &lt;a href="#folders-of-repos"&gt;folder of repos&lt;/a&gt;, and then lists the branches that are new or have moved since the last fetch, each with the repos it&amp;rsquo;s in:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; devvm clone fetch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;agent/search: backend, frontend
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;main: backend
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;==&amp;gt; Review each branch in its repo before you merge it, such as with git log -p main..devvm/main.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm clone fetch&lt;/code&gt; starts the VM if it&amp;rsquo;s stopped. It connects to the VM itself, as the copy does, so it needs neither devvm&amp;rsquo;s &lt;code&gt;Include&lt;/code&gt; line in &lt;code&gt;~/.ssh/config&lt;/code&gt; nor the VM&amp;rsquo;s name in your ssh config. What it fetches:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Every branch of each clone&lt;/strong&gt; into its repo&amp;rsquo;s remote, as &lt;code&gt;devvm/&amp;lt;branch&amp;gt;&lt;/code&gt;, and it never changes your own branches or tags.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A detached HEAD&amp;rsquo;s commits.&lt;/strong&gt; When a clone&amp;rsquo;s HEAD is detached at commits that no branch of the clone has and this repo hasn&amp;rsquo;t fetched, such as an agent&amp;rsquo;s work done without a branch, which &lt;code&gt;git fetch devvm&lt;/code&gt; doesn&amp;rsquo;t fetch, &lt;code&gt;devvm clone fetch&lt;/code&gt; fetches them into a new local branch, &lt;code&gt;saved/devvm/HEAD&lt;/code&gt;, and names it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each stash entry the VM made,&lt;/strong&gt; the same way, into &lt;code&gt;saved/devvm/stash-N&lt;/code&gt;, after the entry&amp;rsquo;s place in the VM&amp;rsquo;s &lt;code&gt;git stash list&lt;/code&gt;, but not the entries devvm copied in from this machine. An entry&amp;rsquo;s untracked files go to a branch of their own, &lt;code&gt;saved/devvm/stash-N-untracked&lt;/code&gt;, which devvm names, along with any of them that git ignores here, so &lt;code&gt;git stash apply saved/devvm/stash-N&lt;/code&gt; never writes them. Look at them with &lt;code&gt;git show saved/devvm/stash-N-untracked&lt;/code&gt; before you use them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The work&amp;rsquo;s &lt;a href="#git-lfs"&gt;Git LFS&lt;/a&gt; objects,&lt;/strong&gt; which &lt;code&gt;git fetch devvm&lt;/code&gt; never brings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It never writes over a branch, so when &lt;code&gt;saved/devvm/&lt;/code&gt; is taken, even by an earlier fetch&amp;rsquo;s, it uses &lt;code&gt;saved/devvm-2/&lt;/code&gt; and on, and it fetches nothing it has saved before. When a repo&amp;rsquo;s remote is gone, &lt;code&gt;devvm clone fetch&lt;/code&gt; adds it again. When you&amp;rsquo;ve pointed the remote at another URL, or the folder on this machine isn&amp;rsquo;t that repo any more, for example because its &lt;code&gt;.git&lt;/code&gt; is gone, devvm leaves that repo alone and says so.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git log -p main..devvm/main &lt;span class="c1"&gt;# review each branch before you merge it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Fetching runs nothing from the VM on this machine. git only receives objects, checking each one, and updates the &lt;code&gt;devvm/*&lt;/code&gt; branches, or creates new &lt;code&gt;saved/devvm/*&lt;/code&gt; branches, for a detached HEAD&amp;rsquo;s commits, the VM&amp;rsquo;s stash entries, or when &lt;code&gt;devvm rm&lt;/code&gt; does the fetch. The commits themselves are untrusted, though, so treat them as you would a contributor&amp;rsquo;s branch and review them before you merge them, check them out or run anything they change.&lt;/p&gt;
&lt;h2 data-hextra-search-id="subfolders"&gt;Subfolders&lt;span class="hx:absolute hx:-mt-20" id="subfolders"&gt;&lt;/span&gt;
&lt;a href="#subfolders" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you run devvm in a subfolder of the repo&amp;rsquo;s folder, devvm uses the &lt;code&gt;--clone&lt;/code&gt; VM as it uses any parent folder&amp;rsquo;s VM (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-subfolder"&gt;a subfolder&lt;/a&gt;). The clone is at the repo folder&amp;rsquo;s path, so the subfolder&amp;rsquo;s path in the VM is the same subfolder in the clone. When the clone has that subfolder, the shell opens there, and &lt;code&gt;devvm host&lt;/code&gt; and &lt;code&gt;devvm code&lt;/code&gt; give it as the folder to open. When the clone lacks it, for example because the subfolder is untracked or ignored and so never copied, they use the clone&amp;rsquo;s top folder instead.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; src/api &lt;span class="c1"&gt;# a subfolder of the repo&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="c1"&gt;# the repo&amp;#39;s --clone VM, its shell in src/api in the clone&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --clone &lt;span class="c1"&gt;# a VM of the subfolder&amp;#39;s own, when it&amp;#39;s a repo&amp;#39;s top folder&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm --clone&lt;/code&gt; in a subfolder never uses a parent folder&amp;rsquo;s VM. It makes a new &lt;code&gt;--clone&lt;/code&gt; VM for the subfolder, as &lt;code&gt;devvm --here&lt;/code&gt; does, and doesn&amp;rsquo;t take &lt;code&gt;--parent&lt;/code&gt;, so the subfolder must be the top folder of a repo of its own.&lt;/p&gt;
&lt;h2 data-hextra-search-id="several-agents-in-one-vm"&gt;Several agents in one VM&lt;span class="hx:absolute hx:-mt-20" id="several-agents-in-one-vm"&gt;&lt;/span&gt;
&lt;a href="#several-agents-in-one-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Several agents can work in one &lt;code&gt;--clone&lt;/code&gt; VM, each on a branch of its own in a git worktree of its own, so each agent edits its own copy of the files. Put the worktrees inside the clone, such as in &lt;code&gt;.worktrees/NAME&lt;/code&gt;, because the clone&amp;rsquo;s parent folders in the VM belong to root, and so &lt;code&gt;git worktree add ../NAME&lt;/code&gt; fails there. In the VM, in the clone:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; .worktrees/ &amp;gt;&amp;gt; .git/info/exclude &lt;span class="c1"&gt;# once, so git status in the clone leaves the worktrees out&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git worktree add -b agent/api .worktrees/api &lt;span class="c1"&gt;# a worktree on a new branch, agent/api&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; .worktrees/api &lt;span class="c1"&gt;# then start the agent here&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;What the agents in one VM share:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One repo.&lt;/strong&gt; Every worktree shares the clone&amp;rsquo;s repo, so the agents&amp;rsquo; branches are all in it. One &lt;code&gt;git fetch devvm&lt;/code&gt; on this machine brings every agent&amp;rsquo;s branch back, such as &lt;code&gt;devvm/agent/api&lt;/code&gt;, and you review each one as you would any of the VM&amp;rsquo;s work (&lt;a href="#fetching-the-vms-work"&gt;fetching the VM&amp;rsquo;s work&lt;/a&gt;). Before &lt;code&gt;devvm rm&lt;/code&gt; deletes the VM, it also checks each worktree inside the clone for uncommitted changes (&lt;a href="#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Not their dependencies.&lt;/strong&gt; Install each worktree&amp;rsquo;s dependencies in that worktree, and never share one &lt;code&gt;node_modules&lt;/code&gt; folder between worktrees, because each branch can need different packages, and two agents installing at once can break it. pnpm and bun keep one package store in the VM and hard-link packages from it into each worktree&amp;rsquo;s &lt;code&gt;node_modules&lt;/code&gt; when both are on the same disk, so another worktree costs little download or disk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM&amp;rsquo;s ports,&lt;/strong&gt; so two servers on the same port collide. Give each worktree&amp;rsquo;s server a port of its own, such as with &lt;code&gt;PORT=3001&lt;/code&gt;. A VM that forwards every port, as new VMs do by default, forwards each of them to this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;ports&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The rest of the VM,&lt;/strong&gt; its network tier and rules, its secrets, and its CPUs, memory and disk, and each agent can read and change every other agent&amp;rsquo;s worktree.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When the agents need different network tiers or rules, secrets or sizes, or when one agent mustn&amp;rsquo;t reach another&amp;rsquo;s work, give each agent a folder of its own on this machine, such as a separate clone of the repo, and run &lt;code&gt;devvm --clone&lt;/code&gt; in each, so each gets a VM of its own.&lt;/p&gt;
&lt;h2 data-hextra-search-id="folders-of-repos"&gt;Folders of repos&lt;span class="hx:absolute hx:-mt-20" id="folders-of-repos"&gt;&lt;/span&gt;
&lt;a href="#folders-of-repos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A project is often several repos in one folder, such as a &lt;code&gt;frontend&lt;/code&gt; that uses &lt;code&gt;file:../shared&lt;/code&gt; in its &lt;code&gt;package.json&lt;/code&gt;, or a .NET solution whose projects point at &lt;code&gt;../Lib/Lib.csproj&lt;/code&gt;. &lt;code&gt;devvm --clone&lt;/code&gt; in that folder gives one VM a clone of each repo you choose, each at the same path as on this machine, so the paths between them work in the VM as they do here. The folder can be a repo itself or not, and when it is one, you ask for this with &lt;code&gt;--repos&lt;/code&gt;, because without it &lt;code&gt;devvm --clone&lt;/code&gt; there gives the VM a clone of the folder&amp;rsquo;s own repo alone, as for any repo, whatever repos are below it.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;my-repos/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── docker-compose.yml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── frontend/ (a repo)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── backend/ (a repo)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── shared/ (a repo)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; my-repos
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --clone &lt;span class="c1"&gt;# choose the repos, then create the VM and open a shell in my-repos&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --clone --repos frontend,shared &lt;span class="c1"&gt;# or choose them on the command line, as a script must&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm looks for repos up to four folders below this one, as &lt;a href="https://next.devvm.dev/docs/safety/git-protection/#nested-repos"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt; does, and skips the folders of packages and build tools, such as &lt;code&gt;node_modules&lt;/code&gt; and &lt;code&gt;vendor&lt;/code&gt;. In a terminal, it lists the repos it found in a picker, each ticked, and you untick those the VM doesn&amp;rsquo;t need. A repo that &lt;code&gt;--clone&lt;/code&gt; can&amp;rsquo;t copy is listed under its own heading with the reason, such as a repo without commits or one whose &lt;code&gt;.git&lt;/code&gt; points into another repo, and it can&amp;rsquo;t be ticked. devvm lists at most 100 repos, and it names how many more it found. A linked worktree of a repo in the folder, such as one in &lt;code&gt;.worktrees/NAME&lt;/code&gt;, isn&amp;rsquo;t a repo of its own, so devvm doesn&amp;rsquo;t list it, and its repo&amp;rsquo;s clone gets every branch of that repo, the worktree&amp;rsquo;s own included. A repo can&amp;rsquo;t be ticked when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--clone&lt;/code&gt; can&amp;rsquo;t copy it,&lt;/strong&gt; such as a repo without commits or one whose &lt;code&gt;.git&lt;/code&gt; points into another repo. It&amp;rsquo;s listed under its own heading with the reason.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its folder&amp;rsquo;s name has a character a terminal can&amp;rsquo;t show,&lt;/strong&gt; such as a line break or a bidi control.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another VM mounts it,&lt;/strong&gt; because that VM is a subfolder&amp;rsquo;s that holds the repo, or the repo&amp;rsquo;s own, or, for a linked worktree, the VM of the repo it belongs to. Code in that VM could swap the repo for another while devvm&amp;rsquo;s git works in it, so devvm names that VM, and &lt;code&gt;devvm clone add&lt;/code&gt; refuses the repo too. Delete that VM, or move the repo out of its folder, to give this VM a clone of it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, give &lt;code&gt;--repos&lt;/code&gt;, or devvm refuses without creating anything:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--repos all&lt;/code&gt; takes every repo &lt;code&gt;--clone&lt;/code&gt; can copy.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--repos none&lt;/code&gt; takes none of them.&lt;/li&gt;
&lt;li&gt;A list, such as &lt;code&gt;--repos frontend,backend&lt;/code&gt;, takes those repos, by their folders relative to this one, with &lt;code&gt;.&lt;/code&gt; for this folder&amp;rsquo;s own repo.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm names each repo you chose that it can&amp;rsquo;t copy, and leaves it out, and it records your choice in the VM&amp;rsquo;s state, never in the folder. When devvm finds no repo below this folder that it can copy, &lt;code&gt;devvm --clone&lt;/code&gt; gives the VM a clone of this folder&amp;rsquo;s own repo, as for a folder that holds no other, and the folder must then be one (&lt;a href="#requirements"&gt;requirements&lt;/a&gt;). A folder of repos inside another repo&amp;rsquo;s working tree is refused, because devvm would copy that repo&amp;rsquo;s files. To clone repos in it, run &lt;code&gt;devvm --clone --repos LIST&lt;/code&gt; in that repo&amp;rsquo;s top folder, and choose them there. Each repo&amp;rsquo;s clone:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Gets the same refs as a single repo&amp;rsquo;s&lt;/strong&gt; (&lt;a href="#whats-copied"&gt;what&amp;rsquo;s copied&lt;/a&gt;), every branch, tag and remote-tracking branch, checked out as the repo is here. When a repo&amp;rsquo;s HEAD is detached, its clone is detached at the same commit, and devvm says so. A repo that is a linked worktree of a repo outside the folder gets what &lt;a href="#a-git-worktree"&gt;a worktree&amp;rsquo;s clone&lt;/a&gt; gets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gets a remote of its own for the VM,&lt;/strong&gt; named as for one repo&amp;rsquo;s clone (&lt;a href="#the-remote"&gt;the remote&lt;/a&gt;): &lt;code&gt;devvm&lt;/code&gt;, or &lt;code&gt;devvm-&amp;lt;folder&amp;gt;&lt;/code&gt; when that repo already has a &lt;code&gt;devvm&lt;/code&gt; remote, for example from a VM of its own. One repo&amp;rsquo;s remote names never change the others&amp;rsquo;. When a repo has all three names taken, devvm leaves that repo out and names it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Leaves the other repos&amp;rsquo; clones out of its &lt;code&gt;git status&lt;/code&gt;,&lt;/strong&gt; when it&amp;rsquo;s the folder&amp;rsquo;s own repo&amp;rsquo;s, and what your repo&amp;rsquo;s &lt;code&gt;.git/info/exclude&lt;/code&gt; leaves out too, such as &lt;code&gt;.worktrees/&lt;/code&gt;, so the other clones aren&amp;rsquo;t changes &lt;code&gt;devvm rm&lt;/code&gt; asks about.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Is left out and named&lt;/strong&gt; when its repo no longer passes the checks as the copy is made, for example because its last commit went, and the others are copied. When the copy fails, devvm copies what&amp;rsquo;s left the next time you run it in the folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="the-folders-own-files"&gt;The folder&amp;rsquo;s own files&lt;span class="hx:absolute hx:-mt-20" id="the-folders-own-files"&gt;&lt;/span&gt;
&lt;a href="#the-folders-own-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A folder of repos often has files of its own at its top, outside every repo, such as a &lt;code&gt;docker-compose.yml&lt;/code&gt;, a &lt;code&gt;Makefile&lt;/code&gt; or an &lt;code&gt;.envrc&lt;/code&gt;. When the folder isn&amp;rsquo;t a repo itself, devvm copies these into the VM once, when it creates the clone, at the same paths. It never copies them again, and nothing comes back from the VM, so a later change on either side stays there. To change one in the VM, edit it there, and to bring a change back, copy it out yourself, for example with &lt;code&gt;scp&lt;/code&gt; and the VM&amp;rsquo;s name, which &lt;code&gt;devvm host&lt;/code&gt; shows:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm host &lt;span class="c1"&gt;# start the VM and show its name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scp devvm-my-repos-&amp;lt;hash&amp;gt;:/path/to/my-repos/docker-compose.yml . &lt;span class="c1"&gt;# copy the VM&amp;#39;s version back&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm copies the files and folders outside every repo, whether the VM has a clone of that repo or not. It keeps each file&amp;rsquo;s permissions but its set-user-id and set-group-id bits, and a link that leads to a path in the folder, as a link. It reads only beneath the folder, one folder at a time, and never through a link. It leaves out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a &lt;code&gt;.git&lt;/code&gt;, a folder shaped like one, such as a bare repo&amp;rsquo;s, and the folders of packages and build tools, such as &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;vendor&lt;/code&gt; and &lt;code&gt;.venv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;a link that leads out of the folder, a file with another hard link, sockets and other special files, and anything on another disk&lt;/li&gt;
&lt;li&gt;a file over 10 MiB, and the files past 64 MiB or 5,000 entries in all&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm says how many of the files it left out. When the folder is a repo itself, its files are its repo&amp;rsquo;s, so devvm copies none of them this way. A secret in one of these files, such as an &lt;code&gt;.env&lt;/code&gt; at the folder&amp;rsquo;s top, reaches the VM as any other file does, so move it out of the folder before &lt;code&gt;devvm --clone&lt;/code&gt; when the VM mustn&amp;rsquo;t have it. devvm refuses the folders it refuses to mount, such as your home folder (&lt;a href="https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses"&gt;folders devvm refuses&lt;/a&gt;), because it would copy their files.&lt;/p&gt;
&lt;h3 data-hextra-search-id="opening-a-repos-folder"&gt;Opening a repo&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="opening-a-repos-folder"&gt;&lt;/span&gt;
&lt;a href="#opening-a-repos-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In a folder of one of the VM&amp;rsquo;s repos, such as &lt;code&gt;my-repos/frontend&lt;/code&gt;, &lt;code&gt;devvm&lt;/code&gt; opens the folder&amp;rsquo;s VM at that repo&amp;rsquo;s path, as it opens any parent folder&amp;rsquo;s VM in a &lt;a href="https://next.devvm.dev/docs/using/vms/#a-subfolder"&gt;subfolder&lt;/a&gt;. A repo of its own in a subfolder usually gets a VM of its own, but the folder&amp;rsquo;s VM has this repo&amp;rsquo;s clone at the same path and mounts nothing of this machine, so the VM can&amp;rsquo;t reach the repo&amp;rsquo;s folder here. &lt;code&gt;devvm --here&lt;/code&gt; in the repo&amp;rsquo;s folder still creates or opens that repo&amp;rsquo;s own VM. In a repo the VM has no clone of, &lt;code&gt;devvm&lt;/code&gt; doesn&amp;rsquo;t use the folder&amp;rsquo;s VM.&lt;/p&gt;
&lt;h3 data-hextra-search-id="adding-a-repo"&gt;Adding a repo&lt;span class="hx:absolute hx:-mt-20" id="adding-a-repo"&gt;&lt;/span&gt;
&lt;a href="#adding-a-repo" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm clone add PATH&lt;/code&gt; copies one more repo into the VM, such as a repo you cloned into the folder after the VM was made, or one that you left out. PATH is the repo&amp;rsquo;s folder, relative to the folder you run it in, and it must be inside the VM&amp;rsquo;s folder. devvm checks the repo as it checks each repo it copies, starts the VM if it&amp;rsquo;s stopped, copies the repo&amp;rsquo;s current and default branches to the same path in the VM and adds its remote. When the copy fails, for example because the VM can&amp;rsquo;t be reached, devvm keeps the repo in the VM&amp;rsquo;s list, so &lt;code&gt;devvm rm&lt;/code&gt; still checks what reached the VM, and running &lt;code&gt;devvm clone add PATH&lt;/code&gt; again copies it again.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone [email protected]:me/docs.git
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone add docs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A repo made in the VM stays in the VM, because the VM can&amp;rsquo;t add a repo to this machine. To bring it out, clone it from the VM with &lt;code&gt;git clone devvm-my-repos-&amp;lt;hash&amp;gt;:/path/to/my-repos/new&lt;/code&gt;, using the VM&amp;rsquo;s full name from &lt;code&gt;devvm ls&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="agents-across-repos"&gt;Agents across repos&lt;span class="hx:absolute hx:-mt-20" id="agents-across-repos"&gt;&lt;/span&gt;
&lt;a href="#agents-across-repos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;An agent that works on one change across repos uses one branch name in each repo, such as &lt;code&gt;agent/search&lt;/code&gt; in &lt;code&gt;frontend&lt;/code&gt; and in &lt;code&gt;backend&lt;/code&gt;, so &lt;code&gt;devvm clone fetch&lt;/code&gt; lists that change as one line with both repos. For several agents at once, give each its own folder with a worktree of each repo, inside the VM&amp;rsquo;s folder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; r in frontend backend&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; git -C &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; worktree add -b agent/search &lt;span class="s2"&gt;&amp;#34;../.worktrees/search/&lt;/span&gt;&lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; .worktrees/search &lt;span class="c1"&gt;# the change&amp;#39;s own copy of the folder&amp;#39;s repos, then start the agent here&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm copies the folder&amp;rsquo;s own files only into the folder itself, so copy those the agent needs into the change&amp;rsquo;s folder too. &lt;code&gt;devvm rm&lt;/code&gt; checks each worktree inside the VM&amp;rsquo;s folder for uncommitted changes, whichever repo it belongs to (&lt;a href="#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="deleting-the-vm"&gt;Deleting the VM&lt;span class="hx:absolute hx:-mt-20" id="deleting-the-vm"&gt;&lt;/span&gt;
&lt;a href="#deleting-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone fetch &lt;span class="c1"&gt;# fetch the VM&amp;#39;s work first, so the check finds it fetched&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm &lt;span class="c1"&gt;# check for unfetched work and uncommitted changes, then ask&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm --no-clone-check &lt;span class="c1"&gt;# skip both checks, so the VM&amp;#39;s work goes with it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git branch -D saved/devvm/main &lt;span class="c1"&gt;# delete a saved branch once you&amp;#39;ve reviewed it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Before &lt;code&gt;devvm rm&lt;/code&gt; deletes a &lt;code&gt;--clone&lt;/code&gt; VM, it checks the clone for work you&amp;rsquo;d lose. It starts a stopped VM for the check as a launch does, so the VM&amp;rsquo;s confinement is checked first:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Work this repo hasn&amp;rsquo;t fetched.&lt;/strong&gt; devvm names it and offers to fetch it into new local branches:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Branches with commits this repo hasn&amp;rsquo;t fetched&lt;/strong&gt; go into &lt;code&gt;saved/devvm/&amp;lt;branch&amp;gt;&lt;/code&gt;. devvm skips a branch whose name git on this machine refuses and names it, and that branch goes with the VM. To keep such a branch, rename it in the VM with &lt;code&gt;git branch -m&lt;/code&gt; before you run &lt;code&gt;devvm rm&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A detached HEAD&amp;rsquo;s commits,&lt;/strong&gt; when the clone&amp;rsquo;s HEAD is detached at commits that no branch of the clone has and this repo hasn&amp;rsquo;t fetched, such as an agent&amp;rsquo;s work done without a branch, are named as &lt;code&gt;HEAD&lt;/code&gt; and go into &lt;code&gt;saved/devvm/HEAD&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A stash entry the VM made,&lt;/strong&gt; which this repo hasn&amp;rsquo;t fetched, is named as &lt;code&gt;stash-N&lt;/code&gt;, after its place in the VM&amp;rsquo;s &lt;code&gt;git stash list&lt;/code&gt;, and goes into &lt;code&gt;saved/devvm/stash-N&lt;/code&gt;, from which &lt;code&gt;git stash apply saved/devvm/stash-0&lt;/code&gt; applies it here, its untracked files apart, as &lt;code&gt;devvm clone fetch&lt;/code&gt; saves them (&lt;a href="#fetching-the-vms-work"&gt;fetching the VM&amp;rsquo;s work&lt;/a&gt;). When devvm can&amp;rsquo;t fetch an entry, it keeps the VM. The stash entries devvm copied in from this machine don&amp;rsquo;t count.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Uncommitted changes&lt;/strong&gt; in the clone or a worktree inside its folder. devvm lists the first 20 of them in all, with each worktree&amp;rsquo;s changes under its path, and asks before deleting them along with the VM:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The changes devvm copied in&lt;/strong&gt; from this machine don&amp;rsquo;t count while the VM leaves them as they came, because they&amp;rsquo;re your work, not the VM&amp;rsquo;s, even if you&amp;rsquo;ve changed or undone them here since. Once the VM changes one of those files, its permissions or what&amp;rsquo;s staged for it, devvm lists it as the VM&amp;rsquo;s work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A worktree whose HEAD is detached&lt;/strong&gt; at commits that nothing else in the clone has, no branch, tag or remote-tracking branch, counts the same way: devvm names it and asks, because those commits go with the VM. To keep them, run &lt;code&gt;git switch -c NAME&lt;/code&gt; in that worktree, then fetch the branch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Worktrees it skips:&lt;/strong&gt; one whose folder is gone or that git would prune, and those outside the clone&amp;rsquo;s folder. When the clone has more than 100 worktrees inside its folder, devvm checks the first 100 and asks before deleting the VM, even if none of them has changes. Worktrees outside the folder don&amp;rsquo;t count towards the 100. The worktrees that opencode makes in the VM&amp;rsquo;s home folder are checked apart, as for any VM with opencode, and devvm asks about them in the same question (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If either check finds something and there&amp;rsquo;s no terminal to ask in, or you give &lt;code&gt;--no-input&lt;/code&gt;, devvm refuses and keeps the VM. These questions are asked only in a terminal, because only you can judge the work, so &lt;code&gt;--force&lt;/code&gt; never answers them (&lt;a href="https://next.devvm.dev/docs/using/command-line/#questions-devvm-asks"&gt;questions devvm asks&lt;/a&gt;). Without a terminal, when the clone has work this repo hasn&amp;rsquo;t fetched, devvm&amp;rsquo;s refusal names &lt;code&gt;devvm clone fetch&lt;/code&gt;: run it first, and the check finds every branch, a detached HEAD&amp;rsquo;s commits and the VM&amp;rsquo;s stash entries fetched, in every repo of a folder of repos too. Two cases check more:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A &lt;a href="#folders-of-repos"&gt;folder of repos&lt;/a&gt;.&lt;/strong&gt; devvm checks every repo the VM has a clone of, reading them all from the VM at once, and names the repo of each branch and each change it lists. It asks once whether to fetch the unfetched branches of every repo, each into that repo&amp;rsquo;s &lt;code&gt;saved/&amp;lt;remote&amp;gt;/&amp;lt;branch&amp;gt;&lt;/code&gt; branches, and once before the uncommitted changes go, with the first 20 changes in all the repos shown. A repo whose copy didn&amp;rsquo;t finish is checked too when its clone is in the VM. Beyond that:
&lt;ul&gt;
&lt;li&gt;When a repo&amp;rsquo;s clone isn&amp;rsquo;t at its path in the VM, for example because something in the VM moved it, devvm says so and asks before deleting the VM, as for uncommitted changes.&lt;/li&gt;
&lt;li&gt;When a repo on this machine isn&amp;rsquo;t the repo the VM has a clone of any more, for example because its &lt;code&gt;.git&lt;/code&gt; is gone, devvm refuses and keeps the VM, because git there would read another repo, so put the repo back, or give &lt;code&gt;--no-clone-check&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;devvm doesn&amp;rsquo;t check the VM&amp;rsquo;s copy of the folder&amp;rsquo;s own files, nor anything else outside the repos, so copy out what you need of those first.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo that another VM mounts,&lt;/strong&gt; such as the VM of a folder the repo is in. Code in that VM could swap the repo under devvm&amp;rsquo;s git, so devvm runs no git in it on this machine. It still checks the clone in the VM, and every other repo of a folder of repos, but it can&amp;rsquo;t fetch the clone&amp;rsquo;s work into the repo, so it names that VM and asks before deleting, as for uncommitted changes, and without a terminal it refuses and keeps the VM. Fetch the work by hand first if you need it, then give &lt;code&gt;--no-clone-check&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once the checks pass, devvm deletes the VM. If the remote still points at the VM, devvm then removes it with &lt;code&gt;git remote remove&lt;/code&gt;, in each repo of a folder of repos too, which also deletes its &lt;code&gt;devvm/*&lt;/code&gt; branches and their upstream settings. Before it does, devvm keeps every &lt;code&gt;devvm/*&lt;/code&gt; branch that has commits no other branch has as a new local branch, named after the remote as &lt;code&gt;saved/&amp;lt;remote&amp;gt;/&amp;lt;branch&amp;gt;&lt;/code&gt;, whoever fetched it. devvm never overwrites a branch, so when one is in the way, it uses &lt;code&gt;saved/&amp;lt;remote&amp;gt;-2&lt;/code&gt;, then &lt;code&gt;-3&lt;/code&gt; and so on, and if it finds no free name, &lt;code&gt;devvm rm&lt;/code&gt; refuses and keeps the VM (&lt;a href="https://next.devvm.dev/docs/internals/overview/#saved-branches"&gt;saved branches&lt;/a&gt;). devvm names each branch it creates, and they&amp;rsquo;re yours to review, merge or delete.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flag&lt;/th&gt;
&lt;th&gt;What it skips&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;only the question whether to delete the VM at all, so both checks still run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--no-export&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the export of the agents&amp;rsquo; history, and it leaves both checks as they are&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--no-clone-check&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;both checks, so the VM goes with the commits this repo hasn&amp;rsquo;t fetched and the uncommitted changes, and devvm warns you of that first&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Use &lt;code&gt;--no-clone-check&lt;/code&gt; when a check can&amp;rsquo;t read the clone, such as when git in the VM is broken or the VM doesn&amp;rsquo;t answer within 2 minutes, and devvm refuses and keeps the VM. Use it too when the VM doesn&amp;rsquo;t start for the check, such as when its tier isn&amp;rsquo;t enforced, because devvm then says what kept it from starting and keeps the VM. devvm still asks whether to delete the VM unless you also give &lt;code&gt;--force&lt;/code&gt;, and it still keeps the &lt;code&gt;devvm/*&lt;/code&gt; branches you fetched as &lt;code&gt;saved/devvm/&lt;/code&gt; branches.&lt;/p&gt;
&lt;h2 data-hextra-search-id="switching-a-vm-that-exists"&gt;Switching a VM that exists&lt;span class="hx:absolute hx:-mt-20" id="switching-a-vm-that-exists"&gt;&lt;/span&gt;
&lt;a href="#switching-a-vm-that-exists" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm clone&lt;/code&gt; shows whether this folder&amp;rsquo;s VM has its own clone of the repo, which is &lt;code&gt;on&lt;/code&gt;, or mounts the folder, which is &lt;code&gt;off&lt;/code&gt;. &lt;code&gt;devvm clone on&lt;/code&gt; and &lt;code&gt;devvm clone off&lt;/code&gt; switch the VM by making it again from the image it has, as &lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;&lt;code&gt;devvm layer add&lt;/code&gt;&lt;/a&gt; does, and then open a shell in it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone &lt;span class="c1"&gt;# show on or off&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone on &lt;span class="c1"&gt;# make the VM again with its own clone of the repo, after asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone off &lt;span class="c1"&gt;# fetch the clone&amp;#39;s work, then make the VM again with this folder mounted&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The VM keeps its home folder and its settings, as &lt;a href="https://next.devvm.dev/docs/using/images/#what-a-vm-made-again-keeps"&gt;a VM made again&lt;/a&gt; does, and everything else on its disk is lost. So in a terminal devvm asks first, with no as the default, and without one it refuses unless you give &lt;code&gt;--force&lt;/code&gt;. &lt;code&gt;--no-export&lt;/code&gt; skips the export of the agents&amp;rsquo; history, and &lt;code&gt;--clean-home&lt;/code&gt; gives the VM the image&amp;rsquo;s home folder instead of its own, as for &lt;code&gt;devvm layer add&lt;/code&gt;. When the VM is in the mode you ask for already, devvm says so and changes nothing.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm clone on&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Needs a folder that &lt;code&gt;--clone&lt;/code&gt; takes&lt;/strong&gt; (&lt;a href="#requirements"&gt;requirements&lt;/a&gt;), and devvm refuses before it changes anything when the folder isn&amp;rsquo;t one. In a &lt;a href="#folders-of-repos"&gt;folder of repos&lt;/a&gt;, devvm asks which repos the new VM gets in the picker before it asks to make the VM again, and &lt;code&gt;devvm clone on --repos LIST&lt;/code&gt; answers that without a terminal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Loses only the VM&amp;rsquo;s disk,&lt;/strong&gt; because your work is in the folder. The new VM mounts nothing of the folder, and as it starts, devvm copies your branches into its clone and adds &lt;a href="#the-remote"&gt;the remote&lt;/a&gt;, as for a new &lt;code&gt;--clone&lt;/code&gt; VM (&lt;a href="#whats-copied"&gt;what&amp;rsquo;s copied&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Takes the &lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;&lt;code&gt;.git&lt;/code&gt; locks&lt;/a&gt; off the folder&lt;/strong&gt; once the new VM is ready and the old one is deleted, because no VM mounts it any more. First it names what the old VM changed that the locks can&amp;rsquo;t stop, as a launch does (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#when-devvm-reports-git"&gt;when devvm reports .git&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;devvm clone off&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Checks the clone first,&lt;/strong&gt; as &lt;code&gt;devvm rm&lt;/code&gt; does (&lt;a href="#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;), every repo of a folder of repos included, because the clone is on the VM&amp;rsquo;s disk and goes with it. It offers to fetch the branches this repo hasn&amp;rsquo;t fetched into &lt;code&gt;saved/devvm/&amp;lt;branch&amp;gt;&lt;/code&gt; branches, and it asks before the clone&amp;rsquo;s uncommitted changes go. Only a terminal can answer these questions, and &lt;code&gt;--force&lt;/code&gt; never does, so without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, devvm refuses and keeps the VM as it is. &lt;code&gt;devvm clone off --no-clone-check&lt;/code&gt; skips the check after a warning, and the clone&amp;rsquo;s unfetched commits and uncommitted changes are lost.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mounts the folder again&lt;/strong&gt; with &lt;code&gt;.git&lt;/code&gt; protection as a new VM gets it, which is &lt;code&gt;on&lt;/code&gt; on macOS and &lt;code&gt;off&lt;/code&gt; on Linux hosts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Removes the remote&lt;/strong&gt; before the new VM first starts, and before devvm locks &lt;code&gt;.git&lt;/code&gt;, and keeps each &lt;code&gt;devvm/*&lt;/code&gt; branch that has commits no other branch has as a &lt;code&gt;saved/devvm/&lt;/code&gt; branch, as &lt;code&gt;devvm rm&lt;/code&gt; does. If the switch is then undone, devvm adds the remote back.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When a step fails, or you press Ctrl+C, before the new VM has its home folder, devvm puts the old VM back as it was, in its old mode, as it does for &lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;any remake&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;--clone&lt;/code&gt; VM keeps its clone on its own disk, so &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; refuse it. To change its layers or bring it up to date, switch it off first:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone off &lt;span class="c1"&gt;# fetch the clone&amp;#39;s work, then mount the folder&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm update &lt;span class="c1"&gt;# or devvm layer add or devvm layer rm&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm clone on &lt;span class="c1"&gt;# its own clone again&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="devvm-clone-json"&gt;devvm clone &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-clone-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-clone-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm clone --json&lt;/code&gt; prints one JSON object with &lt;code&gt;clone&lt;/code&gt;, which is &lt;code&gt;on&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt;, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. With &lt;code&gt;--json&lt;/code&gt; the command only shows, so devvm refuses &lt;code&gt;on&lt;/code&gt; or &lt;code&gt;off&lt;/code&gt; with it, and the flags that go with them.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;clone&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;on&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="devvm-clone-fetch-json"&gt;devvm clone fetch &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-clone-fetch-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-clone-fetch-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm clone fetch --json&lt;/code&gt; fetches as &lt;code&gt;devvm clone fetch&lt;/code&gt; does, then prints one JSON object instead of the list. &lt;code&gt;repos&lt;/code&gt; has each repo with new or moved branches, or with its detached HEAD&amp;rsquo;s commits or stash entries saved, by its folder relative to this one (&lt;code&gt;.&lt;/code&gt; for this folder&amp;rsquo;s own repo), with its remote, those &lt;code&gt;branches&lt;/code&gt;, and &lt;code&gt;saved&lt;/code&gt;, the local branches the detached HEAD&amp;rsquo;s commits and the stash entries went into, when there are any. &lt;code&gt;branches&lt;/code&gt; has the same branches by name, each with its &lt;code&gt;repos&lt;/code&gt;, sorted by name. Both are empty when nothing is new.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;repos&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;path&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;remote&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;branches&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;agent/search&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;path&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;frontend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;remote&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;branches&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;agent/search&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;branches&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;agent/search&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;repos&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;frontend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>devcontainer.json</title><link>https://next.devvm.dev/docs/using/devcontainer/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/devcontainer/</guid><description>
&lt;p&gt;devvm supports the &lt;a href="https://containers.dev/" target="_blank" rel="noopener"&gt;Dev Container specification&lt;/a&gt;, so a project&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; sets up its VM. When you run devvm in a folder with a &lt;code&gt;.devcontainer/devcontainer.json&lt;/code&gt;, or else a &lt;code&gt;.devcontainer.json&lt;/code&gt; at the folder&amp;rsquo;s root, the new VM gets that file&amp;rsquo;s settings by default, as far as devvm supports them. To make the VM without reading the file, run &lt;code&gt;devvm --no-devcontainer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The settings devvm supports are the container image to start from, the features devvm has layers for, the ports, the environment and the commands. devvm says in one line which file it read.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-jsonc" data-lang="jsonc"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;image&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;mcr.microsoft.com/devcontainers/javascript-node:22&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;features&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;ghcr.io/devcontainers/features/docker-in-docker:2&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;forwardPorts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;remoteEnv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nt"&gt;&amp;#34;PATH&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;${containerEnv:PATH}:${containerWorkspaceFolder}/bin&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;postCreateCommand&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;npm ci&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;postStartCommand&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;npm run db:start&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="when-its-read"&gt;When it&amp;rsquo;s read&lt;span class="hx:absolute hx:-mt-20" id="when-its-read"&gt;&lt;/span&gt;
&lt;a href="#when-its-read" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;When the folder&amp;rsquo;s VM is made, and again by &lt;code&gt;devvm update&lt;/code&gt;.&lt;/strong&gt; Comments and trailing commas are allowed. devvm reads the file only within the folder, so it doesn&amp;rsquo;t follow a link out of the folder, and it reads only a regular file of up to 1 MiB. devvm never writes anything to the project folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What you give on the command line wins.&lt;/strong&gt; &lt;code&gt;--from&lt;/code&gt; wins over &lt;code&gt;image&lt;/code&gt;, which wins over &lt;code&gt;$DEVVM_FROM&lt;/code&gt;, and &lt;code&gt;--ports&lt;/code&gt; wins over &lt;code&gt;forwardPorts&lt;/code&gt;, and devvm says so in one line for each. The new VM gets the toolchains and layers that the features map to, which its summary shows, and when you customize the VM, they&amp;rsquo;re already chosen in its list, each row naming the file, so you can leave them out there. &lt;code&gt;--tools&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; replace them, as they replace any part&amp;rsquo;s default (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An existing VM changes only when devvm makes it again.&lt;/strong&gt; Its state records the file&amp;rsquo;s SHA-256. When the file differs from it on a launch, or is gone, or has appeared since, devvm warns once and names &lt;code&gt;devvm update&lt;/code&gt;. devvm doesn&amp;rsquo;t check a VM made with &lt;code&gt;--no-devcontainer&lt;/code&gt;, and &lt;code&gt;devvm update&lt;/code&gt; doesn&amp;rsquo;t read the file for it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A new VM takes each of these from the first place that sets it.&lt;/p&gt;
&lt;div class="devvm-diagram" style="contain-intrinsic-block-size: auto 454px; --devvm-diagram-width: 552px"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" class="pele pele-flowchart" viewBox="0 0 552 454" width="552" height="454" style="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,&amp;quot;Departure Mono&amp;quot;, monospace);font:14px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,&amp;quot;Departure Mono&amp;quot;, monospace)" fill="var(--_fg)" role="graphics-document document" aria-roledescription="flowchart" aria-labelledby="df5f80836d0303045--title" aria-describedby="df5f80836d0303045--desc"&gt;&lt;title id="df5f80836d0303045--title"&gt;Where a new VM's ports and base come from&lt;/title&gt;&lt;desc id="df5f80836d0303045--desc"&gt;A new VM's ports are --ports, or else your ports with the file's forwardPorts added. Its base starts from --from, or else the file's image, or else $DEVVM_FROM, or else Ubuntu's cloud image.&lt;/desc&gt;&lt;g class="pele-clusters"&gt;&lt;g class="pele-cluster" data-id="base"&gt;&lt;rect x="289.36" y="8" width="254.18" height="438" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="392.45" y="31.4" text-anchor="middle"&gt;Its base starts from&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-cluster" data-id="ports"&gt;&lt;rect x="8" y="112.5" width="236.36" height="229" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-cluster-label" fill="var(--_m)" x="62.09" y="135.9" text-anchor="middle"&gt;Its ports&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round"&gt;&lt;g class="pele-edge" data-id="L_flag_fwd_0"&gt;&lt;path d="M126.18,194.5L126.18,254.5"/&gt;&lt;path class="pele-marker" d="M126.18,261.5L122.82,253.5L129.54,253.5Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_from_image_0"&gt;&lt;path d="M416.45,90L416.45,150"/&gt;&lt;path class="pele-marker" d="M416.45,157L413.09,149L419.81,149Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_image_env_0"&gt;&lt;path d="M416.45,202L416.45,262"/&gt;&lt;path class="pele-marker" d="M416.45,269L413.09,261L419.81,261Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;g class="pele-edge" data-id="L_env_ubuntu_0"&gt;&lt;path d="M416.45,314L416.45,374"/&gt;&lt;path class="pele-marker" d="M416.45,381L413.09,373L419.81,373Z" fill="var(--_l)" stroke="none"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-edge-labels" font-size="14"&gt;&lt;g class="pele-edge-label" data-id="L_flag_fwd_0"&gt;&lt;rect x="91" y="219" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="126.18" y="232.2" text-anchor="middle"&gt;or else&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_from_image_0"&gt;&lt;rect x="381.27" y="114.5" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="416.45" y="127.7" text-anchor="middle"&gt;or else&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_image_env_0"&gt;&lt;rect x="381.27" y="226.5" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="416.45" y="239.7" text-anchor="middle"&gt;or else&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-edge-label" data-id="L_env_ubuntu_0"&gt;&lt;rect x="381.27" y="338.5" width="70.36" height="18" rx="3" fill="var(--_bg)"/&gt;&lt;text x="416.45" y="351.7" text-anchor="middle"&gt;or else&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;g class="pele-nodes"&gt;&lt;g class="pele-node pele-shape-rect" data-id="flag" transform="translate(126.18,172)"&gt;&lt;rect x="-49.18" y="-22.5" width="98.36" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;--ports&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="fwd" transform="translate(126.18,291.5)"&gt;&lt;rect x="-98.18" y="-30" width="196.36" height="60" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" text-anchor="middle" xml:space="preserve"&gt;&lt;tspan x="0" y="-4.1"&gt;your ports, with&lt;/tspan&gt;&lt;tspan x="0" y="13.9"&gt;forwardPorts added&lt;/tspan&gt;&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="from" transform="translate(416.45,67.5)"&gt;&lt;rect x="-44.73" y="-22.5" width="89.45" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;--from&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="image" transform="translate(416.45,179.5)"&gt;&lt;rect x="-89.27" y="-22.5" width="178.55" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;the file's image&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="env" transform="translate(416.45,291.5)"&gt;&lt;rect x="-67" y="-22.5" width="134" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;$DEVVM_FROM&lt;/text&gt;
&lt;/g&gt;&lt;g class="pele-node pele-shape-rect" data-id="ubuntu" transform="translate(416.45,403.5)"&gt;&lt;rect x="-107.09" y="-22.5" width="214.18" height="45" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/&gt;&lt;text class="pele-label" x="0" y="4.9" text-anchor="middle"&gt;Ubuntu's cloud image&lt;/text&gt;
&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;p&gt;When devvm refuses something in the file, it stops with one line that names the file, before it makes anything. For invalid JSON, it names the line and column.&lt;/p&gt;
&lt;h2 data-hextra-search-id="updating-a-vm-from-the-file"&gt;Updating a VM from the file&lt;span class="hx:absolute hx:-mt-20" id="updating-a-vm-from-the-file"&gt;&lt;/span&gt;
&lt;a href="#updating-a-vm-from-the-file" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you change the file, run &lt;code&gt;devvm update&lt;/code&gt;. devvm reads the file as it is now, and before it changes anything, it refuses what it would refuse for a new VM. Then it asks to make the VM again from the file, keeping its home folder, the project folder and its settings, as for an &lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VM&lt;/a&gt;, and everything else on the VM&amp;rsquo;s disk is lost. &lt;code&gt;devvm update --force&lt;/code&gt; doesn&amp;rsquo;t ask, and without a terminal devvm refuses unless you give &lt;code&gt;--force&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;devvm replaces only what the file gave the VM, and it keeps what you chose:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Toolchains and layers.&lt;/strong&gt; The ones the file&amp;rsquo;s features gave the VM go when the file no longer has those features, and the ones the file&amp;rsquo;s new features map to are added. The ones you chose yourself stay, whether you gave them with &lt;code&gt;--tools&lt;/code&gt; or &lt;code&gt;--layers&lt;/code&gt;, &lt;code&gt;devvm setup&lt;/code&gt; chose them, or the folder&amp;rsquo;s other files call for them. One you left out in the list, or took out later, stays out.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The container image.&lt;/strong&gt; The VM&amp;rsquo;s base starts from the file&amp;rsquo;s new &lt;code&gt;image&lt;/code&gt;, pinned as for a new VM. When the file no longer has one, the base starts from &lt;code&gt;$DEVVM_FROM&lt;/code&gt;, or else from Ubuntu&amp;rsquo;s cloud image. A VM made with &lt;code&gt;--from&lt;/code&gt; keeps its base, and devvm says that it ignores &lt;code&gt;image&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The ports.&lt;/strong&gt; The ports the file added go when the file no longer lists them, and the ones it lists anew are added, as &lt;code&gt;devvm ports add&lt;/code&gt; adds them. The ports you added with &lt;code&gt;devvm ports add&lt;/code&gt; stay, and one of the file&amp;rsquo;s that you took out with &lt;code&gt;devvm ports rm&lt;/code&gt; stays out. A VM made with &lt;code&gt;--ports&lt;/code&gt; gets the ports the file lists anew, but not the ones &lt;code&gt;--ports&lt;/code&gt; won over.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The environment and the commands.&lt;/strong&gt; They&amp;rsquo;re the file&amp;rsquo;s new ones, and the commands that run once run again on the new disk.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When the file is gone, devvm makes the VM again without it, so what the file gave goes, and so do its environment and commands. When a file appears for a VM made without one, devvm makes the VM again as the file says, as it would a new VM.&lt;/p&gt;
&lt;h2 data-hextra-search-id="properties"&gt;Properties&lt;span class="hx:absolute hx:-mt-20" id="properties"&gt;&lt;/span&gt;
&lt;a href="#properties" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;What devvm does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The VM&amp;rsquo;s base starts from it, as with &lt;a href="https://next.devvm.dev/docs/using/from/"&gt;&lt;code&gt;--from&lt;/code&gt;&lt;/a&gt;. devvm uses only an image that its registry gives anyone who asks anonymously, pinned to that digest. It never uses an image only Docker has, one only your registry login reaches, or one on this machine or its network, which is &lt;code&gt;localhost&lt;/code&gt; or a registry whose address is loopback, private or link-local, by name or as it resolves.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;features&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ghcr.io/devcontainers/features/docker-in-docker&lt;/code&gt; is devvm&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;docker layer&lt;/a&gt;. A feature under &lt;code&gt;ghcr.io/devcontainers/features/&lt;/code&gt; named after one of devvm&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;toolchains&lt;/a&gt;, such as &lt;code&gt;ghcr.io/devcontainers/features/node&lt;/code&gt;, is that shared toolchain. devvm ignores their options and says so in one line. It refuses &lt;code&gt;docker-outside-of-docker&lt;/code&gt;, which is this machine&amp;rsquo;s Docker, and every other feature. devvm never fetches or runs a feature&amp;rsquo;s script.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;forwardPorts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm forwards numbers, &lt;code&gt;localhost:N&lt;/code&gt; and &lt;code&gt;127.0.0.1:N&lt;/code&gt; to this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; alone, adding them to your ports as &lt;code&gt;devvm ports add&lt;/code&gt; does (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;ports&lt;/a&gt;). With every port forwarded, which is the default, they&amp;rsquo;re among them already. &lt;code&gt;devvm ports rm&lt;/code&gt; takes one out, as for any port. It ignores other hosts&amp;rsquo; ports and says so in one line.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;containerEnv&lt;/code&gt;, &lt;code&gt;remoteEnv&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The VM&amp;rsquo;s environment, which login shells and the commands below get. &lt;code&gt;remoteEnv&lt;/code&gt; wins over &lt;code&gt;containerEnv&lt;/code&gt;, and devvm&amp;rsquo;s own variables, such as &lt;code&gt;LANG&lt;/code&gt; and secrets, win over both. A &lt;code&gt;remoteEnv&lt;/code&gt; of &lt;code&gt;null&lt;/code&gt; sets nothing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;onCreateCommand&lt;/code&gt;, &lt;code&gt;updateContentCommand&lt;/code&gt;, &lt;code&gt;postCreateCommand&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;They run once, in that order, once the VM is made and set up (&lt;a href="#commands"&gt;commands&lt;/a&gt;).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;postStartCommand&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;It runs at each start, on the first launch after the VM started.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;initializeCommand&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;It never runs, because it would run on this machine, and devvm says so in one line.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;build&lt;/code&gt;, &lt;code&gt;dockerFile&lt;/code&gt;, &lt;code&gt;dockerfile&lt;/code&gt;, &lt;code&gt;dockerComposeFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Refused, because devvm starts a VM only from an image.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;postAttachCommand&lt;/code&gt;, &lt;code&gt;privileged&lt;/code&gt;, &lt;code&gt;capAdd&lt;/code&gt;, &lt;code&gt;securityOpt&lt;/code&gt;, &lt;code&gt;mounts&lt;/code&gt;, &lt;code&gt;runArgs&lt;/code&gt;, &lt;code&gt;workspaceMount&lt;/code&gt;, &lt;code&gt;workspaceFolder&lt;/code&gt;, &lt;code&gt;remoteUser&lt;/code&gt;, &lt;code&gt;containerUser&lt;/code&gt;, &lt;code&gt;updateRemoteUserUID&lt;/code&gt;, &lt;code&gt;init&lt;/code&gt;, &lt;code&gt;shutdownAction&lt;/code&gt;, &lt;code&gt;overrideCommand&lt;/code&gt;, &lt;code&gt;hostRequirements&lt;/code&gt;, &lt;code&gt;appPort&lt;/code&gt;, &lt;code&gt;portsAttributes&lt;/code&gt;, &lt;code&gt;otherPortsAttributes&lt;/code&gt;, &lt;code&gt;userEnvProbe&lt;/code&gt;, &lt;code&gt;waitFor&lt;/code&gt;, &lt;code&gt;overrideFeatureInstallOrder&lt;/code&gt;, &lt;code&gt;context&lt;/code&gt;, &lt;code&gt;service&lt;/code&gt;, &lt;code&gt;runServices&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ignored, and named in one line.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;name&lt;/code&gt;, &lt;code&gt;customizations&lt;/code&gt;, &lt;code&gt;$schema&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ignored.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;anything else&lt;/td&gt;
&lt;td&gt;Ignored, and named in one line.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="commands"&gt;Commands&lt;span class="hx:absolute hx:-mt-20" id="commands"&gt;&lt;/span&gt;
&lt;a href="#commands" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A command is a string, which devvm runs with &lt;code&gt;sh -c&lt;/code&gt;, an array, which it runs as it is, or an object of named commands, which it runs one by one, sorted by name. The commands run in the VM, as its user, in the project folder, in a login shell, and never on this machine. Their output goes to the &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;run log&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When a command fails, devvm names it in one line, and the commands after it that would run once, or at that start, don&amp;rsquo;t run. devvm keeps the VM and opens it, because the command is the project&amp;rsquo;s and not devvm&amp;rsquo;s. The commands reach only what the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt; allows, like anything else in the VM.&lt;/p&gt;
&lt;h2 data-hextra-search-id="variables"&gt;Variables&lt;span class="hx:absolute hx:-mt-20" id="variables"&gt;&lt;/span&gt;
&lt;a href="#variables" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;${containerWorkspaceFolder}&lt;/code&gt;, &lt;code&gt;${containerWorkspaceFolderBasename}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the project folder, at the same path in the VM, and its name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;${containerEnv:NAME}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in a string command and in &lt;code&gt;containerEnv&lt;/code&gt; and &lt;code&gt;remoteEnv&lt;/code&gt;, the VM&amp;rsquo;s own &lt;code&gt;NAME&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;${localEnv:NAME}&lt;/code&gt;, &lt;code&gt;${env:NAME}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;refused, because devvm never puts this machine&amp;rsquo;s environment in a VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;${localWorkspaceFolder}&lt;/code&gt;, &lt;code&gt;${localWorkspaceFolderBasename}&lt;/code&gt;, &lt;code&gt;${devcontainerId}&lt;/code&gt;, &lt;code&gt;${containerEnv:NAME}&lt;/code&gt; elsewhere&lt;/td&gt;
&lt;td&gt;refused&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;devvm leaves any other &lt;code&gt;${…}&lt;/code&gt; as it is, for the VM&amp;rsquo;s shell, such as &lt;code&gt;${HOME}&lt;/code&gt; in a command.&lt;/p&gt;
&lt;h2 data-hextra-search-id="security"&gt;Security&lt;span class="hx:absolute hx:-mt-20" id="security"&gt;&lt;/span&gt;
&lt;a href="#security" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The file belongs to the project, so a VM can rewrite it for the folder&amp;rsquo;s next VM, or for itself when you run &lt;code&gt;devvm update&lt;/code&gt;, and devvm never lets it run anything on this machine, reach this machine&amp;rsquo;s files or environment, add a mount or weaken confinement. An &lt;code&gt;image&lt;/code&gt; from it can still be any public container image, whose own code runs as root while devvm builds the VM&amp;rsquo;s base, as with &lt;code&gt;--from&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/security/#a-projects-devcontainerjson"&gt;security model&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Its &lt;code&gt;forwardPorts&lt;/code&gt; open ports on this machine, even when you&amp;rsquo;ve narrowed your ports with &lt;code&gt;devvm ports -g&lt;/code&gt; or &lt;code&gt;devvm ports&lt;/code&gt;. devvm forwards them only to this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, never to its other addresses, and never takes a port that a program on this machine already has, just as for &lt;code&gt;devvm ports add&lt;/code&gt;. Anything on this machine that connects to such a port reaches what the VM serves there, including a web page in your browser, so for a repo you don&amp;rsquo;t trust, check its file first, or run &lt;code&gt;devvm --ports none&lt;/code&gt; or &lt;code&gt;devvm --no-devcontainer&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;ports the VM listens on&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>devvm 0.2.0</title><link>https://next.devvm.dev/docs/releases/0.2.0/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/releases/0.2.0/</guid><description>
&lt;p&gt;This page covers 0.2.0 and its release candidates, so far 0.2.0-rc.1, and it&amp;rsquo;s written as 0.2.0 is made, so each release candidate adds its changes here. 0.2.0-rc.1 adds to 0.1.1-rc.3, and 0.2.0 takes 0.1.1&amp;rsquo;s place, because its breaking changes need a new minor version. Install the release candidate with &lt;code&gt;devvm upgrade --to 0.2.0-rc.1&lt;/code&gt;, the install script&amp;rsquo;s &lt;code&gt;--version 0.2.0-rc.1&lt;/code&gt;, or &lt;code&gt;brew install devvmhq/tap/devvm-rc&lt;/code&gt;, while Homebrew&amp;rsquo;s &lt;code&gt;devvm&lt;/code&gt; stays on 0.1.0.&lt;/p&gt;
&lt;p&gt;Each change below has a section of its own, which says what was wrong or missing, how it showed, how devvm works now and what you do. The changelog&amp;rsquo;s entry for each release gives each of the same changes in one sentence, sorted by who notices it, and its What to do section lists what to do once you&amp;rsquo;ve upgraded.&lt;/p&gt;
&lt;h2 data-hextra-search-id="breaking-changes"&gt;Breaking changes&lt;span class="hx:absolute hx:-mt-20" id="breaking-changes"&gt;&lt;/span&gt;
&lt;a href="#breaking-changes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 data-hextra-search-id="at-most-17-vms-run-at-once"&gt;At most 17 VMs run at once&lt;span class="hx:absolute hx:-mt-20" id="at-most-17-vms-run-at-once"&gt;&lt;/span&gt;
&lt;a href="#at-most-17-vms-run-at-once" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Root in a VM could make the VM&amp;rsquo;s ssh port answer as a web server, and because that port is on &lt;code&gt;localhost&lt;/code&gt;, a page it served could get the cookies of the apps you use on &lt;code&gt;localhost&lt;/code&gt;, even in a VM that forwards no ports. Each VM&amp;rsquo;s ssh now uses one of the 17 ports from 1024 up that every browser refuses, so no page in your browser reaches a server in a VM through that port.&lt;/p&gt;
&lt;p&gt;So at most 17 VMs run at once. A start past 17 fails and names the VMs that run on those ports, so stop one of them first (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#too-many-vms-at-once"&gt;too many VMs at once&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A VM that forwards every port leaves out those 17 ports, so that a VM can&amp;rsquo;t take the ports that other VMs&amp;rsquo; ssh needs. A server in the VM on one of them, such as an X server on 6000, reaches this machine only when you list its port with &lt;code&gt;devvm ports&lt;/code&gt;, and &lt;code&gt;devvm ports&lt;/code&gt; and each launch warn when a VM&amp;rsquo;s list names one of them (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;ports&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Each existing VM&amp;rsquo;s ssh moves to one of those ports at the VM&amp;rsquo;s next start. That&amp;rsquo;s the one change devvm makes to the VM&amp;rsquo;s Lima config, and like any change there, it gives the VM new ssh host keys. A VM that runs as you upgrade keeps its old port until then, and devvm warns of it at each launch, so run &lt;code&gt;devvm stop&lt;/code&gt; in its folder, and its next start moves it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="names-are-looked-up-as-theyre-written"&gt;Names are looked up as they&amp;rsquo;re written&lt;span class="hx:absolute hx:-mt-20" id="names-are-looked-up-as-theyre-written"&gt;&lt;/span&gt;
&lt;a href="#names-are-looked-up-as-theyre-written" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The proxy used to look names up with this machine&amp;rsquo;s DNS search domain, which macOS takes from the network&amp;rsquo;s settings and Linux from &lt;code&gt;/etc/resolv.conf&lt;/code&gt;. When either host had a public address, no rule judged the name that the search domain made, so with &lt;code&gt;api.corp.example.com&lt;/code&gt; denied and &lt;code&gt;**&lt;/code&gt; allowing the rest, a VM could reach that host as &lt;code&gt;api&lt;/code&gt;, or &lt;code&gt;api.eu.corp.example.com&lt;/code&gt; as &lt;code&gt;api.eu&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The proxy now looks each name up as it&amp;rsquo;s written, and it no longer adds this machine&amp;rsquo;s DNS search domain, so a short host name no longer reaches a host through the proxy. A tool in a VM that reached a host on your company&amp;rsquo;s network by a name such as &lt;code&gt;jenkins&lt;/code&gt; now needs the host&amp;rsquo;s full name, such as &lt;code&gt;jenkins.corp.example.com&lt;/code&gt;, and a block for a name without a dot says to use its full name (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-name-that-doesnt-resolve"&gt;a name that doesn&amp;rsquo;t resolve&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="claude-codes-plugins-in-the-agent-store"&gt;Claude Code&amp;rsquo;s plugins in the agent store&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-plugins-in-the-agent-store"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-plugins-in-the-agent-store" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm 0.1.0&amp;rsquo;s &lt;code&gt;devvm agent import&lt;/code&gt; copied your whole &lt;code&gt;~/.claude/plugins&lt;/code&gt; into devvm&amp;rsquo;s agent store, where every VM with Claude Code could read it, plugins&amp;rsquo; data included. The store now keeps only what a seed has of Claude Code&amp;rsquo;s plugins, as &lt;a href="#claude-codes-plugins-in-a-vm"&gt;Claude Code&amp;rsquo;s plugins in a VM&lt;/a&gt; describes.&lt;/p&gt;
&lt;p&gt;If you imported Claude Code&amp;rsquo;s settings with devvm 0.1.0, the first start of any VM takes your plugins&amp;rsquo; data out of the store, along with the folder&amp;rsquo;s other entries that are this machine&amp;rsquo;s own, such as &lt;code&gt;installed_plugins.json&lt;/code&gt;. It warns once, naming what it took, and it leaves your own &lt;code&gt;~/.claude/plugins&lt;/code&gt; as it is (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;If the store&amp;rsquo;s plugins folder is a link, or below one, which only a store you made yourself can be, no VM with Claude Code starts until you make it a folder of its own, because a VM&amp;rsquo;s mount would follow the link.&lt;/p&gt;
&lt;p&gt;If a plugin&amp;rsquo;s data held a login of the plugin&amp;rsquo;s own, every VM with Claude Code could read that login, so sign in to that plugin again where you don&amp;rsquo;t trust those VMs. A VM that runs as you upgrade loses the store&amp;rsquo;s entries that are this machine&amp;rsquo;s own from its mount at the first start of any VM, so Claude Code there may not find the store&amp;rsquo;s plugins until that VM&amp;rsquo;s next launch. On a Linux host, the VM can keep seeing what it had read of them until its next start.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-linked-agent-store-is-refused"&gt;A linked agent store is refused&lt;span class="hx:absolute hx:-mt-20" id="a-linked-agent-store-is-refused"&gt;&lt;/span&gt;
&lt;a href="#a-linked-agent-store-is-refused" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; used to write through a link in devvm&amp;rsquo;s agent store and take out whatever they hadn&amp;rsquo;t written in the folder it led to, which for a link to your home folder deleted your files.&lt;/p&gt;
&lt;p&gt;Now they refuse a linked store: they fail before they change anything, naming the link, when a folder on the way to what they write in the store is a link, from &lt;code&gt;~/.config/devvm/agents&lt;/code&gt; down, such as &lt;code&gt;~/.config/devvm/agents/claude&lt;/code&gt; linked into a dotfiles repo. Make that folder one of its own, then run the command again (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="changes"&gt;Changes&lt;span class="hx:absolute hx:-mt-20" id="changes"&gt;&lt;/span&gt;
&lt;a href="#changes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 data-hextra-search-id="each-vms-proxy-runs-as-two-processes"&gt;Each VM&amp;rsquo;s proxy runs as two processes&lt;span class="hx:absolute hx:-mt-20" id="each-vms-proxy-runs-as-two-processes"&gt;&lt;/span&gt;
&lt;a href="#each-vms-proxy-runs-as-two-processes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM&amp;rsquo;s proxy used to be one process, which read every byte the VM sent and held all of your secrets. It&amp;rsquo;s now two. Only &lt;code&gt;devvm _proxy&lt;/code&gt; reads your Keychain, your agents&amp;rsquo; login files and your other files, and &lt;code&gt;devvm _proxy-child&lt;/code&gt;, which reads the VM&amp;rsquo;s network, asks &lt;code&gt;devvm _proxy&lt;/code&gt; for the rest, such as each connection and each value bound to the VM.&lt;/p&gt;
&lt;p&gt;So besides the VM&amp;rsquo;s own proxy password and CAs and your company proxy&amp;rsquo;s password, the code that reads every byte a VM sends holds only the values that the VM&amp;rsquo;s own bindings name, each for a few minutes after it was last asked for, and never a new login&amp;rsquo;s tokens, its refresh token among them (&lt;a href="https://next.devvm.dev/docs/internals/processes/#a-vms-proxy"&gt;a VM&amp;rsquo;s proxy&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;With the split, an error reply from an agent&amp;rsquo;s token endpoint reaches the VM as it is up to 1 MiB, and gets &lt;code&gt;502&lt;/code&gt; past that, and a build&amp;rsquo;s proxy writes its logs to a &lt;code&gt;logs/&lt;/code&gt; folder of their own in its folder.&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s proxy that runs as you upgrade stays one process, without a sandbox, until the VM&amp;rsquo;s next launch. That launch starts it again as two processes, because a launch starts a VM&amp;rsquo;s proxy again for every new devvm, and until then, &lt;code&gt;devvm doctor&lt;/code&gt; names each VM whose proxy an older devvm started (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-childs-sandbox-on-macos"&gt;The child&amp;rsquo;s sandbox on macOS&lt;span class="hx:absolute hx:-mt-20" id="the-childs-sandbox-on-macos"&gt;&lt;/span&gt;
&lt;a href="#the-childs-sandbox-on-macos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On macOS, &lt;code&gt;devvm _proxy-child&lt;/code&gt; starts under &lt;code&gt;sandbox-exec&lt;/code&gt;, with a profile that lets it write only its VM&amp;rsquo;s logs and the shared Nix cache and look at your policy files. A bug that a VM drove there couldn&amp;rsquo;t read your files, reach the Keychain or connect to this machine&amp;rsquo;s unix sockets, such as ssh&amp;rsquo;s and Docker&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-childs-sandbox-on-linux"&gt;The child&amp;rsquo;s sandbox on Linux&lt;span class="hx:absolute hx:-mt-20" id="the-childs-sandbox-on-linux"&gt;&lt;/span&gt;
&lt;a href="#the-childs-sandbox-on-linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On Linux, before it reads a byte of the VM&amp;rsquo;s, &lt;code&gt;devvm _proxy-child&lt;/code&gt; confines itself with Landlock and a seccomp filter. A bug that a VM drove there could read and write only its VM&amp;rsquo;s logs and the shared Nix cache, and couldn&amp;rsquo;t change any other file&amp;rsquo;s mode, owner, attributes or times, run a program, or connect to a unix socket, such as an ssh master&amp;rsquo;s, Docker&amp;rsquo;s or your SSH agent&amp;rsquo;s. It could still learn whether a file of yours exists, its size and when it changed (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-child-without-its-whole-sandbox"&gt;A child without its whole sandbox&lt;span class="hx:absolute hx:-mt-20" id="a-child-without-its-whole-sandbox"&gt;&lt;/span&gt;
&lt;a href="#a-child-without-its-whole-sandbox" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A proxy that can&amp;rsquo;t get its whole sandbox keeps the VM&amp;rsquo;s network, and &lt;code&gt;devvm doctor&lt;/code&gt; warns. On macOS, if &lt;code&gt;sandbox-exec&lt;/code&gt; is missing or fails to start the child, the child runs without the sandbox. On Linux, a kernel without Landlock or seccomp filters, or whose Landlock is older than ABI 6 or lacks its fix for signals between threads, confines the child only in part. Either way the VM keeps its network, and &lt;code&gt;devvm doctor&lt;/code&gt; warns for each VM whose proxy runs that way, naming what the kernel lacks on Linux (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-child-connects-only-through-devvm-_proxy"&gt;The child connects only through &lt;code&gt;devvm _proxy&lt;/code&gt;&lt;span class="hx:absolute hx:-mt-20" id="the-child-connects-only-through-devvm-_proxy"&gt;&lt;/span&gt;
&lt;a href="#the-child-connects-only-through-devvm-_proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Wherever its sandbox runs, a bug that a VM drove in the child can&amp;rsquo;t reach this machine&amp;rsquo;s services on &lt;code&gt;localhost&lt;/code&gt;, such as your dev servers, Docker&amp;rsquo;s published ports and other VMs&amp;rsquo; proxies, nor this machine&amp;rsquo;s own addresses or your LAN&amp;rsquo;s private addresses, unless a rule names the address, just as the VM can&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;A rule such as &lt;code&gt;devvm network allow 127.0.0.1:5432&lt;/code&gt; still applies from the next connection, and a company proxy on &lt;code&gt;localhost&lt;/code&gt; still works, though the child reaches whatever that company proxy reaches, as the VM does. Because &lt;code&gt;devvm _proxy&lt;/code&gt; looks up the child&amp;rsquo;s names, the child reads no file below &lt;code&gt;/etc&lt;/code&gt; on Linux and doesn&amp;rsquo;t talk to mDNSResponder on macOS (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-doctor-checks-every-vms-state"&gt;devvm doctor checks every VM&amp;rsquo;s state&lt;span class="hx:absolute hx:-mt-20" id="devvm-doctor-checks-every-vms-state"&gt;&lt;/span&gt;
&lt;a href="#devvm-doctor-checks-every-vms-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm doctor&lt;/code&gt; warns once of each VM whose state devvm can&amp;rsquo;t read, naming the VM, the file and why, even when it can&amp;rsquo;t read the VM&amp;rsquo;s folder, and it changes nothing. It reads each VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt; as every command on a VM does. Such a VM used to hide doctor&amp;rsquo;s warnings about the other VMs&amp;rsquo; policy files, and the warnings that &lt;code&gt;devvm network&lt;/code&gt; gives for every VM, and it no longer does (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-file-devvm-cant-read"&gt;a file devvm can&amp;rsquo;t read&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="credentials-in-a-copied-marketplace"&gt;Credentials in a copied marketplace&lt;span class="hx:absolute hx:-mt-20" id="credentials-in-a-copied-marketplace"&gt;&lt;/span&gt;
&lt;a href="#credentials-in-a-copied-marketplace" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A Claude Code marketplace can have a password or an access token in its clone&amp;rsquo;s git config or in its source in &lt;code&gt;known_marketplaces.json&lt;/code&gt;, and every VM with Claude Code can read it once it&amp;rsquo;s in devvm&amp;rsquo;s agent store. &lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; now warn when they copy such a marketplace. The warning names the marketplace, the store&amp;rsquo;s file and the keys, and the marketplace is copied as before (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;mounts&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-agent-imports-bounds"&gt;devvm agent import&amp;rsquo;s bounds&lt;span class="hx:absolute hx:-mt-20" id="devvm-agent-imports-bounds"&gt;&lt;/span&gt;
&lt;a href="#devvm-agent-imports-bounds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent import&lt;/code&gt; copies at most 20,000 files, folders and links, 128 MiB, and 16 MiB in one file, of each agent&amp;rsquo;s folder. An agent&amp;rsquo;s folder that holds more, such as one that a VM&amp;rsquo;s project inside it filled, fails the import before the store changes, naming the folder, so take out what it doesn&amp;rsquo;t need and import again (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine"&gt;importing from this machine&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-failed-import-changes-nothing"&gt;A failed import changes nothing&lt;span class="hx:absolute hx:-mt-20" id="a-failed-import-changes-nothing"&gt;&lt;/span&gt;
&lt;a href="#a-failed-import-changes-nothing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A failed &lt;code&gt;devvm agent import&lt;/code&gt; leaves the store as it was. That holds whether the import fails while it reads, such as at a file that changed meanwhile, or while it puts the settings and logins in place, such as at a login it can&amp;rsquo;t save. In the rare case that putting the store back fails too, the import names what it kept (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine"&gt;importing from this machine&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-project-in-an-agents-folder"&gt;A project in an agent&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="a-project-in-an-agents-folder"&gt;&lt;/span&gt;
&lt;a href="#a-project-in-an-agents-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When a VM&amp;rsquo;s project folder is inside a coding agent&amp;rsquo;s folder on this machine, such as a skill you work on in &lt;code&gt;~/.claude/skills/mine&lt;/code&gt;, or holds one, such as &lt;code&gt;~/.pi&lt;/code&gt;, code in the VM can change that agent&amp;rsquo;s settings on this machine, and so the settings that &lt;code&gt;devvm agent import&lt;/code&gt; copies for every VM.&lt;/p&gt;
&lt;p&gt;Each launch of the VM now warns of it in one line, and so does the import, which also leaves out an agent&amp;rsquo;s folder that a link in a VM&amp;rsquo;s project folder leads elsewhere (&lt;a href="https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses"&gt;project folders devvm refuses&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="an-import-while-a-vms-state-cant-be-read"&gt;An import while a VM&amp;rsquo;s state can&amp;rsquo;t be read&lt;span class="hx:absolute hx:-mt-20" id="an-import-while-a-vms-state-cant-be-read"&gt;&lt;/span&gt;
&lt;a href="#an-import-while-a-vms-state-cant-be-read" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent import&lt;/code&gt; can&amp;rsquo;t tell where a VM&amp;rsquo;s project folder is while it can&amp;rsquo;t read that VM&amp;rsquo;s state, so it follows no links then. It warns of each VM whose state it can&amp;rsquo;t read, naming the state. Until that&amp;rsquo;s fixed, it leaves out every link out of an agent&amp;rsquo;s folder, and an agent&amp;rsquo;s folder or login whose path leads through a link, one on the way to your home folder included unless only root can change it, so run &lt;code&gt;devvm doctor&lt;/code&gt; and import again (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine"&gt;importing from this machine&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="cursors-cli-and-your-cursor-account"&gt;Cursor&amp;rsquo;s CLI and your Cursor account&lt;span class="hx:absolute hx:-mt-20" id="cursors-cli-and-your-cursor-account"&gt;&lt;/span&gt;
&lt;a href="#cursors-cli-and-your-cursor-account" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Cursor&amp;rsquo;s CLI in a VM can change less of your Cursor account. Its proxy refuses more of the methods that change your account, your team or your cloud agents, such as merging a cloud agent&amp;rsquo;s pull request, forking or pinning a cloud agent, or writing to its machine, and every call that the CLI itself makes still passes. Do those from Cursor on your machine (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#cursor-cli-login"&gt;Cursor CLI login&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="pins"&gt;Pins&lt;span class="hx:absolute hx:-mt-20" id="pins"&gt;&lt;/span&gt;
&lt;a href="#pins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;mise is 2026.11.10, in base and on this machine, the docker layer&amp;rsquo;s Docker is 29.10.0 and its compose 5.8.0, and Cursor&amp;rsquo;s CLI is 2026.11.17-f532c45. The new mise and Docker change what goes into the images, so base, every image built on it and every shared tool that mise installs are built again once.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;devvm update&lt;/code&gt; in each existing VM&amp;rsquo;s folder. Until you do, a VM made from an older image says it&amp;rsquo;s outdated, and every existing VM says there are newer shared tools at the same versions. The first update or new VM builds base and each of its shared tools again, one at a time, which takes several minutes.&lt;/p&gt;
&lt;h3 data-hextra-search-id="pins-since-020-rc1"&gt;Pins since 0.2.0-rc.1&lt;span class="hx:absolute hx:-mt-20" id="pins-since-020-rc1"&gt;&lt;/span&gt;
&lt;a href="#pins-since-020-rc1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;mise is 2026.11.14, in base and on this machine, the nix layer&amp;rsquo;s Nix is 2.36.0, and the docker layer&amp;rsquo;s buildx is 0.39.1 and its model plugin 1.2.10. The new mise changes what goes into base, so base, every image built on it and every shared tool that mise installs are built again once, as they were for 0.2.0-rc.1&amp;rsquo;s pins.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;devvm update&lt;/code&gt; in each existing VM&amp;rsquo;s folder, and give the first one several minutes.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-faster-first-run"&gt;A faster first run&lt;span class="hx:absolute hx:-mt-20" id="a-faster-first-run"&gt;&lt;/span&gt;
&lt;a href="#a-faster-first-run" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A first run with the defaults took about two and a half minutes on a fast link, and a third of that came after base was built. The shared tool images built one after another, and the tools&amp;rsquo; versions were resolved only once base was done. Now up to four tool images build side by side, each in a build VM of 2 GiB and 2 CPUs. devvm runs only as many as this machine has room for after keeping 6 GiB and 2 CPUs for itself and the memory of devvm&amp;rsquo;s running VMs, and as many as the free disk allows. The tools&amp;rsquo; versions now resolve while base builds. On an M4 Mac mini the defaults&amp;rsquo; first run went from 156 to 118 seconds, and on an x86_64 Linux host from 159 to 125 (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A first run also downloads about 210 MB less on arm64 and about 280 MB less on amd64. devvm&amp;rsquo;s own mise comes as its &lt;code&gt;.tar.gz&lt;/code&gt;, in base and on this machine, a third of the binary&amp;rsquo;s size, and base&amp;rsquo;s build fetches only the package lists apt installs from, with no translations, AppStream components or command-not-found metadata.&lt;/p&gt;
&lt;p&gt;While tool images build side by side, one status line covers them, and each line of a build&amp;rsquo;s commands in the run log starts with its tool&amp;rsquo;s name, such as &lt;code&gt;[node]&lt;/code&gt;. When one fails, devvm stops the others and shows the end of that tool&amp;rsquo;s own lines. Each build VM has a name of its own on Lima, &lt;code&gt;devvm-tools-build&lt;/code&gt; and then &lt;code&gt;devvm-tools-build-2&lt;/code&gt; to &lt;code&gt;devvm-tools-build-4&lt;/code&gt;, and a later build or &lt;code&gt;devvm gc&lt;/code&gt; deletes any of them that a killed or failed run left, and gc names each one it deletes.&lt;/p&gt;
&lt;p&gt;These changes, and the next section&amp;rsquo;s, change what goes into base, every layer and every shared tool, so they&amp;rsquo;re built again once, with the pins since 0.2.0-rc.1. Run &lt;code&gt;devvm update&lt;/code&gt; in each existing VM&amp;rsquo;s folder, as for those pins.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-first-run-on-a-bad-network"&gt;A first run on a bad network&lt;span class="hx:absolute hx:-mt-20" id="a-first-run-on-a-bad-network"&gt;&lt;/span&gt;
&lt;a href="#a-first-run-on-a-bad-network" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A first run failed at the first connection that was cut or stalled, in Lima&amp;rsquo;s download of Ubuntu&amp;rsquo;s cloud image, which neither retried nor timed out, or in any of the downloads in base&amp;rsquo;s build and the tool images&amp;rsquo; builds, which gave up at once or tried again from nothing. Now each of them goes on, and a first run on a network that cut or stalled a connection every 250 MB came through seven faults (&lt;a href="https://next.devvm.dev/docs/internals/images/#building"&gt;building&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ubuntu&amp;rsquo;s cloud image:&lt;/strong&gt; devvm downloads it itself, and a download that&amp;rsquo;s cut or stalls goes on from where it stopped, in the same run or the next (&lt;a href="#ubuntus-cloud-image-in-devvms-folder"&gt;Ubuntu&amp;rsquo;s cloud image in devvm&amp;rsquo;s folder&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-fetch&lt;/code&gt;&lt;/strong&gt;, which base and every layer download through, gives up on a connection slower than 1 KB/s for 30 seconds and goes on from where it stopped, five tries in all, and a file that doesn&amp;rsquo;t match its checksum is fetched again from nothing once. Your own layers&amp;rsquo; &lt;code&gt;devvm-fetch&lt;/code&gt; downloads get the same.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;apt&lt;/strong&gt; tries a package&amp;rsquo;s download again three times, &lt;strong&gt;crane&lt;/strong&gt; five times and &lt;strong&gt;mise&lt;/strong&gt; six times, in tool builds and on this machine, and &lt;strong&gt;oh-my-bash&lt;/strong&gt;&amp;rsquo;s clone gets five tries in all.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;tldr --update&lt;/code&gt;&lt;/strong&gt;, in the &lt;code&gt;cli-tools&lt;/code&gt; feature, gives up after a minute, where a stalled download held base&amp;rsquo;s build for two minutes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="ubuntus-cloud-image-in-devvms-folder"&gt;Ubuntu&amp;rsquo;s cloud image in devvm&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="ubuntus-cloud-image-in-devvms-folder"&gt;&lt;/span&gt;
&lt;a href="#ubuntus-cloud-image-in-devvms-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm downloads the pinned Ubuntu cloud image itself into &lt;code&gt;~/.local/share/devvm/images/ubuntu/&amp;lt;sha256&amp;gt;.img&lt;/code&gt;, checks it against the pin and gives Lima that file, so Lima&amp;rsquo;s download cache no longer grows with each release. On a Mac that cache kept 3.3 GB for each release, the image and a copy converted to a raw disk, and devvm keeps the 943 MB image alone. The first build of base after the upgrade takes the image from Lima&amp;rsquo;s cache when that holds the pinned one, so a release that Ubuntu has since removed still builds, and it never changes Lima&amp;rsquo;s cache (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The download, and the lookups of Ubuntu&amp;rsquo;s dated releases, go through your company proxy and trust the CAs in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt;, as devvm&amp;rsquo;s own mise does, where Lima&amp;rsquo;s download went straight to Ubuntu and the lookups trusted this machine&amp;rsquo;s CAs alone. When the lookups or the download meet a certificate that this machine doesn&amp;rsquo;t trust, devvm names that folder, where the lookups used to say only to check that you&amp;rsquo;re online, and when a certificate is out of date or for another host, devvm says to check this machine&amp;rsquo;s date and time and what answers for the host on this network. Any other certificate that fails to verify is named by its reason, and none of these is tried again. Behind a company proxy whose rules block large downloads, a first build that used to reach Ubuntu directly now fails, saying that downloading Ubuntu&amp;rsquo;s cloud image failed, so ask for cloud-images.ubuntu.com to be let through (&lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt;). When Ubuntu no longer has the pinned release and Lima&amp;rsquo;s cache doesn&amp;rsquo;t hold it either, devvm says that the release is gone and names &lt;code&gt;devvm rebuild base&lt;/code&gt;, where Lima&amp;rsquo;s own error came before.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm space&lt;/code&gt; shows devvm&amp;rsquo;s copies as &lt;code&gt;cloud images&lt;/code&gt;, kept as state, since a release that Ubuntu removed can&amp;rsquo;t be downloaded again. &lt;code&gt;devvm gc --caches&lt;/code&gt; frees those that no image&amp;rsquo;s record names and that aren&amp;rsquo;t pinned now. Of Lima&amp;rsquo;s cache, it frees only an entry that an image record of devvm&amp;rsquo;s names, as an earlier release&amp;rsquo;s build of base left it, once devvm has its own copy of that image, and never one that Lima&amp;rsquo;s own templates use. So run it once after the upgrade to free the copy that Lima&amp;rsquo;s cache holds of the release your current base was built from, 3.3 GB on a Mac and 862 MB on Linux, unless the installed Lima&amp;rsquo;s own templates use that release, which most do today, and an older release&amp;rsquo;s copy, whose record a later &lt;code&gt;devvm rebuild base&lt;/code&gt; replaced, stays. &lt;code&gt;limactl prune&lt;/code&gt; frees the rest, your own downloads included (&lt;a href="https://next.devvm.dev/docs/using/space/#ubuntus-cloud-images"&gt;Ubuntu&amp;rsquo;s cloud images&lt;/a&gt;). It now fails when it can&amp;rsquo;t read the pin, &lt;code&gt;~/.local/share/devvm/images/ubuntu.json&lt;/code&gt;, rather than free an image the pin may name, so delete that file, which base can&amp;rsquo;t build from either, and the next build of base pins Ubuntu&amp;rsquo;s newest release.&lt;/p&gt;
&lt;h3 data-hextra-search-id="status-lines-for-slow-steps"&gt;Status lines for slow steps&lt;span class="hx:absolute hx:-mt-20" id="status-lines-for-slow-steps"&gt;&lt;/span&gt;
&lt;a href="#status-lines-for-slow-steps" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some of devvm&amp;rsquo;s slow steps used to show nothing while they ran. In a terminal, devvm now shows a status line that says what it&amp;rsquo;s waiting for during these steps (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;a command fails&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;finding the folder&amp;rsquo;s VM, checking it before a start, checking its network and reading its host keys, setting it up, running a &lt;code&gt;devcontainer.json&lt;/code&gt;&amp;rsquo;s commands, looking up a folder&amp;rsquo;s disk, checking Lima, deleting a VM or an image, applying the retention settings and installing an upgrade&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ls&lt;/code&gt; reading the VMs, &lt;code&gt;devvm doctor&lt;/code&gt; checking this machine, &lt;code&gt;devvm agent import&lt;/code&gt; reading your agents&amp;rsquo; folders and copying them into the store, and &lt;code&gt;devvm agent save&lt;/code&gt; reading and comparing the VM&amp;rsquo;s settings&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm clone add&lt;/code&gt;, &lt;code&gt;clone fetch&lt;/code&gt;, &lt;code&gt;clone on&lt;/code&gt; and &lt;code&gt;clone off&lt;/code&gt;, &lt;code&gt;devvm git-protect&lt;/code&gt;, &lt;code&gt;devvm stop&lt;/code&gt;, a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s check before &lt;code&gt;devvm rm&lt;/code&gt;, a history export or import, and &lt;code&gt;devvm ports&lt;/code&gt; as it starts a running VM&amp;rsquo;s port forwarder again&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm link&lt;/code&gt; as it asks about the VMs its links lead to, &lt;code&gt;link add&lt;/code&gt;, &lt;code&gt;link rm&lt;/code&gt;, &lt;code&gt;link publish&lt;/code&gt; and &lt;code&gt;link unpublish&lt;/code&gt;, &lt;code&gt;devvm group join&lt;/code&gt; and &lt;code&gt;group leave&lt;/code&gt;, and &lt;code&gt;devvm rm&lt;/code&gt; of a VM that others link to, as they give each running VM its changed links and check the VMs that links lead to&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm network learn&lt;/code&gt; and &lt;code&gt;network lock&lt;/code&gt; as they give a running VM&amp;rsquo;s proxy its new tier&lt;/li&gt;
&lt;li&gt;every stop of a VM, as for &lt;code&gt;devvm restart&lt;/code&gt; or a restart you agree to after changing a setting&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="status-lines-while-devvm-waits"&gt;Status lines while devvm waits&lt;span class="hx:absolute hx:-mt-20" id="status-lines-while-devvm-waits"&gt;&lt;/span&gt;
&lt;a href="#status-lines-while-devvm-waits" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While devvm waits for another devvm that&amp;rsquo;s changing the same thing, such as a VM&amp;rsquo;s state, its folders&amp;rsquo; layout, a group, an image&amp;rsquo;s build or the shared tools, a status line says so, and only while it waits. Some of those waits used to show nothing, and others printed a line after a few seconds that stayed. A run with &lt;code&gt;-v&lt;/code&gt;, or with its output piped, no longer prints that line, because a status line shows only in a terminal without &lt;code&gt;-v&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;a command fails&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="opencodes-worktrees-before-a-vm-goes"&gt;opencode&amp;rsquo;s worktrees before a VM goes&lt;span class="hx:absolute hx:-mt-20" id="opencodes-worktrees-before-a-vm-goes"&gt;&lt;/span&gt;
&lt;a href="#opencodes-worktrees-before-a-vm-goes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;opencode makes its worktrees in &lt;code&gt;~/.local/share/opencode/worktree&lt;/code&gt; in the VM, and a history export now leaves that folder out, because a git repository&amp;rsquo;s config can name a command that git runs (&lt;a href="#opencodes-automations-and-permissions-in-history"&gt;opencode&amp;rsquo;s automations and permissions in history&lt;/a&gt;). So the uncommitted changes in those worktrees went with the VM, with nothing to say so.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm rm&lt;/code&gt;, and a command that makes the VM again with &lt;code&gt;--clean-home&lt;/code&gt;, now check those worktrees first, starting a stopped VM for the check. devvm shows each worktree&amp;rsquo;s uncommitted changes under its path and asks before they go, and it asks too about a detached HEAD&amp;rsquo;s commits that nothing else in the VM has, a worktree that git can&amp;rsquo;t read, and more than 100 worktrees. &lt;code&gt;--force&lt;/code&gt; never answers that question, so without a terminal devvm refuses and keeps the VM. When only the worktrees have work, its refusal names &lt;code&gt;--no-worktree-check&lt;/code&gt;, a new flag that warns and goes ahead without the check. A remake&amp;rsquo;s messages name the command with &lt;code&gt;--clean-home&lt;/code&gt;, because &lt;code&gt;--no-worktree-check&lt;/code&gt; works only with it, and so do the clone check&amp;rsquo;s messages for &lt;code&gt;devvm clone off --clean-home&lt;/code&gt;. For a VM whose folder is gone, &lt;code&gt;devvm rm VM&lt;/code&gt; reads the worktrees from the running VM, and it refuses a stopped one, even with &lt;code&gt;--no-export&lt;/code&gt;, naming &lt;code&gt;devvm rm VM --no-export --no-worktree-check&lt;/code&gt;, because starting it would make its folder again. If a script deletes such VMs, or remakes them with &lt;code&gt;--clean-home&lt;/code&gt;, give it &lt;code&gt;--no-worktree-check&lt;/code&gt; where losing those changes is fine (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="reproducible-release-builds"&gt;Reproducible release builds&lt;span class="hx:absolute hx:-mt-20" id="reproducible-release-builds"&gt;&lt;/span&gt;
&lt;a href="#reproducible-release-builds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Two builds of the same release on two machines gave different archives, because each archive recorded the owner and group of the files on the machine that built it, and the binary&amp;rsquo;s version came from whichever tags that machine&amp;rsquo;s clone of the repo held. Now every release file but the signature is built in one container image, pinned by its digest, with no network, no capabilities, bounded processes and memory, and a time limit kept outside it, with the Go and GoReleaser that the release&amp;rsquo;s &lt;code&gt;mise.lock&lt;/code&gt; pins, from a repository that holds only the release&amp;rsquo;s commit and its own tag, and each archive file&amp;rsquo;s owner, group, mode and time are set. So the same tag, built on an arm64 Mac or on an x86_64 Linux machine, gives byte-identical archives, source tarball, &lt;code&gt;install.sh&lt;/code&gt; and &lt;code&gt;SHA256SUMS&lt;/code&gt;. On each change, CI builds the release twice, once under podman as root and once under Docker as another user, from a repository with a stray tag, and checks that the two builds agree and that every archive&amp;rsquo;s files are root&amp;rsquo;s. &lt;code&gt;scripts/release.sh --tag&lt;/code&gt; builds a published release again, unsigned, so another builder can compare its &lt;code&gt;SHA256SUMS&lt;/code&gt; with the release&amp;rsquo;s. Nothing changes for you (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#reproducible-releases"&gt;Reproducible releases&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="releases-signed-by-two-of-three-keys"&gt;Releases signed by two of three keys&lt;span class="hx:absolute hx:-mt-20" id="releases-signed-by-two-of-three-keys"&gt;&lt;/span&gt;
&lt;a href="#releases-signed-by-two-of-three-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Every release so far was signed by one minisign key, so whoever had that key could sign a release that devvm upgrade and the install script would install. devvm can now check a release against three release keys, one for GitHub&amp;rsquo;s CI, which builds each release, one for a co-signer, a machine of the maintainer&amp;rsquo;s that builds the same bytes again, and a recovery key kept offline. Once a devvm has the keys built in, devvm upgrade and its install script accept a release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; when any two of them signed it, each in a file of its own, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;, &lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt; or &lt;code&gt;SHA256SUMS.recovery.minisig&lt;/code&gt;, with the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, which must match the release being installed. Each file is checked only against its own key, and two signatures by one key count once.&lt;/p&gt;
&lt;p&gt;The keys themselves aren&amp;rsquo;t made yet, so this release has none built in, and its install script holds none. Until a release carries them, devvm upgrade and the install script check each release with the old key alone, as before, and a release that only the new keys signed is refused. The release that brings the keys is signed by the old key too, so this release upgrades to it.&lt;/p&gt;
&lt;p&gt;They still accept the old key&amp;rsquo;s signature, in &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, while releases bridge from it, so devvm 0.1 and 0.2, which know only that key, can upgrade to a release that the three keys sign, which carries the old key&amp;rsquo;s signature too, and devvm upgrade &lt;code&gt;--to&lt;/code&gt; and the install script&amp;rsquo;s &lt;code&gt;--version&lt;/code&gt; can still install a 0.1 or 0.2 release. While the bridge lasts, the old key alone still signs a release, as before. The install script also checks the old key&amp;rsquo;s trusted comment now, &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, where it took any &lt;code&gt;SHA256SUMS&lt;/code&gt; that the key signed, so a release&amp;rsquo;s files signed for another version are refused. Without minisign, the script now says that only the checksum is checked, which can&amp;rsquo;t tell who made the release, and prints the commands to check the signatures by hand: two of the three once it has the release keys, and the old key&amp;rsquo;s until then. Nothing changes for you (&lt;a href="https://next.devvm.dev/docs/internals/install/#the-release-keys-and-the-signatures"&gt;the release keys and the signatures&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#release-keys"&gt;Release keys&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-co-signer-for-releases"&gt;A co-signer for releases&lt;span class="hx:absolute hx:-mt-20" id="a-co-signer-for-releases"&gt;&lt;/span&gt;
&lt;a href="#a-co-signer-for-releases" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Two builders that build the same bytes can check each other only if the second one really rebuilds each release and refuses one that differs, and only if nothing else can publish. devvm now has that second builder, &lt;code&gt;devvm-cosign&lt;/code&gt;, a program of its own that a systemd timer runs hourly on a Linux machine of the maintainer&amp;rsquo;s. CI can only read the repo, so it hands each release&amp;rsquo;s files and its signature over as a workflow artifact. The co-signer checks CI&amp;rsquo;s signature and every file against &lt;code&gt;SHA256SUMS&lt;/code&gt;, checks the tag&amp;rsquo;s SSH signature against the signers its own config pins, rebuilds the tag with its own pinned copy of &lt;code&gt;scripts/release.sh&lt;/code&gt;, and signs &lt;code&gt;SHA256SUMS&lt;/code&gt; only when both builds match, writing a report when they don&amp;rsquo;t. Then it makes the GitHub release itself, and once two of the three release keys signed it, publishes it and commits to the tap the Homebrew formulas it renders from the signed &lt;code&gt;SHA256SUMS&lt;/code&gt; and the tag&amp;rsquo;s template, through a GitHub App&amp;rsquo;s token. Any release published since its state began that it didn&amp;rsquo;t make is an alert, whatever its tag. A build that fails three runs in a row is refused as a mismatch is, so it can&amp;rsquo;t hold up the releases behind it, and an older release made GitHub&amp;rsquo;s latest is an alert too. A refused build and an alert fail every run, and run a notify command of the maintainer&amp;rsquo;s, until the maintainer clears them with &lt;code&gt;devvm-cosign retry&lt;/code&gt; or &lt;code&gt;ack&lt;/code&gt;. It never signs an older version than one it signed, nor two manifests for one version, and a failed upload or publish is safe to run again. Its keys are root&amp;rsquo;s and reach it only as systemd&amp;rsquo;s credentials, and the podman service its builds run in sees neither them, nor its state, nor its processes, starts empty for each run, and lives for one build, though it still runs as the same user. It handles a published base the same way, re-signing an unchanged base without a rebuild, though never one built from an Ubuntu snapshot more than 60 days old, and it can&amp;rsquo;t rebuild a base yet. Nothing changes for you (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/"&gt;The co-signer&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="releases-through-ci-and-the-co-signer"&gt;Releases through CI and the co-signer&lt;span class="hx:absolute hx:-mt-20" id="releases-through-ci-and-the-co-signer"&gt;&lt;/span&gt;
&lt;a href="#releases-through-ci-and-the-co-signer" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Every release so far was built, signed and published from the maintainer&amp;rsquo;s machine, so that one machine decided what every user installed. Now the maintainer&amp;rsquo;s part of a release is signing its tag and pushing it, with &lt;code&gt;scripts/publish.sh&lt;/code&gt;. GitHub&amp;rsquo;s CI then builds the release in its Release workflow, once the maintainer approves the run in a protected environment. The workflow checks the tag&amp;rsquo;s SSH signature against signers kept in that environment, never a list in the tagged commit, builds the release in its pinned container, signs &lt;code&gt;SHA256SUMS&lt;/code&gt; with CI&amp;rsquo;s release key, adds a GitHub artifact attestation of every file, and hands the build to the co-signer. Its token can only read the repo, so CI can&amp;rsquo;t publish anything. The co-signer rebuilds the release, signs it only when its build matches CI&amp;rsquo;s byte for byte, makes the draft release, and publishes it with the tap&amp;rsquo;s formulas. Each release published this way carries CI&amp;rsquo;s signature and the co-signer&amp;rsquo;s, which devvm upgrade and the install script check, and the old release key&amp;rsquo;s signature too, which the maintainer adds by hand with &lt;code&gt;scripts/publish.sh --sign-legacy&lt;/code&gt;, because devvm 0.1 and 0.2 check only that key. Releases go this way once the maintainer has set up GitHub for it, and until then they&amp;rsquo;re built and published from the maintainer&amp;rsquo;s machine as before, with &lt;code&gt;scripts/publish.sh --local&lt;/code&gt;. Nothing changes for you until the old key&amp;rsquo;s bridge ends, and that release&amp;rsquo;s notes will say what to do (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#cis-release-workflow"&gt;CI&amp;rsquo;s release workflow&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#the-bridge-from-the-old-release-key"&gt;the bridge&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="fixes"&gt;Fixes&lt;span class="hx:absolute hx:-mt-20" id="fixes"&gt;&lt;/span&gt;
&lt;a href="#fixes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 data-hextra-search-id="a-project-folder-devvm-cant-read"&gt;A project folder devvm can&amp;rsquo;t read&lt;span class="hx:absolute hx:-mt-20" id="a-project-folder-devvm-cant-read"&gt;&lt;/span&gt;
&lt;a href="#a-project-folder-devvm-cant-read" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When you, or code in a VM that mounts it, took away your read permission on a project folder, devvm used to say that the folder&amp;rsquo;s VM was made for an earlier folder that was deleted or replaced, and offer &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm adopt&lt;/code&gt;. devvm now names the folder and why it can&amp;rsquo;t be read, so make it readable again (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-made-again"&gt;a folder made again&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="warnings-and-the-status-line"&gt;Warnings and the status line&lt;span class="hx:absolute hx:-mt-20" id="warnings-and-the-status-line"&gt;&lt;/span&gt;
&lt;a href="#warnings-and-the-status-line" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A warning used to be written onto the status line&amp;rsquo;s own line, and the status line&amp;rsquo;s next redraw could erase a question&amp;rsquo;s prompt and what you typed. A message that devvm prints during a slow step now prints above the status line, which comes back below it, and a question, the picker and an agent&amp;rsquo;s login in the VM take the status line away until they&amp;rsquo;re done (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;a command fails&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="claude-codes-setup-token-login"&gt;Claude Code&amp;rsquo;s setup-token login&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-setup-token-login"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-setup-token-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent login claude --setup-token&lt;/code&gt; showed nothing and waited, as &lt;a href="https://github.com/devvmhq/devvm/issues/57" target="_blank" rel="noopener"&gt;#57&lt;/a&gt; reported. The login in the VM got no terminal, so &lt;code&gt;claude setup-token&lt;/code&gt;, which draws full-screen, showed nothing. When devvm runs in a terminal, an agent&amp;rsquo;s login in the VM now gets a terminal of its own, as devvm&amp;rsquo;s shell does, so Claude Code shows the address to open and the prompt for its code. Without a terminal, &lt;code&gt;--setup-token&lt;/code&gt; warns that the login may show nothing (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;Claude Code login&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="ctrl-c-in-an-agents-login"&gt;Ctrl-C in an agent&amp;rsquo;s login&lt;span class="hx:absolute hx:-mt-20" id="ctrl-c-in-an-agents-login"&gt;&lt;/span&gt;
&lt;a href="#ctrl-c-in-an-agents-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In a terminal, Ctrl-C now goes to the agent&amp;rsquo;s login in the VM and ends it, and devvm then says that the login ended or saved nothing. devvm puts the terminal back as it was before the login, even when a signal ends devvm itself (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;Claude Code login&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="24-bit-color-in-a-vm"&gt;24-bit color in a VM&lt;span class="hx:absolute hx:-mt-20" id="24-bit-color-in-a-vm"&gt;&lt;/span&gt;
&lt;a href="#24-bit-color-in-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Programs in a VM, such as coding agents, fell back to fewer colors, as &lt;a href="https://github.com/devvmhq/devvm/issues/54" target="_blank" rel="noopener"&gt;#54&lt;/a&gt; reported, because devvm&amp;rsquo;s shell in a VM never got your terminal&amp;rsquo;s &lt;code&gt;COLORTERM&lt;/code&gt;, and neither did an agent&amp;rsquo;s login or &lt;code&gt;ssh&lt;/code&gt; to a VM by name.&lt;/p&gt;
&lt;p&gt;devvm&amp;rsquo;s shell in a VM and an agent&amp;rsquo;s login with &lt;code&gt;devvm agent login&lt;/code&gt; now get your terminal&amp;rsquo;s &lt;code&gt;COLORTERM&lt;/code&gt; when it&amp;rsquo;s &lt;code&gt;truecolor&lt;/code&gt; or &lt;code&gt;24bit&lt;/code&gt;, and no other value (&lt;a href="https://next.devvm.dev/docs/using/vms/#opening-a-vm"&gt;opening a VM&lt;/a&gt;). The ssh config entries for reaching a VM by name now send it as your terminal has it, from the next time devvm launches or stops a VM, which writes them again. A VM made with &lt;code&gt;--from&lt;/code&gt; gets it over ssh only when its image&amp;rsquo;s sshd accepts it (&lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;ssh access by name&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="mcp-servers-logins"&gt;MCP servers&amp;rsquo; logins&lt;span class="hx:absolute hx:-mt-20" id="mcp-servers-logins"&gt;&lt;/span&gt;
&lt;a href="#mcp-servers-logins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Claude Code keeps its logins to MCP servers in the VM&amp;rsquo;s &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, the file where devvm puts the Claude login. Each launch and each &lt;code&gt;devvm agent login claude&lt;/code&gt; used to write devvm&amp;rsquo;s copy of the login over the whole file, as &lt;a href="https://github.com/devvmhq/devvm/issues/62" target="_blank" rel="noopener"&gt;#62&lt;/a&gt; reported. So a login to an MCP server that you started with &lt;code&gt;/mcp&lt;/code&gt; in a VM failed when devvm set the VM up again before it finished, such as when you ran devvm in its folder from another terminal, and one that finished was gone at the VM&amp;rsquo;s next launch.&lt;/p&gt;
&lt;p&gt;With your subscription&amp;rsquo;s login, devvm now replaces only the Claude login in that file and keeps the rest, so the MCP servers&amp;rsquo; logins you make in a VM stay in that VM, and they never reach this machine or another VM. With a Claude Code token, the VM&amp;rsquo;s file stays as it is (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mcp-servers-logins"&gt;MCP servers&amp;rsquo; logins&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="your-claudeai-connectors"&gt;Your claude.ai connectors&lt;span class="hx:absolute hx:-mt-20" id="your-claudeai-connectors"&gt;&lt;/span&gt;
&lt;a href="#your-claudeai-connectors" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The connectors you added in claude.ai didn&amp;rsquo;t work in a VM, as &lt;a href="https://github.com/devvmhq/devvm/issues/61" target="_blank" rel="noopener"&gt;#61&lt;/a&gt; reported. The proxy put your subscription&amp;rsquo;s login only into requests to &lt;code&gt;api.anthropic.com&lt;/code&gt;, so the connectors&amp;rsquo; requests held the login&amp;rsquo;s placeholder and were refused.&lt;/p&gt;
&lt;p&gt;With your subscription&amp;rsquo;s login, the VM&amp;rsquo;s proxy now also puts the login into requests to &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; below &lt;code&gt;/v1/mcp/&lt;/code&gt;, which carry the connectors&amp;rsquo; traffic, from each VM&amp;rsquo;s next launch. So a VM with Claude Code can use every connector you added in claude.ai, as Claude Code on this machine can. A Claude Code token, from &lt;code&gt;claude setup-token&lt;/code&gt; or in devvm&amp;rsquo;s environment, still goes only to &lt;code&gt;api.anthropic.com&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;Claude Code login&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Code in the VM can now read and act through your connectors, so disconnect the ones you don&amp;rsquo;t want VMs to use, or deny &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; with &lt;code&gt;devvm network deny&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;your claude.ai connectors&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="claude-codes-plugins-in-a-vm"&gt;Claude Code&amp;rsquo;s plugins in a VM&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-plugins-in-a-vm"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-plugins-in-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; used to be devvm&amp;rsquo;s agent store&amp;rsquo;s folder, mounted read-only, so whatever Claude Code writes there failed, such as a plugin&amp;rsquo;s data in &lt;code&gt;${CLAUDE_PLUGIN_DATA}&lt;/code&gt;, installing a plugin and updating a marketplace, as &lt;a href="https://github.com/devvmhq/devvm/issues/56" target="_blank" rel="noopener"&gt;#56&lt;/a&gt; reported.&lt;/p&gt;
&lt;p&gt;Each VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; is now its own folder, so all of those work. The store&amp;rsquo;s plugins are Claude Code&amp;rsquo;s read-only seed at &lt;code&gt;~/.claude/plugins-seed&lt;/code&gt;, so they load as before, a plugin keeps its data in the VM, and a plugin you install in a VM stays in that VM until &lt;code&gt;devvm agent save&lt;/code&gt; copies it into the store. A store that devvm 0.1.0&amp;rsquo;s import filled keeps only what a seed has, as &lt;a href="#claude-codes-plugins-in-the-agent-store"&gt;Claude Code&amp;rsquo;s plugins in the agent store&lt;/a&gt; says (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Each VM gets its own &lt;code&gt;~/.claude/plugins&lt;/code&gt; at its next launch, without a restart, in place of its link to the store&amp;rsquo;s folder. Claude Code started in a shell that was open before that launch finds none of the store&amp;rsquo;s plugins, so start it in a new shell.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-project-folder-after-your-mac-restarts"&gt;A project folder after your Mac restarts&lt;span class="hx:absolute hx:-mt-20" id="a-project-folder-after-your-mac-restarts"&gt;&lt;/span&gt;
&lt;a href="#a-project-folder-after-your-mac-restarts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;After a restart, an unchanged folder could be on a device with another number, and devvm took it for another folder, as &lt;a href="https://github.com/devvmhq/devvm/issues/60" target="_blank" rel="noopener"&gt;#60&lt;/a&gt; reported. So every command on its VM refused it as made for an earlier folder at its path, a stopped VM&amp;rsquo;s start refused it as replaced, and the next check of &lt;code&gt;.git&lt;/code&gt; called it replaced.&lt;/p&gt;
&lt;p&gt;A folder at the same path, with no link on it and with the same inode and birth time, is now the same folder on whichever device it&amp;rsquo;s on. The VM&amp;rsquo;s next start records the folder on its new device before it mounts it, in the one change devvm makes to its Lima config. A folder that moved after a restart, before its VM started again, isn&amp;rsquo;t offered the VM, so &lt;code&gt;devvm adopt VM&lt;/code&gt; moves it (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-folder-moved-across-a-restart"&gt;A folder moved across a restart&lt;span class="hx:absolute hx:-mt-20" id="a-folder-moved-across-a-restart"&gt;&lt;/span&gt;
&lt;a href="#a-folder-moved-across-a-restart" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm used to miss a folder that moved while a restart gave its disk another device number, and make it a second VM, and it called the gone folder of a VM whose disk was renumbered not connected. Each VM now records its folder&amp;rsquo;s volume, which no renumbering changes, so devvm finds such a folder. Once the VM has recorded its volume, devvm offers a moved folder its VM by its volume, inode and birth time, and calls a VM&amp;rsquo;s gone folder gone (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-moved-or-renamed-folder"&gt;a moved or renamed folder&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Each VM records its project folder&amp;rsquo;s volume at its first launch that finds the folder. Until then, a folder that moves while a restart gives its disk another device number still needs &lt;code&gt;devvm adopt VM&lt;/code&gt;, and after a restart, the VM&amp;rsquo;s gone folder can still be called not connected. Both stay true for a VM whose folder was already gone before the upgrade, because it never records a volume.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-folder-on-another-volume"&gt;A folder on another volume&lt;span class="hx:absolute hx:-mt-20" id="a-folder-on-another-volume"&gt;&lt;/span&gt;
&lt;a href="#a-folder-on-another-volume" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A folder at the VM&amp;rsquo;s own path whose disk was renumbered, but on another volume than the one recorded, such as a copy of the disk with a volume ID of its own mounted there, is another folder, so devvm gives it the VM only after &lt;code&gt;devvm adopt&lt;/code&gt;. On Linux, every launch checks the volume, so a Btrfs snapshot rolled back at the folder&amp;rsquo;s path, or the folder after you give its volume a new UUID, also needs &lt;code&gt;devvm adopt&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-made-again"&gt;a folder made again&lt;/a&gt;). When devvm can&amp;rsquo;t read the volume at the launch after a renumbering, such as when &lt;code&gt;diskutil&lt;/code&gt; doesn&amp;rsquo;t answer, each launch looks it up until it can (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="two-devvms-at-the-agent-store"&gt;Two devvms at the agent store&lt;span class="hx:absolute hx:-mt-20" id="two-devvms-at-the-agent-store"&gt;&lt;/span&gt;
&lt;a href="#two-devvms-at-the-agent-store" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Two devvms could write the agent store at once, so their files used to mix, or one could fail partway. &lt;code&gt;devvm agent import&lt;/code&gt;, &lt;code&gt;devvm agent save&lt;/code&gt; and a start that cleans Claude Code&amp;rsquo;s plugins out of the store now take turns, so a second one says it&amp;rsquo;s waiting and goes on once the first is done. A save that finds the store changed since it showed what differs now saves nothing instead of writing over an import (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine"&gt;importing from this machine&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-failed-save-changes-nothing"&gt;A failed save changes nothing&lt;span class="hx:absolute hx:-mt-20" id="a-failed-save-changes-nothing"&gt;&lt;/span&gt;
&lt;a href="#a-failed-save-changes-nothing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A save that failed partway, such as at a file it couldn&amp;rsquo;t write in one agent&amp;rsquo;s store or at the Claude Code login it saves last, used to leave the agents it had saved before the failure saved and the rest not. A failed &lt;code&gt;devvm agent save&lt;/code&gt; now leaves the store as it was, because a save saves all or nothing, as an import does, and in the rare case that putting the store back fails too, it names what it kept. A file in the VM where the store has a folder, or the other way round, now fails the save before anything changes, naming the store&amp;rsquo;s path (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="opencodes-lock-files-in-a-save"&gt;opencode&amp;rsquo;s lock files in a save&lt;span class="hx:absolute hx:-mt-20" id="opencodes-lock-files-in-a-save"&gt;&lt;/span&gt;
&lt;a href="#opencodes-lock-files-in-a-save" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent save&lt;/code&gt; refused a VM whose &lt;code&gt;~/.config/opencode&lt;/code&gt; held a lock file, such as the &lt;code&gt;bun.lock&lt;/code&gt; that opencode&amp;rsquo;s plugins&amp;rsquo; installs write or a &lt;code&gt;package-lock.json&lt;/code&gt;, or another file the store doesn&amp;rsquo;t keep, such as &lt;code&gt;.gitignore&lt;/code&gt; or &lt;code&gt;.DS_Store&lt;/code&gt;. The VM sent every file in that folder, while devvm&amp;rsquo;s store keeps none of these, so devvm took each as a path outside the agents&amp;rsquo; settings and saved nothing. The VM now doesn&amp;rsquo;t send them, so they stay in the VM, and the save goes on (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-agent-save-and-a-new-claude-code-login"&gt;devvm agent save and a new Claude Code login&lt;span class="hx:absolute hx:-mt-20" id="devvm-agent-save-and-a-new-claude-code-login"&gt;&lt;/span&gt;
&lt;a href="#devvm-agent-save-and-a-new-claude-code-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent save&lt;/code&gt; and a VM&amp;rsquo;s new Claude Code login take turns. While it saves Claude Code&amp;rsquo;s part of &lt;code&gt;~/.claude.json&lt;/code&gt;, the save holds the lock on Claude Code&amp;rsquo;s logins, the lock that a VM&amp;rsquo;s proxy holds while it saves a Claude Code login made in that VM. Ctrl-C while the save waits for either lock ends the wait (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="names-that-differ-only-in-case"&gt;Names that differ only in case&lt;span class="hx:absolute hx:-mt-20" id="names-that-differ-only-in-case"&gt;&lt;/span&gt;
&lt;a href="#names-that-differ-only-in-case" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On a Mac, when the VM, or your home folder for &lt;code&gt;devvm agent import&lt;/code&gt;, had a file whose name differed from the store&amp;rsquo;s only in case, such as &lt;code&gt;foo.md&lt;/code&gt; where the store has &lt;code&gt;Foo.md&lt;/code&gt;, &lt;code&gt;devvm agent save&lt;/code&gt; and &lt;code&gt;devvm agent import&lt;/code&gt; used to delete the store&amp;rsquo;s file and report success. They now treat such a file as one file, as macOS&amp;rsquo;s volume does, so the store&amp;rsquo;s file gets the new content and keeps its name, and the save&amp;rsquo;s diff shows it as changed.&lt;/p&gt;
&lt;p&gt;Two names in the VM that differ only in case, such as &lt;code&gt;A.md&lt;/code&gt; and &lt;code&gt;a.md&lt;/code&gt;, would be one file in the store, so the save now saves nothing and names both, and so does an import of two such names from a home folder on a volume that tells case apart (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="names-you-choose-in-an-agents-settings"&gt;Names you choose in an agent&amp;rsquo;s settings&lt;span class="hx:absolute hx:-mt-20" id="names-you-choose-in-an-agents-settings"&gt;&lt;/span&gt;
&lt;a href="#names-you-choose-in-an-agents-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm used to take a plugin, a marketplace or an MCP server whose name had &lt;code&gt;key&lt;/code&gt;, &lt;code&gt;token&lt;/code&gt;, &lt;code&gt;secret&lt;/code&gt; or &lt;code&gt;passw&lt;/code&gt; in it, such as &lt;code&gt;tokeneconomizer&lt;/code&gt; or &lt;code&gt;secret-scanner&lt;/code&gt;, for a secret, as &lt;a href="https://github.com/devvmhq/devvm/issues/55" target="_blank" rel="noopener"&gt;#55&lt;/a&gt; reported. It put &lt;code&gt;devvm-redacted&lt;/code&gt; in place of all its settings in the VM&amp;rsquo;s copy, so Claude Code refused the VM&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt; whole and every plugin was off in the VM.&lt;/p&gt;
&lt;p&gt;devvm now knows the agents&amp;rsquo; tables of names, such as Claude Code&amp;rsquo;s &lt;code&gt;mcpServers&lt;/code&gt;, and judges only the fields under a name, so a server named &lt;code&gt;secret-scanner&lt;/code&gt; keeps its command and still loses its &lt;code&gt;env&lt;/code&gt; and its &lt;code&gt;apiKey&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#keys-in-settings-files"&gt;keys in settings files&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;If a VM&amp;rsquo;s copy of an agent&amp;rsquo;s settings file had &lt;code&gt;devvm-redacted&lt;/code&gt; under a name you chose, such as a plugin&amp;rsquo;s marketplace, the VM&amp;rsquo;s next launch writes the whole copy over the VM&amp;rsquo;s own. Until then, &lt;code&gt;devvm agent save&lt;/code&gt; leaves that file out and warns, so make any change to it in devvm&amp;rsquo;s agent store, or launch the VM again and make the change there.&lt;/p&gt;
&lt;p&gt;Thanks to @jspiro for the report and @dhruv1220 for the tests&amp;rsquo; idea in &lt;a href="https://github.com/devvmhq/devvm/pull/58" target="_blank" rel="noopener"&gt;#58&lt;/a&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="folder-names-with-separators-in-a-row"&gt;Folder names with separators in a row&lt;span class="hx:absolute hx:-mt-20" id="folder-names-with-separators-in-a-row"&gt;&lt;/span&gt;
&lt;a href="#folder-names-with-separators-in-a-row" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm used to turn each character other than letters and digits in a folder&amp;rsquo;s name into its own dash, and Lima refuses a name with dashes in a row, so a folder named &lt;code&gt;x--y&lt;/code&gt;, &lt;code&gt;foo (copy)&lt;/code&gt; or &lt;code&gt;C++ stuff&lt;/code&gt; got no VM, as &lt;a href="https://github.com/devvmhq/devvm/issues/52" target="_blank" rel="noopener"&gt;#52&lt;/a&gt; reported. devvm now turns each run of such characters into one dash, so those folders get a VM, and &lt;code&gt;foo (copy)&lt;/code&gt; gets &lt;code&gt;devvm-foo-copy-&amp;lt;hash&amp;gt;&lt;/code&gt;. The state that such a folder&amp;rsquo;s failed VM left is replaced when you run devvm there again (&lt;a href="https://next.devvm.dev/docs/internals/backends/#vm-names"&gt;VM names&lt;/a&gt;). Thanks to @se6a for the report.&lt;/p&gt;
&lt;h3 data-hextra-search-id="host-keys-whatever-a-vms-ports"&gt;Host keys whatever a VM&amp;rsquo;s ports&lt;span class="hx:absolute hx:-mt-20" id="host-keys-whatever-a-vms-ports"&gt;&lt;/span&gt;
&lt;a href="#host-keys-whatever-a-vms-ports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When other programs on this machine, such as your own dev servers, held every port a VM lists, or the VM forwarded none with &lt;code&gt;devvm ports none&lt;/code&gt;, a start that went no further than starting the VM, such as &lt;code&gt;devvm clone fetch&lt;/code&gt; on a stopped &lt;code&gt;--clone&lt;/code&gt; VM, used to leave the VM&amp;rsquo;s ssh host keys unpinned. devvm&amp;rsquo;s own ssh to the VM then failed until something else pinned them, so &lt;code&gt;devvm clone fetch&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s fetch failed with &lt;code&gt;clone_fetch_failed&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;devvm now pins a VM&amp;rsquo;s ssh host keys each time it starts the VM, whatever the VM forwards, and a command that finds the VM running without them pins them first (&lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;ssh into VMs&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-removed-links-connections"&gt;A removed link&amp;rsquo;s connections&lt;span class="hx:absolute hx:-mt-20" id="a-removed-links-connections"&gt;&lt;/span&gt;
&lt;a href="#a-removed-links-connections" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Removing a link with &lt;code&gt;devvm link rm&lt;/code&gt; used to stop only the link&amp;rsquo;s new connections, so a target that never closed its end kept each open connection&amp;rsquo;s ssh process on this machine, and one of the 256 connections a client&amp;rsquo;s links carry at once, until the client or the target stopped. Removing a link now ends its open connections within a few seconds, and when a target starts again, the connections still open through its earlier start end as well (&lt;a href="https://next.devvm.dev/docs/using/links/#removing-a-link"&gt;removing a link&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-settings-file-thats-one-string"&gt;A settings file that&amp;rsquo;s one string&lt;span class="hx:absolute hx:-mt-20" id="a-settings-file-thats-one-string"&gt;&lt;/span&gt;
&lt;a href="#a-settings-file-thats-one-string" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When an agent&amp;rsquo;s settings file in the VM was a single JSON string holding a placeholder, &lt;code&gt;devvm agent save&lt;/code&gt; used to crash, and it now puts the saved value back in it. A login file on this machine that holds only &lt;code&gt;null&lt;/code&gt; is now refused as not a JSON object, where saving a Codex or opencode login made in a VM failed on it (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="forwarded-ports-over-ipv6"&gt;Forwarded ports over IPv6&lt;span class="hx:absolute hx:-mt-20" id="forwarded-ports-over-ipv6"&gt;&lt;/span&gt;
&lt;a href="#forwarded-ports-over-ipv6" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When this machine briefly couldn&amp;rsquo;t listen on a port&amp;rsquo;s IPv6 address, such as when it ran out of open files, the forwarder used to forward the port on &lt;code&gt;127.0.0.1&lt;/code&gt; alone until the server in the VM restarted. So a client that connects only over IPv6, such as &lt;code&gt;http://[::1]:PORT&lt;/code&gt; or a tool that doesn&amp;rsquo;t fall back to &lt;code&gt;127.0.0.1&lt;/code&gt;, didn&amp;rsquo;t reach the VM, and another program on this machine could take &lt;code&gt;::1&lt;/code&gt; on that port and get those connections instead. The forwarder now tries the port again at the VM&amp;rsquo;s next report and forwards it on both addresses (&lt;a href="https://next.devvm.dev/docs/internals/ports/#when-it-cant-forward"&gt;when it can&amp;rsquo;t forward&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-forwarder-after-a-burst"&gt;A forwarder after a burst&lt;span class="hx:absolute hx:-mt-20" id="a-forwarder-after-a-burst"&gt;&lt;/span&gt;
&lt;a href="#a-forwarder-after-a-burst" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When the port forwarder ran out of open files while accepting a connection, it used to stop accepting connections on that port while it still listened there, so the port took connections that nothing answered until the server in the VM restarted. It now tries again shortly after, and so do a link&amp;rsquo;s socket and a browser login&amp;rsquo;s forward, which also carries at most 16 connections at once (&lt;a href="https://next.devvm.dev/docs/internals/ports/#how-it-reaches-the-vm"&gt;how it reaches the VM&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="plain-websockets"&gt;Plain WebSockets&lt;span class="hx:absolute hx:-mt-20" id="plain-websockets"&gt;&lt;/span&gt;
&lt;a href="#plain-websockets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A plain &lt;code&gt;ws://&lt;/code&gt; WebSocket now connects through the proxy, where it used to get &lt;code&gt;502&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-pin-that-meets-gits-rename-on-linux"&gt;A pin that meets git&amp;rsquo;s rename on Linux&lt;span class="hx:absolute hx:-mt-20" id="a-pin-that-meets-gits-rename-on-linux"&gt;&lt;/span&gt;
&lt;a href="#a-pin-that-meets-gits-rename-on-linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On Linux hosts, &lt;code&gt;.git/config&lt;/code&gt; could seem to lose its pin. When git on this machine replaced &lt;code&gt;.git/config&lt;/code&gt; just as devvm pinned it again, the pin used to fail, and devvm warned that the file lost its pin and couldn&amp;rsquo;t be pinned again, then that it was pinned again, at the VM&amp;rsquo;s next check, and a VM&amp;rsquo;s start could fail the same way. devvm now pins the file that the rename left, and warns only that it was pinned again (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-linux-hosts"&gt;how a Linux host locks .git&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="stopped-forwarders-and-link-sessions"&gt;Stopped forwarders and link sessions&lt;span class="hx:absolute hx:-mt-20" id="stopped-forwarders-and-link-sessions"&gt;&lt;/span&gt;
&lt;a href="#stopped-forwarders-and-link-sessions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm stopping a VM&amp;rsquo;s port forwarder or link session, or a &lt;code&gt;kill&lt;/code&gt; of either, used to leave its ssh connection to the VM running on this machine, with its control socket in devvm&amp;rsquo;s run folder. Each signal that devvm sends either one now also reaches what the process started, and either one stops its ssh before it exits. &lt;code&gt;devvm gc --orphans&lt;/code&gt; also deletes a forwarder&amp;rsquo;s socket that nothing listens on (&lt;a href="https://next.devvm.dev/docs/internals/processes/#how-devvm-starts-them"&gt;how devvm starts them&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="lookups-with-transparent-mode-off"&gt;Lookups with transparent mode off&lt;span class="hx:absolute hx:-mt-20" id="lookups-with-transparent-mode-off"&gt;&lt;/span&gt;
&lt;a href="#lookups-with-transparent-mode-off" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In a VM confined to its proxy, with transparent mode off or stopped, a lookup through the system&amp;rsquo;s resolver on a Linux host used to wait out its timeout, because systemd-resolved&amp;rsquo;s stub kept retrying a name server where nothing listened, and workerd under &lt;code&gt;wrangler dev&lt;/code&gt; waited about 40 seconds for each lookup.&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s programs now ask the VM&amp;rsquo;s own name server, at &lt;code&gt;127.0.0.1&lt;/code&gt;, directly, from each VM&amp;rsquo;s next launch, so a lookup through the system&amp;rsquo;s resolver, such as &lt;code&gt;getent&lt;/code&gt;&amp;rsquo;s or curl&amp;rsquo;s, fails at once, and so does workerd&amp;rsquo;s. A VM on the open tier keeps systemd-resolved&amp;rsquo;s stub (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-resolver"&gt;the VM&amp;rsquo;s resolver&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-nix-package-downloaded-twice"&gt;A Nix package downloaded twice&lt;span class="hx:absolute hx:-mt-20" id="a-nix-package-downloaded-twice"&gt;&lt;/span&gt;
&lt;a href="#a-nix-package-downloaded-twice" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When two requests for a package that wasn&amp;rsquo;t in the shared Nix cache yet came close together, the second could download it again after the first had kept it, and the cache counted it twice against its cap. devvm now looks in the cache again before it downloads a package, so each package is downloaded once (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;the shared Nix cache&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-refused-launch"&gt;A refused launch&lt;span class="hx:absolute hx:-mt-20" id="a-refused-launch"&gt;&lt;/span&gt;
&lt;a href="#a-refused-launch" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s proxy named a user and no &lt;code&gt;proxy&lt;/code&gt; secret was saved, &lt;code&gt;devvm&lt;/code&gt; in the folder of a running VM used to refuse, as it should, but also stop the VM, and &lt;code&gt;devvm restart&lt;/code&gt; stopped it before it refused. The same happened when your CAs folder couldn&amp;rsquo;t be used, or the VM&amp;rsquo;s CA or secret files couldn&amp;rsquo;t be readied.&lt;/p&gt;
&lt;p&gt;On a launch or a &lt;code&gt;devvm network&lt;/code&gt; change, devvm now checks the company proxy, your CAs, the VM&amp;rsquo;s CA and its secret files before it stops the VM&amp;rsquo;s proxy, and when it refuses, it says it left the VM and its proxy running as they were. &lt;code&gt;devvm restart&lt;/code&gt; checks the company proxy and your CAs before it stops the VM (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-desktop-after-a-burst"&gt;devvm desktop after a burst&lt;span class="hx:absolute hx:-mt-20" id="devvm-desktop-after-a-burst"&gt;&lt;/span&gt;
&lt;a href="#devvm-desktop-after-a-burst" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When &lt;code&gt;devvm desktop&lt;/code&gt;&amp;rsquo;s relay ran out of open files while accepting a viewer, &lt;code&gt;devvm desktop&lt;/code&gt; used to end with an error, and the desktop&amp;rsquo;s port with it. The relay now tries again shortly, as the port forwarder does (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-desktop-relay"&gt;the desktop relay&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-size-that-isnt-a-number"&gt;A size that isn&amp;rsquo;t a number&lt;span class="hx:absolute hx:-mt-20" id="a-size-that-isnt-a-number"&gt;&lt;/span&gt;
&lt;a href="#a-size-that-isnt-a-number" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When a VM&amp;rsquo;s state file held a size devvm couldn&amp;rsquo;t read as a number, such as &lt;code&gt;&amp;quot;cpus&amp;quot;: &amp;quot;four&amp;quot;&lt;/code&gt; after an edit by hand, the VM used to start with the image&amp;rsquo;s size without a word. devvm now refuses to start the VM or show its size, names the value, and says to set it again with &lt;code&gt;devvm size&lt;/code&gt;. &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt;, &lt;code&gt;--disk&lt;/code&gt;, &lt;code&gt;config.toml&lt;/code&gt; and &lt;code&gt;devvm size -g&lt;/code&gt; also refuse a number too big for devvm to read, which for a disk reached Lima as infinity (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#size"&gt;size&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="opencodes-machine-key-in-history-exports"&gt;opencode&amp;rsquo;s machine key in history exports&lt;span class="hx:absolute hx:-mt-20" id="opencodes-machine-key-in-history-exports"&gt;&lt;/span&gt;
&lt;a href="#opencodes-machine-key-in-history-exports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;opencode 2.4 keeps a private key in &lt;code&gt;~/.local/state/opencode/machine/home-key&lt;/code&gt;, which it makes when it first needs one, such as when you pair a machine with &lt;code&gt;opencode machine add&lt;/code&gt;. Every machine it pairs trusts that key, and opencode never replaces it. It sits in opencode&amp;rsquo;s state folder beside its prompt history, so &lt;code&gt;devvm history export&lt;/code&gt;, and the export that &lt;code&gt;devvm rm&lt;/code&gt; and a VM made again write, used to copy it into the export, and &lt;code&gt;devvm history import&lt;/code&gt; put it into the VM it imported into. The export also held the password of opencode&amp;rsquo;s background service, which its state folder keeps in &lt;code&gt;service.json&lt;/code&gt;, or in &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; for another channel&amp;rsquo;s opencode, with the handoff tickets and temporary files beside it. It held the access tokens of opencode&amp;rsquo;s terminals&amp;rsquo; daemons too, which opencode keeps in the state folder&amp;rsquo;s &lt;code&gt;pty&lt;/code&gt;, as releases before 2.4 do as well. The copy of opencode&amp;rsquo;s database also kept its &lt;code&gt;machine&lt;/code&gt; table, which holds the public keys that the paired machines log in with.&lt;/p&gt;
&lt;p&gt;An export now leaves them out and empties that table, and an import never writes them, even from an older export, so the new VM&amp;rsquo;s opencode makes its own. A VM made again keeps its own, because it&amp;rsquo;s the same machine (&lt;a href="https://next.devvm.dev/docs/internals/agents/#history-exports"&gt;what an export holds&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;If an export of a VM with opencode 2.4 or later holds &lt;code&gt;.local/state/opencode/machine/home-key&lt;/code&gt;, which &lt;code&gt;tar -tzf FILE&lt;/code&gt; lists, that VM&amp;rsquo;s key is in it, and it may be in each VM you imported it into, unless that VM&amp;rsquo;s opencode had made a key of its own first. In each such VM that&amp;rsquo;s still there:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Quit opencode, its TUI and any &lt;code&gt;opencode serve&lt;/code&gt; included, and stop its service with &lt;code&gt;opencode service stop&lt;/code&gt;, because a running opencode keeps the key in memory.&lt;/li&gt;
&lt;li&gt;Delete &lt;code&gt;~/.local/state/opencode/machine/home-key&lt;/code&gt;, so opencode makes a new key when it next needs one.&lt;/li&gt;
&lt;li&gt;Pair each machine you paired there again with &lt;code&gt;opencode machine add NAME --replace&lt;/code&gt;, which prints a new join string for that machine to join with. In a VM you imported the export into, remove the machines it brought with &lt;code&gt;opencode machine remove NAME&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For a VM that you&amp;rsquo;ve deleted, unpair each machine it had paired, on that machine. Once the key is replaced, the old exports in &lt;code&gt;~/.local/share/devvm/exports&lt;/code&gt; hold a key that nothing trusts.&lt;/p&gt;
&lt;h3 data-hextra-search-id="opencodes-service-settings-in-vms"&gt;opencode&amp;rsquo;s service settings in VMs&lt;span class="hx:absolute hx:-mt-20" id="opencodes-service-settings-in-vms"&gt;&lt;/span&gt;
&lt;a href="#opencodes-service-settings-in-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;opencode 2 keeps its background service&amp;rsquo;s settings in &lt;code&gt;~/.config/opencode/service.json&lt;/code&gt;, or in &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; on another channel. They hold the service&amp;rsquo;s password, which the service makes when the file has none, and with remote access on, the secret route that the service&amp;rsquo;s address is served on and your consent to remote access, beside its port, host name, CORS origins and environment. &lt;code&gt;devvm agent import&lt;/code&gt; copied every file in &lt;code&gt;~/.config/opencode&lt;/code&gt; into devvm&amp;rsquo;s agent store, these included, and every VM with opencode got a copy at each launch, with &lt;code&gt;devvm-redacted&lt;/code&gt; in place of the password and of each value of the environment, and with the route as it was. So each such VM&amp;rsquo;s opencode service took &lt;code&gt;devvm-redacted&lt;/code&gt; as its password, which anyone who knows devvm knows. &lt;code&gt;devvm agent save&lt;/code&gt; copied a VM&amp;rsquo;s own file into the store in the same way, and from there into every VM.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; now leave these files out, and no VM gets them, even from a store that holds them. A VM&amp;rsquo;s start takes them out of the store and warns once, and each VM&amp;rsquo;s setup takes out the copy that an earlier devvm gave it, which it knows by the &lt;code&gt;devvm-redacted&lt;/code&gt; in it, so each VM&amp;rsquo;s opencode makes a password of its own the next time its service starts. &lt;code&gt;opencode service get password&lt;/code&gt; shows it in the VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#opencodes-service"&gt;opencode&amp;rsquo;s service&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;If you ran &lt;code&gt;devvm agent import&lt;/code&gt; or &lt;code&gt;devvm agent save&lt;/code&gt; for opencode, your VMs got such a copy. A service that&amp;rsquo;s running keeps its password until it stops, so restart each running VM that has opencode, with &lt;code&gt;devvm restart&lt;/code&gt; in its folder. If this machine&amp;rsquo;s opencode has remote access on, its route reached the store and your VMs, so turn remote access off and on again on this machine, which gives its service a new route:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;opencode service &lt;span class="nb"&gt;set&lt;/span&gt; remote &lt;span class="nb"&gt;false&lt;/span&gt; &lt;span class="c1"&gt;# on this machine: drop the route that your VMs got&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;opencode service &lt;span class="nb"&gt;set&lt;/span&gt; remote &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;# and get a new one&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When this machine&amp;rsquo;s service had remote access on but hadn&amp;rsquo;t started since, its file held a route and no password, so the copy held no &lt;code&gt;devvm-redacted&lt;/code&gt; and stays in the VM. Once this machine&amp;rsquo;s route is new, that copy&amp;rsquo;s route leads nowhere. A password you set yourself with &lt;code&gt;opencode service set password&lt;/code&gt; reached your VMs as it was, with no &lt;code&gt;devvm-redacted&lt;/code&gt; to mark the copies, when it looked to devvm like a variable&amp;rsquo;s name or a number, which is any of these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;capital letters, digits and &lt;code&gt;_&lt;/code&gt;, starting with a letter&lt;/li&gt;
&lt;li&gt;at most five digits&lt;/li&gt;
&lt;li&gt;&lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If yours is one, set a new password on this machine first, because that&amp;rsquo;s the one your VMs got, then delete &lt;code&gt;~/.config/opencode/service.json&lt;/code&gt; in each VM with opencode and restart the VM.&lt;/p&gt;
&lt;h3 data-hextra-search-id="bases-packages-that-dont-come-out"&gt;Base&amp;rsquo;s packages that don&amp;rsquo;t come out&lt;span class="hx:absolute hx:-mt-20" id="bases-packages-that-dont-come-out"&gt;&lt;/span&gt;
&lt;a href="#bases-packages-that-dont-come-out" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When the packages base downloaded couldn&amp;rsquo;t be taken out of its build VM, devvm said so, but the run log didn&amp;rsquo;t say why, because the VM&amp;rsquo;s tar&amp;rsquo;s error output went nowhere. That output now goes to the run log, with a line that names the tar&amp;rsquo;s failure and the failure to read what it sent (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-build-fails"&gt;a build fails&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-clone-check-that-never-ends"&gt;A clone check that never ends&lt;span class="hx:absolute hx:-mt-20" id="a-clone-check-that-never-ends"&gt;&lt;/span&gt;
&lt;a href="#a-clone-check-that-never-ends" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Before &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm clone off&lt;/code&gt; lets a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s clone go, devvm reads what the VM has of it. devvm kept at most 8 MiB of the answer, but it went on reading the rest and waited for the VM&amp;rsquo;s command to end, so a VM that wrote without end, or never answered, kept the command waiting until you pressed Ctrl+C. devvm now stops the VM&amp;rsquo;s command once it sends more than 8 MiB, and it waits at most 2 minutes for the answer, the same bounds as its read of opencode&amp;rsquo;s worktrees. Either way the check fails, and devvm keeps the VM and names &lt;code&gt;--no-clone-check&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/clone/#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;On Lima, the ssh that &lt;code&gt;limactl shell&lt;/code&gt; runs can leave a process behind that holds a command&amp;rsquo;s output open, and such a process could keep devvm waiting past &lt;code&gt;devvm paste&lt;/code&gt;&amp;rsquo;s time limit. devvm now closes a command&amp;rsquo;s output a second after the command ends or its time limit runs out, so such a process can&amp;rsquo;t outlast that limit or the clone check&amp;rsquo;s 2 minutes, and a command whose output was cut short that way fails (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-commands-output"&gt;a command&amp;rsquo;s output&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-tool-release-without-every-download"&gt;A tool release without every download&lt;span class="hx:absolute hx:-mt-20" id="a-tool-release-without-every-download"&gt;&lt;/span&gt;
&lt;a href="#a-tool-release-without-every-download" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Since 0.2.0-rc.1, the mise that devvm resolves the shared tools with downloads some files as it locks them, and it fails the whole lock when one of them isn&amp;rsquo;t there. So when a shared tool&amp;rsquo;s newest release wasn&amp;rsquo;t published for every platform yet, as Node 24.23.0&amp;rsquo;s musl builds weren&amp;rsquo;t for days after its release, resolving the shared tools failed. A first run then stopped and said to get online, while the daily check and &lt;code&gt;devvm tools update&lt;/code&gt; kept the versions they had. devvm now locks each tool on its own after such a failure, and it locks a tool that still fails one platform at a time, so it uses that tool&amp;rsquo;s newest older version that&amp;rsquo;s published everywhere and says so, as it did before. A tool whose newest version has no download on any platform fails the resolve (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-new-tool-release-isnt-there-yet"&gt;a new tool release isn&amp;rsquo;t there yet&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="hardening"&gt;Hardening&lt;span class="hx:absolute hx:-mt-20" id="hardening"&gt;&lt;/span&gt;
&lt;a href="#hardening" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;These fixes close ways that code in a VM, or a file it wrote, could reach past what devvm lets a VM do. Most of them change nothing you see.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvms-own-folders-in-another-case"&gt;devvm&amp;rsquo;s own folders in another case&lt;span class="hx:absolute hx:-mt-20" id="devvms-own-folders-in-another-case"&gt;&lt;/span&gt;
&lt;a href="#devvms-own-folders-in-another-case" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On a Mac, where a name&amp;rsquo;s case doesn&amp;rsquo;t count, a project at &lt;code&gt;~/.Config/devvm/layers&lt;/code&gt; used to get a VM with read-write access to devvm&amp;rsquo;s settings and layer scripts, because devvm compared a project folder with your home folder and its own folders by name alone. It now compares them by the folders themselves as well, so it refuses that project as it refuses &lt;code&gt;~/.config/devvm/layers&lt;/code&gt;. A VM already made in such a folder still mounts it, so delete it with &lt;code&gt;devvm rm&lt;/code&gt; there. devvm also refuses an SSH key in a folder that a VM mounts by a name in another case (&lt;a href="https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses"&gt;project folders devvm refuses&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="passwords-in-limas-console-logs"&gt;Passwords in Lima&amp;rsquo;s console logs&lt;span class="hx:absolute hx:-mt-20" id="passwords-in-limas-console-logs"&gt;&lt;/span&gt;
&lt;a href="#passwords-in-limas-console-logs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Lima&amp;rsquo;s boot scripts write the VM&amp;rsquo;s proxy settings, with the VM&amp;rsquo;s own proxy password, to the VM&amp;rsquo;s serial console, which Lima keeps in its console logs for the VM, &lt;code&gt;serial.log&lt;/code&gt;, &lt;code&gt;serialp.log&lt;/code&gt; or &lt;code&gt;serialv.log&lt;/code&gt; in the VM&amp;rsquo;s folder in devvm&amp;rsquo;s Lima home. devvm used to take the passwords out of Lima&amp;rsquo;s &lt;code&gt;ha.stderr.log&lt;/code&gt; only. Once the VM has started, devvm now replaces each password with as many &lt;code&gt;*&lt;/code&gt; in Lima&amp;rsquo;s console log for the VM as well, as it does in &lt;code&gt;ha.stderr.log&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/overview/#the-run-log"&gt;the run log&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-vm-and-its-ssh-agent"&gt;A VM and its SSH agent&lt;span class="hx:absolute hx:-mt-20" id="a-vm-and-its-ssh-agent"&gt;&lt;/span&gt;
&lt;a href="#a-vm-and-its-ssh-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM that forwarded your agent or devvm&amp;rsquo;s own used to be able to remove every key from it with &lt;code&gt;ssh-add -D&lt;/code&gt;, lock it with a password of its own with &lt;code&gt;ssh-add -x&lt;/code&gt;, or add keys to it, and every VM that shares devvm&amp;rsquo;s agent lost it then, and with your own agent, so did you.&lt;/p&gt;
&lt;p&gt;A VM now reaches its agent only through its proxy, which passes on listing keys, signing and binding a session to a host, and refuses everything else, so &lt;code&gt;ssh-add&lt;/code&gt; in a VM can still list and use the keys, but not remove, lock or add them. An editor&amp;rsquo;s connection gets the same agent as devvm&amp;rsquo;s shell, the one the VM started with (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;A VM that forwards an SSH agent and runs as you upgrade keeps the agent as it was until its next start, so it can still remove, lock or add keys, and devvm warns of it each time it opens the VM or changes its links. Run &lt;code&gt;devvm restart&lt;/code&gt; in its folder to give it the relay at once (&lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;agent forwarding&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="links-inside-an-agents-folder"&gt;Links inside an agent&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="links-inside-an-agents-folder"&gt;&lt;/span&gt;
&lt;a href="#links-inside-an-agents-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent import&lt;/code&gt; used to copy a link inside an agent&amp;rsquo;s folder as the file it led to, wherever that file was in the folder, so a link in &lt;code&gt;~/.claude/skills&lt;/code&gt; or &lt;code&gt;~/.claude/plugins/cache&lt;/code&gt; could put your history, &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; or a plugin&amp;rsquo;s data into the store, where every VM with the agent reads it. It now copies such a link only when it leads to one of the settings the import copies, and leaves any other out with a warning that names where it leads (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine"&gt;importing from this machine&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="your-plugins-data-stays-on-this-machine"&gt;Your plugins&amp;rsquo; data stays on this machine&lt;span class="hx:absolute hx:-mt-20" id="your-plugins-data-stays-on-this-machine"&gt;&lt;/span&gt;
&lt;a href="#your-plugins-data-stays-on-this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm agent import&lt;/code&gt; used to copy all of &lt;code&gt;~/.claude/plugins&lt;/code&gt; into the store, so every VM with Claude Code got the data that your plugins keep on this machine, which can hold their own logins. From that folder, it now copies only the marketplaces, their records and the plugins&amp;rsquo; cache, and &lt;code&gt;devvm agent save&lt;/code&gt; copies only those from a VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine"&gt;importing from this machine&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-history-exports-names"&gt;A history export&amp;rsquo;s names&lt;span class="hx:absolute hx:-mt-20" id="a-history-exports-names"&gt;&lt;/span&gt;
&lt;a href="#a-history-exports-names" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm history import&lt;/code&gt; used to leave out the agents&amp;rsquo; logins and the files that devvm&amp;rsquo;s setup writes by their names as the export wrote them, so an export that spelled one another way, such as &lt;code&gt;.claude/./settings.json&lt;/code&gt; or &lt;code&gt;.claude//plugins&lt;/code&gt;, got it into the VM&amp;rsquo;s home. It now refuses a name with a &lt;code&gt;.&lt;/code&gt; or empty part, and once the export is unpacked, it deletes what it leaves out by its path (&lt;a href="https://next.devvm.dev/docs/internals/agents/#importing-history"&gt;importing history&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="every-host-in-one-form"&gt;Every host in one form&lt;span class="hx:absolute hx:-mt-20" id="every-host-in-one-form"&gt;&lt;/span&gt;
&lt;a href="#every-host-in-one-form" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A few of devvm&amp;rsquo;s checks used to read a host in a way of their own. &lt;code&gt;devvm secret set --host&lt;/code&gt;, an MCP server&amp;rsquo;s URL and a &lt;code&gt;NO_PROXY&lt;/code&gt; entry took a name with a letter that isn&amp;rsquo;t plain ASCII, such as the Kelvin sign, which Unicode&amp;rsquo;s case folding turns into &lt;code&gt;k&lt;/code&gt;, as the ASCII name it folds into. &lt;code&gt;--from&lt;/code&gt; took a registry&amp;rsquo;s host with such a letter, or an address in brackets before a trailing dot such as &lt;code&gt;[::1].&lt;/code&gt;, as one on the internet.&lt;/p&gt;
&lt;p&gt;Every host is now read as the proxy reads it. The proxy refuses a host with such a letter, so now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm secret set&lt;/code&gt; refuses it&lt;/li&gt;
&lt;li&gt;an MCP server with one gets no secret&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;NO_PROXY&lt;/code&gt; entry with one matches no host&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--from&lt;/code&gt; doesn&amp;rsquo;t take such a registry as public&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm network rm&lt;/code&gt; with it never removes the rule with the plain letter&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The proxy also answers &lt;code&gt;400&lt;/code&gt; to a host with brackets around anything but an IPv6 address, such as &lt;code&gt;[evil.com]:443&lt;/code&gt;, and a partial clone&amp;rsquo;s warnings now read a remote&amp;rsquo;s host without its trailing dot, so they name &lt;code&gt;example.com&lt;/code&gt;, not &lt;code&gt;example.com.&lt;/code&gt;, and a remote at &lt;code&gt;localhost.&lt;/code&gt; gets the same warning as one at &lt;code&gt;localhost&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;how the proxy reads a host&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="connections-to-the-proxy-on-linux-hosts"&gt;Connections to the proxy on Linux hosts&lt;span class="hx:absolute hx:-mt-20" id="connections-to-the-proxy-on-linux-hosts"&gt;&lt;/span&gt;
&lt;a href="#connections-to-the-proxy-on-linux-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each connection that a VM confined to its proxy makes to the proxy starts a devvm process on a Linux host, and with no limit, a VM that opened connections without end could start thousands of them and fill the host with processes. devvm now carries at most 256 of a VM&amp;rsquo;s connections to its proxy at once, and answers any past that with &lt;code&gt;503&lt;/code&gt; before it reaches the proxy. A VM that&amp;rsquo;s running when you upgrade has no limit until its next start (&lt;a href="https://next.devvm.dev/docs/internals/processes/#the-qemu-wrapper-and-its-keeper"&gt;the QEMU wrapper&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-closed-connections-ssh-process"&gt;A closed connection&amp;rsquo;s ssh process&lt;span class="hx:absolute hx:-mt-20" id="a-closed-connections-ssh-process"&gt;&lt;/span&gt;
&lt;a href="#a-closed-connections-ssh-process" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When a VM never closed its end of a forwarded port&amp;rsquo;s or a link&amp;rsquo;s connection, that connection&amp;rsquo;s ssh process used to stay on this machine after the program here, or in the client, had closed its side, so a hostile VM could take all 256 connections that a forwarder or a client&amp;rsquo;s links carry at once. The ssh process now ends once its client has closed and the VM has sent nothing for 30 seconds. So a program that stops sending and waits more than 30 seconds for an answer to begin, such as &lt;code&gt;nc -N&lt;/code&gt; in front of a slow query, has its connection cut (&lt;a href="https://next.devvm.dev/docs/internals/ports/#how-it-reaches-the-vm"&gt;how it reaches the VM&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-a-vms-proxy-holds"&gt;What a VM&amp;rsquo;s proxy holds&lt;span class="hx:absolute hx:-mt-20" id="what-a-vms-proxy-holds"&gt;&lt;/span&gt;
&lt;a href="#what-a-vms-proxy-holds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM&amp;rsquo;s proxy used to count only its tunnels toward its limit, keep idle connections open without end, keep a plain HTTP request running after its client had gone, and take 1 MiB of a request&amp;rsquo;s headers inside an intercepted tunnel, so a VM could make it hold more and more. It now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;holds at most 2048 of the VM&amp;rsquo;s connections of every kind at once, where one without the VM&amp;rsquo;s password doesn&amp;rsquo;t count, and has at most 2048 requests to hosts under way at once&lt;/li&gt;
&lt;li&gt;closes a connection that waits 10 minutes for its next request, or that lacked the VM&amp;rsquo;s password&lt;/li&gt;
&lt;li&gt;ends a plain HTTP request a minute after its client has stopped sending and nothing has come back&lt;/li&gt;
&lt;li&gt;takes at most 64 KiB of headers everywhere, and carries at most 100 HTTP/2 requests at once in a tunnel&lt;/li&gt;
&lt;li&gt;lets long downloads, WebSockets and slow streams go on as long as they last (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="a-no_proxy-address-with-a-zone"&gt;A &lt;code&gt;NO_PROXY&lt;/code&gt; address with a zone&lt;span class="hx:absolute hx:-mt-20" id="a-no_proxy-address-with-a-zone"&gt;&lt;/span&gt;
&lt;a href="#a-no_proxy-address-with-a-zone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;An IPv6 address with a zone in your company proxy&amp;rsquo;s &lt;code&gt;NO_PROXY&lt;/code&gt;, such as &lt;code&gt;fe80::1%eth0&lt;/code&gt;, used to send that address past the company proxy without its zone, as &lt;a href="https://github.com/devvmhq/devvm/issues/59" target="_blank" rel="noopener"&gt;#59&lt;/a&gt; reported. Such an entry now matches nothing, as it does in Go&amp;rsquo;s HTTP clients (&lt;a href="https://next.devvm.dev/docs/safety/network/#behind-a-company-proxy"&gt;behind a company proxy&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-no_proxy-entrys-port"&gt;A &lt;code&gt;NO_PROXY&lt;/code&gt; entry&amp;rsquo;s port&lt;span class="hx:absolute hx:-mt-20" id="a-no_proxy-entrys-port"&gt;&lt;/span&gt;
&lt;a href="#a-no_proxy-entrys-port" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The proxy used to read &lt;code&gt;git.test:0&lt;/code&gt; as &lt;code&gt;git.test&lt;/code&gt; on every port, so it sent those hosts directly instead of through your company proxy, and it read &lt;code&gt;git.test:080&lt;/code&gt; or &lt;code&gt;git.test:+80&lt;/code&gt; as port 80, which Go&amp;rsquo;s clients don&amp;rsquo;t. An entry whose port no request has, such as &lt;code&gt;git.test:0&lt;/code&gt;, or whose port isn&amp;rsquo;t in plain decimal, now matches no host, as one past 65535 already didn&amp;rsquo;t (&lt;a href="https://next.devvm.dev/docs/internals/network/#through-a-company-proxy"&gt;through a company proxy&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-vm-never-runs-without-its-proxy"&gt;A VM never runs without its proxy&lt;span class="hx:absolute hx:-mt-20" id="a-vm-never-runs-without-its-proxy"&gt;&lt;/span&gt;
&lt;a href="#a-vm-never-runs-without-its-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A &lt;code&gt;devvm network&lt;/code&gt; change could leave a VM running without its proxy. A change between &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt; on a running VM is now refused before the VM&amp;rsquo;s tier changes, so its tier never says one thing while its proxy enforces another. A VM whose proxy doesn&amp;rsquo;t enforce the tier the VM has now, or whose proxy is stopped for new settings and then can&amp;rsquo;t start again, is still stopped, and a &lt;code&gt;devvm network&lt;/code&gt; change now stops it in that case as well (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-vms-logs-and-their-caps"&gt;A VM&amp;rsquo;s logs and their caps&lt;span class="hx:absolute hx:-mt-20" id="a-vms-logs-and-their-caps"&gt;&lt;/span&gt;
&lt;a href="#a-vms-logs-and-their-caps" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Root in a VM could write to its serial console, &lt;code&gt;/dev/hvc0&lt;/code&gt;, without end, and the console log grew until this machine&amp;rsquo;s disk was full, and so could Lima&amp;rsquo;s own logs for the VM until its next start. While a VM runs, its proxy now keeps the disk space that Lima&amp;rsquo;s console log for the VM and Lima&amp;rsquo;s own logs for the VM each take under 10 MiB, with a &lt;code&gt;.1&lt;/code&gt; file of up to 10 MiB more, and replaces the VM&amp;rsquo;s proxy password in them as they grow. A VM that&amp;rsquo;s running when you upgrade gets this once a devvm command starts its proxy again (&lt;a href="https://next.devvm.dev/docs/internals/processes/#limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvms-other-logs"&gt;devvm&amp;rsquo;s other logs&lt;span class="hx:absolute hx:-mt-20" id="devvms-other-logs"&gt;&lt;/span&gt;
&lt;a href="#devvms-other-logs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm&amp;rsquo;s other logs are held to their caps as well:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The port forwarder&amp;rsquo;s and the link session&amp;rsquo;s logs now stay under 1 MiB while they run, not only from their next start, and a link&amp;rsquo;s warnings take turns with the session&amp;rsquo;s other lines.&lt;/li&gt;
&lt;li&gt;The build proxy&amp;rsquo;s log stays under 10 MiB, as a VM&amp;rsquo;s proxy&amp;rsquo;s does.&lt;/li&gt;
&lt;li&gt;A run writes at most 128 MiB to its run log, and the run logs take at most 256 MiB together, though devvm never deletes the newest or one that a running devvm still writes (&lt;a href="https://next.devvm.dev/docs/internals/overview/#the-run-log"&gt;the run log&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="how-deep-a-save-goes"&gt;How deep a save goes&lt;span class="hx:absolute hx:-mt-20" id="how-deep-a-save-goes"&gt;&lt;/span&gt;
&lt;a href="#how-deep-a-save-goes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A chain of thousands of folders used to keep &lt;code&gt;devvm agent save&lt;/code&gt; busy for a long time while it held the agent store&amp;rsquo;s lock. The save now has an import&amp;rsquo;s bounds on depth, so a VM that sends folders nested more than 128 deep, or a path of more than 4,096 bytes, gets nothing saved, as an import of such folders does (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="opencodes-automations-and-permissions-in-history"&gt;opencode&amp;rsquo;s automations and permissions in history&lt;span class="hx:absolute hx:-mt-20" id="opencodes-automations-and-permissions-in-history"&gt;&lt;/span&gt;
&lt;a href="#opencodes-automations-and-permissions-in-history" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;opencode 2.4 keeps its automations in its database, each with a schedule or an event that triggers it and a shell command that it runs, which opencode asks you to approve once, as the automation is made, and then runs without asking again. The database also keeps the requests you said always to allow in a project, and each session&amp;rsquo;s own permission rules. A copy of the database in a history export kept all of them, so a hostile VM could write an automation, an allow rule or a session that allows every command into its database, and &lt;code&gt;devvm history import&lt;/code&gt; would put it into the VM you imported the export into, where opencode would run its command without asking. The same went for what opencode&amp;rsquo;s service starts by itself when it starts: a suspended session&amp;rsquo;s turn, a subagent&amp;rsquo;s job and a message queued for a session&amp;rsquo;s next turn. A project&amp;rsquo;s start command, which opencode runs for each worktree it makes, was in the copy too. opencode&amp;rsquo;s git repositories in &lt;code&gt;~/.local/share/opencode&lt;/code&gt;, its snapshots, its cache of repositories and its worktrees, were in the export too, and a repository&amp;rsquo;s config can name a command that opencode&amp;rsquo;s own git commands then run.&lt;/p&gt;
&lt;p&gt;The copy in an export, and the copy that an import makes of a database in any export, now has:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;no automations, subagents&amp;rsquo; jobs or queued messages&lt;/li&gt;
&lt;li&gt;no requests you said always to allow, and each session keeps only its deny and ask rules, each written again as sqlite3 reads it&lt;/li&gt;
&lt;li&gt;no suspended sessions, so no turn resumes on its own&lt;/li&gt;
&lt;li&gt;no project commands&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The copy drops every view and refuses a table with a generated column, which could hide rows from these steps, and its own check counts what&amp;rsquo;s left and leaves the database out unless nothing is. An export also leaves out opencode&amp;rsquo;s &lt;code&gt;snapshot&lt;/code&gt;, &lt;code&gt;repos&lt;/code&gt; and &lt;code&gt;worktree&lt;/code&gt; folders, and an import never writes them, so an export doesn&amp;rsquo;t hold opencode&amp;rsquo;s worktrees. The worktrees&amp;rsquo; commits are in your project&amp;rsquo;s own repository, and &lt;code&gt;devvm rm&lt;/code&gt;, which deletes their folders with the VM, now checks them for uncommitted changes first (&lt;a href="#opencodes-worktrees-before-a-vm-goes"&gt;opencode&amp;rsquo;s worktrees before a VM goes&lt;/a&gt;). An export also leaves out the project plugins you approved in opencode&amp;rsquo;s native client, which doesn&amp;rsquo;t ship yet: &lt;code&gt;plugin-approvals.json&lt;/code&gt; and the &lt;code&gt;plugin-staged&lt;/code&gt; folder in &lt;code&gt;~/.local/state/opencode&lt;/code&gt;. That client runs the staged copies without checking their hash again, so without this a hostile VM&amp;rsquo;s export could approve a plugin for the VM you import it into. In the new VM, make again any automation you want, and opencode asks again before the requests you had always allowed. A VM made again keeps its own, because its home folder&amp;rsquo;s copy isn&amp;rsquo;t an export (&lt;a href="https://next.devvm.dev/docs/internals/agents/#history-exports"&gt;what an export holds&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-stopped-vms-shell"&gt;A stopped VM&amp;rsquo;s shell&lt;span class="hx:absolute hx:-mt-20" id="a-stopped-vms-shell"&gt;&lt;/span&gt;
&lt;a href="#a-stopped-vms-shell" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In a terminal, &lt;code&gt;limactl shell&lt;/code&gt; of a stopped VM asks whether to start it, yes by default. When a VM shut itself down as devvm opened its shell or ran a command in it, you could get that question, and a yes, or just Enter, started the VM as Lima does: unconfined and without its proxy, mounting a folder that replaced the project folder, or making the project folder again if it was gone. devvm&amp;rsquo;s own start refuses each of these. Every &lt;code&gt;limactl shell&lt;/code&gt; that devvm runs now says not to start the VM, so the shell or command fails, and devvm&amp;rsquo;s next launch starts the VM with every check (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-stopped-vms-shell"&gt;a stopped VM&amp;rsquo;s shell&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Processes</title><link>https://next.devvm.dev/docs/internals/processes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/processes/</guid><description>
&lt;p&gt;This page goes through every process that devvm runs on this machine for a VM, one section each: what it holds, such as secrets and keys, the input a VM controls that it reads, what it writes and how far that can grow, how it&amp;rsquo;s confined, and who starts it and waits for it. Then it lists every listener on this machine whose bytes a VM controls, and why devvm is written in Go. The pages each section links to have the details, and the &lt;a href="https://next.devvm.dev/docs/internals/security/"&gt;security model&lt;/a&gt; has what these processes protect.&lt;/p&gt;
&lt;p&gt;Every process here runs as you. devvm runs its own long-running processes as itself, &lt;code&gt;devvm&lt;/code&gt; with a hidden command, so their code is the binary you installed, and the other long-running programs it runs are OpenSSH&amp;rsquo;s &lt;code&gt;ssh&lt;/code&gt; and &lt;code&gt;ssh-agent&lt;/code&gt;, Lima and, on Linux, QEMU.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Process&lt;/th&gt;
&lt;th&gt;Started by&lt;/th&gt;
&lt;th&gt;Ends&lt;/th&gt;
&lt;th&gt;Confinement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#devvm-itself"&gt;devvm itself&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;you&lt;/td&gt;
&lt;td&gt;when its command ends&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#a-vms-proxy"&gt;A VM&amp;rsquo;s proxy&lt;/a&gt;: its broker, &lt;code&gt;devvm _proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each start of the VM&lt;/td&gt;
&lt;td&gt;with the VM&amp;rsquo;s hostagent, its child, or &lt;code&gt;devvm stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#a-vms-proxy"&gt;A VM&amp;rsquo;s proxy&lt;/a&gt;: its child, &lt;code&gt;devvm _proxy-child&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the broker&lt;/td&gt;
&lt;td&gt;with its broker&lt;/td&gt;
&lt;td&gt;a Seatbelt profile on macOS, and Landlock and a seccomp filter on Linux (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#a-builds-proxy"&gt;A build&amp;rsquo;s proxy&lt;/a&gt;, &lt;code&gt;devvm _proxy&lt;/code&gt; and its child&lt;/td&gt;
&lt;td&gt;a build behind a company proxy&lt;/td&gt;
&lt;td&gt;with the build&lt;/td&gt;
&lt;td&gt;its child&amp;rsquo;s, as a VM&amp;rsquo;s proxy&amp;rsquo;s child&amp;rsquo;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#the-port-forwarder"&gt;The port forwarder&lt;/a&gt;, &lt;code&gt;devvm _ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each start of a project VM, and each change of its ports&lt;/td&gt;
&lt;td&gt;with the VM&amp;rsquo;s hostagent, or &lt;code&gt;devvm stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#the-link-session"&gt;The link session&lt;/a&gt;, &lt;code&gt;devvm _links&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a start or a change of links, for a client with links&lt;/td&gt;
&lt;td&gt;when the client stops or has no links, or &lt;code&gt;devvm stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#ssh-masters-and-relays"&gt;ssh masters and relays&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;the forwarder, the link session and devvm&lt;/td&gt;
&lt;td&gt;with the process that started them&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#the-qemu-wrapper-and-its-keeper"&gt;The QEMU wrapper&lt;/a&gt;, &lt;code&gt;devvm _qemu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lima, on Linux hosts&lt;/td&gt;
&lt;td&gt;with QEMU&lt;/td&gt;
&lt;td&gt;QEMU&amp;rsquo;s restricted network, and a user namespace for a VM with &lt;code&gt;.git&lt;/code&gt; pins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#the-daily-tools-check"&gt;The daily tools check&lt;/a&gt;, &lt;code&gt;devvm _refresh-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a launch of an existing VM, once a day&lt;/td&gt;
&lt;td&gt;when the check is done&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#the-desktop-relay"&gt;The desktop relay&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;devvm desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#the-ssh-agents"&gt;The SSH agents&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;you, or &lt;code&gt;devvm&lt;/code&gt; for devvm&amp;rsquo;s own&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s own: at logout or a reboot&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl start&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;when the VM stops&lt;/td&gt;
&lt;td&gt;a Seatbelt profile on macOS, for a confined VM or a build&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="how-devvm-starts-them"&gt;How devvm starts them&lt;span class="hx:absolute hx:-mt-20" id="how-devvm-starts-them"&gt;&lt;/span&gt;
&lt;a href="#how-devvm-starts-them" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm starts the proxy, the port forwarder, the link session and the daily tools check detached, in a session of their own, so they outlive the run that started them and the terminal it ran in (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;). Each gets no input and devvm&amp;rsquo;s environment without &lt;code&gt;SSH_AUTH_SOCK&lt;/code&gt;, so none of them uses your SSH agent of its own accord, and its output goes to its own log or nowhere. The one exception is a VM&amp;rsquo;s proxy, which relays the agent that the VM&amp;rsquo;s start forwards, named in its config (&lt;a href="#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;). devvm marks every file it was given past standard input, output and error close-on-exec as it starts, so a terminal or a pipe that devvm inherited never stays open in them (&lt;a href="https://next.devvm.dev/docs/contributing/design/#things-learned"&gt;things learned&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm finds such a process again by its pid file and its arguments, and it signals a process only while both still say it&amp;rsquo;s that process, so a pid that the system gave another program since is never signalled. A stop sends &lt;code&gt;SIGTERM&lt;/code&gt;, waits two seconds, and sends &lt;code&gt;SIGKILL&lt;/code&gt; only to a process whose arguments are still the ones devvm started. Each signal goes to the process&amp;rsquo;s group, which its own session makes it the leader of, so what it started ends with it, such as the forwarder&amp;rsquo;s and the link session&amp;rsquo;s ssh masters and relays, even when it&amp;rsquo;s killed and can&amp;rsquo;t stop them itself. A forwarder or a link session that gets &lt;code&gt;SIGTERM&lt;/code&gt; from anything else, such as &lt;code&gt;kill&lt;/code&gt;, stops its ssh before it exits, waiting up to two seconds for that, as devvm does for its cleanups. A process that devvm waits for, such as the proxy, says it&amp;rsquo;s ready in a status file of its own, which holds its pid and its address, so a file that another process left never counts (&lt;a href="https://next.devvm.dev/docs/internals/network/#how-long-a-proxy-runs"&gt;how long a proxy runs&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The run that starts a process reaps it if it ends first, and once that run ends, nothing on this machine waits for it. Instead, each one ends on its own. The proxy and the forwarder follow the VM&amp;rsquo;s hostagent through its pid file, &lt;code&gt;ha.pid&lt;/code&gt;, which is the VM&amp;rsquo;s lifeline, and the link session asks the VM&amp;rsquo;s backend every 5 seconds whether the VM still runs the start it was made for. &lt;code&gt;devvm stop&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop a VM&amp;rsquo;s proxy, forwarder and link session while they still run.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-itself"&gt;devvm itself&lt;span class="hx:absolute hx:-mt-20" id="devvm-itself"&gt;&lt;/span&gt;
&lt;a href="#devvm-itself" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; everything you keep with devvm. It reads secrets from the macOS Keychain with the &lt;code&gt;security&lt;/code&gt; command or from files only you can read, and it writes each VM&amp;rsquo;s proxy password and the company proxy&amp;rsquo;s credentials into files only you can read, never into a process&amp;rsquo;s arguments (&lt;a href="https://next.devvm.dev/docs/internals/network/#where-secrets-are-saved"&gt;where secrets are saved&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from a VM:&lt;/strong&gt; the output of the commands it runs there, such as a VM&amp;rsquo;s host keys, its settings to save and a history export, and the files a VM can write or swap, such as the project folder&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt;. It reads such a file without following a link out of the folder, and with a cap on its size, and each kind of output has a cap of its own, such as 128 MiB for a VM&amp;rsquo;s settings and 2 GiB for a history export (&lt;a href="https://next.devvm.dev/docs/internals/agents/#saving-a-vms-settings"&gt;coding agents&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; its run log, &lt;code&gt;~/.local/share/devvm/logs/runs/&amp;lt;date&amp;gt;-&amp;lt;time&amp;gt;-&amp;lt;pid&amp;gt;.log&lt;/code&gt;, with at most 4 MiB of output for each command it runs in a VM and at most 128 MiB in all, after which one line says the rest was left out. It keeps the newest 20 logs, or as many as &lt;code&gt;logs.runs&lt;/code&gt; sets, and deletes older ones once the logs take more than 256 MiB together. It never deletes the newest log, or one whose run still runs, which it tells from the pid in the log&amp;rsquo;s name. It writes state files whole, renamed into place (&lt;a href="https://next.devvm.dev/docs/internals/overview/#state-files"&gt;state files&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listens:&lt;/strong&gt; only in &lt;code&gt;devvm desktop&lt;/code&gt; (&lt;a href="#the-desktop-relay"&gt;the desktop relay&lt;/a&gt;) and while &lt;code&gt;devvm agent login&lt;/code&gt; waits for a browser&amp;rsquo;s login (&lt;a href="#listeners-a-vm-reaches"&gt;listeners&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confinement:&lt;/strong&gt; none. devvm needs your Keychain and your files, and it&amp;rsquo;s the program you chose to run.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="a-vms-proxy"&gt;A VM&amp;rsquo;s proxy&lt;span class="hx:absolute hx:-mt-20" id="a-vms-proxy"&gt;&lt;/span&gt;
&lt;a href="#a-vms-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each running VM&amp;rsquo;s proxy is two processes, so the code that reads every byte the VM sends never holds what only the host should. The two are a broker, &lt;code&gt;devvm _proxy -config FILE&lt;/code&gt;, with the VM&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt; in its run folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;, and its child, &lt;code&gt;devvm _proxy-child -for FILE&lt;/code&gt;, which the broker starts and which reads the VM&amp;rsquo;s network (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;). The child asks the broker over a socketpair between them for a bound value, a changed file, a connection to a link, a login&amp;rsquo;s token exchange, a name&amp;rsquo;s addresses and a connection to an address or the company proxy, each by something the broker finds in its own config, which is one VM&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-proxys-broker"&gt;the proxy&amp;rsquo;s broker&lt;/a&gt; has the design and its threat check).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The broker:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; the VM&amp;rsquo;s password and the company proxy&amp;rsquo;s credentials, which it reads from the config and hands the child as it starts. It looks up each bound secret&amp;rsquo;s value itself, through the Keychain or the secret&amp;rsquo;s file, keeps a value for 5 minutes, an agent&amp;rsquo;s login for 30 seconds and a failed lookup for 5 seconds, and drops them all when the VM&amp;rsquo;s bindings change. It reads the agents&amp;rsquo; login files in devvm&amp;rsquo;s store and refreshes their OAuth logins there, and it sends each login that the VM makes to the agent&amp;rsquo;s token endpoint itself, saves it into the store and rewrites the VM&amp;rsquo;s bindings, so a login&amp;rsquo;s real tokens never reach the child (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VM:&lt;/strong&gt; the child&amp;rsquo;s frames, each at most 2 MiB, and through them a login&amp;rsquo;s token request, at most 64 KiB of headers and 64 KiB of body, and its endpoint&amp;rsquo;s reply, at most 1 MiB. It also reads your policy files and the VM&amp;rsquo;s bindings, each at most 1 MiB, and the links&amp;rsquo; list, &lt;code&gt;links.json&lt;/code&gt;, at most 1 MiB, which &lt;code&gt;devvm _links&lt;/code&gt; writes. It reads them for the child once they change, reads the bindings and the links&amp;rsquo; list again at each request that uses them, and reads the policy files again at each connection it opens for the child. For a VM that forwards an SSH agent, it reads the agent&amp;rsquo;s requests that the VM sends, each at most 256 KiB (&lt;a href="#the-ssh-agents"&gt;the SSH agents&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; its own lines in &lt;code&gt;proxy.log&lt;/code&gt;, its child&amp;rsquo;s pid file, &lt;code&gt;run/proxy-child.pid&lt;/code&gt;, and how the child is confined, &lt;code&gt;run/proxy.confined&lt;/code&gt;, and the login files and bindings above. It also holds the logs that the VM&amp;rsquo;s backend writes as the VM runs to 10 MiB each, with a &lt;code&gt;.1&lt;/code&gt; file of as much, the VM&amp;rsquo;s serial console&amp;rsquo;s among them, looking at each every second in a goroutine of its own (&lt;a href="#limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;/a&gt;), because they&amp;rsquo;re in the backend&amp;rsquo;s folder for the VM, beside its disk, which the child must never write. A proxy that an older devvm started doesn&amp;rsquo;t hold them, so a VM that&amp;rsquo;s running when you upgrade gets this once its next devvm command starts its proxy again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounds:&lt;/strong&gt; one value, 8 token exchanges, 4 files, 256 links, 256 lookups and 1024 connections at once from its child, and an error for a request past them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connects:&lt;/strong&gt; for the child, to an address only once its own read of the VM&amp;rsquo;s policy files and of this machine&amp;rsquo;s addresses allows it, as the floor does, and to the company proxy of its config, each within 15 seconds. It also looks up names through this machine&amp;rsquo;s resolver for the child, each within 20 seconds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listens:&lt;/strong&gt; on the VM&amp;rsquo;s agent socket, &lt;code&gt;~/.local/share/devvm/run/agent-&amp;lt;hash&amp;gt;.sock&lt;/code&gt;, for a VM that forwards an SSH agent. It also opens the VM&amp;rsquo;s proxy port and hands the listener to its child (&lt;a href="#listeners-a-vm-reaches"&gt;listeners&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confinement:&lt;/strong&gt; none. It runs as you, with your Keychain and your files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; devvm starts it before each start of the VM, on every tier, and waits up to 5 seconds for it to say it&amp;rsquo;s listening. The broker says so once its child has said it&amp;rsquo;s ready, within 4 seconds of the broker&amp;rsquo;s start. It exits when the hostagent it follows ends, 15 minutes after it starts if the hostagent never appears, or when its child ends, and &lt;code&gt;devvm stop&lt;/code&gt; also stops it (&lt;a href="https://next.devvm.dev/docs/internals/network/#how-long-a-proxy-runs"&gt;how long a proxy runs&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The child:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; the VM&amp;rsquo;s password, the VM&amp;rsquo;s CA and the next one, with their keys, the company proxy&amp;rsquo;s credentials, and each value that the broker gave it, until the broker&amp;rsquo;s lookup of that value is as old as the broker keeps one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VM:&lt;/strong&gt; every request the VM sends. It takes at most 64 KiB of a request&amp;rsquo;s headers within 30 seconds, also in an intercepted or transparent connection, and it requires the VM&amp;rsquo;s password before anything else. It reads a ClientHello of at most 16 KiB and 256 bytes within 10 seconds of its first byte. It looks at the changing files with &lt;code&gt;stat&lt;/code&gt; alone and asks the broker for one once it changed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; its event log, &lt;code&gt;network.jsonl&lt;/code&gt;, and its own lines in &lt;code&gt;proxy.log&lt;/code&gt;, in the VM&amp;rsquo;s logs folder, &lt;code&gt;~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;, each rotated before it passes 10 MiB, with one &lt;code&gt;.1&lt;/code&gt; file kept (&lt;a href="https://next.devvm.dev/docs/internals/network/#log-files"&gt;log files&lt;/a&gt;). Its HTTP server&amp;rsquo;s errors go to &lt;code&gt;proxy.log&lt;/code&gt; too, and so does what reaches either process&amp;rsquo;s error output, which counts toward the 10 MiB. For a VM with the nix layer, it fills the &lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;shared Nix cache&lt;/a&gt;, at most 10 GiB unless its config sets another cap. It reads and writes nothing else of yours or devvm&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounds:&lt;/strong&gt; at most 8448 open files, a limit it sets on itself before it&amp;rsquo;s confined, at most 1024 &lt;code&gt;CONNECT&lt;/code&gt; tunnels at once, at most 2048 connections of every kind with the VM&amp;rsquo;s password, plain HTTP and idle ones included, at most 128 more that haven&amp;rsquo;t sent the password yet, and at most 2048 requests to hosts under way, its tunnels&amp;rsquo; included. It keeps at most 1024 of the certificates it made for intercepted hosts for each CA, dropping the one used longest ago. A connection to the proxy, and the HTTP inside an intercepted or transparent connection, waits at most 10 minutes between requests, and HTTP/2 inside one carries at most 100 requests at once. A request without the VM&amp;rsquo;s password gets its &lt;code&gt;407&lt;/code&gt; and its connection closed. A plain HTTP request whose client has stopped sending goes on while its answer keeps coming, and ends after a minute with nothing to pass on, so a client that went away frees what its request holds (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;). Nothing bounds how long a request or a tunnel lasts, so long downloads, WebSockets and slow streams go on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listens:&lt;/strong&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt;, on the VM&amp;rsquo;s proxy port, through the listener the broker opened (&lt;a href="#listeners-a-vm-reaches"&gt;listeners&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connects:&lt;/strong&gt; nowhere itself. It asks the broker to look up each name and to open each connection to a host or to the company proxy, and the broker hands it the connection, so it reaches this machine&amp;rsquo;s loopback, its own addresses and the private and link-local ranges only where a rule names the address, or through a company proxy (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inherits:&lt;/strong&gt; standard input from the null device, &lt;code&gt;proxy.log&lt;/code&gt; as its output and its error output, the socket to the broker as descriptor 3 and the listener as descriptor 4, and from the environment only &lt;code&gt;TZ&lt;/code&gt;, &lt;code&gt;SSL_CERT_FILE&lt;/code&gt;, &lt;code&gt;SSL_CERT_DIR&lt;/code&gt; and &lt;code&gt;GODEBUG&lt;/code&gt;. Run by hand without those two sockets, it refuses to start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confinement:&lt;/strong&gt; on macOS, a Seatbelt profile that denies everything but what the child needs, from its first instruction, because the broker starts it through &lt;code&gt;/usr/bin/sandbox-exec&lt;/code&gt; with the profile as an argument, never as a file (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;). The profile lets it run and read devvm&amp;rsquo;s binary, write regular files in its logs folder and the shared Nix cache, look at the changing files with &lt;code&gt;stat&lt;/code&gt;, and ask &lt;code&gt;trustd&lt;/code&gt; to check certificates. It denies the child your home folder, devvm&amp;rsquo;s other folders, the Keychain, every connection of its own, over TCP, UDP or a unix socket, a bind, a fork, a signal to another process, and a look at another process, its arguments included. The child checks that the sandbox holds before it says it&amp;rsquo;s ready, and it says how it&amp;rsquo;s confined in &lt;code&gt;run/proxy.confined&lt;/code&gt;, which is &lt;code&gt;full seatbelt&lt;/code&gt; when it is. The broker adds a second line with its pid and when the system says it started, and devvm doctor reads the file only when that line names the broker that runs now. So doctor ignores a file that a newer devvm&amp;rsquo;s broker left behind when, after a downgrade, an older devvm started the VM&amp;rsquo;s proxy, and it names that proxy as one an older devvm started. When doctor can&amp;rsquo;t read when the running broker started, it says it can&amp;rsquo;t tell whether the proxy runs in its sandbox. Where &lt;code&gt;sandbox-exec&lt;/code&gt; is missing or fails to start it, the broker starts it unconfined, writes a warning in &lt;code&gt;proxy.log&lt;/code&gt;, and devvm doctor warns while the VM runs (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox"&gt;the proxy runs without a sandbox&lt;/a&gt;). On Linux it confines itself before it reads a byte of the VM&amp;rsquo;s. It sets &lt;code&gt;no_new_privs&lt;/code&gt;, limits itself to the same folders with Landlock, and installs a seccomp filter that refuses it every socket but a netlink route socket, &lt;code&gt;connect&lt;/code&gt;, TCP Fast Open, a listen, &lt;code&gt;io_uring&lt;/code&gt;, the calls that reach another process, a change to a file&amp;rsquo;s metadata by its path, the kernel&amp;rsquo;s keyrings, a program, a process or a namespace of its own. It says &lt;code&gt;full landlock&lt;/code&gt; when the kernel has Landlock&amp;rsquo;s ABI 6 and its fix for signals between threads. An older kernel confines it in part, which it says, and the broker and devvm doctor warn of it the same way.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; the broker starts it, devvm&amp;rsquo;s own binary, by its real path on macOS and as &lt;code&gt;/proc/self/exe&lt;/code&gt; on Linux, and on Linux the system kills it when the broker&amp;rsquo;s thread that started it ends. It ends when it reads the end of its socket to the broker. It then stops listening, closes every connection it accepted, including the tunnels it carries and the WebSocket upgrades it passes on, and refuses one that arrives after that. It then waits for the handlers to return, 5 seconds at most, because Go&amp;rsquo;s HTTP server neither closes a connection that a handler took from it nor waits for a handler. When the hostagent ends, the broker closes the socket and kills the child a second past those 5 seconds. &lt;code&gt;devvm stop&lt;/code&gt;&amp;rsquo;s &lt;code&gt;SIGTERM&lt;/code&gt; reaches the broker, which sends the child &lt;code&gt;SIGTERM&lt;/code&gt;, which ends it at once, and kills it if it hasn&amp;rsquo;t ended within a second. A child that ends, however it ends, ends its broker, and neither starts the other again.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="a-builds-proxy"&gt;A build&amp;rsquo;s proxy&lt;span class="hx:absolute hx:-mt-20" id="a-builds-proxy"&gt;&lt;/span&gt;
&lt;a href="#a-builds-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A build gets a proxy of its own only behind a company proxy, because a build VM otherwise reaches the internet directly (&lt;a href="https://next.devvm.dev/docs/contributing/design/#a-company-proxy"&gt;a company proxy&lt;/a&gt;). It&amp;rsquo;s the same &lt;code&gt;devvm _proxy&lt;/code&gt; broker and its child, with a config in the build VM&amp;rsquo;s &lt;code&gt;run/build-proxy&lt;/code&gt; folder, which devvm makes again for each build.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; a password made for the build, and the company proxy&amp;rsquo;s credentials. It has no CA, no secrets, no links and no Nix cache, so its broker looks up only the &lt;code&gt;proxy&lt;/code&gt; secret, when &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s company proxy names one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the build:&lt;/strong&gt; its requests, in the child, with the same checks as a VM&amp;rsquo;s proxy, under a policy that allows any host on ports 80 and 443, but not this machine&amp;rsquo;s own or internal addresses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; &lt;code&gt;events.jsonl&lt;/code&gt; and &lt;code&gt;proxy.log&lt;/code&gt;, in the build proxy&amp;rsquo;s &lt;code&gt;logs/&lt;/code&gt; folder, which its child writes and which holds nothing else of the build proxy&amp;rsquo;s, each rotated as a VM&amp;rsquo;s proxy rotates its own. devvm deletes the build proxy&amp;rsquo;s folder after a build that succeeds and keeps it after one that fails. The build&amp;rsquo;s devvm process holds the build VM&amp;rsquo;s own logs to their caps, with a company proxy or without one, as a VM&amp;rsquo;s proxy holds a VM&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confinement:&lt;/strong&gt; none for the broker. Its child is confined as a VM&amp;rsquo;s proxy&amp;rsquo;s child is, under the same Seatbelt profile on macOS and with Landlock and the seccomp filter on Linux, and its only folder is the build proxy&amp;rsquo;s &lt;code&gt;logs/&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; the build starts its broker, keeps its process and stops it when the build ends, which ends the child as &lt;code&gt;devvm stop&lt;/code&gt; does, and a cleanup stops it when the build fails or is interrupted. It also follows the build VM&amp;rsquo;s hostagent, as a VM&amp;rsquo;s proxy does.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-port-forwarder"&gt;The port forwarder&lt;span class="hx:absolute hx:-mt-20" id="the-port-forwarder"&gt;&lt;/span&gt;
&lt;a href="#the-port-forwarder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;One forwarder runs for each running project VM that forwards ports, as &lt;code&gt;devvm _ports&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/ports/#its-process-and-files"&gt;its process and files&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; the key that the backend logs in to the VM with, which on Lima is Lima&amp;rsquo;s &lt;code&gt;_config/user&lt;/code&gt;, and the VM&amp;rsquo;s host keys for its current start. Its ssh uses no agent.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VM:&lt;/strong&gt; the VM&amp;rsquo;s report of the ports it listens on, which comes over one ssh session about every 10 seconds, as the VM paces it. A line of the report has at most 127 bytes and its newline, and a longer line, or a report of more than 4096 lines, ends the session, which the forwarder opens again, so nothing is cut. The forwarder applies at most one report every 500 ms. It also reads the bytes of each forwarded connection, which it carries as they are, and the other VMs&amp;rsquo; records of their ports.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; &lt;code&gt;ports.forwarded&lt;/code&gt; in the VM&amp;rsquo;s run folder, and its log, &lt;code&gt;ports.log&lt;/code&gt;, in the VM&amp;rsquo;s logs folder. The VM chooses some of what goes in the log, so the forwarder makes at most 200 writes at once and then one every 10 seconds, each cut at 512 bytes and without control characters other than newlines and tabs. The log is also its process&amp;rsquo;s output, and before each line the forwarder checks its size on disk, so a line that would take it past 1 MiB rotates it first. The log&amp;rsquo;s end goes to &lt;code&gt;ports.log.1&lt;/code&gt;, replacing the one there, and the log starts empty. devvm rotates a log that an earlier forwarder left past 1 MiB as it starts the next one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounds:&lt;/strong&gt; at most 256 forwards, and at most 256 connections at once. When accepting a connection fails while the port still listens, such as when the forwarder runs out of open files, it tries again after a wait that starts at 5 ms and doubles with each failure in a row, up to a second, and logs only the first failure of a run, as the link session and a login&amp;rsquo;s forward do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listens:&lt;/strong&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; for each forwarded port (&lt;a href="#listeners-a-vm-reaches"&gt;listeners&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confinement:&lt;/strong&gt; none. Its ssh processes get the higher limit of open files that devvm runs with.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; devvm starts it once the backend says the VM runs, and again when the VM&amp;rsquo;s ports change. It exits once the VM&amp;rsquo;s hostagent is gone, which it checks every 2 seconds, and &lt;code&gt;devvm stop&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-link-session"&gt;The link session&lt;span class="hx:absolute hx:-mt-20" id="the-link-session"&gt;&lt;/span&gt;
&lt;a href="#the-link-session" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;One link session runs for each running client VM with &lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;links&lt;/a&gt;, as &lt;code&gt;devvm _links VM&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/ports/#the-link-session"&gt;the link session&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; the login key and the pinned host keys of the client and of each target it connects to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VMs:&lt;/strong&gt; the bytes of each link&amp;rsquo;s connection, both ways, and the messages of the client&amp;rsquo;s sshd, such as its refusal of a forward, each cut at 512 bytes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; &lt;code&gt;links.json&lt;/code&gt; in the client&amp;rsquo;s run folder, the client&amp;rsquo;s event log, &lt;code&gt;network.jsonl&lt;/code&gt;, with the proxy&amp;rsquo;s own writer, so it rotates by the same rule, and its log, &lt;code&gt;links.log&lt;/code&gt;, in the client&amp;rsquo;s logs folder, which it writes, limits and rotates past 1 MiB as the forwarder does its own. Its warning that the client refused to listen for a link carries the client&amp;rsquo;s sshd&amp;rsquo;s words, and the client chooses how often it comes, so each warning takes its turn from the same limit as the log&amp;rsquo;s lines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounds:&lt;/strong&gt; at most 256 of the client&amp;rsquo;s connections at once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listens:&lt;/strong&gt; on a unix socket for each link, mode 600, in &lt;code&gt;~/.local/share/devvm/run&lt;/code&gt; (mode 700).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confinement:&lt;/strong&gt; none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; a start of the client and a change of its links start it. It ends once the client no longer runs the start it was made for, which it checks every 5 seconds, or has no links left, and &lt;code&gt;devvm stop&lt;/code&gt; stops it with the client.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="ssh-masters-and-relays"&gt;ssh masters and relays&lt;span class="hx:absolute hx:-mt-20" id="ssh-masters-and-relays"&gt;&lt;/span&gt;
&lt;a href="#ssh-masters-and-relays" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The forwarder and the link session each reach a VM over one ssh connection of their own, its master. The forwarder&amp;rsquo;s master runs the VM&amp;rsquo;s report of its ports, and the link session keeps one master to the client, which asks for the links&amp;rsquo; remote forwards, and one to each target. Every master checks the VM&amp;rsquo;s pinned host key, sets &lt;code&gt;ControlPersist=no&lt;/code&gt;, and sends a keepalive every 10 seconds, giving up after 3 that get no answer.&lt;/p&gt;
&lt;p&gt;Each connection that the forwarder or the link session carries gets an ssh process of its own, a relay, which runs &lt;code&gt;ssh -W&lt;/code&gt;. A link&amp;rsquo;s relay can only ride on its target&amp;rsquo;s master. A forwarder&amp;rsquo;s relay rides on the VM&amp;rsquo;s master when it can, and it checks the same pinned host key either way, so it reaches only that VM.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; the login key, and no agent (&lt;code&gt;IdentityAgent=none&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VM:&lt;/strong&gt; the bytes of the connection it carries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; nothing of its own. A master&amp;rsquo;s messages go to its process&amp;rsquo;s log.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ends:&lt;/strong&gt; a relay ends when either side ends, when its forward or its link goes, and 30 seconds after the program on this machine closes its side if the VM sends nothing in that time (&lt;a href="https://next.devvm.dev/docs/internals/ports/#how-it-reaches-the-vm"&gt;how it reaches the VM&lt;/a&gt;). Each process that starts a master or a relay waits for it, and kills it when it ends that connection.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;devvm desktop&lt;/code&gt; and &lt;code&gt;devvm agent login&lt;/code&gt; start relays of their own, one ssh process for each connection, which rides on no master (&lt;code&gt;ControlMaster=no&lt;/code&gt;, &lt;code&gt;ControlPath=none&lt;/code&gt;). A login&amp;rsquo;s relay ends as the forwarder&amp;rsquo;s do, and a login carries at most 16 connections at once, closing any past that, so whatever else on this machine connects to its port can&amp;rsquo;t start ssh processes without end. A viewer&amp;rsquo;s ssh process gets 2 seconds to end once its viewer leaves, and is then killed.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-qemu-wrapper-and-its-keeper"&gt;The QEMU wrapper and its keeper&lt;span class="hx:absolute hx:-mt-20" id="the-qemu-wrapper-and-its-keeper"&gt;&lt;/span&gt;
&lt;a href="#the-qemu-wrapper-and-its-keeper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On Linux hosts, Lima starts each VM&amp;rsquo;s QEMU through a wrapper that devvm writes into &lt;code&gt;~/.local/share/devvm/run/qemu/&lt;/code&gt;, which runs &lt;code&gt;devvm _qemu exec&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm _qemu exec&lt;/code&gt;&lt;/strong&gt; reads Lima&amp;rsquo;s arguments for QEMU and adds &lt;code&gt;restrict=on&lt;/code&gt; to Lima&amp;rsquo;s one network, except for an open VM and a build with the internet, and for a VM confined to its proxy it adds a &lt;code&gt;guestfwd&lt;/code&gt; to that proxy. It refuses arguments of any other shape (&lt;code&gt;qemu_refused&lt;/code&gt;). It then runs QEMU in its place, or, for a VM with &lt;code&gt;.git&lt;/code&gt; pins, which a VM whose &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-linux-hosts"&gt;.git protection&lt;/a&gt; is on has, starts the keeper and waits for it. Only such a VM gets a user namespace.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The keeper, &lt;code&gt;devvm _qemu pinned&lt;/code&gt;,&lt;/strong&gt; runs in a user namespace and a mount namespace of its own, as you, with the capability to mount in that namespace alone. It makes &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s hooks and config read-only there, and it pins a path again after any change in a folder it watches, and every 2 seconds. It records each pin it makes again in &lt;code&gt;git-pins.jsonl&lt;/code&gt; in the VM&amp;rsquo;s run folder, and on QEMU&amp;rsquo;s error output, which Lima logs. Past 1 MiB, the file takes no more events, only a line for each that says it went unrecorded, up to 64 KiB more, and the next check names those. It starts QEMU through &lt;code&gt;devvm _qemu drop&lt;/code&gt;, which clears its ambient, permitted, effective and inheritable capabilities, keeping the bounding set, sets &lt;code&gt;no_new_privs&lt;/code&gt;, and runs QEMU.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm _qemu probe DIR&lt;/code&gt;&lt;/strong&gt; checks, in a namespace of its own, that a file in DIR can be pinned.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm _qemu connect&lt;/code&gt;&lt;/strong&gt; is what QEMU&amp;rsquo;s &lt;code&gt;guestfwd&lt;/code&gt; runs for each connection that the VM makes to &lt;code&gt;192.168.5.4:3128&lt;/code&gt;. It connects to the VM&amp;rsquo;s proxy and carries the bytes both ways, so it reads only what the VM sends to its proxy, which the proxy checks. Each one is a process of its own, about 7.7 MB of memory, so it carries at most 256 of the VM&amp;rsquo;s connections at once, about 2 GB for a VM that holds them all, each holding a slot, which is a lock file in the &lt;code&gt;proxy.slots&lt;/code&gt; folder of the VM&amp;rsquo;s run folder. A connection past that gets a &lt;code&gt;503&lt;/code&gt; and is closed before it reaches the proxy, and QEMU&amp;rsquo;s error output, which Lima logs, says so at most once a minute (&lt;code&gt;qemu_connects_full&lt;/code&gt;). A VM that was running when devvm was upgraded has no slots, and so no limit, until its next start. It has no idle timeout and no limit on the bytes it carries, because the proxy bounds what each connection carries, and a long download or a quiet stream must go on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The keeper dies with &lt;code&gt;devvm _qemu exec&lt;/code&gt;, and QEMU with the keeper. &lt;code&gt;devvm _qemu connect&lt;/code&gt; ends when its connection ends, and its slot is free again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-daily-tools-check"&gt;The daily tools check&lt;span class="hx:absolute hx:-mt-20" id="the-daily-tools-check"&gt;&lt;/span&gt;
&lt;a href="#the-daily-tools-check" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm _refresh-tools&lt;/code&gt; asks for the shared tools&amp;rsquo; newest versions once a day, so a later launch can offer them (&lt;a href="https://next.devvm.dev/docs/using/toolchains/"&gt;shared tools&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; the company proxy&amp;rsquo;s password, when &lt;code&gt;config.toml&lt;/code&gt; sets the proxy, in the environment of the mise it runs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads:&lt;/strong&gt; nothing from a VM. It downloads devvm&amp;rsquo;s pinned mise, checked by its SHA-256, mise reads the tools&amp;rsquo; versions from the internet, and the check fetches .NET&amp;rsquo;s release data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; the shared tools&amp;rsquo; lock, under its lock, the time of the check, and its output to &lt;code&gt;~/.local/share/devvm/logs/tools-check.log&lt;/code&gt;, which each check starts empty.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; a launch of an existing VM starts it when the shared tools have a lock file and a day has passed since the last check, and doesn&amp;rsquo;t wait for it. &lt;code&gt;DEVVM_NO_TOOL_CHECK&lt;/code&gt; turns it off.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-desktop-relay"&gt;The desktop relay&lt;span class="hx:absolute hx:-mt-20" id="the-desktop-relay"&gt;&lt;/span&gt;
&lt;a href="#the-desktop-relay" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm desktop&lt;/code&gt; runs the relay in its own process, for as long as it runs (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#on-this-machine"&gt;on this machine&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; the VM&amp;rsquo;s desktop password, which never goes into the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VM:&lt;/strong&gt; the VM&amp;rsquo;s side of VNC&amp;rsquo;s handshake, which is a version, at most 255 security types and a result, within 15 seconds, and then the VM&amp;rsquo;s screen, which it passes to the viewer as it is.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; lines to the run log when each viewer connects and disconnects, and for each connection it refuses, and each ssh process&amp;rsquo;s messages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounds:&lt;/strong&gt; at most 8 connections at once, counting those still in their handshake, one check of a password at a time, and a second&amp;rsquo;s wait after a wrong one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listens:&lt;/strong&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt; alone, on the VM&amp;rsquo;s desktop port (&lt;a href="#listeners-a-vm-reaches"&gt;listeners&lt;/a&gt;). When accepting a connection fails but the port stays open, as when it runs out of open files, it tries again after 5 ms and then twice as long each time, up to a second, and logs only the first failure of a run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; it ends when you press Ctrl+C, or when the VM no longer runs, which it checks every 5 seconds, and it waits for each viewer&amp;rsquo;s connection.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-ssh-agents"&gt;The SSH agents&lt;span class="hx:absolute hx:-mt-20" id="the-ssh-agents"&gt;&lt;/span&gt;
&lt;a href="#the-ssh-agents" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM whose &lt;a href="https://next.devvm.dev/docs/using/ssh/#agent-forwarding"&gt;SSH agent&lt;/a&gt; choice is &lt;code&gt;on&lt;/code&gt; gets your own agent, which devvm doesn&amp;rsquo;t start, stop or confine. A VM whose choice is &lt;code&gt;devvm&lt;/code&gt; gets devvm&amp;rsquo;s own agent, which is OpenSSH&amp;rsquo;s &lt;code&gt;ssh-agent&lt;/code&gt;, run as &lt;code&gt;ssh-agent -a ~/.local/share/devvm/agent.sock&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; only the keys you add with &lt;code&gt;devvm ssh-agent add&lt;/code&gt;, each for 12 hours unless you chose another lifetime. devvm refuses a key in a folder that a VM mounts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VM:&lt;/strong&gt; only the requests that the VM&amp;rsquo;s proxy passes on. A VM can use the keys while it&amp;rsquo;s connected, and it can&amp;rsquo;t copy them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; devvm starts it when a VM that uses it starts, or when you add a key, and doesn&amp;rsquo;t stop it, so it runs until you log out or restart this machine. devvm keeps no pid file for it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Apart from the exceptions below, a VM that devvm starts never reaches either agent&amp;rsquo;s socket itself. &lt;code&gt;ssh-agent&lt;/code&gt; answers every request that reaches it by its own rules, and a forwarded connection may send any of them, so a VM with the agent&amp;rsquo;s own socket could remove every key with &lt;code&gt;ssh-add -D&lt;/code&gt;, lock the agent with a password of its own with &lt;code&gt;ssh-add -x&lt;/code&gt;, or add keys to it without bound. Every VM that uses the agent would lose it then, and with your own agent, so would you. Instead, the VM&amp;rsquo;s proxy&amp;rsquo;s broker, never its child, listens on a socket of the VM&amp;rsquo;s own, &lt;code&gt;~/.local/share/devvm/run/agent-&amp;lt;hash&amp;gt;.sock&lt;/code&gt;, mode 600, and the VM&amp;rsquo;s start forwards that socket, as devvm&amp;rsquo;s own connections to the VM and its &lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;ssh entry&lt;/a&gt; do, so an editor forwards it too. The proxy passes on only three requests to the agent: listing its keys, signing with one, and &lt;code&gt;[email protected]&lt;/code&gt;, which ssh sends as it forwards an agent and as it logs in with one, so a key you added with destination constraints (&lt;code&gt;ssh-add -h&lt;/code&gt;) keeps them. It answers any other request with &lt;code&gt;SSH_AGENT_FAILURE&lt;/code&gt; itself, and logs the first one on each connection in its own log, so removing a key, locking the agent, adding a key and loading a smartcard&amp;rsquo;s keys never reach the agent. It reads each message whole, at most 256 KiB, as &lt;code&gt;ssh-agent&lt;/code&gt; does, and ends a connection that sends a longer one. Each VM&amp;rsquo;s proxy carries at most 16 connections at once, each with a connection of its own to the agent, and it closes a connection that sends no whole request for 2 minutes. The cap is each VM&amp;rsquo;s own, not the agent&amp;rsquo;s, so VMs that share an agent can hold 16 connections each, and enough of them could still use up the agent&amp;rsquo;s open files, 256 by default on macOS. A request that the agent asks you about, for a key added with &lt;code&gt;--confirm&lt;/code&gt;, waits as long as the agent does, and &lt;code&gt;ssh-agent&lt;/code&gt; answers one request at a time, so while it waits for your answer, every other VM that shares the agent, and you, wait too.&lt;/p&gt;
&lt;p&gt;devvm records in the VM&amp;rsquo;s state each start it made. For a start whose choice forwards an agent, it also records that the start forwarded the relay, even when devvm ran the start without &lt;code&gt;SSH_AUTH_SOCK&lt;/code&gt; and so had no agent to relay. For such a start, devvm&amp;rsquo;s own connections and the ssh entry name the relay even while the proxy starts again or is gone, or relays nothing, so the VM then has no agent, never the agent&amp;rsquo;s own socket, even when a later command runs from a shell that has one. A VM running a start that devvm didn&amp;rsquo;t record, such as one started with &lt;code&gt;devvm limactl start&lt;/code&gt;, gets no agent in its ssh entry, and devvm&amp;rsquo;s own connections get its proxy&amp;rsquo;s relay of the agent that devvm last started it with, or none, never the agent&amp;rsquo;s own socket. Only a VM that an earlier devvm started without the relay keeps the agent&amp;rsquo;s own socket, in devvm&amp;rsquo;s connections and its ssh entry, until its next start.&lt;/p&gt;
&lt;p&gt;The proxy relays the agent that the VM&amp;rsquo;s start chose, and it keeps relaying that agent until the VM&amp;rsquo;s next start, even when it starts again for a running VM, so a change of choice waits for the next start, as it does for the VM&amp;rsquo;s backend. The proxy deletes the socket when it ends with the VM&amp;rsquo;s hostagent, devvm deletes it when it stops the proxy, and &lt;code&gt;devvm gc --orphans&lt;/code&gt; deletes one that a killed proxy left, which nothing listens on.&lt;/p&gt;
&lt;h2 data-hextra-search-id="limas-hostagent"&gt;Lima&amp;rsquo;s hostagent&lt;span class="hx:absolute hx:-mt-20" id="limas-hostagent"&gt;&lt;/span&gt;
&lt;a href="#limas-hostagent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each running VM has a hostagent, &lt;code&gt;limactl hostagent&lt;/code&gt;, which &lt;code&gt;limactl start&lt;/code&gt; runs and which runs the VM: on macOS it runs Apple&amp;rsquo;s Virtualization framework in its own process, and on Linux it starts QEMU.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Holds:&lt;/strong&gt; Lima&amp;rsquo;s login key, &lt;code&gt;_config/user&lt;/code&gt; in devvm&amp;rsquo;s Lima home, which every VM there authorizes, and the VM&amp;rsquo;s disk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reads from the VM:&lt;/strong&gt; everything the VM&amp;rsquo;s network sends, on macOS. On Linux, QEMU carries it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes:&lt;/strong&gt; its logs, &lt;code&gt;ha.stdout.log&lt;/code&gt; and &lt;code&gt;ha.stderr.log&lt;/code&gt;, in the VM&amp;rsquo;s Lima folder, which also get QEMU&amp;rsquo;s errors on Linux, and the VM&amp;rsquo;s serial console logs there, &lt;code&gt;serial.log&lt;/code&gt;, &lt;code&gt;serialv.log&lt;/code&gt; and &lt;code&gt;serialp.log&lt;/code&gt;, which QEMU or Apple&amp;rsquo;s Virtualization framework writes for it and which the VM&amp;rsquo;s root writes to through &lt;code&gt;/dev/hvc0&lt;/code&gt; and the other consoles. Each start writes them anew. devvm replaces each proxy password in &lt;code&gt;ha.stderr.log&lt;/code&gt; and the serial consoles&amp;rsquo; logs with as many &lt;code&gt;*&lt;/code&gt; once the start ends, in the first 64 MiB of each log. While the VM runs, its proxy looks at each of these logs every second, skipping one that hasn&amp;rsquo;t grown. It replaces each password in what the log gained since, because a reboot inside the VM, which QEMU on Linux carries out in place, runs Lima&amp;rsquo;s boot scripts again and writes the password to the console again, and it rotates a log once it holds more than 10 MiB. When a line hasn&amp;rsquo;t ended yet, the next look reads it again from its start if that&amp;rsquo;s within 64 KiB of where the last look stopped, and otherwise from 64 KiB before that point, where it stars everything up to an &lt;code&gt;@&lt;/code&gt; as the rest of a secret. So a line that never ends costs at most 64 KiB more than what&amp;rsquo;s new in it, and a secret of any length is found. A rotation copies the log&amp;rsquo;s last 10 MiB, from a line&amp;rsquo;s start, to the log&amp;rsquo;s &lt;code&gt;.1&lt;/code&gt; file, replacing the one there, and then empties the log. The copy has each password and proxy key replaced, and the start of one that the copy cuts before its &lt;code&gt;@&lt;/code&gt; masked. The next look stars the rest of that one, which the writer goes on with, up to its &lt;code&gt;@&lt;/code&gt;. So each of these logs takes at most 10 MiB and 10 MiB more in its &lt;code&gt;.1&lt;/code&gt; file, plus what a VM writes in a second. The log&amp;rsquo;s writer goes on at its own offset, past a hole that takes no disk, so the cap is on the space the log takes on disk rather than on its length, which keeps growing. The cap holds only on a file system with holes, such as APFS, ext4, XFS and btrfs, because one without them would write the emptied part out as zeros. What the writer adds between the copy and the emptying is lost. On macOS, a reboot inside the VM stops it, as Apple&amp;rsquo;s Virtualization framework ends a VM that restarts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listens:&lt;/strong&gt; on macOS, on the VM&amp;rsquo;s ssh port on this machine&amp;rsquo;s loopback, which QEMU listens on instead on Linux. It also listens on unix sockets in the VM&amp;rsquo;s Lima folder and, for an open VM or a build, on loopback ports for Lima&amp;rsquo;s DNS resolver (&lt;a href="#listeners-a-vm-reaches"&gt;listeners&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confinement:&lt;/strong&gt; on macOS, a confined VM&amp;rsquo;s hostagent and a build&amp;rsquo;s run under a Seatbelt profile, &lt;code&gt;sandbox.sb&lt;/code&gt; in the VM&amp;rsquo;s run folder, which denies &lt;code&gt;com.apple.dnssd.service&lt;/code&gt;. A confined VM&amp;rsquo;s profile lets it connect only to the VM&amp;rsquo;s ssh port and its proxy on the host&amp;rsquo;s loopback, to the unix sockets in the VM&amp;rsquo;s Lima folder and, when the VM forwards an agent, to that SSH agent, and it lets the hostagent listen only on the VM&amp;rsquo;s ssh port and those unix sockets. A build&amp;rsquo;s profile lets it reach either the internet, but not the host&amp;rsquo;s loopback apart from its ssh port and its build proxy&amp;rsquo;s port, or nothing, and it doesn&amp;rsquo;t limit what the hostagent listens on. Every profile limits only the network, so the hostagent can still read and write your files. An open VM&amp;rsquo;s hostagent and every hostagent on Linux run unconfined, and on Linux, QEMU&amp;rsquo;s restricted network confines a confined VM instead (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts and ends:&lt;/strong&gt; devvm records the hostagent it started in &lt;code&gt;started&lt;/code&gt; in the VM&amp;rsquo;s run folder and checks that the VM still runs on it (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt;), and the proxy and the forwarder follow its &lt;code&gt;ha.pid&lt;/code&gt;. Nothing waits for it, and &lt;code&gt;limactl stop&lt;/code&gt;, which &lt;code&gt;devvm stop&lt;/code&gt; runs, ends it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="listeners-a-vm-reaches"&gt;Listeners a VM reaches&lt;span class="hx:absolute hx:-mt-20" id="listeners-a-vm-reaches"&gt;&lt;/span&gt;
&lt;a href="#listeners-a-vm-reaches" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;These are the listeners on this machine that carry bytes a VM controls. Every one listens on this machine&amp;rsquo;s loopback or on a unix socket, so other machines never reach them, but every program and every user on this machine can connect to a TCP port on its loopback.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Listener&lt;/th&gt;
&lt;th&gt;Process&lt;/th&gt;
&lt;th&gt;Gate&lt;/th&gt;
&lt;th&gt;What the VM controls&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;each forwarded port, on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the port forwarder&lt;/td&gt;
&lt;td&gt;none: whatever connects reaches the VM&amp;rsquo;s server, 256 connections at once&lt;/td&gt;
&lt;td&gt;everything its server sends back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the VM&amp;rsquo;s ssh port, on the loopback, one of the 17 ports every browser refuses (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;why&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;the hostagent on macOS, QEMU on Linux&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s sshd, which each of devvm&amp;rsquo;s connections checks against the VM&amp;rsquo;s pinned host key, and browsers&amp;rsquo; own refusal of the port&lt;/td&gt;
&lt;td&gt;everything the VM&amp;rsquo;s sshd sends, which root in the VM can make speak HTTP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lima&amp;rsquo;s DNS resolver, on loopback ports the system picks&lt;/td&gt;
&lt;td&gt;the hostagent, for an open VM and every build, never for a VM confined to its proxy&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;its lookups&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the unix sockets in the VM&amp;rsquo;s Lima folder: the network socket on macOS, which carries the VM&amp;rsquo;s network frames, and Lima&amp;rsquo;s ssh control socket, &lt;code&gt;ssh.sock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the hostagent, and Lima&amp;rsquo;s ssh&lt;/td&gt;
&lt;td&gt;the folder&amp;rsquo;s mode&lt;/td&gt;
&lt;td&gt;its network frames, and everything its sshd sends&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the VM&amp;rsquo;s proxy port, on &lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s proxy&amp;rsquo;s child&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s password, before anything else&lt;/td&gt;
&lt;td&gt;its requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a build&amp;rsquo;s proxy port, on &lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the build&amp;rsquo;s proxy&amp;rsquo;s child&lt;/td&gt;
&lt;td&gt;the build&amp;rsquo;s password&lt;/td&gt;
&lt;td&gt;its requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the desktop port, on &lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s desktop password, checked on this machine&lt;/td&gt;
&lt;td&gt;its screen, once a viewer is in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;127.0.0.1:1455&lt;/code&gt;, with &lt;code&gt;::1:1455&lt;/code&gt; and port 1457 on both when they&amp;rsquo;re free&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm agent login&lt;/code&gt;, while Codex&amp;rsquo;s or opencode&amp;rsquo;s browser login to ChatGPT waits, but not with &lt;code&gt;--device-code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;none: whatever connects reaches the agent&amp;rsquo;s login server in the VM, 16 connections at once&lt;/td&gt;
&lt;td&gt;the login server&amp;rsquo;s answers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;each link&amp;rsquo;s unix socket&lt;/td&gt;
&lt;td&gt;the link session&lt;/td&gt;
&lt;td&gt;the socket&amp;rsquo;s mode, 600 in a folder of mode 700&lt;/td&gt;
&lt;td&gt;the client&amp;rsquo;s bytes, through its sshd&amp;rsquo;s remote forward or its proxy, and the target&amp;rsquo;s answers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the ssh masters&amp;rsquo; control sockets, &lt;code&gt;run/port-&amp;lt;hash&amp;gt;.ctl&lt;/code&gt; and &lt;code&gt;run/link-&amp;lt;hash&amp;gt;.ctl&lt;/code&gt; in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the forwarder&amp;rsquo;s and the link session&amp;rsquo;s ssh masters&lt;/td&gt;
&lt;td&gt;the folder&amp;rsquo;s mode: any process of yours that connects gets a channel into the VM&lt;/td&gt;
&lt;td&gt;everything the VM sends on that channel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the VM&amp;rsquo;s agent socket, &lt;code&gt;run/agent-&amp;lt;hash&amp;gt;.sock&lt;/code&gt; in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s proxy&amp;rsquo;s broker, for a VM that forwards an SSH agent&lt;/td&gt;
&lt;td&gt;the socket&amp;rsquo;s mode, 600 in a folder of mode 700&lt;/td&gt;
&lt;td&gt;the agent&amp;rsquo;s requests, of which the proxy passes on only listing keys, signing and binding a session to a host&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A forwarded port and the login&amp;rsquo;s port carry whatever connects to them into the VM, a browser&amp;rsquo;s pages included, and that&amp;rsquo;s what &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;attack vectors&lt;/a&gt; lists as left open.&lt;/p&gt;
&lt;h2 data-hextra-search-id="why-go"&gt;Why Go&lt;span class="hx:absolute hx:-mt-20" id="why-go"&gt;&lt;/span&gt;
&lt;a href="#why-go" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm stays in Go, and its own history shows why. None of its first 712 commits fixes a memory-safety bug, and none fixes a data race that got past Go&amp;rsquo;s race detector, which every test run uses. devvm&amp;rsquo;s own code imports &lt;code&gt;unsafe&lt;/code&gt; only for a few raw system calls on Linux, which confine the proxy&amp;rsquo;s child and set a file&amp;rsquo;s times through its descriptor, and it builds without cgo. Its security and reliability fixes fall mostly into five classes, which a language&amp;rsquo;s types don&amp;rsquo;t prevent:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lifecycles and resources,&lt;/strong&gt; such as a relay that outlived its link, a VM&amp;rsquo;s QEMU left running without its hostagent, and a VM that could make devvm read more than it should.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Policy semantics,&lt;/strong&gt; such as a 6to4 address judged by its IPv4 address, and a placeholder swapped only when it&amp;rsquo;s the whole value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secret leaks,&lt;/strong&gt; such as a proxy password in Lima&amp;rsquo;s log, and a resolver&amp;rsquo;s error in a VM&amp;rsquo;s refusal reason.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Races between processes,&lt;/strong&gt; such as a proxy that had just started looking gone, and two runs choosing ports or making a folder&amp;rsquo;s VM at once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File-system trust,&lt;/strong&gt; such as a project folder replaced after devvm found it, a folder that a VM names as a git folder, a link under a folder&amp;rsquo;s path, and a project folder mounted by its path rather than as the folder itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A port to Rust would cost what keeps devvm easy to keep:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One static binary,&lt;/strong&gt; built with &lt;code&gt;CGO_ENABLED=0&lt;/code&gt; for every platform from one machine. Go&amp;rsquo;s &lt;code&gt;crypto/tls&lt;/code&gt; needs no C toolchain, while rustls&amp;rsquo;s usual providers, aws-lc-rs and ring, have C in them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A small dependency tree:&lt;/strong&gt; Go&amp;rsquo;s standard library, Go&amp;rsquo;s own &lt;code&gt;x&lt;/code&gt; modules, Cobra and pflag, a TOML parser and go-i18n, with the few modules that cobra/doc brings in, where a Rust proxy on the usual async, HTTP and TLS crates brings in about a hundred.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One owner for each concern,&lt;/strong&gt; which depguard, forbidigo and the &lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-structure-test"&gt;structure test&lt;/a&gt; enforce, and which none of them could see across a language boundary.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The proxy is the only part that could be split off, and it&amp;rsquo;s bound to the rest: its broker looks up secrets and refreshes agents&amp;rsquo; logins with devvm&amp;rsquo;s own code, its config is a schema that every release&amp;rsquo;s state keeps, and its child reads its built-in policies from devvm&amp;rsquo;s binary.&lt;/p&gt;
&lt;p&gt;The answer changes only for a requirement Go can&amp;rsquo;t meet, such as intercepting QUIC. Even then, only that piece would move, as a process of its own.&lt;/p&gt;</description></item><item><title>Coding agents</title><link>https://next.devvm.dev/docs/internals/agents/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/internals/agents/</guid><description>
&lt;p&gt;This page explains how devvm gives the coding agents in a VM their settings, logins and history, and what it checks on the way, for the tasks that &lt;a href="https://next.devvm.dev/docs/using/coding-agents/"&gt;Coding agents&lt;/a&gt; shows. How the proxy holds the agents&amp;rsquo; secrets is in &lt;a href="https://next.devvm.dev/docs/internals/network/#agents-logins-and-settings"&gt;agents&amp;rsquo; logins and settings&lt;/a&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-guide-in-every-vm"&gt;The guide in every VM&lt;span class="hx:absolute hx:-mt-20" id="the-guide-in-every-vm"&gt;&lt;/span&gt;
&lt;a href="#the-guide-in-every-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each launch installs the guide again whenever it differs from devvm&amp;rsquo;s, and it belongs to root and is read-only, so nothing that the VM&amp;rsquo;s user runs without &lt;code&gt;sudo&lt;/code&gt; can change what the agents read, and a change made with &lt;code&gt;sudo&lt;/code&gt; lasts only until the next launch.&lt;/p&gt;
&lt;h2 data-hextra-search-id="pasting"&gt;Pasting&lt;span class="hx:absolute hx:-mt-20" id="pasting"&gt;&lt;/span&gt;
&lt;a href="#pasting" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;How devvm paste reads the clipboard, names a copied file, refuses links and finds Linux&amp;rsquo;s clipboard programs is in the design note on &lt;a href="https://next.devvm.dev/docs/contributing/design/#pasting-images"&gt;pasting images&lt;/a&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="each-agents-variables"&gt;Each agent&amp;rsquo;s variables&lt;span class="hx:absolute hx:-mt-20" id="each-agents-variables"&gt;&lt;/span&gt;
&lt;a href="#each-agents-variables" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every VM sets &lt;code&gt;OPENCODE_DISABLE_AUTOUPDATE=1&lt;/code&gt;, as it sets &lt;code&gt;DISABLE_AUTOUPDATER=1&lt;/code&gt; for Claude Code, because the agents are read-only shared tools that can&amp;rsquo;t update themselves, and devvm keeps their versions. For the same reason every VM sets &lt;code&gt;PI_SKIP_VERSION_CHECK=1&lt;/code&gt;, so pi doesn&amp;rsquo;t ask you to run &lt;code&gt;pi update&lt;/code&gt;, and &lt;code&gt;PI_TELEMETRY=0&lt;/code&gt;, which turns off pi&amp;rsquo;s report of its install and the attribution headers it adds to some providers&amp;rsquo; requests. Claude Code&amp;rsquo;s telemetry and error reports are off with &lt;code&gt;DISABLE_TELEMETRY=1&lt;/code&gt; and &lt;code&gt;DISABLE_ERROR_REPORTING=1&lt;/code&gt;, and &lt;code&gt;CLAUDE_CODE_PLUGIN_CACHE_DIR&lt;/code&gt; and &lt;code&gt;CLAUDE_CODE_PLUGIN_SEED_DIR&lt;/code&gt; name its plugins folder and its seed (&lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;). devvm writes every agent&amp;rsquo;s variables into each VM at every launch, whichever agents the VM has, and every shell in the VM gets them, login or not, so an agent that an editor&amp;rsquo;s terminal or &lt;code&gt;ssh&lt;/code&gt; runs gets them too. pi would download &lt;code&gt;fd&lt;/code&gt; and &lt;code&gt;rg&lt;/code&gt; into &lt;code&gt;~/.pi/agent/bin&lt;/code&gt; whenever they&amp;rsquo;re missing, so base has both, from Ubuntu&amp;rsquo;s or the container image&amp;rsquo;s own packages, and pi finds Ubuntu&amp;rsquo;s and Debian&amp;rsquo;s &lt;code&gt;fd&lt;/code&gt; by its name there, &lt;code&gt;fdfind&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="importing"&gt;Importing&lt;span class="hx:absolute hx:-mt-20" id="importing"&gt;&lt;/span&gt;
&lt;a href="#importing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The import copies only the paths in &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;the store&amp;rsquo;s table&lt;/a&gt;, from &lt;code&gt;~/.claude&lt;/code&gt;, &lt;code&gt;~/.claude.json&lt;/code&gt;, &lt;code&gt;~/.codex&lt;/code&gt;, &lt;code&gt;~/.config/opencode&lt;/code&gt;, &lt;code&gt;~/.local/share/opencode&lt;/code&gt; and &lt;code&gt;~/.pi/agent&lt;/code&gt;, so it never copies your history, such as &lt;code&gt;~/.claude/projects&lt;/code&gt;, &lt;code&gt;~/.codex&lt;/code&gt;&amp;rsquo;s sessions or &lt;code&gt;~/.pi/agent/sessions&lt;/code&gt;, and never &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;. Of &lt;code&gt;~/.claude/plugins&lt;/code&gt; it copies only what a seed has, &lt;code&gt;known_marketplaces.json&lt;/code&gt;, &lt;code&gt;marketplaces&lt;/code&gt; and &lt;code&gt;cache&lt;/code&gt;, whether the folder is in &lt;code&gt;~/.claude&lt;/code&gt; or a link you allowed leads to it, so this machine&amp;rsquo;s own entries, such as each plugin&amp;rsquo;s data in &lt;code&gt;data&lt;/code&gt;, its MCP bundles in &lt;code&gt;mcpb&lt;/code&gt;, the plugins that claude.ai synced, its trash and its record of the plugins it installed, never reach the store (&lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;). Claude Code&amp;rsquo;s plugin records name the plugins&amp;rsquo; folders by their paths, so the store&amp;rsquo;s copies of the JSON files in &lt;code&gt;~/.claude/plugins&lt;/code&gt; name the plugins&amp;rsquo; folders in the store, where the VMs mount them.&lt;/p&gt;
&lt;p&gt;A link inside an agent&amp;rsquo;s folder that leads to a file inside it is copied as that file only when the file is one of the settings that the import copies of the folder itself, by the name that the link resolves to, one link at a time. So a link never copies what the import leaves out, such as &lt;code&gt;~/.claude/projects&lt;/code&gt;, &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; or a plugin&amp;rsquo;s data in &lt;code&gt;~/.claude/plugins/data&lt;/code&gt;, and the import also leaves out a name that differs from a setting&amp;rsquo;s only in case, which a Mac&amp;rsquo;s file system would still find. The import reads each file it listed, and a link&amp;rsquo;s file by the path that the link resolved to. It reads through the agent&amp;rsquo;s folder opened one folder at a time, each from its parent, without following a link in any part of the path, and it fails unless the file it opened is the one it listed. A VM whose project folder is inside an agent&amp;rsquo;s folder, such as a skill you work on in &lt;code&gt;~/.claude/skills&lt;/code&gt;, can change a link or a folder there between the listing and the read, so such a change fails the import rather than copy what the new link leads to, and devvm warns, before it reads anything, of each VM whose project folder is inside an agent&amp;rsquo;s folder or holds it. A VM whose state devvm can&amp;rsquo;t read gets a warning of its own, naming its state file, because devvm can&amp;rsquo;t tell where its project folder is, and while any state can&amp;rsquo;t be read, devvm leaves out, with a warning naming the state, every path it would read through a link: an agent&amp;rsquo;s folder or login whose path passes through one, and every link out of an agent&amp;rsquo;s folder. That also counts the links on the way to your home folder, because a VM made with &lt;code&gt;--unsafe-folder&lt;/code&gt; on a folder that holds your home folder holds them. It doesn&amp;rsquo;t count a link that only root can change, such as macOS&amp;rsquo;s &lt;code&gt;/var&lt;/code&gt; or the &lt;code&gt;/home&lt;/code&gt; of Fedora Silverblue, whose folders up to &lt;code&gt;/&lt;/code&gt; are root&amp;rsquo;s alone, by their modes and by what the system says you may write, an ACL included. A VM changes this machine&amp;rsquo;s files only as you, so no VM can change where such a link leads. devvm opens an agent&amp;rsquo;s folder twice, as a root to list it and one folder at a time to read it, and fails the import, naming the folder, unless both are the same folder, so a VM can&amp;rsquo;t swap the folder between the two. A project folder that holds an agent&amp;rsquo;s folder, such as &lt;code&gt;~/.pi&lt;/code&gt; for pi&amp;rsquo;s &lt;code&gt;~/.pi/agent&lt;/code&gt;, lets its VM put a link in the agent folder&amp;rsquo;s place, so devvm resolves the folder&amp;rsquo;s path one link at a time and leaves the folder out, with a warning, when a link in a VM&amp;rsquo;s project folder leads it out of that folder, which would let the VM choose any folder of this machine&amp;rsquo;s, such as your home folder. A login file in a folder left out so, such as pi&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt;, is left out with it. Otherwise devvm reads the folder where the path led when it resolved it. It reads an agent&amp;rsquo;s login file, other than Claude Code&amp;rsquo;s &lt;code&gt;~/.claude.json&lt;/code&gt;, in the same way: devvm resolves its path one link at a time, leaves it out in the same way, and reads it where the path led, through its folder opened one folder at a time without following a link and never resolved again. It opens the file itself without following a link and reads it only as a regular file of at most 128 MiB, so a link, a FIFO or an endless file that a VM put in its place fails the import. It copies at most 20,000 files, folders and links, 128 MiB, and 16 MiB in one file, of each agent&amp;rsquo;s folder, the bounds of &lt;a href="#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;, so such a VM can&amp;rsquo;t fill the store that every VM with the agent mounts. It reads each folder 256 entries at a time and counts every entry as it reads it, a link, a socket or a FIFO as much as a file, stopping at 20,000, so a folder of millions of entries never costs it more than that and one batch, and a folder that holds more fails the import before anything is written, naming the folder. It goes at most 128 folders deep, in paths of at most 4,096 bytes, because it opens each folder from the agent&amp;rsquo;s folder down, one name at a time, through the folder above it, which it opened in the same way. So a chain of folders nested deeper fails the import in the same way, and a link or a FIFO that a VM swaps in for a folder during the walk fails the import instead of leading it elsewhere or holding it. A file that grows past 16 MiB, or past what&amp;rsquo;s left of the 128 MiB, between the listing and the read fails the import too, naming the file. The copy of a Claude Code plugin record names the store&amp;rsquo;s longer paths, so it can be larger than the file, and what it grows counts against the same bounds, so a copy that would pass them fails the import, naming the folder.&lt;/p&gt;
&lt;p&gt;The import reads and writes every agent&amp;rsquo;s settings into a staging folder of the agent&amp;rsquo;s store first, &lt;code&gt;.devvm-import-&lt;/code&gt; and a random name, beside the agent&amp;rsquo;s folder there, so no VM mounts it. When a file fails to read, has changed since it was listed or passes the bounds, the import fails, leaving the store as it was and taking out the staging folder. An interrupt before every agent&amp;rsquo;s settings are staged does the same, and the run&amp;rsquo;s cleanups take out its staging folders. Once every agent&amp;rsquo;s settings are staged, the import moves each file into place and moves what your home folder no longer has aside, into a folder of the staging folder, where a file it replaces is kept too, as a second hard link, so each file is still replaced in one rename. Then it saves the logins, all or none, reading each login file it replaces first. A failure from then on, such as a rename that fails or a login that can&amp;rsquo;t be saved, puts back every agent&amp;rsquo;s store and every login as they were, the last change first, and an interrupt waits for that, or for the import to finish, before the run&amp;rsquo;s cleanups take the staging folder out. It puts back every agent&amp;rsquo;s store that it changed, even after putting one back fails. Only then, if one did fail, does it say so, naming each store it couldn&amp;rsquo;t put back and its staging folder. It keeps that staging folder, which holds what devvm couldn&amp;rsquo;t put back, until the next import or save. A run that&amp;rsquo;s killed while it puts the settings in place can leave the store partly replaced, so run the import again. The staging folders go once the import is done. The import holds the store&amp;rsquo;s lock, &lt;code&gt;agents.lock&lt;/code&gt; in devvm&amp;rsquo;s data folder, from its staging to its logins, as &lt;a href="#saving-a-vms-settings"&gt;the save&lt;/a&gt; does while it writes, and a start does while it cleans &lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt; or &lt;a href="#opencodes-service"&gt;opencode&amp;rsquo;s service settings&lt;/a&gt;, once it finds something to take out, so no two of them change the store at once, and the second waits under a status line until the first is done. A staging folder that a killed import or save left counts as nothing of the agent&amp;rsquo;s, so the import doesn&amp;rsquo;t ask before it replaces a store that holds only that, and the next import or save of that agent takes it out first. A replacement keeps the store&amp;rsquo;s folders, so a running VM&amp;rsquo;s mounts still show them. The import and &lt;a href="#saving-a-vms-settings"&gt;the save&lt;/a&gt; read names as the volume that holds the store reads them, so on a volume that ignores case, as a Mac&amp;rsquo;s does by default, a file named &lt;code&gt;foo.md&lt;/code&gt; replaces the store&amp;rsquo;s &lt;code&gt;Foo.md&lt;/code&gt; in place, under the store&amp;rsquo;s name. What they keep when they move aside what a folder no longer has is each file and folder they wrote or keep, found by what it is on the volume rather than by how its name is spelled, so the store&amp;rsquo;s &lt;code&gt;Foo.md&lt;/code&gt; stays. Their staging folder is on the same volume and holds only what they wrote, so a name that&amp;rsquo;s already there before they write it, under no name they wrote, is one the volume reads as another of theirs, such as &lt;code&gt;a.md&lt;/code&gt; after &lt;code&gt;A.md&lt;/code&gt;, and then they fail before the store changes and name both. The save also counts the names that it leaves out in this check. The staging folder reads names by its own folder&amp;rsquo;s rules, which are the store&amp;rsquo;s wherever a volume&amp;rsquo;s rules hold for every folder, as on macOS, but Linux&amp;rsquo;s ext4 can ignore case in some folders alone, so a store whose agent folder alone ignores case gets no such check. A file with a second name, a hard link, which only a hand-made store has, is kept only by the name it&amp;rsquo;s written or kept under, and the save&amp;rsquo;s diff shows its other names as removed. Where the store has a folder and the home folder now has a file, or the other way round, as when a link that led to a folder now leads to a file, the import replaces it. Before they write anything, both the import and &lt;a href="#saving-a-vms-settings"&gt;the save&lt;/a&gt; check the path of every folder and file they&amp;rsquo;ll write, and each part of the path below devvm&amp;rsquo;s config folder must be a folder, never a link. A link there, which only a hand-made store has and which could lead to your home folder, fails the command before the store changes, for any of the agents that the command handles, and the command names it. A link in the store in place of a settings file is replaced, never followed. They then write only through the agent&amp;rsquo;s store, or its folder there, opened from devvm&amp;rsquo;s config folder as a root, every part of its path a folder, so a link put in the store after the check can&amp;rsquo;t lead a write out of it. They also reach a folder of the store that they empty from devvm&amp;rsquo;s config folder in the same way, as the start does for &lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;, and devvm&amp;rsquo;s config folder itself may be a link, as a dotfiles repo&amp;rsquo;s is.&lt;/p&gt;
&lt;p&gt;opencode 2 keeps its logins in its own database rather than in &lt;code&gt;~/.local/share/opencode/auth.json&lt;/code&gt;, so when this machine&amp;rsquo;s opencode is version 2 or later, devvm reads its logins with &lt;code&gt;opencode auth export&lt;/code&gt; and saves them in the store in the format of &lt;code&gt;auth.json&lt;/code&gt;, the file that devvm copies for opencode 1. When &lt;code&gt;opencode auth export&lt;/code&gt; fails, the import fails too, and the store keeps the login it had.&lt;/p&gt;
&lt;h3 data-hextra-search-id="links-out-of-an-agents-folder"&gt;Links out of an agent&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="links-out-of-an-agents-folder"&gt;&lt;/span&gt;
&lt;a href="#links-out-of-an-agents-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The import reads each agent&amp;rsquo;s folder through a handle that&amp;rsquo;s rooted at that folder, so no link inside it leads out of it (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-packages"&gt;the packages&lt;/a&gt;). A link that leads out is resolved, every link on the way, and only then followed, as &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#links-out-of-an-agents-folder"&gt;links out of an agent&amp;rsquo;s folder&lt;/a&gt; says, and &lt;a href="https://next.devvm.dev/docs/contributing/design/#links-out-of-an-agents-folder"&gt;the design note&lt;/a&gt; explains why:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How it resolves.&lt;/strong&gt; devvm resolves a link one name at a time, as the system does, and keeps where each link on the way is, so it sees a link that a VM put in its project folder even in the middle of a chain. It compares a target with the refused places and the VMs&amp;rsquo; folders by name and by identity, so another spelling of a folder, such as &lt;code&gt;~/.SSH&lt;/code&gt; on a Mac, where case doesn&amp;rsquo;t count, is still that folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where it reads.&lt;/strong&gt; devvm opens the folder it reads the link&amp;rsquo;s target through, a &lt;code&gt;follow-links&lt;/code&gt; folder, the linked folder or the linked file&amp;rsquo;s own folder, one folder at a time from &lt;code&gt;/&lt;/code&gt;, each opened from its parent and never through a link, so a link that a VM swaps into that path fails the import rather than lead elsewhere. It lists what the link leads to through that folder as a root, and reads each file without blocking, refusing a FIFO, a device or a file that changed into a link as it opened it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What it lists.&lt;/strong&gt; A linked folder&amp;rsquo;s folders and files are listed under the link&amp;rsquo;s own path, and a link inside it is listed as a file when the root resolves it to a regular file. Anything else is left out with a warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The bounds.&lt;/strong&gt; It counts every entry it reads, a folder&amp;rsquo;s read 256 at a time, and the size of every file, across all the links of one import, and leaves out a link that would pass 20,000 entries, 128 MiB or a file of 16 MiB, the bounds of &lt;a href="#saving-a-vms-settings"&gt;saving a VM&amp;rsquo;s settings&lt;/a&gt;. The walks of all the links read at most 80,000 entries, those of links left out included, and once they have, each link left is left out unread, with the same warning. A file that grows past them between the listing and the read fails the import.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s folder.&lt;/strong&gt; It reads the state of every VM devvm has, and warns once for each link and VM when the link&amp;rsquo;s target is in that VM&amp;rsquo;s project folder or holds it, or when a link inside a linked folder resolves into it. While a VM&amp;rsquo;s state can&amp;rsquo;t be read, it follows no link out of an agent&amp;rsquo;s folder, as &lt;a href="#importing"&gt;importing&lt;/a&gt; says.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="saving-a-vms-settings"&gt;Saving a VM&amp;rsquo;s settings&lt;span class="hx:absolute hx:-mt-20" id="saving-a-vms-settings"&gt;&lt;/span&gt;
&lt;a href="#saving-a-vms-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The save reads only the settings in &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;the store&amp;rsquo;s table&lt;/a&gt; from the VM&amp;rsquo;s home, and never the logins, so it never reads your history, &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, &lt;code&gt;~/.codex/auth.json&lt;/code&gt;, opencode&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; or pi&amp;rsquo;s. From the VM&amp;rsquo;s &lt;code&gt;~/.claude.json&lt;/code&gt; it keeps only the settings, account state and MCP servers, as the import does, and the VM leaves out its per-project entries before it sends anything. devvm puts that part in the store&amp;rsquo;s logins folder, where the import keeps it too. A folder that the store already has is mounted read-only in the VM, so the agent there can&amp;rsquo;t change it, and the save leaves it as it is. The exception is Claude Code&amp;rsquo;s plugins folder, which is the VM&amp;rsquo;s own, with the store&amp;rsquo;s as its seed (&lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;). A folder that the store doesn&amp;rsquo;t have yet is the VM&amp;rsquo;s own until you save it, and once the VM next starts with the store&amp;rsquo;s new folder mounted, its setup links that folder in place of its own (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;mounts&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm treats everything the VM sends as untrusted, because the agent in the VM could have changed any of it. It reads at most 128 MiB from the VM, in at most 20,000 files, folders and links, none of the files larger than 16 MiB, at most 128 folders deep and in paths of at most 4,096 bytes, the import&amp;rsquo;s bounds, because the save opens each folder one name at a time from the store down. When the VM sends more, or sends a path outside the agents&amp;rsquo; settings or a name with a character that a terminal wouldn&amp;rsquo;t show, devvm saves nothing. Each file it saves is yours alone (mode 600), or mode 700 when it was executable in the VM, so it never keeps a set-user-ID or set-group-ID bit. A link in a settings folder that leads to a file in the same folder becomes a copy of that file. devvm leaves out any other link, any other kind of file, such as a socket, and a settings file that it can&amp;rsquo;t parse whole, such as a &lt;code&gt;settings.json&lt;/code&gt; that isn&amp;rsquo;t JSON, and it warns you about each. When it leaves out a file in a folder, the store keeps its own copy of that file. A settings file that the VM doesn&amp;rsquo;t have stays in the store. A folder that the VM sends, other than Claude Code&amp;rsquo;s plugins folder, replaces the store&amp;rsquo;s folder whole, so devvm writes each of its files again and takes out the files that the VM&amp;rsquo;s folder doesn&amp;rsquo;t have, but it keeps the store&amp;rsquo;s folder itself, so a running VM&amp;rsquo;s mounts still show it. It compares each of the VM&amp;rsquo;s names with the store&amp;rsquo;s file that the store&amp;rsquo;s volume reads it as, found by what the file is, so where the volume ignores case, the diff shows the VM&amp;rsquo;s &lt;code&gt;foo.md&lt;/code&gt; as a change to the store&amp;rsquo;s &lt;code&gt;Foo.md&lt;/code&gt; rather than a file added and another removed. The save writes holding the store&amp;rsquo;s lock, as &lt;a href="#importing"&gt;the import&lt;/a&gt; does, and once it holds the lock, it plans again from the store as it is then. When that differs from what it showed you, as when an import wrote the store while you read the diff, it saves nothing and says so, rather than write over that change. Where the store has a folder and the VM has a file, or the other way round, the save saves nothing and names the store&amp;rsquo;s path, because putting one in the other&amp;rsquo;s place would take out what the store has there, which the diff doesn&amp;rsquo;t show. It then saves all or nothing, as the import does, so it first writes every agent&amp;rsquo;s files into a staging folder of the agent&amp;rsquo;s store first, with the import&amp;rsquo;s name, &lt;code&gt;.devvm-import-&lt;/code&gt; and a random name, and takes out any that a killed import or save left there. Then it moves each file into place and moves aside what a folder the VM sent no longer has, and it saves the part of &lt;code&gt;~/.claude.json&lt;/code&gt; last, holding the lock of the folder of Claude Code&amp;rsquo;s logins, which a VM&amp;rsquo;s proxy holds while it saves a Claude Code login made in that VM, so the two take turns. A failure from then on, such as a rename that fails or the login that can&amp;rsquo;t be saved, puts back every agent&amp;rsquo;s store and the login as they were, the last change first, and when putting a store back fails too, devvm says so, naming each store it couldn&amp;rsquo;t put back and its staging folder, which it keeps until the next import or save. A run that&amp;rsquo;s killed while it puts the settings in place can leave the store partly saved, so run the save again. A Ctrl-C while the save waits for the store&amp;rsquo;s lock or the login&amp;rsquo;s ends the wait, and the save leaves the store as it was.&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#copies"&gt;copies&lt;/a&gt; of the settings files and of &lt;code&gt;~/.claude.json&lt;/code&gt; hold placeholders, such as &lt;code&gt;devvm-redacted&lt;/code&gt;, where the store has your secrets. devvm puts the store&amp;rsquo;s secret back in place of each placeholder, as long as the VM&amp;rsquo;s copy had that placeholder in that place and nothing around it changed, such as the URL of the MCP server that a header is for. When something around a placeholder changed, devvm leaves the whole file out and warns you, so a VM can&amp;rsquo;t send a secret it never saw to another host, and you can make that change in the store&amp;rsquo;s file yourself. devvm also leaves out any other file that holds a placeholder, such as a skill. No VM gets opencode&amp;rsquo;s files in &lt;code&gt;~/.config/opencode&lt;/code&gt; that are neither settings nor Markdown, such as a &lt;code&gt;.env&lt;/code&gt;, so devvm leaves out the VM&amp;rsquo;s own file of that name and keeps the store&amp;rsquo;s.&lt;/p&gt;
&lt;h2 data-hextra-search-id="mounts"&gt;Mounts&lt;span class="hx:absolute hx:-mt-20" id="mounts"&gt;&lt;/span&gt;
&lt;a href="#mounts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Absolute paths in the mounted folders, such as Claude Code&amp;rsquo;s plugin paths, still work, because each is mounted at the same path as in the store on this machine. The VM follows a symlink in these folders among its own files, so a link to a file outside the folder, by a relative or an absolute path, doesn&amp;rsquo;t reach that file on this machine, on macOS&amp;rsquo;s virtiofs mounts and on Linux&amp;rsquo;s 9p mounts alike. devvm doesn&amp;rsquo;t mount a folder whose path has a comma, on any backend, and it warns you. Lima can&amp;rsquo;t mount such a path (&lt;a href="https://next.devvm.dev/docs/backends/lima/#limits"&gt;Lima&amp;rsquo;s limits&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The VM reads every file in these folders, a Claude Code marketplace&amp;rsquo;s git clone included, so when &lt;code&gt;devvm agent import&lt;/code&gt; or &lt;code&gt;devvm agent save&lt;/code&gt; copies a marketplace, it checks the clone for a credential and warns of each one. It reads, with git itself and without its includes, every git config below the clone&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt;, a submodule&amp;rsquo;s included, and each file a config includes from inside the clone, which the copy holds too, and it looks for an &lt;code&gt;http.extraHeader&lt;/code&gt; and a URL with a password or an access token in its user info: a remote&amp;rsquo;s or a submodule&amp;rsquo;s URL, a push URL, a proxy, or the base of an &lt;code&gt;insteadOf&lt;/code&gt;. It judges a URL as &lt;code&gt;--clone&lt;/code&gt; judges a remote, so an scp-like &lt;code&gt;git@host:path&lt;/code&gt; is a name, not a credential. It also checks each marketplace&amp;rsquo;s source in &lt;code&gt;known_marketplaces.json&lt;/code&gt;. A warning names the keys, never the credential, and a URL in a key&amp;rsquo;s name that holds one shows as &lt;code&gt;&amp;lt;url&amp;gt;&lt;/code&gt;. When git can&amp;rsquo;t read such a config, devvm warns that it couldn&amp;rsquo;t check it, with git&amp;rsquo;s reason, as the VM reads the file whatever git makes of it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-plugins"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-plugins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Claude Code keeps everything of its plugins in one folder, &lt;code&gt;~/.claude/plugins&lt;/code&gt; unless &lt;code&gt;CLAUDE_CODE_PLUGIN_CACHE_DIR&lt;/code&gt; names another, and writes there as it runs: each plugin&amp;rsquo;s data in &lt;code&gt;data/&amp;lt;plugin&amp;gt;&lt;/code&gt;, which a plugin reaches as &lt;code&gt;${CLAUDE_PLUGIN_DATA}&lt;/code&gt;, the plugins it installs in &lt;code&gt;cache&lt;/code&gt;, its marketplaces&amp;rsquo; copies in &lt;code&gt;marketplaces&lt;/code&gt; and their updates, its MCP bundles in &lt;code&gt;mcpb&lt;/code&gt;, the plugins claude.ai synced in &lt;code&gt;synced&lt;/code&gt;, its trash in &lt;code&gt;.trash&lt;/code&gt;, and its records, such as &lt;code&gt;installed_plugins.json&lt;/code&gt;. The store&amp;rsquo;s plugins folder is mounted read-only in every VM with Claude Code, because a VM that could write it could change what Claude Code runs in every other VM (&lt;a href="https://next.devvm.dev/docs/contributing/design/#claude-codes-plugins-a-seed-and-a-folder-of-the-vms-own"&gt;the design note&lt;/a&gt;). So each VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; is its own folder, on its own disk, and the store&amp;rsquo;s folder is the VM&amp;rsquo;s seed, Claude Code&amp;rsquo;s own support for a plugins folder it only reads. Every shell in the VM sets &lt;code&gt;CLAUDE_CODE_PLUGIN_CACHE_DIR&lt;/code&gt; to &lt;code&gt;~/.claude/plugins&lt;/code&gt; and &lt;code&gt;CLAUDE_CODE_PLUGIN_SEED_DIR&lt;/code&gt; to &lt;code&gt;~/.claude/plugins-seed&lt;/code&gt;, where the VM links the store&amp;rsquo;s folder. A seed is laid out as a plugins folder, with the marketplaces&amp;rsquo; records in &lt;code&gt;known_marketplaces.json&lt;/code&gt;, their copies in &lt;code&gt;marketplaces&lt;/code&gt; and the plugins in &lt;code&gt;cache&lt;/code&gt;. As Claude Code starts, it registers the seed&amp;rsquo;s marketplaces in the VM&amp;rsquo;s own folder, turns off their updates, and loads each plugin that &lt;code&gt;enabledPlugins&lt;/code&gt; turns on from the seed&amp;rsquo;s &lt;code&gt;cache&lt;/code&gt;, without copying it, and it never writes into the seed. It registers a marketplace from the seed only when the seed has its copy in &lt;code&gt;marketplaces&lt;/code&gt;, so a marketplace from a folder on this machine, which Claude Code reads in place and never copies, isn&amp;rsquo;t one, and Claude Code in the VM adds it from &lt;code&gt;extraKnownMarketplaces&lt;/code&gt; in &lt;code&gt;settings.json&lt;/code&gt; only when that folder is in the VM too. In &lt;code&gt;claude -p&lt;/code&gt;, Claude Code registers the seed&amp;rsquo;s marketplaces during the first session that the VM&amp;rsquo;s folder doesn&amp;rsquo;t have them yet, so a plugin&amp;rsquo;s hooks for the start of a session run from the next session on.&lt;/p&gt;
&lt;p&gt;At every launch, the VM&amp;rsquo;s setup makes &lt;code&gt;~/.claude/plugins&lt;/code&gt; a folder of the VM&amp;rsquo;s own when it isn&amp;rsquo;t one, replacing a link there, and it links &lt;code&gt;~/.claude/plugins-seed&lt;/code&gt; to the store&amp;rsquo;s folder. A VM made again with other layers keeps its own plugins folder, as it keeps the rest of its home.&lt;/p&gt;
&lt;p&gt;A store that devvm 0.1.0&amp;rsquo;s &lt;code&gt;devvm agent import&lt;/code&gt; wrote can hold the whole of &lt;code&gt;~/.claude/plugins&lt;/code&gt;, each plugin&amp;rsquo;s data included, and every VM with Claude Code mounts the store&amp;rsquo;s folder whole. So every start, before the VM runs, takes out of the store&amp;rsquo;s plugins folder each entry that a seed doesn&amp;rsquo;t have and warns once, naming them. It leaves the folder itself, so no VM&amp;rsquo;s mounts change and its Lima config needs no edit. A VM that&amp;rsquo;s already running stops seeing the entries through its mount at once on macOS, while on a Linux host, whose 9p mounts cache what the VM has read, it can keep seeing what it read until its next start. devvm reaches the folder from its config folder, every part of the path below it a folder, never a link, which only a hand-made store has and which the VM&amp;rsquo;s mount would follow, perhaps to your own &lt;code&gt;~/.claude/plugins&lt;/code&gt;. It takes a link among the entries out without following it, and it leaves the temporary files that a &lt;code&gt;devvm agent import&lt;/code&gt; or &lt;code&gt;devvm agent save&lt;/code&gt; running at the same time writes &lt;code&gt;known_marketplaces.json&lt;/code&gt; through. When it can&amp;rsquo;t take an entry out, or finds a link on the path, the start of a VM with Claude Code fails, naming the folder and what it should hold, rather than give the VM what it would read, and the start of any other VM warns.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; copy only what a seed has, so neither copies what each machine keeps of its own. The save&amp;rsquo;s script in the VM excludes, by name, every other entry of the VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt; when it&amp;rsquo;s a folder and not a link, and devvm saves nothing when the VM sends any other entry of it, as for any path outside the agents&amp;rsquo; settings. The VM&amp;rsquo;s folder holds only what the VM added to its seed, so the save adds the files that the VM&amp;rsquo;s folder has and changes those that differ, but it never takes a file out of the store&amp;rsquo;s folder. The save merges the VM&amp;rsquo;s &lt;code&gt;known_marketplaces.json&lt;/code&gt; into the store&amp;rsquo;s. It renames each path in the VM&amp;rsquo;s records that leads to the VM&amp;rsquo;s own plugins folder to the store&amp;rsquo;s folder, where every VM mounts it, and then each marketplace whose copy is in the store&amp;rsquo;s &lt;code&gt;marketplaces&lt;/code&gt;, by a path without &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;..&lt;/code&gt; parts, replaces the store&amp;rsquo;s of the same name. The others stay as the store has them, because a seed can&amp;rsquo;t use them. They are the ones that Claude Code registered from the seed, whose copies are at the seed&amp;rsquo;s link, which are the store&amp;rsquo;s own, and those that Claude Code reads where they are, such as a folder in the VM. So a save that changes no marketplace leaves the file as it is. devvm leaves the file out with a warning when it isn&amp;rsquo;t a JSON object. The save&amp;rsquo;s script sends an entry whose name has a wildcard&amp;rsquo;s character, such as &lt;code&gt;*&lt;/code&gt;, rather than exclude it by a pattern that could match other names, so devvm then saves nothing, naming it.&lt;/p&gt;
&lt;p&gt;An export of a VM&amp;rsquo;s history leaves out the VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt;, and an import of one leaves out both it and &lt;code&gt;~/.claude/plugins-seed&lt;/code&gt;. The VM&amp;rsquo;s plugins folder holds settings, not history. The plugins it installed reach another VM only through &lt;code&gt;devvm agent save&lt;/code&gt;, after you read its diff, and each plugin&amp;rsquo;s data can hold the plugin&amp;rsquo;s own logins and large caches, which an export on this machine would keep. A new VM gets the store&amp;rsquo;s plugins from its seed again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="copies"&gt;Copies&lt;span class="hx:absolute hx:-mt-20" id="copies"&gt;&lt;/span&gt;
&lt;a href="#copies" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm merges the settings and MCP servers from the store&amp;rsquo;s &lt;code&gt;.claude.json&lt;/code&gt; into the VM&amp;rsquo;s own &lt;code&gt;~/.claude.json&lt;/code&gt;, so servers added in the VM stay (&lt;a href="https://next.devvm.dev/docs/internals/network/#mcp-servers"&gt;MCP servers&lt;/a&gt;). Your API key, your answers about API keys and your per-project entries never reach the VM. devvm also replaces the secrets in the agents&amp;rsquo; settings files with &lt;code&gt;devvm-redacted&lt;/code&gt;, and names what it replaced. Those are the values under keys that look like secrets, every env value and header, and the secrets in URLs and in arguments. In other text, such as a hook&amp;rsquo;s command, devvm replaces the secrets in its URLs, the keys that start like a known key, such as &lt;code&gt;sk-&lt;/code&gt; or &lt;code&gt;ghp_&lt;/code&gt;, and the credential after &lt;code&gt;Bearer&lt;/code&gt; or &lt;code&gt;Basic&lt;/code&gt;, and keeps the words around them (&lt;a href="https://next.devvm.dev/docs/internals/network/#keys-in-settings-files"&gt;keys in settings files&lt;/a&gt;). pi&amp;rsquo;s settings files that can hold a key are &lt;code&gt;settings.json&lt;/code&gt;, &lt;code&gt;models.json&lt;/code&gt; and &lt;code&gt;mcp.json&lt;/code&gt;, so a provider&amp;rsquo;s &lt;code&gt;apiKey&lt;/code&gt; in &lt;code&gt;models.json&lt;/code&gt; reaches the VM as &lt;code&gt;devvm-redacted&lt;/code&gt;, and pi&amp;rsquo;s &lt;code&gt;keybindings.json&lt;/code&gt; and Markdown files reach it as they are. From the &lt;code&gt;env&lt;/code&gt; of Claude Code&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt;, the VM gets only Claude Code&amp;rsquo;s own settings, such as &lt;code&gt;ANTHROPIC_MODEL&lt;/code&gt;, the &lt;code&gt;CLAUDE_CODE_*&lt;/code&gt;, &lt;code&gt;DISABLE_*&lt;/code&gt; and &lt;code&gt;MAX_*&lt;/code&gt; variables and those ending in &lt;code&gt;_TIMEOUT_MS&lt;/code&gt;, but none whose name marks it as a credential, such as &lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt;. It also gets the values that only name where a secret is, base URLs without their passwords, &lt;code&gt;true&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt; and short numbers. Every other env value, and every env value of an MCP server, becomes &lt;code&gt;devvm-redacted&lt;/code&gt;. When devvm can&amp;rsquo;t parse a settings file to take its secrets out, the VM doesn&amp;rsquo;t get a copy of it, and neither does it get opencode&amp;rsquo;s files in &lt;code&gt;~/.config/opencode&lt;/code&gt; that are neither settings nor Markdown, such as a &lt;code&gt;.env&lt;/code&gt;. devvm names each file it doesn&amp;rsquo;t copy, and when it can&amp;rsquo;t make the copy of a login, it says why.&lt;/p&gt;
&lt;h2 data-hextra-search-id="opencodes-service"&gt;opencode&amp;rsquo;s service&lt;span class="hx:absolute hx:-mt-20" id="opencodes-service"&gt;&lt;/span&gt;
&lt;a href="#opencodes-service" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;opencode keeps its background service&amp;rsquo;s settings in &lt;code&gt;~/.config/opencode/service.json&lt;/code&gt;, or in &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; for a channel other than latest, dev, beta or next (an earlier build named it &lt;code&gt;service-&amp;lt;hash&amp;gt;.json&lt;/code&gt;), and it writes each one through a temporary file beside it, &lt;code&gt;&amp;lt;file&amp;gt;.&amp;lt;pid&amp;gt;.tmp&lt;/code&gt;. They hold the service&amp;rsquo;s password, 32 random bytes that the service makes when it starts and the file has none, and with remote access on, the route that the service is served on, a random name that keeps its address unguessable. So &lt;code&gt;opencode service get&lt;/code&gt; with no key hides both, and only &lt;code&gt;opencode service get password&lt;/code&gt; shows the password. They also hold the service&amp;rsquo;s port, host name, CORS origins and environment. That makes them each machine&amp;rsquo;s own rather than settings, so the import and the save leave out every entry of &lt;code&gt;~/.config/opencode&lt;/code&gt; with one of these names, what&amp;rsquo;s in a folder of that name included, and the save&amp;rsquo;s script in the VM never sends them, so the VM&amp;rsquo;s own file never makes a save fail. The VM&amp;rsquo;s file stays in the VM, so a VM made again keeps it, and no export of the VM&amp;rsquo;s history holds it, because &lt;code&gt;~/.config/opencode&lt;/code&gt; isn&amp;rsquo;t history.&lt;/p&gt;
&lt;p&gt;A store that an earlier import filled can hold them, so every start looks for them in the store&amp;rsquo;s &lt;code&gt;~/.config/opencode&lt;/code&gt;, which it opens as it opens &lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt; folder, and once it finds any, it takes them out holding the store&amp;rsquo;s lock and warns once, naming them. No VM gets them from the store meanwhile, because a VM&amp;rsquo;s setup copies only the files that the import would copy, so a start whose clean-up fails only warns, naming the folder. devvm writes &lt;code&gt;devvm-redacted&lt;/code&gt; in place of a secret in every copy of a settings file that it makes, so a file with one of these names that holds it is a copy that devvm made, whose password every VM with such a copy shares. Each launch&amp;rsquo;s setup takes out each such regular file in the VM&amp;rsquo;s &lt;code&gt;~/.config/opencode&lt;/code&gt; and leaves the VM&amp;rsquo;s own files, links and folders, so the VM&amp;rsquo;s opencode makes its own password when its service next starts. A service that&amp;rsquo;s running keeps the password it started with until it stops, as when the VM restarts.&lt;/p&gt;
&lt;h2 data-hextra-search-id="claude-codes-login"&gt;Claude Code&amp;rsquo;s login&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-login"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-login" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm agent login claude&lt;/code&gt; runs Claude Code&amp;rsquo;s own login in the VM, and the VM&amp;rsquo;s proxy saves the login as it reaches Claude&amp;rsquo;s token endpoint, and Claude Code in the VM gets only placeholders. devvm then sets the VM up again, so it uses the login at once, and every other VM with Claude Code gets it from its next launch.&lt;/p&gt;
&lt;p&gt;A VM gets either &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; or &lt;code&gt;CLAUDE_CODE_OAUTH_TOKEN&lt;/code&gt; from devvm, never both, because Claude Code would use the token in its environment over the login in its file. A VM that started with the login devvm replaced keeps working, because its proxy puts the login devvm keeps now in place of either placeholder. The VM gets placeholders whatever its network tier.&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s setup merges devvm&amp;rsquo;s copy of the login into the VM&amp;rsquo;s own &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, because Claude Code keeps more than its Claude login in that file, such as its logins to MCP servers under &lt;code&gt;mcpOAuth&lt;/code&gt;, which hold an MCP server&amp;rsquo;s tokens and, while a login is under way, its PKCE verifier. devvm sends its copy beside the setup as &lt;code&gt;claude-credentials.json&lt;/code&gt;, and the setup&amp;rsquo;s &lt;code&gt;merge_claude_credentials&lt;/code&gt; replaces the VM&amp;rsquo;s &lt;code&gt;claudeAiOauth&lt;/code&gt; with the copy&amp;rsquo;s, or takes it out when the copy has none, and keeps every other key of the VM&amp;rsquo;s file. It reads the file with &lt;code&gt;jq&lt;/code&gt; and writes the result whole, mode 600, to a temp file in &lt;code&gt;~/.cache&lt;/code&gt;, which neither an export of the VM&amp;rsquo;s history nor a VM made again carries, and then moves it over the file. When the VM&amp;rsquo;s file is a link, isn&amp;rsquo;t JSON or isn&amp;rsquo;t one JSON object, the copy replaces it and the setup says so, and a link is taken away first, so the move never writes through it. When it&amp;rsquo;s a folder, the setup leaves it as it is and says so. When the move fails, the setup removes the temp file and fails. A write that Claude Code makes to the file between the setup&amp;rsquo;s read and its move, such as a login to an MCP server that finishes in those milliseconds, is lost, and you make that login again. With a Claude Code token, devvm sends no copy, so the VM&amp;rsquo;s file stays as it is. Claude Code uses the token in its environment over any login left in the file, and that login&amp;rsquo;s placeholder gets the token at &lt;code&gt;api.anthropic.com&lt;/code&gt; and nothing at &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The MCP servers&amp;rsquo; logins stay in the VM. &lt;code&gt;devvm agent save&lt;/code&gt; reads only the settings, an export of the VM&amp;rsquo;s history leaves &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; out and an import never writes it, and a VM made again doesn&amp;rsquo;t get it, so nothing of the VM&amp;rsquo;s file reaches devvm&amp;rsquo;s store, this machine or another VM. Only the store&amp;rsquo;s copy goes into the file, and it holds the placeholders alone.&lt;/p&gt;
&lt;h2 data-hextra-search-id="codexs-and-opencodes-logins"&gt;Codex&amp;rsquo;s and opencode&amp;rsquo;s logins&lt;span class="hx:absolute hx:-mt-20" id="codexs-and-opencodes-logins"&gt;&lt;/span&gt;
&lt;a href="#codexs-and-opencodes-logins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The proxy reads the real API keys and logins from the login files in devvm&amp;rsquo;s store as it needs them and refreshes ChatGPT logins there. The proxy puts in opencode&amp;rsquo;s API keys for the providers that &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt; lists, and its OpenAI and GitHub Copilot logins. The VM&amp;rsquo;s entry for such an API key holds only its type and the placeholder, so the entry&amp;rsquo;s other fields, such as its &lt;code&gt;metadata&lt;/code&gt;, stay on this machine.&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s copy of Codex&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; holds only what Codex needs for its API key and its ChatGPT login: the placeholders, how it logs in, when it last refreshed, and the IDs of the account and the login. devvm keeps every other field on this machine, because the VM&amp;rsquo;s proxy can&amp;rsquo;t put it in, and it names those fields at every launch. That includes Codex&amp;rsquo;s other ways to log in, such as a personal access token or an Amazon Bedrock key, so Codex in a VM can&amp;rsquo;t use them. devvm treats Claude Code&amp;rsquo;s account state in &lt;code&gt;~/.claude.json&lt;/code&gt; the same way, so the VM gets only the account fields that Claude Code writes there today, and devvm names any other field at every launch.&lt;/p&gt;
&lt;p&gt;devvm keeps every other entry of opencode&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; on this machine too, because devvm doesn&amp;rsquo;t know which hosts it&amp;rsquo;s for, so the VM gets that entry without its key or its tokens, and devvm warns you about each at every launch. That&amp;rsquo;s an API key for any other provider, such as Azure&amp;rsquo;s or a local model server&amp;rsquo;s, a well-known login, which an organization&amp;rsquo;s own opencode config sets up, and any other OAuth login, such as Copilot Enterprise&amp;rsquo;s. The VM keeps only the fields of a withheld entry that name the account or how it logs in, such as its type, its &lt;code&gt;enterpriseUrl&lt;/code&gt; and its expiry, so opencode in the VM doesn&amp;rsquo;t use that provider.&lt;/p&gt;
&lt;h2 data-hextra-search-id="logging-in"&gt;Logging in&lt;span class="hx:absolute hx:-mt-20" id="logging-in"&gt;&lt;/span&gt;
&lt;a href="#logging-in" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you approve a browser login, the browser comes back to &lt;code&gt;localhost:1455&lt;/code&gt;, where the agent&amp;rsquo;s own server in the VM waits, so devvm forwards this machine&amp;rsquo;s &lt;code&gt;localhost:1455&lt;/code&gt;, and &lt;code&gt;localhost:1457&lt;/code&gt;, which Codex uses when 1455 is taken in the VM, to the same ports in the VM. The forward lasts only while the login runs, and it ends when the login ends, fails or you press Ctrl+C, which ends the agent&amp;rsquo;s login in the VM too.&lt;/p&gt;
&lt;p&gt;Codex in a VM keeps its login in &lt;code&gt;~/.codex/auth.json&lt;/code&gt;, never in a keyring, because devvm sets &lt;code&gt;cli_auth_credentials_store = &amp;quot;file&amp;quot;&lt;/code&gt; in the VM&amp;rsquo;s &lt;code&gt;~/.codex/config.toml&lt;/code&gt; on every launch.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;--api-key&lt;/code&gt;, devvm gives the running VM its copy of the login, with a placeholder in place of the key, and the VM&amp;rsquo;s proxy puts the key in at once. opencode keeps its logins in its own database in the VM, and it reads its &lt;code&gt;auth.json&lt;/code&gt; only when it first makes that database, so when opencode has already run in the VM, devvm also gives it the key&amp;rsquo;s placeholder with &lt;code&gt;opencode auth import&lt;/code&gt;. devvm reads at most 1 MiB of what that import prints in the VM, and when it prints more, devvm stops it and fails, so running devvm in the VM&amp;rsquo;s folder tries again. Every other VM with opencode gets the key&amp;rsquo;s placeholder at its next launch, the same way, and any credentials that you added to opencode in a VM yourself stay in its database.&lt;/p&gt;
&lt;h2 data-hextra-search-id="logins-made-in-a-vm"&gt;Logins made in a VM&lt;span class="hx:absolute hx:-mt-20" id="logins-made-in-a-vm"&gt;&lt;/span&gt;
&lt;a href="#logins-made-in-a-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When Codex or opencode in a VM logs in to OpenAI, whether &lt;code&gt;devvm agent login&lt;/code&gt; runs it or you run it yourself, the VM&amp;rsquo;s proxy saves the login in devvm&amp;rsquo;s store, in the agent&amp;rsquo;s own &lt;code&gt;auth.json&lt;/code&gt;, and the agent in the VM gets only placeholders, so on every tier but open the VM never holds the login&amp;rsquo;s tokens. The VM you logged in from uses the login at once, and every VM with that agent gets it from its next launch. opencode reads its &lt;code&gt;auth.json&lt;/code&gt; only when it first makes its database, so in a VM where opencode has already run, devvm adds the store&amp;rsquo;s logins to opencode&amp;rsquo;s database at each launch when they changed since the VM last got them, and makes them the ones opencode uses. Credentials that you added to opencode in the VM yourself stay in its database, labeled with your names rather than devvm, and &lt;code&gt;opencode auth switch&lt;/code&gt; changes back to one of them. A login that shows a code to type into a browser on any machine works in a VM as it is, such as &lt;code&gt;codex login --device-auth&lt;/code&gt; and opencode&amp;rsquo;s Codex device code login. opencode&amp;rsquo;s Sign in with ChatGPT doesn&amp;rsquo;t work in a VM, because it gets its tokens from another endpoint, whose replies the VM&amp;rsquo;s proxy refuses so that they never reach the VM, so choose one of opencode&amp;rsquo;s Codex logins instead, as &lt;code&gt;devvm agent login opencode&lt;/code&gt; does. A new login replaces the one in the store, together with Codex&amp;rsquo;s API key, so every VM with the agent uses the account you logged in to last. A VM saves a login only for an agent that it has, so a VM without Codex can&amp;rsquo;t replace the store&amp;rsquo;s Codex login, and a VM without opencode can&amp;rsquo;t replace opencode&amp;rsquo;s. When a VM sends a login for an agent it doesn&amp;rsquo;t have, such as one that a program installed in the VM itself, its proxy refuses the login, devvm saves nothing, and the proxy&amp;rsquo;s own log says so. In a VM with both Codex and opencode, devvm tells their logins apart by the program that sends them. &lt;code&gt;devvm network log&lt;/code&gt; shows a &lt;code&gt;login&lt;/code&gt; line for each login it saved. On the open tier, a program that goes around the VM&amp;rsquo;s proxy gets the login&amp;rsquo;s tokens itself, and devvm saves nothing (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;). Claude Code&amp;rsquo;s logins in a VM are saved in the same way (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#claude-code-login"&gt;Claude Code login&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="pis-logins"&gt;pi&amp;rsquo;s logins&lt;span class="hx:absolute hx:-mt-20" id="pis-logins"&gt;&lt;/span&gt;
&lt;a href="#pis-logins" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm agent login pi --api-key --provider PROVIDER&lt;/code&gt; saves the key in the store&amp;rsquo;s &lt;code&gt;~/.local/share/devvm/logins/pi/.pi/agent/auth.json&lt;/code&gt;, in pi&amp;rsquo;s own format, beside pi&amp;rsquo;s other providers, as opencode&amp;rsquo;s &lt;code&gt;--api-key&lt;/code&gt; does (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#logging-in-with-devvm-agent-login"&gt;logging in with devvm agent login&lt;/a&gt;). The VM&amp;rsquo;s &lt;code&gt;~/.pi/agent/auth.json&lt;/code&gt; holds a placeholder in place of each of those keys, and the VM&amp;rsquo;s proxy puts the key into pi&amp;rsquo;s requests to that provider&amp;rsquo;s hosts, on every network tier, and allows those hosts, as the table in &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt; describes. The VM&amp;rsquo;s entry for such a provider holds only its type and the placeholder, so it gets none of the entry&amp;rsquo;s other fields, such as its &lt;code&gt;env&lt;/code&gt;, whose values pi uses before the environment&amp;rsquo;s, and the store keeps them on this machine.&lt;/p&gt;
&lt;p&gt;devvm keeps every other entry of pi&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; on this machine too, and the VM gets that entry without its key, its &lt;code&gt;env&lt;/code&gt; or its tokens, and devvm warns you about each. That&amp;rsquo;s an API key for any other provider, such as a local model server&amp;rsquo;s, a key that&amp;rsquo;s a command for pi to run, such as &lt;code&gt;!security find-generic-password&lt;/code&gt;, and a key that pi fills in from a variable, such as &lt;code&gt;$KEY&lt;/code&gt; or &lt;code&gt;${KEY}&lt;/code&gt;, even for a provider whose key the proxy puts in, because devvm can&amp;rsquo;t tell what pi would send. The VM keeps only the fields of a withheld entry that name the account or how it logs in, such as its type, its &lt;code&gt;accountId&lt;/code&gt; and its expiry.&lt;/p&gt;
&lt;p&gt;pi&amp;rsquo;s Claude and ChatGPT logins use the same token endpoints as Claude Code&amp;rsquo;s, Codex&amp;rsquo;s and opencode&amp;rsquo;s logins, whose replies the VM&amp;rsquo;s proxy captures for those agents, and devvm never keeps such a login as pi&amp;rsquo;s. In a VM that also has the matching agent, Claude Code for a Claude login and Codex or opencode for a ChatGPT login, the proxy saves pi&amp;rsquo;s login as that agent&amp;rsquo;s own, in place of the one devvm keeps for every VM with that agent. In a VM with none of them, the proxy refuses pi&amp;rsquo;s login and devvm saves nothing (&lt;a href="#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="cursors-cli"&gt;Cursor&amp;rsquo;s CLI&lt;span class="hx:absolute hx:-mt-20" id="cursors-cli"&gt;&lt;/span&gt;
&lt;a href="#cursors-cli" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The VM&amp;rsquo;s proxy puts the real login only into the requests for the methods that devvm found the CLI calling in its package, on Cursor&amp;rsquo;s API, its agent&amp;rsquo;s hosts and its codebase indexing, and into no other. It refuses every other request below &lt;code&gt;/auth/&lt;/code&gt; on those hosts, the methods that make or show a key, a token, a secret or a sign-in, the methods that change your account, and any path it can&amp;rsquo;t read as Cursor&amp;rsquo;s hosts do. Those are the real control. As a defence in depth, the proxy also reads every reply from those hosts as it passes, its headers and the agent&amp;rsquo;s streams included, and cuts one off where a token starts. devvm checked this against one release of the CLI, by reading its code, and against Cursor&amp;rsquo;s own answers to a login that isn&amp;rsquo;t there, so a method that Cursor adds that hands out a token in a shape devvm doesn&amp;rsquo;t know would reach the VM. Such a token would work without the proxy, so if you suspect that one reached a VM, log in again with &lt;code&gt;devvm agent login cursor&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;). Neither does devvm guard Cursor&amp;rsquo;s hosts that the CLI doesn&amp;rsquo;t use: if one of them also answered &lt;code&gt;/auth/poll&lt;/code&gt;, a VM could finish a login there and keep its tokens, though none is known to.&lt;/p&gt;
&lt;p&gt;Your Cursor agents on every machine and in the cloud share Cursor&amp;rsquo;s agent store, your cloud agents follow the skills in it, and your team shares a store of its own, so a VM that could write there could leave instructions for them. So no VM gets the store (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;why&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="api-keys"&gt;API keys&lt;span class="hx:absolute hx:-mt-20" id="api-keys"&gt;&lt;/span&gt;
&lt;a href="#api-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The proxy puts in opencode&amp;rsquo;s and pi&amp;rsquo;s API keys for the providers that &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#api-keys-the-proxy-puts-in"&gt;API keys the proxy puts in&lt;/a&gt; lists, in the headers it names. OpenRouter&amp;rsquo;s key goes in either of its two headers, because pi sends it in &lt;code&gt;x-api-key&lt;/code&gt; for OpenRouter&amp;rsquo;s Anthropic models, as Anthropic&amp;rsquo;s own API takes a key, and in &lt;code&gt;Authorization&lt;/code&gt; for every other model. The proxy swaps the placeholder only when the header holds the placeholder and nothing else, or for &lt;code&gt;Authorization&lt;/code&gt;, &lt;code&gt;Bearer&lt;/code&gt;, one space and the placeholder, which is how opencode and pi send each of these keys. A header that holds anything else beside the placeholder, or a second header of the same name, keeps the placeholder, so code in the VM can&amp;rsquo;t surround your key with text of its own, which a provider that quotes part of a key it refuses could show back to it.&lt;/p&gt;
&lt;p&gt;The placeholder for an OpenAI key starts with &lt;code&gt;sk-&lt;/code&gt;, as an OpenAI API key does, because pi takes an OpenAI key that starts any other way for a Sign in with ChatGPT login and then leaves settings such as the longest reply it wants out of its requests.&lt;/p&gt;
&lt;p&gt;The placeholder keeps a key out of the VM only from the launch that first gives the VM the placeholder. A VM that was given one of these keys as it was before then, such as through &lt;code&gt;[pass-keys]&lt;/code&gt; when the proxy didn&amp;rsquo;t put that provider&amp;rsquo;s key in, may still hold copies of it. They can be in opencode&amp;rsquo;s database, its write-ahead log and its freed pages, in the disk&amp;rsquo;s free space and anywhere that the VM&amp;rsquo;s own code copied the key. While opencode in the VM fails to import the placeholder, devvm&amp;rsquo;s record of opencode&amp;rsquo;s last import, &lt;code&gt;~/.local/state/devvm/opencode-import.json&lt;/code&gt;, holds the key too.&lt;/p&gt;
&lt;p&gt;With some of these keys, code in the VM can make a credential of its own that works without the proxy. Google Gemini&amp;rsquo;s key gets an ephemeral token for Gemini&amp;rsquo;s Live API, which lasts up to about 20 hours and allows as many uses as the VM asks for. xAI&amp;rsquo;s key gets a realtime client secret that lasts as long as the VM chooses, and OpenAI&amp;rsquo;s key gets one that lasts up to 2 hours. opencode&amp;rsquo;s experimental voice mode asks for these itself, so the proxy allows those requests (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#secrets-and-keys-the-vm-may-use"&gt;attack vectors&lt;/a&gt;). Some of these providers&amp;rsquo; own tools also fetch the URLs that a request names, such as Google Gemini&amp;rsquo;s URL context and Search grounding, xAI&amp;rsquo;s live search, Groq&amp;rsquo;s compound models and Mistral&amp;rsquo;s agents with web search, so code in the VM can reach hosts that the allowlist doesn&amp;rsquo;t have through them, as it can through Anthropic&amp;rsquo;s and OpenAI&amp;rsquo;s.&lt;/p&gt;
&lt;h2 data-hextra-search-id="history-exports"&gt;History exports&lt;span class="hx:absolute hx:-mt-20" id="history-exports"&gt;&lt;/span&gt;
&lt;a href="#history-exports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The agents&amp;rsquo; logins aren&amp;rsquo;t in the export, which leaves out &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;, &lt;code&gt;~/.codex/auth.json&lt;/code&gt;, and opencode&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt;, &lt;code&gt;account.json&lt;/code&gt;, &lt;code&gt;mcp-auth.json&lt;/code&gt; and &lt;code&gt;bin&lt;/code&gt;, and holds nothing of &lt;code&gt;~/.pi/agent&lt;/code&gt; but its sessions, so pi&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; stays out too. It leaves out the VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt;, which holds settings and each plugin&amp;rsquo;s data rather than history (&lt;a href="#claude-codes-plugins"&gt;Claude Code&amp;rsquo;s plugins&lt;/a&gt;). It also leaves out what of &lt;code&gt;~/.local/state/opencode&lt;/code&gt; is the VM&amp;rsquo;s own as a machine:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;its &lt;code&gt;machine&lt;/code&gt; folder, whose &lt;code&gt;home-key&lt;/code&gt; is the private key that every machine opencode pairs with &lt;code&gt;opencode machine add&lt;/code&gt; trusts&lt;/li&gt;
&lt;li&gt;its &lt;code&gt;service.json&lt;/code&gt;, or &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; for another channel&amp;rsquo;s opencode, which holds the password of opencode&amp;rsquo;s background service, and the handoff tickets and temporary files that opencode writes beside it&lt;/li&gt;
&lt;li&gt;its &lt;code&gt;pty&lt;/code&gt; folder, which holds the sockets of its terminals&amp;rsquo; daemons and their access tokens&lt;/li&gt;
&lt;li&gt;its &lt;code&gt;plugin-approvals.json&lt;/code&gt;, with its lock and the temporary files it&amp;rsquo;s written through, which holds the project plugins you approved in opencode&amp;rsquo;s native client, which doesn&amp;rsquo;t ship in opencode 2.4.1&lt;/li&gt;
&lt;li&gt;its &lt;code&gt;plugin-staged&lt;/code&gt; folder, the approved plugins&amp;rsquo; copies, which that client runs without checking their hash again, so an export would otherwise approve a plugin for another VM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The copy of opencode&amp;rsquo;s database leaves out its &lt;code&gt;machine&lt;/code&gt; table too, which holds the public keys that the machines it paired log in to it with. An import never writes them either, so the new VM&amp;rsquo;s opencode makes its own, and a VM made again keeps the VM&amp;rsquo;s own, because it&amp;rsquo;s the same machine (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-vm-made-again-keeps"&gt;what a VM made again keeps&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;opencode keeps its sessions and its logins together in one database, &lt;code&gt;~/.local/share/opencode/opencode.db&lt;/code&gt;, so the export holds a copy of that database without its logins. The VM makes the copy with &lt;code&gt;sqlite3&lt;/code&gt;, which every base image has, and the copy has no logins, API keys or opencode account in any part of the file, not even a key you typed into opencode in the VM, while the VM&amp;rsquo;s own database keeps them (&lt;a href="https://next.devvm.dev/docs/contributing/design/#opencodes-database-in-history-exports"&gt;how&lt;/a&gt;). The copy also leaves out what opencode 2.4 would act on without asking in the VM that imports it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;its &lt;code&gt;automation&lt;/code&gt; table, because opencode runs each automation&amp;rsquo;s shell command on its schedule or event without asking again&lt;/li&gt;
&lt;li&gt;its &lt;code&gt;permission&lt;/code&gt; table, the requests you said always to allow&lt;/li&gt;
&lt;li&gt;its &lt;code&gt;job&lt;/code&gt; table, the subagents&amp;rsquo; jobs, and its &lt;code&gt;session_inbox&lt;/code&gt; table, the messages queued for a session&amp;rsquo;s next turn, because opencode&amp;rsquo;s service starts those jobs and turns when it starts&lt;/li&gt;
&lt;li&gt;each session&amp;rsquo;s allow rules, as the session keeps only the deny and ask rules of its permission rules&lt;/li&gt;
&lt;li&gt;each suspended session&amp;rsquo;s mark, so no session resumes its turn on its own&lt;/li&gt;
&lt;li&gt;each project&amp;rsquo;s commands, whose start command opencode runs for each worktree it makes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The export also leaves out opencode&amp;rsquo;s git repositories in &lt;code&gt;~/.local/share/opencode&lt;/code&gt;, which are &lt;code&gt;snapshot&lt;/code&gt;, &lt;code&gt;repos&lt;/code&gt; and &lt;code&gt;worktree&lt;/code&gt;, because a repository&amp;rsquo;s config can name a command that git runs, and opencode&amp;rsquo;s own git commands would run it in the VM that imports it. So the export doesn&amp;rsquo;t hold opencode&amp;rsquo;s worktrees, and the work in them stays in the VM, which a VM made again keeps and &lt;code&gt;devvm rm&lt;/code&gt; deletes, after it checks them (&lt;a href="#opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;/a&gt;). Their commits are in the project&amp;rsquo;s own repository. A view or a generated column in the database could hide rows from these steps, so the copy drops every view, and it fails its check when a table has a generated column. The export never holds the database&amp;rsquo;s &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt; or &lt;code&gt;-journal&lt;/code&gt; files, which can hold logins that opencode saved last. When the VM has no &lt;code&gt;sqlite3&lt;/code&gt;, such as a VM made from an image built without it, the export leaves the database out, so opencode&amp;rsquo;s sessions aren&amp;rsquo;t in it, and the run log says so. It does the same when the VM&amp;rsquo;s &lt;code&gt;sqlite3&lt;/code&gt; can&amp;rsquo;t read JSON, which the sessions&amp;rsquo; rules are. devvm starts a stopped VM for the export as a launch does, so it locks the folder&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; again and checks the VM&amp;rsquo;s confinement first, and the VM stays running. devvm writes the file only once the export is complete, so a failed export leaves no file and leaves an existing FILE as it was. An export holds at most 2 GiB, because a VM could otherwise write until this machine&amp;rsquo;s disk is full. When the VM sends more, devvm stops the export and keeps nothing of it, so &lt;code&gt;devvm history export&lt;/code&gt; fails, while &lt;code&gt;devvm rm&lt;/code&gt; and the commands that make a VM again warn that they kept no export and go on without one. Only you can read the file, and devvm makes the exports folder yours alone each time it writes one there, whatever its mode was before. When FILE is in a folder of your own, that folder keeps its mode. If the export fails, &lt;code&gt;devvm rm&lt;/code&gt; keeps the VM, and &lt;code&gt;devvm rm --no-export&lt;/code&gt; deletes it without exporting. &lt;code&gt;devvm rm VM&lt;/code&gt;, for a VM whose folder is gone, exports in the same way, but only from a running VM or a &lt;code&gt;--clone&lt;/code&gt; VM, because starting any other would make its folder again (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-vm-whose-folder-is-gone"&gt;a VM whose folder is gone&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="opencodes-worktrees"&gt;opencode&amp;rsquo;s worktrees&lt;span class="hx:absolute hx:-mt-20" id="opencodes-worktrees"&gt;&lt;/span&gt;
&lt;a href="#opencodes-worktrees" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;opencode 2.4 makes each worktree with &lt;code&gt;git worktree add&lt;/code&gt;, in &lt;code&gt;~/.local/share/opencode/worktree/&amp;lt;project&amp;gt;/&amp;lt;name&amp;gt;&lt;/code&gt;, where &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; is the first six characters of the project&amp;rsquo;s ID in opencode. Because an export leaves that folder out, &lt;code&gt;devvm rm&lt;/code&gt;, and a command that makes the VM again with &lt;code&gt;--clean-home&lt;/code&gt;, read the worktrees there before the VM&amp;rsquo;s disk goes. devvm runs one command in the running VM, in its home folder, which finds each folder at that depth with a &lt;code&gt;.git&lt;/code&gt; in it, those whose names start with a dot too, and prints, for each one, its path, its &lt;code&gt;git status --porcelain&lt;/code&gt;, and the commit its HEAD is detached at when no branch, tag or remote-tracking branch in the VM has that commit. A worktree whose &lt;code&gt;git status&lt;/code&gt; fails counts as one with changes, because the VM still has its files. The command looks at 100 worktrees at most and says when there are more. devvm reads at most 8 MiB of its answer and stops the command once it sends more, and it waits at most 2 minutes for the answer, so a VM that answers without end, or never, can&amp;rsquo;t keep &lt;code&gt;devvm rm&lt;/code&gt; waiting.&lt;/p&gt;
&lt;p&gt;The answer comes from the VM, so devvm checks it before it shows any of it. Each record must be whole, each path must be a clean path below the home folder that opencode&amp;rsquo;s pattern matches, each worktree must appear once and be followed by its status, and there can be no more than 100 of them. An answer that breaks any of these, a command that fails, an answer over the limit or one that doesn&amp;rsquo;t come in time keeps the VM, because the VM may hold work devvm can&amp;rsquo;t see, and devvm names &lt;code&gt;--no-worktree-check&lt;/code&gt;. A path or a change devvm shows goes through the same filter as every message, which drops the characters that would move the cursor or hide text. The VM can still leave a worktree out of its answer, which hides only its own work. For a &lt;code&gt;--clone&lt;/code&gt; VM, the same question covers the clone check&amp;rsquo;s findings, so devvm asks once.&lt;/p&gt;
&lt;p&gt;devvm checks only that folder. A worktree that opencode&amp;rsquo;s &lt;code&gt;worktree.directory&lt;/code&gt; setting puts elsewhere in the VM&amp;rsquo;s home folder isn&amp;rsquo;t checked, and it goes with the VM as any other file there does. One that the setting puts in the project folder is on this machine for a VM that mounts it, and in the clone for a &lt;code&gt;--clone&lt;/code&gt; VM, whose check covers the worktrees inside its folder (&lt;a href="https://next.devvm.dev/docs/using/clone/#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="importing-history"&gt;Importing history&lt;span class="hx:absolute hx:-mt-20" id="importing-history"&gt;&lt;/span&gt;
&lt;a href="#importing-history" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The import works on every VM, whether its base is Ubuntu&amp;rsquo;s image or a Debian-, Ubuntu- or Alpine-based container image (&lt;a href="https://next.devvm.dev/docs/using/from/"&gt;starting from a container image&lt;/a&gt;), because it unpacks the export with GNU &lt;code&gt;tar&lt;/code&gt;, which Debian and Ubuntu always have and which devvm installs in every base made &lt;code&gt;--from alpine&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;An export holds what a VM wrote, so devvm treats it as untrusted. Its transcripts can hold what the old VM&amp;rsquo;s agents read, and a VM on a less strict tier reaches more, such as your local network on the open tier. So when the export comes from a VM on a less strict tier than the VM you import it into, going from open to internet, allowlist and none, devvm warns you before it imports. devvm knows an export&amp;rsquo;s tier only from the &lt;code&gt;.folder&lt;/code&gt; file beside it in &lt;code&gt;~/.local/share/devvm/exports&lt;/code&gt;, so it warns about an export with no tier recorded, or any FILE elsewhere, such as in the project folder that a VM can write, as if it came from an open VM. devvm never unpacks an export on this machine. It streams the file into the VM as it is, and the VM&amp;rsquo;s own &lt;code&gt;tar&lt;/code&gt; unpacks it there as the VM&amp;rsquo;s user, so it can only write what that user can write. Before unpacking anything, the VM lists the paths in the export, and when one of them is outside &lt;!-- the agents' history, generated from internal/agents by mise run cli-docs --&gt;&lt;code&gt;~/.claude&lt;/code&gt;, &lt;code&gt;~/.claude.json&lt;/code&gt;, &lt;code&gt;~/.codex&lt;/code&gt;, &lt;code&gt;~/.local/share/opencode&lt;/code&gt;, &lt;code&gt;~/.local/state/opencode&lt;/code&gt;, &lt;code&gt;~/.pi/agent/sessions&lt;/code&gt; and &lt;code&gt;~/.cursor/chats&lt;/code&gt;&lt;!-- end of the agents' history --&gt;, starts with &lt;code&gt;/&lt;/code&gt; or has a &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;..&lt;/code&gt; or empty part, such as &lt;code&gt;.claude/./plugins&lt;/code&gt; or &lt;code&gt;.claude//plugins&lt;/code&gt;, devvm imports nothing and says so, because &lt;code&gt;tar&lt;/code&gt; matches the paths it leaves out against each name as the export writes it. Once it has unpacked the export, it also deletes each of those paths by its path, whatever name put a file there. It leaves out of that check, and never unpacks, the AppleDouble files whose names start with &lt;code&gt;._&lt;/code&gt;, which macOS&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; puts beside each file that has extended attributes, so an export you packed yourself on a Mac imports. The import keeps no owner or mode from the export, so the VM user&amp;rsquo;s umask applies and no file is set-user-ID. It also takes out every symbolic link that points outside the folder it&amp;rsquo;s in, which is any link to an absolute path or one with a &lt;code&gt;..&lt;/code&gt; part, so an agent writing to a session file can&amp;rsquo;t follow a link out of its history. An export that devvm didn&amp;rsquo;t write, such as a &lt;code&gt;.tar.gz&lt;/code&gt; you made yourself, can hold opencode&amp;rsquo;s database with its logins, so the import takes out the database&amp;rsquo;s &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt; and &lt;code&gt;-journal&lt;/code&gt; files and puts in a copy of the database without its logins or what opencode would act on without asking, as the export makes it (&lt;a href="#history-exports"&gt;history exports&lt;/a&gt;), or leaves the database out when the VM has no &lt;code&gt;sqlite3&lt;/code&gt;. It never writes opencode&amp;rsquo;s git repositories either. opencode in the new VM then reads the logins that devvm gave the VM, as it does when it first makes its database. When the VM already has an opencode database, it keeps its own, and opencode&amp;rsquo;s sessions from the export aren&amp;rsquo;t imported.&lt;/p&gt;</description></item><item><title>Links between VMs</title><link>https://next.devvm.dev/docs/using/links/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/links/</guid><description>
&lt;p&gt;A link lets a program in one of your VMs reach a TCP service in another by name, as in &lt;code&gt;postgres://db:5432/app&lt;/code&gt; or &lt;code&gt;fetch(&amp;quot;http://api:3000&amp;quot;)&lt;/code&gt;. The VM with the service is the target, and you publish its port in its folder. The VM that reaches it is the client, and you add the link in the client&amp;rsquo;s folder. Links work on every backend, whatever the two VMs&amp;rsquo; network tiers, as long as the target&amp;rsquo;s tier is the client&amp;rsquo;s or a stricter one. devvm carries each connection over ssh through this machine, so neither VM&amp;rsquo;s network changes, and &lt;a href="https://next.devvm.dev/docs/internals/ports/#links-between-vms"&gt;How it works › Links between VMs&lt;/a&gt; explains how.&lt;/p&gt;
&lt;p&gt;For a database in &lt;code&gt;~/code/db&lt;/code&gt; and an app in &lt;code&gt;~/code/app&lt;/code&gt;, both with VMs:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/db &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm link publish &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# offer the database&amp;#39;s port to links&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm link add db &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# programs in app&amp;#39;s VM reach it as db:5432&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Programs in the app&amp;rsquo;s VM then reach the database as &lt;code&gt;db:5432&lt;/code&gt; and as &lt;code&gt;db.devvm.internal:5432&lt;/code&gt;. A link joins the two VMs&amp;rsquo; trust, so add one only between VMs you&amp;rsquo;d trust with each other&amp;rsquo;s reach (&lt;a href="#a-link-joins-the-two-vms-trust"&gt;below&lt;/a&gt;). To link several VMs to each other at once, put them in a &lt;a href="#groups"&gt;group&lt;/a&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="publishing-a-port"&gt;Publishing a port&lt;span class="hx:absolute hx:-mt-20" id="publishing-a-port"&gt;&lt;/span&gt;
&lt;a href="#publishing-a-port" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Links reach only the ports a VM publishes, so you publish a port in the target&amp;rsquo;s folder before any VM can link to it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link publish &lt;span class="c1"&gt;# what this folder&amp;#39;s VM publishes: none, or a list&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link publish &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# offer port 5432 to links&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link publish 8000-8010 &lt;span class="c1"&gt;# offer a range&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link unpublish &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# stop offering it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm link publish&lt;/code&gt; takes ports and ranges as &lt;code&gt;devvm ports&lt;/code&gt; does, such as &lt;code&gt;5432,8000-8010&lt;/code&gt;, but not &lt;code&gt;all&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;. A port you publish is offered to links from any of your VMs, and each link is still made in its client&amp;rsquo;s folder with &lt;code&gt;devvm link add&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm link unpublish&lt;/code&gt; takes ports as &lt;code&gt;devvm link publish&lt;/code&gt; lists them, and it refuses a port that isn&amp;rsquo;t published. The server in the VM keeps running. When other VMs link to a port you take out, devvm names them, and their next connections to that port are refused, while connections that are open stay until they close. To remove those links, run &lt;code&gt;devvm link rm&lt;/code&gt; in their folders.&lt;/li&gt;
&lt;li&gt;A change applies at once, whether the VM is running or stopped.&lt;/li&gt;
&lt;li&gt;Publishing forwards nothing to this machine, and it doesn&amp;rsquo;t change &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;the ports the VM forwards&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A link connects to the target&amp;rsquo;s own &lt;code&gt;127.0.0.1&lt;/code&gt;, so the server in the target has to listen there or on all its addresses. A server that listens on &lt;code&gt;::1&lt;/code&gt; alone isn&amp;rsquo;t reached.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-a-link"&gt;Adding a link&lt;span class="hx:absolute hx:-mt-20" id="adding-a-link"&gt;&lt;/span&gt;
&lt;a href="#adding-a-link" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the client&amp;rsquo;s folder, &lt;code&gt;devvm link add TARGET PORT&lt;/code&gt; links its VM to PORT of the VM that TARGET names, once that VM publishes the port:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link add db &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# reach port 5432 of the VM for the folder db as db:5432&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link add db &lt;span class="m"&gt;5432&lt;/span&gt; --as pg &lt;span class="c1"&gt;# reach it as pg:5432 instead&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link add ../api &lt;span class="m"&gt;8080&lt;/span&gt; &lt;span class="c1"&gt;# name the target by its folder&amp;#39;s path&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link add devvm-api-71a99b1076d92c &lt;span class="m"&gt;8080&lt;/span&gt; &lt;span class="c1"&gt;# or by its VM&amp;#39;s name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;TARGET takes one of four forms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A folder&amp;rsquo;s name,&lt;/strong&gt; as VM names have it, such as &lt;code&gt;db&lt;/code&gt; for &lt;code&gt;devvm-db-71a99b1076d92c&lt;/code&gt;. devvm matches it against the folder that each VM was made for, so a VM whose backend needed a shorter name still matches its whole folder name. When more than one VM has a folder of that name, devvm refuses and lists each VM with its folder, so you can give the VM&amp;rsquo;s name or the folder&amp;rsquo;s path instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A folder&amp;rsquo;s path,&lt;/strong&gt; which starts with &lt;code&gt;.&lt;/code&gt; or holds a &lt;code&gt;/&lt;/code&gt;, such as &lt;code&gt;../api&lt;/code&gt; or &lt;code&gt;/Users/you/code/api&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s name,&lt;/strong&gt; as &lt;code&gt;devvm ls&lt;/code&gt; lists it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s ssh alias,&lt;/strong&gt; such as &lt;code&gt;devvm-db&lt;/code&gt;, as you&amp;rsquo;d give it to ssh (&lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;SSH access by name&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm refuses a target that has no VM, the client&amp;rsquo;s own VM, and a port that the target doesn&amp;rsquo;t publish. It also refuses a link that &lt;a href="#links-and-network-tiers"&gt;the two VMs&amp;rsquo; tiers&lt;/a&gt; don&amp;rsquo;t allow. When devvm makes the link, it says what the client reaches it as, and that the link joins the two VMs&amp;rsquo; trust.&lt;/p&gt;
&lt;h3 data-hextra-search-id="names"&gt;Names&lt;span class="hx:absolute hx:-mt-20" id="names"&gt;&lt;/span&gt;
&lt;a href="#names" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Programs in the client reach a link at &lt;code&gt;NAME:PORT&lt;/code&gt; and &lt;code&gt;NAME.devvm.internal:PORT&lt;/code&gt;. NAME is the target&amp;rsquo;s folder name, as VM names have it, unless you give &lt;code&gt;--as NAME&lt;/code&gt;. &lt;code&gt;.internal&lt;/code&gt; is reserved for private networks, so &lt;code&gt;NAME.devvm.internal&lt;/code&gt; never names a host on the internet, and it&amp;rsquo;s the name to use when the short one could clash with a name your network resolves.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A client has one name for each VM it links to. The first link to a target sets the name, and later links to that target take it too, so after &lt;code&gt;devvm link add db 5432 --as pg&lt;/code&gt;, &lt;code&gt;devvm link add db 8000&lt;/code&gt; reaches &lt;code&gt;pg:8000&lt;/code&gt;. To change the name, remove that target&amp;rsquo;s links and add them again.&lt;/li&gt;
&lt;li&gt;A name is one DNS label, made of lowercase letters, digits and dashes, which starts and ends with a letter or a digit and isn&amp;rsquo;t all digits. devvm refuses &lt;code&gt;localhost&lt;/code&gt;, the client&amp;rsquo;s own hostname and a name that another of the client&amp;rsquo;s links has. When the target&amp;rsquo;s folder name isn&amp;rsquo;t a valid name, or it&amp;rsquo;s taken, give another with &lt;code&gt;--as NAME&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A link is reached only by its names, never at the client&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, so &lt;code&gt;localhost:5432&lt;/code&gt; in the client stays the client&amp;rsquo;s own.&lt;/li&gt;
&lt;li&gt;A link&amp;rsquo;s name hides the same name from anywhere else in the client, such as a host &lt;code&gt;db&lt;/code&gt; under your network&amp;rsquo;s search domain.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="ports"&gt;Ports&lt;span class="hx:absolute hx:-mt-20" id="ports"&gt;&lt;/span&gt;
&lt;a href="#ports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The client reaches the target&amp;rsquo;s port on the same port number, so &lt;code&gt;devvm link add web 80&lt;/code&gt; gives &lt;code&gt;web:80&lt;/code&gt;, and ports below 1024 work like any other. Two targets can publish the same port, because the client reaches each one by its own name.&lt;/p&gt;
&lt;p&gt;Links carry TCP over IPv4 alone. Each name resolves to an IPv4 address, so a program that connects only over IPv6 doesn&amp;rsquo;t reach it, and UDP isn&amp;rsquo;t carried.&lt;/p&gt;
&lt;h3 data-hextra-search-id="which-vm-a-link-reaches"&gt;Which VM a link reaches&lt;span class="hx:absolute hx:-mt-20" id="which-vm-a-link-reaches"&gt;&lt;/span&gt;
&lt;a href="#which-vm-a-link-reaches" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A link stays with the VM it was made for, because devvm records the target VM&amp;rsquo;s identity with the link. A VM made again in the target&amp;rsquo;s folder after &lt;code&gt;devvm rm&lt;/code&gt;, or another VM with the same folder name that appears later, isn&amp;rsquo;t the linked target. &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; keep the target&amp;rsquo;s identity as they make the VM again, so its links still reach it (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-link-joins-the-two-vms-trust"&gt;A link joins the two VMs&amp;rsquo; trust&lt;span class="hx:absolute hx:-mt-20" id="a-link-joins-the-two-vms-trust"&gt;&lt;/span&gt;
&lt;a href="#a-link-joins-the-two-vms-trust" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Code in the client can often run code in the target through the target&amp;rsquo;s own service, such as Postgres&amp;rsquo;s &lt;code&gt;COPY … TO PROGRAM&lt;/code&gt;. It then has whatever the target has: its network, the secrets it may use and its project folder. devvm doesn&amp;rsquo;t stop that, because it&amp;rsquo;s what the service itself allows. So add a link only between VMs you&amp;rsquo;d trust with each other&amp;rsquo;s reach, and publish only the ports that you mean other VMs to use. &lt;a href="https://next.devvm.dev/docs/safety/network/#links-between-vms"&gt;Network tiers&lt;/a&gt; explains what this means for each tier.&lt;/p&gt;
&lt;h2 data-hextra-search-id="links-and-network-tiers"&gt;Links and network tiers&lt;span class="hx:absolute hx:-mt-20" id="links-and-network-tiers"&gt;&lt;/span&gt;
&lt;a href="#links-and-network-tiers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A client links only to a target on its own &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt; or a stricter one, because a link to a target on a lower tier would let the client reach more through the target. So an allowlist client links to allowlist and none targets, but not to internet or open ones, and an open client may link to any target. When devvm can&amp;rsquo;t read a client&amp;rsquo;s or a target&amp;rsquo;s tier, because that part of its state was changed by hand, it refuses the link rather than take it as open (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-file-devvm-cant-read"&gt;a file devvm can&amp;rsquo;t read&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm checks this rule when you add a link, at each launch of the client and on every connection (&lt;a href="https://next.devvm.dev/docs/internals/ports/#each-connection"&gt;each connection&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For a client on a confined tier, on every connection the target&amp;rsquo;s tier must also be in force as the target runs. If you move the target from open to a confined tier while it&amp;rsquo;s running, &lt;code&gt;devvm ls&lt;/code&gt; shows it as &lt;code&gt;unenforced&lt;/code&gt; until the target starts again behind its proxy, and devvm refuses the client&amp;rsquo;s connections to it until then, so start the target again with &lt;code&gt;devvm restart&lt;/code&gt; in its folder.&lt;/li&gt;
&lt;li&gt;devvm also warns you of such a target when you add a link to it, when you publish a port in its folder that the client links to, and each time the client starts. The warning names the target and refuses nothing, and devvm doesn&amp;rsquo;t warn of a stopped target, because its tier applies when it next starts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While such a link exists, devvm refuses to give the target a tier lower than a client&amp;rsquo;s, such as &lt;code&gt;devvm network open&lt;/code&gt; in its folder, and names the clients that link to it, and it refuses to give the client a tier higher than a target&amp;rsquo;s, such as &lt;code&gt;devvm network allowlist&lt;/code&gt; for a client that links to an open VM. Remove those links with &lt;code&gt;devvm link rm&lt;/code&gt; first, or give the target the client&amp;rsquo;s tier:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link rm db &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# in the client&amp;#39;s folder: remove the link to db&amp;#39;s port 5432&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm network allowlist &lt;span class="c1"&gt;# or, in the target&amp;#39;s folder, give the target an allowlist client&amp;#39;s tier&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Every VM has its proxy, so a program that uses the VM&amp;rsquo;s proxy settings, such as curl, sends its requests for a link to the VM&amp;rsquo;s proxy, and the proxy carries a request for one of the link&amp;rsquo;s names and its port, such as &lt;code&gt;db:5432&lt;/code&gt; or &lt;code&gt;db.devvm.internal:5432&lt;/code&gt;, to the link. Other programs reach the link by its name directly. The proxy passes a link&amp;rsquo;s connection on as it is, so it doesn&amp;rsquo;t look into it and puts none of your secrets into it.&lt;/p&gt;
&lt;p&gt;The network rules don&amp;rsquo;t apply to links. The allowlist doesn&amp;rsquo;t allow or block a link&amp;rsquo;s connections, and &lt;code&gt;devvm network deny db&lt;/code&gt; doesn&amp;rsquo;t stop the link &lt;code&gt;db&lt;/code&gt;. The rule above and the published ports decide which connections a link carries, and &lt;code&gt;devvm network log&lt;/code&gt; shows them (&lt;a href="#the-link-log"&gt;the link log&lt;/a&gt;). To stop a link, remove it with &lt;code&gt;devvm link rm&lt;/code&gt;, or unpublish its port in the target&amp;rsquo;s folder.&lt;/p&gt;
&lt;h2 data-hextra-search-id="listing-links"&gt;Listing links&lt;span class="hx:absolute hx:-mt-20" id="listing-links"&gt;&lt;/span&gt;
&lt;a href="#listing-links" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm link&lt;/code&gt; lists this folder&amp;rsquo;s VM&amp;rsquo;s links, with one row for each port:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NAME PORT TARGET FOLDER STATUS APPLIES
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;db 5432 devvm-db-71a99b1076d92c /Users/you/code/db Running yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;db 8000 devvm-db-71a99b1076d92c /Users/you/code/db Running unpublished&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;STATUS&lt;/code&gt; is the target&amp;rsquo;s status as its backend reports it, such as &lt;code&gt;Running&lt;/code&gt; or &lt;code&gt;Stopped&lt;/code&gt;, and it&amp;rsquo;s empty when devvm can&amp;rsquo;t tell. &lt;code&gt;APPLIES&lt;/code&gt; is &lt;code&gt;yes&lt;/code&gt; for a link that works while the target runs, or else it says why the link doesn&amp;rsquo;t apply:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;gone&lt;/code&gt;: the target VM no longer exists.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;replaced&lt;/code&gt;: the target&amp;rsquo;s folder has another VM, made again since the link was.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unpublished&lt;/code&gt;: the target doesn&amp;rsquo;t publish the port.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;policy&lt;/code&gt;: the target is on a lower network tier than the client.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ungrouped&lt;/code&gt;: a &lt;a href="#groups"&gt;group&lt;/a&gt; made the link, and the two VMs aren&amp;rsquo;t in that group together any more. You can remove such a link with &lt;code&gt;devvm link rm&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;devvm ls&lt;/code&gt; shows how many links each VM has, in its &lt;code&gt;LINKS&lt;/code&gt; column.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-link-json"&gt;devvm link &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-link-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-link-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm link --json&lt;/code&gt; prints the same list as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. Each of the &lt;code&gt;links&lt;/code&gt; has its &lt;code&gt;name&lt;/code&gt;, its &lt;code&gt;port&lt;/code&gt;, the &lt;code&gt;target&lt;/code&gt; VM, the target&amp;rsquo;s folder as &lt;code&gt;target_folder&lt;/code&gt; and its status as &lt;code&gt;target_status&lt;/code&gt;, both &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; when devvm doesn&amp;rsquo;t know them, &lt;code&gt;applies&lt;/code&gt;, which is &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;, and &lt;code&gt;reason&lt;/code&gt;, which is why the link doesn&amp;rsquo;t apply, as &lt;code&gt;APPLIES&lt;/code&gt; shows it, or &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; when it does.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;links&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;db&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5432&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;target&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm-db-71a99b1076d92c&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;target_folder&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/code/db&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;target_status&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Running&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;applies&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;reason&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="devvm-link-publish-json"&gt;devvm link publish &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-link-publish-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-link-publish-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm link publish --json&lt;/code&gt; prints what the VM publishes as one JSON object, and it only shows, so devvm refuses a list of ports with it. &lt;code&gt;ports&lt;/code&gt; is &lt;code&gt;none&lt;/code&gt; or a list of ports and ranges, written as &lt;code&gt;devvm link publish&lt;/code&gt; takes it.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;ports&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;5432,8000-8010&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="removing-a-link"&gt;Removing a link&lt;span class="hx:absolute hx:-mt-20" id="removing-a-link"&gt;&lt;/span&gt;
&lt;a href="#removing-a-link" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm link rm TARGET PORT&lt;/code&gt; removes one of this folder&amp;rsquo;s VM&amp;rsquo;s links, where TARGET is the link&amp;rsquo;s name or anything that &lt;code&gt;devvm link add&lt;/code&gt; takes:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link rm db &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# stop reaching db:5432&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm link rm pg &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="c1"&gt;# by the name given with --as&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On a running client, the link&amp;rsquo;s next connection is refused, and the connections that are open through it end within a few seconds, so a program in the client that keeps one open, such as a database client, sees it closed.&lt;/p&gt;
&lt;h2 data-hextra-search-id="when-links-change"&gt;When links change&lt;span class="hx:absolute hx:-mt-20" id="when-links-change"&gt;&lt;/span&gt;
&lt;a href="#when-links-change" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A change of links reaches a running client at once and a stopped one when it next starts, and devvm says which. On a running client, the names resolve at once, because devvm rewrites the client&amp;rsquo;s &lt;code&gt;/etc/hosts&lt;/code&gt;, and a link&amp;rsquo;s port answers within a few seconds. The VM&amp;rsquo;s proxy reaches a new link as soon as its port answers, so the programs that use the VM&amp;rsquo;s proxy settings also reach it, including those that were already running. Nothing in the VM restarts, and the VM&amp;rsquo;s environment doesn&amp;rsquo;t change, whatever its tier.&lt;/p&gt;
&lt;h2 data-hextra-search-id="when-a-target-stops-or-goes"&gt;When a target stops or goes&lt;span class="hx:absolute hx:-mt-20" id="when-a-target-stops-or-goes"&gt;&lt;/span&gt;
&lt;a href="#when-a-target-stops-or-goes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm never starts a VM for a link. A connection to a stopped target fails, and each launch of the client warns about each stopped target, until you start it with &lt;code&gt;devvm&lt;/code&gt; in its folder. The client&amp;rsquo;s links then work again without any change to the client. When the target stops, the connections that were open through it end. A link also needs both VMs&amp;rsquo; backends to carry links, which every backend of devvm&amp;rsquo;s does, and when one can&amp;rsquo;t, each launch of the client says so.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm rm&lt;/code&gt; of a target removes every link to it from your other VMs and names the clients that lost one. A VM that you make again in that folder isn&amp;rsquo;t linked, so publish its ports and add the links again.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm rm&lt;/code&gt; of a client removes its links, and &lt;code&gt;devvm stop&lt;/code&gt; of a client ends its links&amp;rsquo; connections.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A link can&amp;rsquo;t listen when a program in the client already holds its port in a way that covers the link&amp;rsquo;s address, such as a server of the client&amp;rsquo;s own on all its addresses with the same port. That link alone doesn&amp;rsquo;t work, devvm says so, and the client&amp;rsquo;s other links work. Stop that program, then run &lt;code&gt;devvm restart&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="groups"&gt;Groups&lt;span class="hx:absolute hx:-mt-20" id="groups"&gt;&lt;/span&gt;
&lt;a href="#groups" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A group is a set of your VMs that reach each other&amp;rsquo;s published ports by name, without a &lt;code&gt;devvm link add&lt;/code&gt; for each pair. You join each VM in its own folder, and devvm makes the links between them, so every VM in the group gets a link to each port that every other VM in it publishes. A VM is in one group at a time.&lt;/p&gt;
&lt;p&gt;For a database in &lt;code&gt;~/code/db&lt;/code&gt;, an API in &lt;code&gt;~/code/api&lt;/code&gt; and an app in &lt;code&gt;~/code/app&lt;/code&gt;, each with a VM:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/db &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm link publish &lt;span class="m"&gt;5432&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm group join web
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/api &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm link publish &lt;span class="m"&gt;8080&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm group join web
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code/app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm group join web&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Programs in the app&amp;rsquo;s VM then reach &lt;code&gt;db:5432&lt;/code&gt; and &lt;code&gt;api:8080&lt;/code&gt;, programs in the API&amp;rsquo;s VM reach &lt;code&gt;db:5432&lt;/code&gt;, and programs in the database&amp;rsquo;s VM reach &lt;code&gt;api:8080&lt;/code&gt;. The links a group makes are links like any other, so what this page says about names, ports, network tiers, the link log and stopped targets holds for them too, and &lt;code&gt;devvm link&lt;/code&gt; lists them.&lt;/p&gt;
&lt;h3 data-hextra-search-id="joining-a-group"&gt;Joining a group&lt;span class="hx:absolute hx:-mt-20" id="joining-a-group"&gt;&lt;/span&gt;
&lt;a href="#joining-a-group" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm group join NAME&lt;/code&gt; puts this folder&amp;rsquo;s VM in the group NAME. The first VM to join makes the group, and devvm says so. A group&amp;rsquo;s name is made of lowercase letters, digits and dashes, starts and ends with a letter or a digit, and isn&amp;rsquo;t all digits.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm group join web &lt;span class="c1"&gt;# join the group web&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm group join web --as api2 &lt;span class="c1"&gt;# join it as api2 instead of this folder&amp;#39;s name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm group &lt;span class="c1"&gt;# the group, its VMs and the ports each one publishes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm group leave &lt;span class="c1"&gt;# leave it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When the VM joins, devvm makes the group&amp;rsquo;s links in it and in each of the group&amp;rsquo;s other VMs, and it names the links that each VM gains. The links reach a running VM at once and a stopped one when it next starts, as &lt;a href="#when-links-change"&gt;When links change&lt;/a&gt; describes. devvm refuses a VM that&amp;rsquo;s in another group already, so run &lt;code&gt;devvm group leave&lt;/code&gt; first, and it refuses a VM whose backend can&amp;rsquo;t carry links. A VM made again in a folder isn&amp;rsquo;t in the group that the folder&amp;rsquo;s old VM was in.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm group&lt;/code&gt; shows the group this folder&amp;rsquo;s VM is in, with one row for each of its VMs:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NAME VM FOLDER PUBLISHED
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;api devvm-api-0f3c2a91b7d4e6 /Users/you/code/api 8080
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;app devvm-app-5e1d7c08a2b9f4 /Users/you/code/app none
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;db devvm-db-71a99b1076d92c /Users/you/code/db 5432&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;NAME&lt;/code&gt; is what the group&amp;rsquo;s other VMs reach that VM by, and &lt;code&gt;PUBLISHED&lt;/code&gt; is the ports it publishes, or &lt;code&gt;none&lt;/code&gt;. When this folder&amp;rsquo;s VM isn&amp;rsquo;t in a group, devvm says so.&lt;/p&gt;
&lt;h3 data-hextra-search-id="ports-in-a-group"&gt;Ports in a group&lt;span class="hx:absolute hx:-mt-20" id="ports-in-a-group"&gt;&lt;/span&gt;
&lt;a href="#ports-in-a-group" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The group&amp;rsquo;s links reach every port that a VM in it publishes, so you publish and unpublish ports in each VM&amp;rsquo;s folder, as &lt;a href="#publishing-a-port"&gt;Publishing a port&lt;/a&gt; describes. A port that you publish reaches the links of every other VM in the group, and a port that you take out goes from them, at once on a running VM and at its next start on a stopped one. devvm names the links that each VM gains or loses. A range that you publish gives a link for each port in it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="names-in-a-group"&gt;Names in a group&lt;span class="hx:absolute hx:-mt-20" id="names-in-a-group"&gt;&lt;/span&gt;
&lt;a href="#names-in-a-group" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The group&amp;rsquo;s other VMs reach a VM by its folder name, as VM names have it, unless it joined with &lt;code&gt;--as NAME&lt;/code&gt;. The name follows the rules for &lt;a href="#names"&gt;link names&lt;/a&gt;, and devvm refuses &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Two VMs in a group can&amp;rsquo;t have the same name, so when another VM in the group has the name this VM would join as, devvm refuses the join until you give this VM another with &lt;code&gt;--as NAME&lt;/code&gt;. devvm also refuses a name that&amp;rsquo;s another VM&amp;rsquo;s folder name, because that&amp;rsquo;s the other VM&amp;rsquo;s own hostname. To change a VM&amp;rsquo;s name in its group, leave the group, then join it again with &lt;code&gt;--as NAME&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A VM&amp;rsquo;s folder name is its own hostname, so devvm refuses to put a VM in a group where another VM&amp;rsquo;s name is this VM&amp;rsquo;s folder name, whatever &lt;code&gt;--as NAME&lt;/code&gt; you give, because the name would reach the joining VM itself. For two folders with the same name, such as &lt;code&gt;~/work/api&lt;/code&gt; and &lt;code&gt;~/old/api&lt;/code&gt;, have the VM that&amp;rsquo;s in the group leave it and join again with another name, such as &lt;code&gt;devvm group join web --as api1&lt;/code&gt;, then join the other with &lt;code&gt;--as api2&lt;/code&gt;. A VM whose folder has a name of its own needs neither.&lt;/li&gt;
&lt;li&gt;The links that you make with &lt;code&gt;devvm link add&lt;/code&gt; take precedence over the group&amp;rsquo;s. When you link to a VM in the group yourself, the group&amp;rsquo;s links to that VM take the name your link gives it, and a port that you linked gets no link from the group. When one of your links has the name of another VM in the group, the group&amp;rsquo;s links to that VM go, and devvm warns you of it, until you remove your link with &lt;code&gt;devvm link rm&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="a-group-joins-the-trust-of-all-its-vms"&gt;A group joins the trust of all its VMs&lt;span class="hx:absolute hx:-mt-20" id="a-group-joins-the-trust-of-all-its-vms"&gt;&lt;/span&gt;
&lt;a href="#a-group-joins-the-trust-of-all-its-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A group joins the trust of every VM in it, as &lt;a href="#a-link-joins-the-two-vms-trust"&gt;a link joins the two VMs&amp;rsquo; trust&lt;/a&gt;, because code in any of them can often run code in the others through the ports they publish. A VM that joins later gets the same reach into every VM in the group, and they get the same reach into it, so devvm says so on every join. Put VMs in a group only when you&amp;rsquo;d trust each of them with the others&amp;rsquo; reach.&lt;/p&gt;
&lt;h3 data-hextra-search-id="groups-and-network-tiers"&gt;Groups and network tiers&lt;span class="hx:absolute hx:-mt-20" id="groups-and-network-tiers"&gt;&lt;/span&gt;
&lt;a href="#groups-and-network-tiers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A group&amp;rsquo;s VMs are all on one tier. devvm refuses to put a VM in a group whose VMs are on another tier, and it names both tiers. It checks joins one at a time, so when two VMs join a group at once, the second is checked against the first, and a devvm that waits for another says so. While a VM is in a group, devvm refuses to change its tier with &lt;code&gt;devvm network&lt;/code&gt;, so run &lt;code&gt;devvm group leave&lt;/code&gt; first.&lt;/p&gt;
&lt;p&gt;Because every VM in a group is on one tier, the group&amp;rsquo;s links keep &lt;a href="#links-and-network-tiers"&gt;the rule&lt;/a&gt; that a client links only to a target on its tier or a stricter one. Each of their connections is still refused while the target&amp;rsquo;s tier isn&amp;rsquo;t in force as it runs, and devvm warns you of such a target when the group makes a link to it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="leaving-a-group"&gt;Leaving a group&lt;span class="hx:absolute hx:-mt-20" id="leaving-a-group"&gt;&lt;/span&gt;
&lt;a href="#leaving-a-group" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm group leave&lt;/code&gt; takes this folder&amp;rsquo;s VM out of its group. It removes the links that the group made, in this VM and in the group&amp;rsquo;s other VMs, and names the links that each VM loses. The links that you made with &lt;code&gt;devvm link add&lt;/code&gt; stay. &lt;code&gt;devvm link rm&lt;/code&gt; doesn&amp;rsquo;t remove a link that the group made, so leave the group, or unpublish the port in its target&amp;rsquo;s folder.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm rm&lt;/code&gt; of a VM takes it out of its group, and when the group&amp;rsquo;s last VM leaves, the group is gone.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-group-json"&gt;devvm group &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-group-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-group-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm group --json&lt;/code&gt; prints the group as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes. &lt;code&gt;group&lt;/code&gt; is the group&amp;rsquo;s name, or &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; when the VM is in none, and &lt;code&gt;members&lt;/code&gt; is &lt;code&gt;[]&lt;/code&gt; then. Each of the &lt;code&gt;members&lt;/code&gt; has its &lt;code&gt;name&lt;/code&gt; in the group, its &lt;code&gt;vm&lt;/code&gt;, its &lt;code&gt;folder&lt;/code&gt;, and the ports it publishes as &lt;code&gt;published&lt;/code&gt;, written as &lt;code&gt;devvm link publish&lt;/code&gt; lists them, or &lt;code&gt;none&lt;/code&gt;.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;group&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;web&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;members&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;db&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;vm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm-db-71a99b1076d92c&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;folder&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/code/db&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;published&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;5432&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="containers-in-the-vm"&gt;Containers in the VM&lt;span class="hx:absolute hx:-mt-20" id="containers-in-the-vm"&gt;&lt;/span&gt;
&lt;a href="#containers-in-the-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A container that the &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;docker layer&lt;/a&gt; runs in the client has a network of its own, so it neither resolves a link&amp;rsquo;s names nor reaches its address. Run it with &lt;code&gt;--network host&lt;/code&gt;, as in &lt;code&gt;docker run --network host IMAGE&lt;/code&gt;, so it shares the VM&amp;rsquo;s network and reaches the links as the VM does.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-link-log"&gt;The link log&lt;span class="hx:absolute hx:-mt-20" id="the-link-log"&gt;&lt;/span&gt;
&lt;a href="#the-link-log" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm network log&lt;/code&gt; in the client&amp;rsquo;s folder shows its links&amp;rsquo; connections, whatever its tier. A line has the time, &lt;code&gt;link&lt;/code&gt; for a connection devvm carried or &lt;code&gt;REFUSED&lt;/code&gt; for one it refused, the link&amp;rsquo;s name and port, and the target VM, with why devvm refused it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-11-01T10:00:00Z link db:5432 to devvm-db-71a99b1076d92c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2026-11-01T10:05:00Z REFUSED db:5432 to devvm-db-71a99b1076d92c: it isn&amp;#39;t running&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When the client is on a confined tier and the target&amp;rsquo;s isn&amp;rsquo;t in force yet, the line says &lt;code&gt;unenforced&lt;/code&gt;, as &lt;a href="#links-and-network-tiers"&gt;Links and network tiers&lt;/a&gt; describes.&lt;/p&gt;
&lt;p&gt;A client has at most 256 of its links&amp;rsquo; connections carried at once, and devvm refuses and logs the next one. &lt;a href="https://next.devvm.dev/docs/safety/network/#devvm-network-log---json"&gt;devvm network log &amp;ndash;json&lt;/a&gt; describes the events in JSON.&lt;/p&gt;</description></item><item><title>A VM's desktop</title><link>https://next.devvm.dev/docs/using/desktop/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/desktop/</guid><description>
&lt;p&gt;A VM has no screen of its own, but with the &lt;code&gt;desktop&lt;/code&gt; layer it gets an Xfce desktop, which &lt;code&gt;devvm desktop&lt;/code&gt; opens in a window on this machine. This page covers adding the desktop, opening it, its password and the clipboard, and what it costs. &lt;a href="https://next.devvm.dev/docs/internals/desktop/"&gt;The desktop&lt;/a&gt; explains how devvm keeps it to this machine.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-the-desktop"&gt;Adding the desktop&lt;span class="hx:absolute hx:-mt-20" id="adding-the-desktop"&gt;&lt;/span&gt;
&lt;a href="#adding-the-desktop" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The desktop is one of devvm&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/images/#built-in-layers"&gt;built-in layers&lt;/a&gt;, so only the VMs you choose it for get it, and &lt;code&gt;base&lt;/code&gt; and the other VMs stay without it. To add it to a new VM, check &lt;code&gt;desktop&lt;/code&gt; under Layers in the list devvm shows when you customize a new VM, or name it with &lt;code&gt;--layers&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --layers desktop &lt;span class="c1"&gt;# a VM of base with the desktop&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --layers docker,desktop &lt;span class="c1"&gt;# the desktop on top of the docker layer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm builds the &lt;code&gt;desktop&lt;/code&gt; image the first time a VM needs it, and VMs that choose it share that image. &lt;code&gt;--layers&lt;/code&gt; is the exact list of the VM&amp;rsquo;s layers, so name every layer you want the VM to have.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --layers desktop &lt;span class="c1"&gt;# every new VM gets the desktop&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm setup --layers docker,desktop &lt;span class="c1"&gt;# the desktop on top of docker, for every new VM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To give every new VM the desktop, choose it with &lt;code&gt;devvm setup --layers desktop&lt;/code&gt;, or add it to the layers you already chose, such as &lt;code&gt;devvm setup --layers docker,desktop&lt;/code&gt;. New VMs then get it unless you leave it out when you customize them or give &lt;code&gt;--layers&lt;/code&gt; without it (&lt;a href="https://next.devvm.dev/docs/using/settings/#layers-for-new-vms"&gt;layers for new VMs&lt;/a&gt;). VMs that exist keep the layers they were made with.&lt;/p&gt;
&lt;p&gt;A VM made without the desktop has none, and &lt;code&gt;devvm desktop&lt;/code&gt; says so. To give it one, run &lt;code&gt;devvm layer add desktop&lt;/code&gt;, which makes the VM again from an image with the desktop on top of its own layers, such as &lt;code&gt;docker+desktop&lt;/code&gt;. The VM keeps its home folder, the project folder and its settings, and loses the rest of its disk, such as the packages you installed, so devvm asks first (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;adding layers to a VM&lt;/a&gt;). &lt;code&gt;devvm layer rm desktop&lt;/code&gt; takes the desktop out again in the same way (&lt;a href="https://next.devvm.dev/docs/using/images/#taking-layers-out-of-a-vm"&gt;taking layers out of a VM&lt;/a&gt;).&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer add desktop &lt;span class="c1"&gt;# make this folder&amp;#39;s VM again with the desktop, after asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm layer rm desktop &lt;span class="c1"&gt;# make it again without the desktop&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The desktop works on base, and on a base made &lt;code&gt;--from&lt;/code&gt; a Debian, Ubuntu or Alpine container image.&lt;/p&gt;
&lt;h2 data-hextra-search-id="opening-it"&gt;Opening it&lt;span class="hx:absolute hx:-mt-20" id="opening-it"&gt;&lt;/span&gt;
&lt;a href="#opening-it" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm desktop &lt;span class="c1"&gt;# serves this folder&amp;#39;s VM&amp;#39;s desktop and opens it in Screen Sharing&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm desktop --no-open &lt;span class="c1"&gt;# only shows its address and password&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm desktop --clipboard &lt;span class="c1"&gt;# shares the clipboard both ways, for this run&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm desktop&lt;/code&gt; gets the VM ready as &lt;code&gt;devvm host&lt;/code&gt; does, and starts it if it&amp;rsquo;s stopped. Then it starts the VM&amp;rsquo;s desktop, unless it&amp;rsquo;s running already, and shows its address and password:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm-website-0123456789abcd&amp;#39;s desktop is at
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;vnc://127.0.0.1:41234
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password: k3mxq7tw
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;It stays there until you press Ctrl+C.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On macOS, devvm opens the address in Screen Sharing, which comes with macOS and asks for the password. Screen Sharing can keep the password in your keychain, and the address stays the same each time. On Linux, open the address in a VNC viewer of your own, such as TigerVNC&amp;rsquo;s &lt;code&gt;vncviewer&lt;/code&gt; or Remmina.&lt;/p&gt;
&lt;p&gt;The desktop stays at that address until you press Ctrl+C, or until the VM stops, and then &lt;code&gt;devvm desktop&lt;/code&gt; ends. The desktop goes on running in the VM, so the windows you left open are there the next time you run &lt;code&gt;devvm desktop&lt;/code&gt;. It&amp;rsquo;s 1600 by 1000 pixels.&lt;/p&gt;
&lt;p&gt;The desktop is only ever on this machine, and only while &lt;code&gt;devvm desktop&lt;/code&gt; runs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;devvm serves it on this machine&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; alone, so nothing else on your network reaches it. Each VM keeps its port, which no other VM and no program on this machine has. When a program has taken it, devvm chooses another one and keeps that.&lt;/li&gt;
&lt;li&gt;In the VM, the desktop listens on no port at all, so a VM that &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;forwards every port&lt;/a&gt; never forwards it.&lt;/li&gt;
&lt;li&gt;On a confined &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt;, the VM still reaches only its proxy while you use its desktop.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="browsers"&gt;Browsers&lt;span class="hx:absolute hx:-mt-20" id="browsers"&gt;&lt;/span&gt;
&lt;a href="#browsers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The desktop has no browser of its own, so install the one you want in the VM, such as Google Chrome, Chromium or Firefox. Browsers reach the web through the VM&amp;rsquo;s proxy without asking you for a password, and so do the desktop&amp;rsquo;s other programs. Browsers ask for a proxy&amp;rsquo;s password rather than read it from the VM&amp;rsquo;s proxy settings, so the desktop&amp;rsquo;s programs use the VM&amp;rsquo;s local proxy instead. The local proxy is a small proxy in the VM, at &lt;code&gt;http://127.0.77.1:3128&lt;/code&gt;, which adds the VM&amp;rsquo;s password to each request and sends it on to the VM&amp;rsquo;s proxy. A browser follows the desktop&amp;rsquo;s proxy settings unless you&amp;rsquo;ve given it one of its own. The local proxy listens on the VM&amp;rsquo;s loopback alone, and devvm never forwards it to this machine, even on a VM that &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;forwards every port&lt;/a&gt; (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#the-local-proxy"&gt;the local proxy&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The local proxy changes nothing about what the VM may reach. A host that the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;network tier&lt;/a&gt; doesn&amp;rsquo;t allow is still blocked, and a plain &lt;code&gt;http://&lt;/code&gt; page shows the proxy&amp;rsquo;s reason and the &lt;code&gt;devvm network allow&lt;/code&gt; command that allows it. An &lt;code&gt;https://&lt;/code&gt; page shows the browser&amp;rsquo;s own error instead, such as Chrome&amp;rsquo;s &lt;code&gt;ERR_TUNNEL_CONNECTION_FAILED&lt;/code&gt;, so run &lt;code&gt;devvm-why&lt;/code&gt; in the desktop&amp;rsquo;s terminal to see what was blocked.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-password"&gt;The password&lt;span class="hx:absolute hx:-mt-20" id="the-password"&gt;&lt;/span&gt;
&lt;a href="#the-password" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each VM has its own password of eight lowercase letters and digits. devvm makes it the first time you run &lt;code&gt;devvm desktop&lt;/code&gt; and keeps it with the VM&amp;rsquo;s state on this machine, so &lt;code&gt;devvm rm&lt;/code&gt; deletes it. The password never goes into the VM, and it isn&amp;rsquo;t in devvm&amp;rsquo;s run log. devvm checks it on this machine before a viewer reaches the VM, whatever the VM&amp;rsquo;s own desktop asks for. Other users and programs on this machine can also connect to &lt;code&gt;127.0.0.1&lt;/code&gt;, so the password is what keeps them out, and devvm lets a viewer try only one password a second (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#on-this-machine"&gt;on this machine&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-clipboard"&gt;The clipboard&lt;span class="hx:absolute hx:-mt-20" id="the-clipboard"&gt;&lt;/span&gt;
&lt;a href="#the-clipboard" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm desktop --clipboard &lt;span class="c1"&gt;# share the clipboard both ways, for this run&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm desktop &lt;span class="c1"&gt;# the next run without it shares nothing&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The clipboard isn&amp;rsquo;t shared unless you add &lt;code&gt;--clipboard&lt;/code&gt;. With sharing on, what you copy on this machine goes into the VM, where a coding agent can read it, and what the VM copies lands on this machine&amp;rsquo;s clipboard. Without &lt;code&gt;--clipboard&lt;/code&gt;, devvm keeps this machine&amp;rsquo;s clipboard out of the VM, even when something in the VM has changed its desktop&amp;rsquo;s settings, and the VM&amp;rsquo;s desktop doesn&amp;rsquo;t send its clipboard.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--clipboard&lt;/code&gt; turns sharing on in both directions for that run, and the next run without it turns sharing off again. devvm can&amp;rsquo;t stop a VM whose desktop was changed from sending its clipboard to Screen Sharing, so when you don&amp;rsquo;t want the VM&amp;rsquo;s clipboard on this machine, also turn off Use Shared Clipboard in Screen Sharing&amp;rsquo;s Edit menu.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-it-costs"&gt;What it costs&lt;span class="hx:absolute hx:-mt-20" id="what-it-costs"&gt;&lt;/span&gt;
&lt;a href="#what-it-costs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;About 370 MB of disk for the &lt;code&gt;desktop&lt;/code&gt; image, which every VM with the layer shares, while &lt;code&gt;base&lt;/code&gt; and the VMs without the layer stay that much smaller.&lt;/li&gt;
&lt;li&gt;About 500 MB of the VM&amp;rsquo;s memory while its desktop runs, which it does from your first &lt;code&gt;devvm desktop&lt;/code&gt; until the VM stops. A VM whose desktop you never open uses none.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="when-the-desktop-doesnt-open"&gt;When the desktop doesn&amp;rsquo;t open&lt;span class="hx:absolute hx:-mt-20" id="when-the-desktop-doesnt-open"&gt;&lt;/span&gt;
&lt;a href="#when-the-desktop-doesnt-open" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The VM has no desktop:&lt;/strong&gt; it was made without the &lt;code&gt;desktop&lt;/code&gt; layer. Run &lt;code&gt;devvm layer add desktop&lt;/code&gt; to make it again with the layer, as &lt;a href="#adding-the-desktop"&gt;adding the desktop&lt;/a&gt; explains.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The desktop didn&amp;rsquo;t start:&lt;/strong&gt; devvm shows the end of its run log. The desktop&amp;rsquo;s own log is &lt;code&gt;~/.cache/devvm-desktop.log&lt;/code&gt; in the VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Screen Sharing didn&amp;rsquo;t open:&lt;/strong&gt; open the address devvm shows in Screen Sharing yourself, by typing it into Finder&amp;rsquo;s Go &amp;gt; Connect to Server, or in another VNC viewer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Screen Sharing says the password is wrong:&lt;/strong&gt; use the password &lt;code&gt;devvm desktop&lt;/code&gt; shows for this VM. Each VM has its own.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Starting from a container image</title><link>https://next.devvm.dev/docs/using/from/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/from/</guid><description>
&lt;p&gt;By default &lt;code&gt;base&lt;/code&gt; starts from Ubuntu 26.04&amp;rsquo;s cloud image. &lt;code&gt;--from IMAGE&lt;/code&gt; starts it from a Debian-, Ubuntu- or Alpine-based container image instead, such as &lt;code&gt;node:24&lt;/code&gt;, &lt;code&gt;python:3.13&lt;/code&gt;, &lt;code&gt;debian:13&lt;/code&gt;, &lt;code&gt;alpine:3&lt;/code&gt; or an image you built yourself. Use it when your project needs a distribution or a system package set that Ubuntu doesn&amp;rsquo;t give you.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm --from node:24 &lt;span class="c1"&gt;# a new VM whose base is node:24&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm build --from alpine:3 base &lt;span class="c1"&gt;# just the image&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;DEVVM_FROM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;node:24 devvm &lt;span class="c1"&gt;# a default for every new VM and build&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Everything above &lt;code&gt;base&lt;/code&gt; builds and runs as usual, including base&amp;rsquo;s own setup and the layers (&lt;code&gt;docker&lt;/code&gt; and yours). The VM gets its &lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;shared tools&lt;/a&gt; as any VM does, and &lt;a href="#shared-tools-and-glibc"&gt;shared tools and glibc&lt;/a&gt; describes where devvm builds them. devvm keeps the images from each container image apart, so each &lt;code&gt;base&lt;/code&gt; and the images on it sit side by side with the others, and each image&amp;rsquo;s record keeps the container image its base came from and that image&amp;rsquo;s digest.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--from&lt;/code&gt; applies to new VMs and to &lt;code&gt;devvm build&lt;/code&gt; and &lt;code&gt;devvm rebuild&lt;/code&gt;, and &lt;code&gt;devvm images rm&lt;/code&gt; takes it to delete an image on a base from that container image. An existing VM keeps what it was made from, and &lt;code&gt;devvm tools add&lt;/code&gt; and &lt;code&gt;devvm tools update&lt;/code&gt; build its shared tools for that &lt;code&gt;base&lt;/code&gt;. devvm ignores another &lt;code&gt;--from&lt;/code&gt; for an existing VM, with a warning. &lt;a href="https://next.devvm.dev/docs/internals/images/#how-its-converted"&gt;Images and caching&lt;/a&gt; explains how devvm turns a container image into a VM&amp;rsquo;s disk and how it treats the image&amp;rsquo;s code as untrusted.&lt;/p&gt;
&lt;h2 data-hextra-search-id="tags-and-digests"&gt;Tags and digests&lt;span class="hx:absolute hx:-mt-20" id="tags-and-digests"&gt;&lt;/span&gt;
&lt;a href="#tags-and-digests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm builds &lt;code&gt;base&lt;/code&gt; from the exact image that a tag names when it builds, which is the image&amp;rsquo;s digest, and it records that digest:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When the tag moves to a new image, such as a new &lt;code&gt;node:24&lt;/code&gt;, the next build makes a new &lt;code&gt;base&lt;/code&gt;. That build happens for a new VM with &lt;code&gt;--from&lt;/code&gt;, &lt;code&gt;devvm build&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt;, &lt;code&gt;devvm layer add&lt;/code&gt; or &lt;code&gt;devvm update&lt;/code&gt;. The old &lt;code&gt;base&lt;/code&gt; is then stale, and the VMs made from it are outdated, which &lt;code&gt;devvm update&lt;/code&gt; changes (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Offline, or when the registry doesn&amp;rsquo;t have the image any more, devvm uses the digest it recorded last, with a warning. With none recorded, it fails.&lt;/li&gt;
&lt;li&gt;Opening an existing VM never looks anything up, because only builds do.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--from node:24@sha256:&amp;lt;digest&amp;gt;&lt;/code&gt; pins an exact image, and devvm never looks it up.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm reads a reference the way Docker does, so &lt;code&gt;node:24&lt;/code&gt; is Docker Hub&amp;rsquo;s &lt;code&gt;library/node&lt;/code&gt; with the tag &lt;code&gt;24&lt;/code&gt;. A first part with a dot or a port, or &lt;code&gt;localhost&lt;/code&gt;, names the registry, as in &lt;code&gt;ghcr.io/org/image:tag&lt;/code&gt; or &lt;code&gt;localhost:5000/app&lt;/code&gt;. A reference without a tag means &lt;code&gt;latest&lt;/code&gt;. &lt;a href="https://next.devvm.dev/docs/internals/images/#digests"&gt;Digests&lt;/a&gt; explains how devvm asks a registry for them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="images-only-docker-has"&gt;Images only Docker has&lt;span class="hx:absolute hx:-mt-20" id="images-only-docker-has"&gt;&lt;/span&gt;
&lt;a href="#images-only-docker-has" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Public images work from any registry, such as Docker Hub, ghcr.io or quay.io. When a registry doesn&amp;rsquo;t give devvm the image, devvm takes it from Docker, as long as Docker runs and has it. That covers an image you built and never pushed, and a private one, which you get with &lt;code&gt;docker login&lt;/code&gt; and then &lt;code&gt;docker pull&lt;/code&gt;. devvm itself never logs in to a registry, and it never pulls, builds or deletes Docker&amp;rsquo;s images.&lt;/p&gt;
&lt;p&gt;If the image&amp;rsquo;s tag moves to another image while devvm builds, for example because you rebuilt it, devvm stops and asks you to run it again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="supported-images"&gt;Supported images&lt;span class="hx:absolute hx:-mt-20" id="supported-images"&gt;&lt;/span&gt;
&lt;a href="#supported-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Debian, Ubuntu and Alpine&lt;/strong&gt; and the distributions based on them. devvm refuses any other, and an image without a shell or &lt;code&gt;/etc/os-release&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;This machine&amp;rsquo;s architecture.&lt;/strong&gt; devvm refuses an image without an arm64 build (or amd64), and names the ones it has.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alpine&lt;/strong&gt; uses OpenRC and musl, so its VMs get musl builds of the shared tools, built on that image and kept apart for it. Its base also gets GNU &lt;code&gt;tar&lt;/code&gt; from Alpine&amp;rsquo;s packages in place of busybox&amp;rsquo;s, because devvm sends the VM&amp;rsquo;s setup and &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#importing-history"&gt;imports agents&amp;rsquo; history&lt;/a&gt; with it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unpinned packages.&lt;/strong&gt; While &lt;code&gt;base&lt;/code&gt; builds, its packages come from the container image&amp;rsquo;s own sources as they are then, apt&amp;rsquo;s or Alpine&amp;rsquo;s, and so do the &lt;a href="https://next.devvm.dev/docs/using/images/#desktop"&gt;desktop layer&lt;/a&gt;&amp;rsquo;s, the &lt;a href="https://next.devvm.dev/docs/using/images/#docker"&gt;docker layer&lt;/a&gt;&amp;rsquo;s on Alpine and the &lt;a href="https://next.devvm.dev/docs/using/images/#nix"&gt;nix layer&lt;/a&gt;&amp;rsquo;s. devvm keeps no copy of them, unlike base from Ubuntu&amp;rsquo;s image, so building the same base again installs the sources&amp;rsquo; packages of that day, and it needs the network for them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A glibc new enough for your shared tools.&lt;/strong&gt; A Debian- or Ubuntu-based container image&amp;rsquo;s glibc must be at least as new as each shared tool needs, which &lt;a href="#shared-tools-and-glibc"&gt;shared tools and glibc&lt;/a&gt; covers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tested.&lt;/strong&gt; The end-to-end tests make VMs from &lt;code&gt;node:24&lt;/code&gt; (Debian 12, with node, python, claude and the docker and nix layers) and &lt;code&gt;alpine:3&lt;/code&gt; (with node, dotnet and the docker, nix and desktop layers), and build &lt;code&gt;base&lt;/code&gt; from &lt;code&gt;ubuntu:26.04&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="shared-tools-and-glibc"&gt;Shared tools and glibc&lt;span class="hx:absolute hx:-mt-20" id="shared-tools-and-glibc"&gt;&lt;/span&gt;
&lt;a href="#shared-tools-and-glibc" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A shared tool&amp;rsquo;s build is mounted by every VM that gets the same version of the tool, so devvm never builds one where a container image&amp;rsquo;s code could change it for other VMs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;On a Debian- or Ubuntu-based container image,&lt;/strong&gt; VMs get the same builds of the shared tools as VMs on Ubuntu&amp;rsquo;s own image, which devvm builds in its own &lt;code&gt;base&lt;/code&gt; from Ubuntu&amp;rsquo;s cloud image, never in the container image. When that &lt;code&gt;base&lt;/code&gt; isn&amp;rsquo;t built yet, devvm says so and builds it first, as it does for a VM on Ubuntu&amp;rsquo;s image.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On an Alpine-based container image,&lt;/strong&gt; musl builds need Alpine, so devvm builds them in the VM&amp;rsquo;s own &lt;code&gt;base&lt;/code&gt; and keeps them for the VMs on that exact container image, by its digest. When the container image&amp;rsquo;s tag moves to a new container image, devvm builds the tools it gives those VMs next again, on the new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;shared tools&lt;/a&gt; are their projects&amp;rsquo; own prebuilt releases, and each one is built against a glibc version that it needs at least. devvm reads that version from each tool&amp;rsquo;s files when it builds the tool&amp;rsquo;s image, and it reads the container image&amp;rsquo;s glibc version when it converts the image (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;). When a Debian- or Ubuntu-based image has an older glibc than a tool needs, devvm refuses to give that tool to the VM. The error names the tool, the glibc version it needs and the one the image has, and devvm doesn&amp;rsquo;t make the VM. The same happens when &lt;code&gt;devvm tools add&lt;/code&gt;, &lt;code&gt;devvm tools update&lt;/code&gt; or &lt;code&gt;devvm update&lt;/code&gt; would give an existing VM such a tool.&lt;/p&gt;
&lt;p&gt;To fix it, start from a newer container image with &lt;code&gt;--from&lt;/code&gt;, or leave that tool out. Today no shared tool needs a glibc newer than 2.28, so Debian 10 and Ubuntu 20.04 and newer images run all of them, and &lt;a href="https://next.devvm.dev/docs/using/toolchains/#which-bases-they-run-on"&gt;toolchains&lt;/a&gt; lists what each one needs. devvm measures it again for every new version it builds. Alpine-based images get musl builds of the tools, which need no glibc. pi is the one shared tool without a musl build, because its project releases it for glibc alone, so devvm refuses to give pi to a VM on an Alpine-based image, before it builds anything, and the error names pi. Leave pi out of that VM, or start from a Debian- or Ubuntu-based image. devvm doesn&amp;rsquo;t check base from Ubuntu&amp;rsquo;s own image, whose glibc is newer than any shared tool needs.&lt;/p&gt;
&lt;h2 data-hextra-search-id="backends"&gt;Backends&lt;span class="hx:absolute hx:-mt-20" id="backends"&gt;&lt;/span&gt;
&lt;a href="#backends" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Lima starts &lt;code&gt;base&lt;/code&gt; from a container image by converting the image into a disk (&lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;backends&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>What devvm keeps on this machine</title><link>https://next.devvm.dev/docs/using/space/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/space/</guid><description>
&lt;p&gt;devvm, the tools it runs and Lima keep files on this machine outside your project folders. This page lists each of them: what it is, who makes it, where it is, whether devvm can make it again, and how it&amp;rsquo;s cleaned up. Most of it is in devvm&amp;rsquo;s data folder, &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, and devvm can make all of that again except your exports and what your commands saved, such as your agents&amp;rsquo; logins and your secrets. Lima&amp;rsquo;s own caches hold more, and they can also hold your own downloads.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-space"&gt;devvm space&lt;span class="hx:absolute hx:-mt-20" id="devvm-space"&gt;&lt;/span&gt;
&lt;a href="#devvm-space" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm space&lt;/code&gt; shows what devvm keeps on this machine and how much disk each kind of thing takes. It changes nothing and starts no VM, and it gives Lima 30 seconds to answer. &lt;code&gt;devvm space --json&lt;/code&gt; prints the same as JSON, for scripts (&lt;a href="#devvm-space---json"&gt;devvm space &amp;ndash;json&lt;/a&gt;). The first table has a row for each kind of thing devvm has, followed by a total:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WHAT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;VMs&lt;/code&gt;, &lt;code&gt;images&lt;/code&gt;, &lt;code&gt;tools gnu&lt;/code&gt; or &lt;code&gt;tools musl&lt;/code&gt; for the shared tools&amp;rsquo; builds for each C library, &lt;code&gt;history&lt;/code&gt; for the exports of agents&amp;rsquo; history, &lt;code&gt;network logs&lt;/code&gt; for the VMs&amp;rsquo; logs and the daily tools check&amp;rsquo;s log, &lt;code&gt;run logs&lt;/code&gt;, &lt;code&gt;mise&lt;/code&gt;, &lt;code&gt;packages&lt;/code&gt; for the copies of &lt;a href="https://next.devvm.dev/docs/using/images/#base"&gt;base&amp;rsquo;s packages&lt;/a&gt;, &lt;code&gt;cloud images&lt;/code&gt; for devvm&amp;rsquo;s copies of &lt;a href="#ubuntus-cloud-images"&gt;Ubuntu&amp;rsquo;s cloud images&lt;/a&gt;, &lt;code&gt;Nix cache&lt;/code&gt; for the &lt;a href="https://next.devvm.dev/docs/using/toolchains/#nix-projects"&gt;shared Nix cache&lt;/a&gt;, &lt;code&gt;leftover state&lt;/code&gt; for the whole folder of each VM that &lt;code&gt;devvm gc --orphans&lt;/code&gt; would forget, and &lt;code&gt;state&lt;/code&gt; for the rest of devvm&amp;rsquo;s data folder, which includes the rest of the VMs&amp;rsquo; folders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;COUNT&lt;/code&gt;, &lt;code&gt;SIZE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;how many there are and the disk they take, in powers of 1024 (&lt;code&gt;2.1G&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;KEPT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;remade&lt;/code&gt; when devvm makes it again when it&amp;rsquo;s needed, &lt;code&gt;only copy&lt;/code&gt; for VMs and exports, which nothing else has, &lt;code&gt;log&lt;/code&gt; for logs, &lt;code&gt;state&lt;/code&gt; for what devvm knows of its VMs and images and for the cloud images, as a release that Ubuntu removed can&amp;rsquo;t be downloaded again, and &lt;code&gt;leftover&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what &lt;code&gt;devvm gc&lt;/code&gt; frees of it now, which for the Nix cache is what it takes beyond its cap&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FREED BY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what frees the rest, such as &lt;code&gt;devvm rm&lt;/code&gt;, &lt;code&gt;images rm&lt;/code&gt;, which deletes images that are current, &lt;code&gt;gc --caches&lt;/code&gt; or &lt;code&gt;gc --nix-cache&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RETAIN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention setting&lt;/a&gt; that applies to the row when it&amp;rsquo;s on, such as &lt;code&gt;30d&lt;/code&gt;, with what it would delete now in brackets, and &lt;code&gt;-&lt;/code&gt; when none is on&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Sizes count each file&amp;rsquo;s blocks once, as &lt;code&gt;du&lt;/code&gt; does. On macOS a Lima VM&amp;rsquo;s disk shares its image&amp;rsquo;s blocks until the VM writes them, so those blocks count for both the VM and its image, and the total can be more than the disk they take. When Lima doesn&amp;rsquo;t answer while one of your VMs uses it, devvm says so, and its VMs and images aren&amp;rsquo;t counted.&lt;/p&gt;
&lt;h3 data-hextra-search-id="limas-caches"&gt;Lima&amp;rsquo;s caches&lt;span class="hx:absolute hx:-mt-20" id="limas-caches"&gt;&lt;/span&gt;
&lt;a href="#limas-caches" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The second table lists the caches that belong to Lima, with what each cache holds, how many entries it has, its size and where it is. That&amp;rsquo;s Lima&amp;rsquo;s download cache, which can hold your own downloads and the cloud images that earlier releases of devvm had Lima download, so it isn&amp;rsquo;t in the total. The &lt;a href="#lima"&gt;Lima&lt;/a&gt; section below says what it holds.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --caches &lt;span class="c1"&gt;# gc as usual, then free the cloud images nothing needs, after asking&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --caches --force &lt;span class="c1"&gt;# the same without asking, as a script must&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm never prunes these on its own. &lt;code&gt;devvm gc --caches&lt;/code&gt; cleans up as &lt;code&gt;devvm gc&lt;/code&gt; does, then frees devvm&amp;rsquo;s copies of &lt;a href="#ubuntus-cloud-images"&gt;Ubuntu&amp;rsquo;s cloud images&lt;/a&gt; and devvm&amp;rsquo;s share of Lima&amp;rsquo;s caches that nothing of devvm&amp;rsquo;s needs. It lists the entries it would delete with their sizes and asks. Without a terminal it refuses unless you give &lt;code&gt;--force&lt;/code&gt;, which frees them without asking.&lt;/p&gt;
&lt;h3 data-hextra-search-id="devvm-space-json"&gt;devvm space &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-space-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-space-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm space --json&lt;/code&gt; prints both tables as one JSON object, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes, and devvm still says on stderr what it says without &lt;code&gt;--json&lt;/code&gt;. &lt;code&gt;devvm&lt;/code&gt; has a row of the first table each, with sizes in bytes:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;what&lt;/code&gt;, &lt;code&gt;count&lt;/code&gt;, &lt;code&gt;size&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the row&amp;rsquo;s &lt;code&gt;WHAT&lt;/code&gt;, &lt;code&gt;COUNT&lt;/code&gt; and &lt;code&gt;SIZE&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the backend that has them, &lt;code&gt;lima&lt;/code&gt;, for VMs, images and shared tools, left out for the other rows and for a shared tool&amp;rsquo;s build when devvm can&amp;rsquo;t tell which backend it&amp;rsquo;s for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sized&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether devvm knows the size, which &lt;code&gt;SIZE&lt;/code&gt; shows as &lt;code&gt;-&lt;/code&gt; when it doesn&amp;rsquo;t&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kept&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the row&amp;rsquo;s &lt;code&gt;KEPT&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what &lt;code&gt;devvm gc&lt;/code&gt; frees of it now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the row&amp;rsquo;s &lt;code&gt;FREED BY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;retain&lt;/code&gt;, &lt;code&gt;retain_frees&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the retention setting that applies to the row and what it would delete now, both left out when none is on&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;total&lt;/code&gt; and &lt;code&gt;gc&lt;/code&gt; are the totals row&amp;rsquo;s &lt;code&gt;SIZE&lt;/code&gt; and &lt;code&gt;GC&lt;/code&gt;. &lt;code&gt;backends&lt;/code&gt; has the second table&amp;rsquo;s rows, each with its &lt;code&gt;backend&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;path&lt;/code&gt;, &lt;code&gt;count&lt;/code&gt;, &lt;code&gt;size&lt;/code&gt; and &lt;code&gt;sized&lt;/code&gt;. &lt;code&gt;unknown&lt;/code&gt; names the backends that one of your VMs uses that didn&amp;rsquo;t answer, and &lt;code&gt;strays&lt;/code&gt; has the &lt;a href="#vms-devvm-has-no-state-for"&gt;VMs devvm has no state for&lt;/a&gt;, each with its &lt;code&gt;backend&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt; and the &lt;code&gt;data&lt;/code&gt; folder its label names. &lt;code&gt;folder_gone&lt;/code&gt; has the &lt;a href="#vms-whose-folder-is-gone"&gt;VMs whose folder is gone&lt;/a&gt;, each with its &lt;code&gt;backend&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;folder&lt;/code&gt;, and &lt;code&gt;folder_not_connected&lt;/code&gt; has those whose folder is on a disk that isn&amp;rsquo;t connected, with the same fields. devvm leaves these out when they&amp;rsquo;re empty.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;devvm&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;what&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;VMs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5368709120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sized&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;kept&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;only copy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;gc&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rest&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvm rm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;what&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;history&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3145728&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sized&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;kept&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;only copy&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;gc&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;rest&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;gc --history&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;retain&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;30d&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;retain_frees&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1048576&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;total&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5371854848&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;gc&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;backends&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;backend&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;download cache&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;path&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/Library/Caches/lima&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;size&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;629145600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sized&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;span class="hx:absolute hx:-mt-20" id="devvms-data-folder"&gt;&lt;/span&gt;
&lt;a href="#devvms-data-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm keeps its state in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, or in &lt;code&gt;$XDG_DATA_HOME/devvm&lt;/code&gt; when &lt;code&gt;XDG_DATA_HOME&lt;/code&gt; is set. Everything in it is devvm&amp;rsquo;s own, and devvm makes most of it again when it&amp;rsquo;s needed. The exceptions are the exports, which are the only copy of a deleted VM&amp;rsquo;s agent history, and the defaults, agents&amp;rsquo; logins, keys and secrets that your commands saved.&lt;/p&gt;
&lt;p&gt;Only you can read it, because each time devvm runs, it makes this folder and the settings folder, &lt;code&gt;~/.config/devvm&lt;/code&gt;, yours alone (mode 700), whatever mode they had, so nothing inside either one is open to others. If devvm can&amp;rsquo;t, for example because someone else owns a folder, it warns and goes on. Whenever devvm writes into the folders that hold history, logs, keys and secrets, which are &lt;code&gt;exports/&lt;/code&gt;, &lt;code&gt;logs/&lt;/code&gt;, &lt;code&gt;logs/runs/&lt;/code&gt;, &lt;code&gt;run/&lt;/code&gt;, &lt;code&gt;secrets/&lt;/code&gt;, and the &lt;code&gt;run/&lt;/code&gt;, &lt;code&gt;run/ca/&lt;/code&gt; and &lt;code&gt;logs/&lt;/code&gt; folders in each VM&amp;rsquo;s folder, it makes them only yours again as well, whatever mode they had.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;How it&amp;rsquo;s cleaned up&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;version&lt;/code&gt;, &lt;code&gt;version.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-newer-devvm-changed-devvms-folders"&gt;layout version&lt;/a&gt;, and an empty file that each devvm checking it locks&lt;/td&gt;
&lt;td&gt;they stay, and take no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;settings.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the defaults that &lt;code&gt;devvm setup&lt;/code&gt;, &lt;code&gt;devvm size -g&lt;/code&gt;, &lt;code&gt;devvm ports -g&lt;/code&gt;, &lt;code&gt;devvm network -g&lt;/code&gt; and &lt;code&gt;devvm retention&lt;/code&gt; save, below &lt;a href="https://next.devvm.dev/docs/using/settings/#configtoml"&gt;&lt;code&gt;config.toml&lt;/code&gt;&lt;/a&gt;&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;it stays, and takes almost no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ssh_config&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;ssh config&lt;/a&gt; for running VMs&lt;/td&gt;
&lt;td&gt;devvm takes a VM out when it stops or deletes the VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent-keys.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the keys in &lt;a href="https://next.devvm.dev/docs/using/ssh/#devvms-own-agent"&gt;devvm&amp;rsquo;s own SSH agent&lt;/a&gt; and their options&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm ssh-agent rm&lt;/code&gt; takes a key out&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;logins/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your agents&amp;rsquo; logins in &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;devvm&amp;rsquo;s agent store&lt;/a&gt;, one folder for each agent, which &lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent login&lt;/code&gt; save and only you can read&lt;/td&gt;
&lt;td&gt;they stay until you delete them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;secrets/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;on hosts without a Keychain, such as Linux hosts, your &lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;secrets&lt;/a&gt;, one file each&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm secret rm&lt;/code&gt; deletes one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;custom-secrets.json&lt;/code&gt;, &lt;code&gt;custom-secrets.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/safety/network/#your-own-secrets"&gt;secrets of your own&lt;/a&gt;, each with its hosts, header, variable and prefix but never its value, and an empty file that each devvm changing them locks&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm secret rm&lt;/code&gt; takes a secret out, and both stay, taking almost no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;one folder for each VM, which holds everything devvm keeps for it in its data folder. &lt;code&gt;&amp;lt;hash&amp;gt;&lt;/code&gt; is the hash of the project folder&amp;rsquo;s path that the VM&amp;rsquo;s name ends with. The folder holds the VM&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/internals/overview/#a-vms-state"&gt;state&lt;/a&gt; in &lt;code&gt;vm.json&lt;/code&gt;, which records the VM&amp;rsquo;s name, its ssh alias, its image, folder, backend and settings and the version of the devvm that made it, and the VM&amp;rsquo;s own network rules in &lt;code&gt;policy&lt;/code&gt;. The files of its proxy, port forwarder, link session and sandbox are in &lt;code&gt;run/&lt;/code&gt;, with the VM&amp;rsquo;s host keys for its current start in &lt;code&gt;run/known_hosts&lt;/code&gt;, which devvm reads again each time the VM starts, and its logs are in &lt;code&gt;logs/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm rm&lt;/code&gt; deletes the whole folder with the VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;images/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a folder for each image, named by its key, which holds the image&amp;rsquo;s record, &lt;code&gt;record.json&lt;/code&gt;; the &lt;a href="https://next.devvm.dev/docs/using/images/#rebuilding"&gt;rebuild counters&lt;/a&gt; in &lt;code&gt;rebuilds.json&lt;/code&gt;, one for each backend, each image that base starts from and each image; the Ubuntu cloud image that base starts from on this machine, in &lt;code&gt;ubuntu.json&lt;/code&gt;; and in &lt;code&gt;locks/&lt;/code&gt; an empty file for each image that the devvm building it locks, one, &lt;code&gt;rebuilds&lt;/code&gt;, that a devvm changing a rebuild counter locks, one, &lt;code&gt;ubuntu&lt;/code&gt;, that a devvm pinning the cloud image locks, and one, &lt;code&gt;packages&lt;/code&gt;, that a devvm changing &lt;code&gt;packages/&lt;/code&gt; locks&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm gc&lt;/code&gt; and &lt;code&gt;devvm images rm&lt;/code&gt; delete an image&amp;rsquo;s folder and its lock file with the image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;packages/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a copy of each package that a first build of base installed, named by its SHA-256, and in &lt;code&gt;sets/&lt;/code&gt; the list of packages each base recorded, named by its key, which building the same base again installs from these copies (&lt;a href="https://next.devvm.dev/docs/using/images/#base"&gt;base&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm gc&lt;/code&gt; deletes the lists of bases that are neither current nor built, then the copies that no list names. &lt;code&gt;devvm rebuild base&lt;/code&gt; records a new list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tools/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;shared tools&lt;/a&gt;, one read-only image per tool version, each with a record beside it, &lt;code&gt;&amp;lt;image&amp;gt;.json&lt;/code&gt;, which holds its checksum, the backend that built it, the C library it&amp;rsquo;s built for, when it was built and, once retention finds that no VM has it, since when&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm gc&lt;/code&gt; deletes the versions that no VM has and that aren&amp;rsquo;t the current ones, and &lt;code&gt;devvm gc --tool-images&lt;/code&gt; also the current ones that no VM has, except while a VM is &lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;being made&lt;/a&gt;, each with its record&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mise.lock&lt;/code&gt;, &lt;code&gt;mise.lock.toml&lt;/code&gt;, &lt;code&gt;mise.lock.checked&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the tools lock, which holds the tools&amp;rsquo; versions and their checksums, the config it was resolved from, and when devvm last checked upstream for newer versions&lt;/td&gt;
&lt;td&gt;devvm replaces them when it checks again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cache/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what devvm makes again whenever it needs it: its own mise, the shared Nix cache, and in &lt;code&gt;from-digests.json&lt;/code&gt; the digest that each container image a &lt;code&gt;--from&lt;/code&gt; base starts from had when devvm last looked it up&lt;/td&gt;
&lt;td&gt;you can delete it at any time, and devvm makes each part again when it&amp;rsquo;s needed. An image built from a container image keeps that digest in its own record, so it stays current without the cache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cache/mise/&amp;lt;version&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the mise that devvm runs on this machine to resolve the tools lock, one folder per mise version&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm gc&lt;/code&gt; deletes the folders of older versions, which an upgrade of devvm leaves&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;exports/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the agents&amp;rsquo; &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#history"&gt;history&lt;/a&gt; that &lt;code&gt;devvm history export&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; save, one &lt;code&gt;.tar.gz&lt;/code&gt; per export, each with a &lt;code&gt;.folder&lt;/code&gt; file beside it that names its VM&amp;rsquo;s project folder&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm gc --history&lt;/code&gt; deletes them, or with &lt;code&gt;--older-than 30d&lt;/code&gt; those that old, and nothing else does&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;logs/runs/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;run logs&lt;/a&gt;, one per devvm run that runs a command&lt;/td&gt;
&lt;td&gt;devvm keeps the newest 20, and deletes older ones once they take more than 256 MiB together, but never one that a running devvm still writes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;logs/tools-check.log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the output of the daily check for newer shared tools&lt;/td&gt;
&lt;td&gt;each check replaces it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s network log, &lt;code&gt;network.jsonl&lt;/code&gt;, which holds its proxy&amp;rsquo;s decisions, its proxy&amp;rsquo;s own output, &lt;code&gt;proxy.log&lt;/code&gt;, its link session&amp;rsquo;s output, &lt;code&gt;links.log&lt;/code&gt;, and its port forwarder&amp;rsquo;s, &lt;code&gt;ports.log&lt;/code&gt;. Before the network log or the proxy&amp;rsquo;s log would grow past 10 MiB, the proxy moves it to the same name with &lt;code&gt;.1&lt;/code&gt; added, replacing the older one, so each of them takes at most about 20 MiB, and &lt;code&gt;devvm network log&lt;/code&gt; reads both of the network log&amp;rsquo;s files. The link session&amp;rsquo;s and the forwarder&amp;rsquo;s logs do the same at 1 MiB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm rm&lt;/code&gt; deletes them with the VM&amp;rsquo;s folder, &lt;code&gt;.1&lt;/code&gt; files included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/ca/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the certificate authorities that the VM trusts for its proxy, its current one and the next, with their keys, which never leave this machine&lt;/td&gt;
&lt;td&gt;devvm makes a new one when the current one has less than a week of its 30 days left, the VM&amp;rsquo;s first start after &lt;code&gt;devvm network open&lt;/code&gt; deletes them, and &lt;code&gt;devvm rm&lt;/code&gt; deletes them with the VM&amp;rsquo;s folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cache/nix-cache/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/using/toolchains/#nix-projects"&gt;shared Nix cache&lt;/a&gt;: the packages that VMs with the &lt;code&gt;nix&lt;/code&gt; layer downloaded from Nix&amp;rsquo;s binary cache, once for all of them&lt;/td&gt;
&lt;td&gt;the VMs&amp;rsquo; proxies and &lt;code&gt;devvm gc&lt;/code&gt; delete its least recently used files while it takes more than its cap, &lt;code&gt;nix-cache.size&lt;/code&gt;, which is 10 GiB when it&amp;rsquo;s off, and &lt;code&gt;devvm gc --nix-cache&lt;/code&gt; deletes all of it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;run/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what running VMs need that isn&amp;rsquo;t one VM&amp;rsquo;s or whose path must be short, such as the QEMU wrapper on Linux hosts, the claims lock, &lt;code&gt;claims.lock&lt;/code&gt;, which devvm holds while it chooses a new VM&amp;rsquo;s ssh alias or a VM&amp;rsquo;s host ports, the sockets of port forwarders and link sessions, and those that VMs&amp;rsquo; proxies relay their SSH agents on, which are named by hashes, in &lt;code&gt;build-ports/&lt;/code&gt; the ssh port of each build VM that&amp;rsquo;s starting, and in &lt;code&gt;builds/&lt;/code&gt; a folder for each build VM, laid out as a VM&amp;rsquo;s folder is&lt;/td&gt;
&lt;td&gt;devvm deletes a VM&amp;rsquo;s sockets when it deletes the VM, a build VM&amp;rsquo;s port once the VM has started or failed to, or, if the devvm that started the VM was killed, the first time it chooses a port 15 minutes later, and a build VM&amp;rsquo;s folder once its image is built, or else when it deletes the build VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent.sock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the socket of &lt;a href="https://next.devvm.dev/docs/using/ssh/#devvms-own-agent"&gt;devvm&amp;rsquo;s own SSH agent&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;it takes no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;oci-build.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an empty file that the devvm building a base from a container image on Lima locks, so that one such build runs at a time&lt;/td&gt;
&lt;td&gt;it stays, and takes no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tools.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an empty file that the devvm building shared tools or updating the tools lock locks, so that one at a time writes to &lt;code&gt;tools/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;it stays, and takes no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;groups.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an empty file that each devvm joining or leaving a &lt;a href="https://next.devvm.dev/docs/using/links/#groups"&gt;group&lt;/a&gt;, or changing a group&amp;rsquo;s links, locks, so that they take turns&lt;/td&gt;
&lt;td&gt;it stays, and takes no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agents.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an empty file that each devvm writing the &lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store"&gt;agent store&lt;/a&gt; locks, so that they take turns&lt;/td&gt;
&lt;td&gt;it stays, and takes no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;making.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an empty file that each devvm making a VM locks, so that &lt;code&gt;devvm gc --tool-images&lt;/code&gt; can tell a VM is &lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;being made&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;it stays, and takes no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;retention.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an empty file that the devvm applying the &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention settings&lt;/a&gt; locks, so that one at a time applies them&lt;/td&gt;
&lt;td&gt;it stays, and takes no space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lima/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s own &lt;a href="https://next.devvm.dev/docs/backends/lima/#devvms-lima-home"&gt;Lima home&lt;/a&gt;, with its VMs and images, unless &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; moves it&lt;/td&gt;
&lt;td&gt;see &lt;a href="#lima"&gt;Lima&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;Which ports each VM forwards is in its state, and its port forwarder&amp;rsquo;s files are in its own folder too, its log in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt; and the rest in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt;. &lt;code&gt;devvm rm&lt;/code&gt; deletes them with the VM.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://next.devvm.dev/docs/using/settings/#retention"&gt;retention settings&lt;/a&gt;, which are all off until you set them, make devvm delete some of these on its own, and that section lists what each one deletes. Retention also writes &lt;code&gt;retention.run&lt;/code&gt; in the data folder, when it last ran, and records in each current shared tool&amp;rsquo;s record since when no VM has had it. It never deletes anything in &lt;code&gt;cache/&lt;/code&gt; but the shared Nix cache&amp;rsquo;s files.&lt;/li&gt;
&lt;li&gt;A build also makes a temporary folder in the data folder, &lt;code&gt;tools-build.&amp;lt;random&amp;gt;&lt;/code&gt; for the shared tools, and devvm deletes it when the build ends, even after a failure or Ctrl+C.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="shared-tools"&gt;Shared tools&lt;span class="hx:absolute hx:-mt-20" id="shared-tools"&gt;&lt;/span&gt;
&lt;a href="#shared-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each tool version is built once for each kind of VM that uses it, so &lt;code&gt;tools/&lt;/code&gt; can hold more than one build of the same version. A base on Alpine needs its tools built for its C library, musl, rather than glibc, so a node 24 that both an Ubuntu VM and an Alpine VM use is two builds, and &lt;code&gt;devvm images&lt;/code&gt; lists both. Each Alpine container image gets builds of its own, so VMs on two different Alpine images have two musl builds of it. &lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;Cleaning up&lt;/a&gt; says which ones &lt;code&gt;devvm gc&lt;/code&gt; deletes.&lt;/p&gt;
&lt;h3 data-hextra-search-id="exports"&gt;Exports&lt;span class="hx:absolute hx:-mt-20" id="exports"&gt;&lt;/span&gt;
&lt;a href="#exports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm rm&lt;/code&gt; saves the history of a VM whose image has an agent before it deletes the VM, so each export in &lt;code&gt;exports/&lt;/code&gt; can be the only copy of that VM&amp;rsquo;s transcripts and sessions. devvm deletes an export only when you ask it to. &lt;code&gt;devvm history&lt;/code&gt; lists the exports, which are named &lt;code&gt;&amp;lt;vm&amp;gt;-&amp;lt;date&amp;gt;-&amp;lt;time&amp;gt;.tar.gz&lt;/code&gt;, with their VM, its folder, their date and their size. &lt;code&gt;devvm gc --history&lt;/code&gt; lists them by their VM and date, then deletes them, each with the &lt;code&gt;.folder&lt;/code&gt; file beside it, after asking in a terminal, and &lt;code&gt;devvm gc --history --older-than 30d&lt;/code&gt; deletes only those written 30 days ago or more. gc leaves anything else in the folder alone, such as an export that &lt;code&gt;devvm history export&lt;/code&gt; is still writing.&lt;/p&gt;
&lt;h3 data-hextra-search-id="leftovers-of-a-vm-deleted-outside-devvm"&gt;Leftovers of a VM deleted outside devvm&lt;span class="hx:absolute hx:-mt-20" id="leftovers-of-a-vm-deleted-outside-devvm"&gt;&lt;/span&gt;
&lt;a href="#leftovers-of-a-vm-deleted-outside-devvm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When you delete a VM with its backend&amp;rsquo;s own command instead of &lt;code&gt;devvm rm&lt;/code&gt;, such as &lt;code&gt;limactl delete&lt;/code&gt;, devvm still keeps the VM&amp;rsquo;s folder, with its state, its logs and its backend&amp;rsquo;s files, the VM&amp;rsquo;s sockets in &lt;code&gt;run/&lt;/code&gt;, its ssh config entry and its host keys. &lt;code&gt;devvm gc&lt;/code&gt; also keeps the shared tools that the VM&amp;rsquo;s state names. &lt;code&gt;devvm rm&lt;/code&gt; deletes these only together with the VM, so once the VM is gone it says the folder has no VM.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm gc --orphans&lt;/code&gt; deletes what devvm keeps for such a VM, as &lt;code&gt;devvm rm&lt;/code&gt; does after it deletes a VM. That includes, for a &lt;code&gt;--clone&lt;/code&gt; VM, the &lt;code&gt;devvm&lt;/code&gt; remote in your repo. gc first asks each VM&amp;rsquo;s backend whether it still has the VM, lists the VMs it would forget with their project folders, and in a terminal asks. It never deletes a VM, and it leaves a VM&amp;rsquo;s state alone in these cases, saying why:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The backend doesn&amp;rsquo;t answer&lt;/strong&gt;, for example because it isn&amp;rsquo;t installed. When a backend that one of your VMs uses can&amp;rsquo;t list its images, gc warns and leaves all of that backend&amp;rsquo;s VMs&amp;rsquo; state alone, as it does the rest of that backend&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;cleaning up&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The VM was made elsewhere.&lt;/strong&gt; devvm records where each new VM&amp;rsquo;s backend keeps it: the Lima home, which &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; moves. When this run looks somewhere else, the VM may still exist there. A VM whose state doesn&amp;rsquo;t record it counts as made in the backend&amp;rsquo;s default place, so while &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; is set, gc leaves such a VM alone.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Its state changed in the last hour,&lt;/strong&gt; because the VM may still be being made.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When another devvm starts to make the VM again in its folder after gc listed it, gc refuses to forget it and stops there, and so does retention&amp;rsquo;s &lt;code&gt;orphans.age&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Forgetting a VM also removes your other VMs&amp;rsquo; &lt;a href="https://next.devvm.dev/docs/using/links/"&gt;links&lt;/a&gt; to it, as &lt;code&gt;devvm rm&lt;/code&gt; does. &lt;code&gt;devvm gc --orphans&lt;/code&gt; also removes links to VMs whose state is already gone, naming each one, and deletes the sockets that a link session, a port forwarder or a VM&amp;rsquo;s proxy leaves on your machine when it&amp;rsquo;s killed, which are the ones nothing listens on.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once a VM&amp;rsquo;s state is gone, &lt;code&gt;devvm gc&lt;/code&gt; treats its shared tools like any others. &lt;code&gt;devvm space&lt;/code&gt; counts the whole folder of each VM that &lt;code&gt;devvm gc --orphans&lt;/code&gt; would forget as &lt;code&gt;leftover state&lt;/code&gt;, and each socket a link session, a port forwarder or a proxy left counts there too. A VM that gc leaves alone for one of the reasons above isn&amp;rsquo;t leftover state, so its folder counts as &lt;code&gt;state&lt;/code&gt; and its logs as &lt;code&gt;network logs&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="vms-devvm-has-no-state-for"&gt;VMs devvm has no state for&lt;span class="hx:absolute hx:-mt-20" id="vms-devvm-has-no-state-for"&gt;&lt;/span&gt;
&lt;a href="#vms-devvm-has-no-state-for" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM can also be the other way around: the backend has it, with devvm&amp;rsquo;s label, but devvm has no state for it. Usually it belongs to another devvm, such as one run with another &lt;code&gt;XDG_DATA_HOME&lt;/code&gt; for a test or a sandbox. &lt;code&gt;devvm space&lt;/code&gt; names each one, with the data folder its label names. devvm never deletes one, because the other devvm may still use it, but the next tools build and &lt;code&gt;devvm gc&lt;/code&gt; delete the build VMs that a killed or failed tools build left, &lt;code&gt;devvm-tools-build&lt;/code&gt; to &lt;code&gt;devvm-tools-build-4&lt;/code&gt;. To delete any other yourself:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm limactl delete NAME &lt;span class="c1"&gt;# delete the VM named NAME from devvm&amp;#39;s Lima home&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-hextra-search-id="vms-whose-folder-is-gone"&gt;VMs whose folder is gone&lt;span class="hx:absolute hx:-mt-20" id="vms-whose-folder-is-gone"&gt;&lt;/span&gt;
&lt;a href="#vms-whose-folder-is-gone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A VM whose project folder you deleted or moved still takes its disk, and it isn&amp;rsquo;t leftover state, because its backend still has it and it may hold that project&amp;rsquo;s work. &lt;code&gt;devvm space&lt;/code&gt; names each VM whose backend has it and whose folder is gone, with that folder, and counts it among the &lt;code&gt;VMs&lt;/code&gt;. Neither &lt;code&gt;devvm gc&lt;/code&gt; nor retention ever deletes one. &lt;code&gt;devvm rm VM&lt;/code&gt; deletes it after asking, exporting its agents&amp;rsquo; history first (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-vm-whose-folder-is-gone"&gt;a VM whose folder is gone&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm space&lt;/code&gt; also names each VM whose folder is on a disk that isn&amp;rsquo;t connected, with that folder, and counts it among the &lt;code&gt;VMs&lt;/code&gt; too. Connect the disk to use the VM again. &lt;code&gt;devvm rm VM&lt;/code&gt; deletes one only after you confirm in a terminal, and &lt;code&gt;--force&lt;/code&gt; never answers that question (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-on-a-disk-that-isnt-connected"&gt;a folder on a disk that isn&amp;rsquo;t connected&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-devvm-doctor-finds-in-vms"&gt;What devvm doctor finds in &lt;code&gt;vms/&lt;/code&gt;&lt;span class="hx:absolute hx:-mt-20" id="what-devvm-doctor-finds-in-vms"&gt;&lt;/span&gt;
&lt;a href="#what-devvm-doctor-finds-in-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;vms/&lt;/code&gt; should hold only VMs&amp;rsquo; folders, each named by a hash of 14 hexadecimal digits and holding the VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt;. &lt;code&gt;devvm doctor&lt;/code&gt; warns about anything else it finds there, says what to do, and changes nothing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;An entry that isn&amp;rsquo;t a VM&amp;rsquo;s folder,&lt;/strong&gt; such as a file or a folder with another name, which devvm never uses. Move it out of &lt;code&gt;vms/&lt;/code&gt; or delete it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s folder without &lt;code&gt;vm.json&lt;/code&gt;,&lt;/strong&gt; which a devvm that stopped while making or deleting a VM leaves, for example one holding only the VM&amp;rsquo;s &lt;code&gt;lock&lt;/code&gt;. No VM uses the folder, so delete it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A folder doctor can&amp;rsquo;t read,&lt;/strong&gt; &lt;code&gt;vms/&lt;/code&gt; itself or a VM&amp;rsquo;s folder, so it can&amp;rsquo;t check what&amp;rsquo;s in it. Check that you own it and can read it, for example with &lt;code&gt;ls -ld&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These warnings never make doctor fail, and &lt;code&gt;devvm doctor --json&lt;/code&gt; lists them in &lt;code&gt;warnings&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="your-settings"&gt;Your settings&lt;span class="hx:absolute hx:-mt-20" id="your-settings"&gt;&lt;/span&gt;
&lt;a href="#your-settings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;~/.config/devvm&lt;/code&gt; holds what you edit: &lt;code&gt;config.toml&lt;/code&gt;, your network rules, your agents&amp;rsquo; settings, your own layers, and your company&amp;rsquo;s CA certificates. devvm also writes the folder&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-newer-devvm-changed-devvms-folders"&gt;layout version&lt;/a&gt; into &lt;code&gt;version&lt;/code&gt; there when the file is missing or older. &lt;a href="https://next.devvm.dev/docs/using/settings/#your-settings"&gt;Your settings&lt;/a&gt; lists each file. devvm never deletes any of them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="lima"&gt;Lima&lt;span class="hx:absolute hx:-mt-20" id="lima"&gt;&lt;/span&gt;
&lt;a href="#lima" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Lima backend&amp;rsquo;s VMs and images are in devvm&amp;rsquo;s Lima home, &lt;code&gt;~/.local/share/devvm/lima&lt;/code&gt;. Each image is a stopped VM named &lt;code&gt;devvm-img-&amp;lt;key&amp;gt;&lt;/code&gt;, and each project VM is a clone of one. On macOS a clone&amp;rsquo;s disk shares its image&amp;rsquo;s blocks until the VM writes them, so &lt;code&gt;du&lt;/code&gt; counts those blocks twice. On Linux hosts a VM&amp;rsquo;s disk is an overlay of its image&amp;rsquo;s. &lt;code&gt;devvm rm&lt;/code&gt; deletes a VM, &lt;code&gt;devvm gc&lt;/code&gt; deletes stale and unfinished images, and &lt;code&gt;devvm images rm&lt;/code&gt; deletes any image you name.&lt;/p&gt;
&lt;p&gt;Lima keeps a download cache of its own, &lt;code&gt;~/Library/Caches/lima&lt;/code&gt; on macOS and &lt;code&gt;~/.cache/lima&lt;/code&gt; on Linux, or &lt;code&gt;$XDG_CACHE_HOME/lima&lt;/code&gt; when &lt;code&gt;XDG_CACHE_HOME&lt;/code&gt; is set. devvm gives Lima its own copy of Ubuntu&amp;rsquo;s cloud image, so its builds add nothing to that cache. The cache can still hold the cloud images that earlier releases of devvm had Lima download, about 900 MB for each release, and on macOS a copy of each converted to a raw disk, which takes about 2.4 GB more. The cache is Lima&amp;rsquo;s and it isn&amp;rsquo;t in devvm&amp;rsquo;s Lima home, so your own Lima VMs&amp;rsquo; downloads share it.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --caches &lt;span class="c1"&gt;# free devvm&amp;#39;s share of Lima&amp;#39;s cache, after asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm deletes something in it only when you run &lt;code&gt;devvm gc --caches&lt;/code&gt;, and only a folder of Ubuntu&amp;rsquo;s cloud image that all of these hold for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It&amp;rsquo;s devvm&amp;rsquo;s.&lt;/strong&gt; Lima keeps each download in a folder named by the SHA-256 of its address, and the folder&amp;rsquo;s address is the one devvm downloads base from, for its Ubuntu release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm&amp;rsquo;s own state names it.&lt;/strong&gt; An image record of devvm&amp;rsquo;s names that address, as a build of base by an earlier release left it, and devvm now has its own copy of that image, which builds use instead. An image that no record names stays, as your own Lima VMs may have downloaded it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lima&amp;rsquo;s own templates don&amp;rsquo;t use it.&lt;/strong&gt; devvm reads the templates of the &lt;code&gt;limactl&lt;/code&gt; on your &lt;code&gt;PATH&lt;/code&gt;, and when it can&amp;rsquo;t read them, it frees nothing of Lima&amp;rsquo;s cache, and the run log says why.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It hasn&amp;rsquo;t changed in the last hour.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No VM needs its entry once it&amp;rsquo;s made, because Lima copies the disk out of the cache. &lt;code&gt;limactl prune&lt;/code&gt; deletes the whole cache, your own downloads included, so devvm never runs it, and you can run it yourself to free the rest.&lt;/p&gt;
&lt;h3 data-hextra-search-id="ubuntus-cloud-images"&gt;Ubuntu&amp;rsquo;s cloud images&lt;span class="hx:absolute hx:-mt-20" id="ubuntus-cloud-images"&gt;&lt;/span&gt;
&lt;a href="#ubuntus-cloud-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm keeps the Ubuntu cloud image that base starts from in &lt;code&gt;~/.local/share/devvm/images/ubuntu&lt;/code&gt;, as &lt;code&gt;&amp;lt;sha256&amp;gt;.img&lt;/code&gt;, about 900 MB for each release, and a download that stopped as &lt;code&gt;&amp;lt;sha256&amp;gt;.img.part&lt;/code&gt;, which the next build goes on from. &lt;code&gt;devvm space&lt;/code&gt; shows them as &lt;code&gt;cloud images&lt;/code&gt;.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm gc --caches &lt;span class="c1"&gt;# free the cloud images no image needs, after asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm keeps the image pinned now, which the next build of base needs, and each image that an image&amp;rsquo;s record names, as Ubuntu removes its dated releases after a few months and building that image again needs the copy. &lt;code&gt;devvm gc --caches&lt;/code&gt; frees the others, and a stopped download of any image once that image is there whole, unless one changed in the last hour. When devvm can&amp;rsquo;t read which image is pinned, &lt;code&gt;devvm gc --caches&lt;/code&gt; fails rather than free an image the pin may name (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="outside-devvms-folders"&gt;Outside devvm&amp;rsquo;s folders&lt;span class="hx:absolute hx:-mt-20" id="outside-devvms-folders"&gt;&lt;/span&gt;
&lt;a href="#outside-devvms-folders" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm also changes a few things outside its own folders:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Keychain:&lt;/strong&gt; on macOS, the &lt;a href="https://next.devvm.dev/docs/safety/network/#saving-and-binding-secrets"&gt;secrets&lt;/a&gt; you save are Keychain items under the service &lt;code&gt;devvm&lt;/code&gt;. &lt;code&gt;devvm secret rm&lt;/code&gt; deletes one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;/strong&gt; when you let it, devvm adds the line &lt;code&gt;Include ~/.local/share/devvm/ssh_config&lt;/code&gt; so that ssh reaches VMs by name (&lt;a href="https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name"&gt;SSH and editors&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Time Machine:&lt;/strong&gt; on macOS, devvm keeps each VM&amp;rsquo;s &lt;code&gt;run/ca/&lt;/code&gt; out of Time Machine&amp;rsquo;s backups, because a copy of a key elsewhere could impersonate any site to that VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm itself:&lt;/strong&gt; the install script puts each version in &lt;code&gt;~/.local/lib/devvm/&amp;lt;version&amp;gt;&lt;/code&gt; and links &lt;code&gt;~/.local/bin/devvm&lt;/code&gt; to it. A newer install removes older versions that nothing runs (&lt;a href="https://next.devvm.dev/docs/using/upgrading/#upgrading"&gt;upgrading&lt;/a&gt;). Homebrew keeps devvm in its own folders.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/using/upgrading/#uninstalling"&gt;Uninstalling&lt;/a&gt; removes all of it.&lt;/p&gt;</description></item><item><title>The command line</title><link>https://next.devvm.dev/docs/using/command-line/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/command-line/</guid><description>
&lt;p&gt;This page covers what works the same way in every command: the help, flags and their values, the questions devvm asks and what answers them beforehand, &lt;code&gt;--json&lt;/code&gt; for scripts, and shell completion. &lt;a href="https://next.devvm.dev/docs/getting-started/commands/"&gt;Everyday commands&lt;/a&gt; lists the commands, and the &lt;a href="https://next.devvm.dev/docs/cli/"&gt;CLI reference&lt;/a&gt; has every command with all its flags.&lt;/p&gt;
&lt;h2 data-hextra-search-id="help"&gt;Help&lt;span class="hx:absolute hx:-mt-20" id="help"&gt;&lt;/span&gt;
&lt;a href="#help" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm help COMMAND&lt;/code&gt;, &lt;code&gt;devvm COMMAND --help&lt;/code&gt; and &lt;code&gt;devvm COMMAND -h&lt;/code&gt; print a command&amp;rsquo;s help. It starts with a few sentences on what the command does, then its usage line and its examples, the most common first, each with a comment. Then come its commands, if it has any, and its flags, and the help ends with the address of the docs page that covers the command. &lt;code&gt;devvm --help&lt;/code&gt; lists the commands in the groups that &lt;a href="https://next.devvm.dev/docs/getting-started/commands/"&gt;Everyday commands&lt;/a&gt; has, which are Your VM, Change your VM, Images, Disk space and This machine, with &lt;code&gt;help&lt;/code&gt; under Additional Commands, and it ends with devvm&amp;rsquo;s issue tracker after its docs page.&lt;/p&gt;
&lt;p&gt;devvm itself takes no word after it but a command&amp;rsquo;s name, so every word there is a command, and a layer may have any name a command has. When the word after &lt;code&gt;devvm&lt;/code&gt; isn&amp;rsquo;t a command, devvm refuses it as a usage error. If the word names a toolchain, an agent or a layer, your own layers included, devvm points you to the flag that chooses it for a new VM, such as &lt;code&gt;devvm --tools node&lt;/code&gt; for &lt;code&gt;devvm node&lt;/code&gt;, and a word that joins several with &lt;code&gt;+&lt;/code&gt; or a comma gets one line with each flag, such as &lt;code&gt;devvm --tools node --agents claude&lt;/code&gt; for &lt;code&gt;devvm node+claude&lt;/code&gt;. Any other word gets the closest command, such as &lt;code&gt;devvm stop&lt;/code&gt; for &lt;code&gt;devvm stpo&lt;/code&gt;. &lt;code&gt;devvm stpo --help&lt;/code&gt; and &lt;code&gt;devvm help stpo&lt;/code&gt; are refused the same way.&lt;/p&gt;
&lt;h2 data-hextra-search-id="flags-and-values"&gt;Flags and values&lt;span class="hx:absolute hx:-mt-20" id="flags-and-values"&gt;&lt;/span&gt;
&lt;a href="#flags-and-values" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;These rules hold for every command:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each flag belongs to the commands that list it in their help, and only &lt;code&gt;-h&lt;/code&gt; or &lt;code&gt;--help&lt;/code&gt;, &lt;code&gt;-v&lt;/code&gt; or &lt;code&gt;--verbose&lt;/code&gt; and &lt;code&gt;--no-input&lt;/code&gt; work with every command. &lt;code&gt;-v&lt;/code&gt; shows the output of the commands devvm runs as they run (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails"&gt;details&lt;/a&gt;), and &lt;code&gt;--no-input&lt;/code&gt; makes devvm ask nothing (&lt;a href="#questions-devvm-asks"&gt;questions devvm asks&lt;/a&gt;). A flag can come before or after the command&amp;rsquo;s arguments, and options that take a value also work with an equals sign, such as &lt;code&gt;--cpus=N&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The options for a new VM, such as &lt;code&gt;--tools&lt;/code&gt; and &lt;code&gt;--cpus&lt;/code&gt;, are taken only by &lt;code&gt;devvm&lt;/code&gt;. Another command given one of them, such as &lt;code&gt;devvm ls --cpus 4&lt;/code&gt;, fails as it does for any flag it doesn&amp;rsquo;t know (&lt;a href="https://next.devvm.dev/docs/using/images/#what-a-new-vm-gets"&gt;what a new VM gets&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;When a flag or a setting can mean none or off, you write that as a word: &lt;code&gt;devvm setup --features none&lt;/code&gt;, &lt;code&gt;devvm --agents none&lt;/code&gt;, &lt;code&gt;devvm ports none&lt;/code&gt;, &lt;code&gt;devvm retention history.age=off&lt;/code&gt; and &lt;code&gt;devvm ssh-agent add KEY_FILE --lifetime forever&lt;/code&gt;. devvm refuses an empty value, such as &lt;code&gt;--features ''&lt;/code&gt;, and an empty argument, so a blank never stands for none or for a default.&lt;/li&gt;
&lt;li&gt;Every duration is a whole number followed by a unit, which is &lt;code&gt;m&lt;/code&gt; for minutes, &lt;code&gt;h&lt;/code&gt; for hours, &lt;code&gt;d&lt;/code&gt; for days or &lt;code&gt;w&lt;/code&gt; for weeks, as in &lt;code&gt;30m&lt;/code&gt;, &lt;code&gt;12h&lt;/code&gt;, &lt;code&gt;30d&lt;/code&gt; or &lt;code&gt;2w&lt;/code&gt;. That covers &lt;code&gt;devvm gc --older-than&lt;/code&gt;, the retention settings&amp;rsquo; ages and &lt;code&gt;devvm ssh-agent add --lifetime&lt;/code&gt;, and only &lt;code&gt;--lifetime&lt;/code&gt; also takes &lt;code&gt;forever&lt;/code&gt;, for a key that devvm&amp;rsquo;s agent keeps until it ends.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="questions-devvm-asks"&gt;Questions devvm asks&lt;span class="hx:absolute hx:-mt-20" id="questions-devvm-asks"&gt;&lt;/span&gt;
&lt;a href="#questions-devvm-asks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm asks a question only in a terminal, and each question has a flag or a command that answers it beforehand, so a script never needs to answer one. Without a terminal, with &lt;code&gt;--no-input&lt;/code&gt;, or when the input ends before an answer, devvm can&amp;rsquo;t ask, and every question is handled the same way in all three cases. A question that only adds something, such as an agent&amp;rsquo;s folders or the &lt;code&gt;Include&lt;/code&gt; line, gets its usual answer or a warning that says what to do, and a command that deletes something refuses unless you give it &lt;code&gt;--force&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Answered by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;the CPUs and memory new VMs get, on the first run&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--cpus&lt;/code&gt; and &lt;code&gt;--memory&lt;/code&gt;, or &lt;code&gt;devvm size -g&lt;/code&gt;, or nothing: where devvm can&amp;rsquo;t ask, new VMs get the size they would anyway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the coding agents new VMs get, on the first run and in &lt;code&gt;devvm setup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm setup --agents LIST&lt;/code&gt; or &lt;code&gt;devvm setup --agents none&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base&amp;rsquo;s features, on the first run before the new VM&amp;rsquo;s summary, or on the first build&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm setup --features LIST&lt;/code&gt; or &lt;code&gt;devvm setup --features none&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to customize a new VM, after its summary&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt;, &lt;code&gt;--layers&lt;/code&gt;, &lt;code&gt;--network&lt;/code&gt;, &lt;code&gt;--ports&lt;/code&gt;, &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; and &lt;code&gt;--disk&lt;/code&gt;, or nothing: where devvm can&amp;rsquo;t ask, the VM gets what the summary shows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a new VM&amp;rsquo;s toolchains, coding agents and layers, when you customize it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a new VM&amp;rsquo;s network tier, chosen from a list when you customize it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--network TIER&lt;/code&gt;, or &lt;code&gt;devvm network -g&lt;/code&gt; with a tier for every new VM, or nothing: where devvm can&amp;rsquo;t show the list, the VM gets the tier the summary shows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the ports a new VM forwards, chosen from a list when you customize it: every port, none, or the ports you type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--ports&lt;/code&gt;, or &lt;code&gt;devvm ports -g&lt;/code&gt; with the ports every new VM forwards, or nothing: where devvm can&amp;rsquo;t ask, the VM forwards the ports the summary shows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a new VM&amp;rsquo;s CPUs, memory and disk, when you customize it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; and &lt;code&gt;--disk&lt;/code&gt;, or nothing: where devvm can&amp;rsquo;t ask, the VM gets the size the summary shows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the layers new VMs get, in &lt;code&gt;devvm setup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm setup --layers LIST&lt;/code&gt; or &lt;code&gt;devvm setup --layers none&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a VM&amp;rsquo;s toolchains and agents, in &lt;code&gt;devvm tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm tools add&lt;/code&gt; and &lt;code&gt;devvm tools rm&lt;/code&gt;, or &lt;code&gt;--json&lt;/code&gt; to show them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;new VMs&amp;rsquo; network tier, in &lt;code&gt;devvm setup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm network -g&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to load an SSH key into your agent&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm ssh-agent add KEY_FILE&lt;/code&gt; beforehand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to restart a running VM to apply a change from &lt;code&gt;devvm size&lt;/code&gt;, &lt;code&gt;devvm network&lt;/code&gt;, &lt;code&gt;devvm ssh-agent&lt;/code&gt; or &lt;code&gt;devvm git-protect&lt;/code&gt;, or, as devvm opens it, the changes that wait for its next start, such as an agent&amp;rsquo;s new folders&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm restart&lt;/code&gt; afterwards, or nothing: without a terminal or with &lt;code&gt;--no-input&lt;/code&gt;, the change waits for the VM&amp;rsquo;s next start&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to add the &lt;code&gt;Include&lt;/code&gt; line to &lt;code&gt;~/.ssh/config&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--ssh-config&lt;/code&gt; on &lt;code&gt;devvm&lt;/code&gt;, &lt;code&gt;devvm host&lt;/code&gt; and &lt;code&gt;devvm code&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a Claude Code token or a GitHub token&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm secret set NAME --stdin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;an agent&amp;rsquo;s API key, in &lt;code&gt;devvm agent login --api-key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--stdin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to delete, in &lt;code&gt;devvm rm&lt;/code&gt;, &lt;code&gt;devvm gc&lt;/code&gt;, &lt;code&gt;devvm gc --caches&lt;/code&gt;, &lt;code&gt;devvm images rm&lt;/code&gt; and &lt;code&gt;devvm secret rm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to replace the images built on one, in &lt;code&gt;devvm rebuild&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to replace what devvm&amp;rsquo;s agent store has, in &lt;code&gt;devvm agent import&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to install a release, in &lt;code&gt;devvm upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to use the VM made for an earlier folder here, in &lt;code&gt;devvm adopt&lt;/code&gt;, or to move a VM to this folder, in &lt;code&gt;devvm adopt VM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--force&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;whether to move the VM made for this folder at the path it had before, in any command on this folder&amp;rsquo;s VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm adopt --force&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;--force&lt;/code&gt; only skips a confirmation, and it never deletes more than the command does without it. A command that would delete something asks first in a terminal, and where devvm can&amp;rsquo;t ask, it refuses unless you give &lt;code&gt;--force&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A few questions protect work that only you can judge, so no flag answers them, and devvm asks them only in a terminal. Where devvm can&amp;rsquo;t ask, each of them refuses and says what to run instead. They are these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm rm&lt;/code&gt; deleting the VM of a folder this one is inside or the VM made for an earlier folder at this path&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s commits that this repo hasn&amp;rsquo;t fetched and its uncommitted changes&lt;/li&gt;
&lt;li&gt;a command giving the VM of a folder this one is inside more access&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm agent save&lt;/code&gt; saving a VM&amp;rsquo;s settings for every VM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With &lt;code&gt;--no-input&lt;/code&gt;, devvm asks nothing even in a terminal, and it never reads an answer from a pipe or a file either. A question that has no usual answer fails instead, after devvm shows the question, and the error names the flag or command that answers it. A question fails the same way when the input ends before an answer, as it does when you press Ctrl+D at the prompt.&lt;/p&gt;
&lt;h2 data-hextra-search-id="output-for-scripts"&gt;Output for scripts&lt;span class="hx:absolute hx:-mt-20" id="output-for-scripts"&gt;&lt;/span&gt;
&lt;a href="#output-for-scripts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every command that shows or lists something takes &lt;code&gt;--json&lt;/code&gt;, which prints what the command shows as one JSON object instead of a table or lines, so a script can read it. The page for each command lists its fields with an example, and every command&amp;rsquo;s JSON follows the same rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The object&amp;rsquo;s first field is &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt;. A shape only ever gains fields. devvm adds new fields to version 1, and any other change to a shape, such as a field renamed, removed or given another type, comes with a new version.&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;--json&lt;/code&gt;, standard output gets only the JSON. devvm&amp;rsquo;s messages, such as warnings and notes, still go to standard error, as they do without it, and the JSON is never colored.&lt;/li&gt;
&lt;li&gt;A list with nothing in it is &lt;code&gt;[]&lt;/code&gt;, never &lt;code&gt;null&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Sizes are in bytes, unless a field&amp;rsquo;s name gives the unit, such as &lt;code&gt;memory_gib&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A field that doesn&amp;rsquo;t apply, such as a VM&amp;rsquo;s &lt;code&gt;from&lt;/code&gt; when its base is Ubuntu&amp;rsquo;s cloud image, is left out.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A command that shows a setting when you run it bare and changes the setting when you give it a value, such as &lt;code&gt;devvm network&lt;/code&gt; or &lt;code&gt;devvm size&lt;/code&gt;, only shows with &lt;code&gt;--json&lt;/code&gt;. devvm refuses a value given with &lt;code&gt;--json&lt;/code&gt;, such as &lt;code&gt;devvm network open&lt;/code&gt; with &lt;code&gt;--json&lt;/code&gt;, and changes nothing.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Its JSON&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ls --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/vms/#devvm-ls---json"&gt;the project VMs&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm images --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/images/#devvm-images---json"&gt;the images and the shared tool images&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm tools --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/toolchains/#devvm-tools---json"&gt;this folder&amp;rsquo;s VM&amp;rsquo;s shared tools&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm size --json&lt;/code&gt;, &lt;code&gt;devvm ports --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/ports-size/#as-json"&gt;this folder&amp;rsquo;s VM&amp;rsquo;s size and ports&lt;/a&gt;, or with &lt;code&gt;-g&lt;/code&gt;, new VMs'&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/safety/network/#devvm-network---json"&gt;this folder&amp;rsquo;s VM&amp;rsquo;s network tier and allowlist&lt;/a&gt;, or with &lt;code&gt;-g&lt;/code&gt;, new VMs&amp;rsquo; choice&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm network log --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/safety/network/#devvm-network-log---json"&gt;this folder&amp;rsquo;s VM&amp;rsquo;s network log, or with &lt;code&gt;--blocked&lt;/code&gt; its blocks&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm secret --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/safety/network/#devvm-secret---json"&gt;the secrets, whether each is saved and the VMs using it&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm ssh-agent --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/ssh/#devvm-ssh-agent---json"&gt;this folder&amp;rsquo;s VM&amp;rsquo;s SSH agent forwarding and devvm&amp;rsquo;s own agent&amp;rsquo;s keys&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm link --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/links/#devvm-link---json"&gt;this folder&amp;rsquo;s VM&amp;rsquo;s links&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm link publish --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/links/#devvm-link-publish---json"&gt;the ports this folder&amp;rsquo;s VM publishes to links&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm git-protect --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#devvm-git-protect---json"&gt;this folder&amp;rsquo;s VM&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm history --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#devvm-history---json"&gt;the saved exports of agents&amp;rsquo; history&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm space --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/space/#devvm-space---json"&gt;what devvm keeps on this machine&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm retention --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/settings/#devvm-retention---json"&gt;the retention settings&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm doctor --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/internals/install/#devvm-doctor---json"&gt;what devvm needs on this machine and what&amp;rsquo;s missing&lt;/a&gt;, and it prints nothing else&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm upgrade --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://next.devvm.dev/docs/using/upgrading/#devvm-upgrade---json"&gt;the newest release and how this devvm was installed&lt;/a&gt;, and it installs nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="shell-completion"&gt;Shell completion&lt;span class="hx:absolute hx:-mt-20" id="shell-completion"&gt;&lt;/span&gt;
&lt;a href="#shell-completion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm completion SHELL&lt;/code&gt; prints the shell completion script for &lt;code&gt;bash&lt;/code&gt;, &lt;code&gt;zsh&lt;/code&gt; or &lt;code&gt;fish&lt;/code&gt;. The script completes commands, flags and the image names that &lt;code&gt;devvm build&lt;/code&gt; and &lt;code&gt;devvm rebuild&lt;/code&gt; take, including layers joined with &lt;code&gt;+&lt;/code&gt; after the ones you&amp;rsquo;ve already typed. It also completes shared tools for &lt;code&gt;devvm tools add&lt;/code&gt; and &lt;code&gt;devvm tools rm&lt;/code&gt;, the lists that &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; take, after the names you&amp;rsquo;ve already typed and their commas, and &lt;code&gt;all&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt; for &lt;code&gt;--ports&lt;/code&gt; and &lt;code&gt;devvm ports&lt;/code&gt;. Load it from your shell&amp;rsquo;s startup file:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shell&lt;/th&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;In&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;bash&lt;/td&gt;
&lt;td&gt;&lt;code&gt;source &amp;lt;(devvm completion bash)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.bashrc&lt;/code&gt;, with the bash-completion package installed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;zsh&lt;/td&gt;
&lt;td&gt;&lt;code&gt;source &amp;lt;(devvm completion zsh)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.zshrc&lt;/code&gt;, after &lt;code&gt;compinit&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fish&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm completion fish | source&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.config/fish/config.fish&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Upgrading and uninstalling</title><link>https://next.devvm.dev/docs/using/upgrading/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/upgrading/</guid><description>
&lt;p&gt;This page covers upgrading devvm, switching between Homebrew and the install script, and removing devvm with everything it keeps. Each depends on how you &lt;a href="https://next.devvm.dev/docs/getting-started/install/"&gt;installed devvm&lt;/a&gt;, and your images, VMs and settings stay through an upgrade or a switch, because they don&amp;rsquo;t live with devvm. &lt;a href="https://next.devvm.dev/docs/internals/install/"&gt;Installing and updating&lt;/a&gt; explains what the install script and devvm upgrade check.&lt;/p&gt;
&lt;h2 data-hextra-search-id="upgrading"&gt;Upgrading&lt;span class="hx:absolute hx:-mt-20" id="upgrading"&gt;&lt;/span&gt;
&lt;a href="#upgrading" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To upgrade devvm, run &lt;code&gt;devvm upgrade&lt;/code&gt;, which installs the newest release the way you installed devvm:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm upgrade &lt;span class="c1"&gt;# install the newest release, asking first&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm upgrade --check &lt;span class="c1"&gt;# say whether a newer release is out, and install nothing&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm upgrade --force &lt;span class="c1"&gt;# install it without asking, as a script must&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm upgrade --to 0.1.0 &lt;span class="c1"&gt;# install that release, even one older than the devvm you have&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm upgrade --to 0.2.0-rc.1 &lt;span class="c1"&gt;# install a prerelease, which only --to installs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It says which release it will install in place of the devvm you have, and asks first, so without a terminal or with &lt;code&gt;--no-input&lt;/code&gt; it needs &lt;code&gt;--force&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You don&amp;rsquo;t have to remember to check. When you run devvm in a terminal, it checks at most once a day for a newer release without making you wait, and when one is out it says so in one line that names devvm upgrade. It never upgrades on its own, and &lt;code&gt;release-check = false&lt;/code&gt; in &lt;code&gt;config.toml&lt;/code&gt; or &lt;code&gt;DEVVM_NO_RELEASE_CHECK=1&lt;/code&gt; turns the check off (&lt;a href="https://next.devvm.dev/docs/using/settings/#the-release-check"&gt;the release check&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;You can also upgrade devvm without devvm upgrade, with the command for the way you installed it:&lt;/p&gt;
&lt;div class="devvm-install"&gt;
&lt;div class="hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain"&gt;
&lt;div class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800" role="tablist"&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-0-1" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-0-1" aria-selected="true" tabindex="0" data-state="selected"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 4h1V3h1V2h1V1H6v1H5Zm-3 7h1v-1H2Zm1 1h2v-1H3Zm-2-2h1V5H1Zm4 1h1v-1H5Zm1 1h2v-1H6Zm2-1h1v-1H8ZM2 5h2V4H2Zm7 5h1V9H9ZM4 6h3V5H4Zm4 3h1V6H8ZM7 5h2V4H7Zm2 1h1V5H9Zm0 0"/&gt;&lt;/svg&gt;macOS&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-0-2" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-0-2" aria-selected="false" tabindex="-1"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M3 1h5v1H3ZM2 2h1v1H2ZM8 2h1v1H8ZM2 3h1v1H2ZM4 3h1v1H4ZM6 3h1v1H6ZM8 3h1v1H8ZM2 4h1v1H2ZM8 4h1v1H8ZM1 5h1v1H1ZM4 5h3v1H4ZM9 5h1v1H9ZM0 6h1v1H0ZM3 6h1v1H3ZM7 6h1v1H7ZM10 6h1v1H10ZM0 7h1v1H0ZM2 7h1v1H2ZM8 7h1v1H8ZM10 7h1v1H10ZM0 8h1v1H0ZM2 8h1v1H2ZM8 8h1v1H8ZM10 8h1v1H10ZM1 9h2v1H1ZM8 9h2v1H8ZM2 10h7v1H2ZM1 11h3v1H1ZM7 11h3v1H7Z"/&gt;&lt;/svg&gt;Linux&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-0-1" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-0-1" aria-hidden="false" tabindex="0" data-state="selected"&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew upgrade devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you installed &lt;code&gt;devvm-rc&lt;/code&gt;, Homebrew&amp;rsquo;s formula for prereleases, run &lt;code&gt;brew upgrade devvm-rc&lt;/code&gt; instead (&lt;a href="#trying-a-prerelease"&gt;trying a prerelease&lt;/a&gt;). If you installed devvm with the install script, run the script again, as on Linux.&lt;/p&gt;&lt;/div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-0-2" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-0-2" aria-hidden="true"&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://github.com/devvmhq/devvm/releases/latest/download/install.sh &lt;span class="p"&gt;|&lt;/span&gt; bash&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Running the install script again installs the newest release.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;script&gt;
(() =&gt; {
const group = document.currentScript.parentElement;
const platform = [navigator.userAgentData?.platform, navigator.platform, navigator.userAgent].join(" ");
if (!/linux/i.test(platform) || /android/i.test(platform)) return;
const select = (elements, attribute, on, off) =&gt;
elements.forEach((element, i) =&gt; {
const selected = i === 1;
element.dataset.state = selected ? "selected" : "";
element.setAttribute(attribute, selected ? on : off);
if (selected) element.tabIndex = 0;
else if (attribute === "aria-selected") element.tabIndex = -1;
else element.removeAttribute("tabindex");
});
select(group.querySelectorAll("[role=tab]"), "aria-selected", "true", "false");
select(group.querySelectorAll("[role=tabpanel]"), "aria-hidden", "false", "true");
})();
&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;Your images and VMs stay, because they live in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, and your settings and layers stay in &lt;code&gt;~/.config/devvm&lt;/code&gt;, apart from devvm itself.&lt;/p&gt;
&lt;p&gt;Images whose inputs changed are built again the next time you use them. Existing VMs keep working, and &lt;code&gt;devvm tools update&lt;/code&gt; moves a VM to the new shared tools. &lt;code&gt;devvm gc&lt;/code&gt; deletes the copies of devvm&amp;rsquo;s files that older versions wrote out, except those that a VM&amp;rsquo;s proxy was started with.&lt;/p&gt;
&lt;h3 data-hextra-search-id="how-devvm-upgrade-upgrades"&gt;How devvm upgrade upgrades&lt;span class="hx:absolute hx:-mt-20" id="how-devvm-upgrade-upgrades"&gt;&lt;/span&gt;
&lt;a href="#how-devvm-upgrade-upgrades" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm upgrade tells how devvm was installed from where the devvm you ran is, and it never runs anything to find out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;With the install script&lt;/strong&gt;, devvm is &lt;code&gt;~/.local/lib/devvm/&amp;lt;version&amp;gt;/devvm&lt;/code&gt;, and &lt;code&gt;~/.local/bin/devvm&lt;/code&gt; links to it, or the same folders under &lt;code&gt;DEVVM_PREFIX&lt;/code&gt;. devvm upgrade downloads the new release and checks it, as &lt;a href="#what-devvm-upgrade-checks"&gt;What devvm upgrade checks&lt;/a&gt; describes. It unpacks the release into a folder of its own beside the devvm you have, runs the new devvm to see that it works, and then switches &lt;code&gt;~/.local/bin/devvm&lt;/code&gt; to it. When anything fails before the new devvm runs through &lt;code&gt;~/.local/bin/devvm&lt;/code&gt;, the link goes back, so the devvm you had stays the one that runs. The version you upgraded from stays in &lt;code&gt;~/.local/lib/devvm&lt;/code&gt;, and so does any older version that a running VM still uses, until a later upgrade finds nothing using it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;With Homebrew&lt;/strong&gt;, devvm is in Homebrew&amp;rsquo;s Cellar, and devvm upgrade runs &lt;code&gt;brew upgrade devvm&lt;/code&gt; after asking, or &lt;code&gt;brew upgrade devvm-rc&lt;/code&gt; when you installed the formula for prereleases. Homebrew may upgrade Lima at the same time, because the formula needs it. Homebrew installs the release its formula names, which can come out a little after the release itself, so until then &lt;code&gt;brew upgrade devvm&lt;/code&gt; finds nothing to upgrade.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Any other way&lt;/strong&gt;, such as &lt;code&gt;go install&lt;/code&gt;, a build from devvm&amp;rsquo;s source, or a copy of devvm somewhere else, devvm upgrade can&amp;rsquo;t upgrade. It says how that devvm was installed and how to upgrade it, such as with &lt;code&gt;go install github.com/devvmhq/devvm/cmd/devvm@latest&lt;/code&gt;, and fails.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A devvm built without a release key it can read can&amp;rsquo;t check a release&amp;rsquo;s signatures, so devvm upgrade refuses to install a release with it and says to run the install script again.&lt;/p&gt;
&lt;h3 data-hextra-search-id="what-devvm-upgrade-checks"&gt;What devvm upgrade checks&lt;span class="hx:absolute hx:-mt-20" id="what-devvm-upgrade-checks"&gt;&lt;/span&gt;
&lt;a href="#what-devvm-upgrade-checks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm upgrade downloads over HTTPS only, and checks each file before it uses the next:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It downloads the release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; and its signatures, and checks that the release key that has signed every release so far signed it for that release&amp;rsquo;s version, or, once devvm has its three new release keys built in, that two of them did. The keys are built into the devvm you have, so a replaced release can&amp;rsquo;t bring its own (&lt;a href="https://next.devvm.dev/docs/internals/install/#the-release-keys-and-the-signatures"&gt;the release keys and the signatures&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;It downloads the archive for this machine and checks it against its checksum in &lt;code&gt;SHA256SUMS&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It unpacks the archive, which must hold only devvm&amp;rsquo;s files in one folder.&lt;/li&gt;
&lt;li&gt;It runs the new devvm with &lt;code&gt;--version&lt;/code&gt;, which must say the release&amp;rsquo;s version.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When a check fails, devvm upgrade installs nothing, and the devvm you have stays the one that runs. It checks the signature itself, so it doesn&amp;rsquo;t need minisign on this machine, as the install script does. It never runs a script that it downloaded, only the new devvm&amp;rsquo;s &lt;code&gt;--version&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="an-older-release"&gt;An older release&lt;span class="hx:absolute hx:-mt-20" id="an-older-release"&gt;&lt;/span&gt;
&lt;a href="#an-older-release" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When the newest release is older than the devvm you have, devvm upgrade refuses to install it, even with &lt;code&gt;--force&lt;/code&gt;. A server that offers an old release in place of the newest could bring back problems that a newer release fixed, so devvm upgrade never goes back a version unless you name it. &lt;code&gt;devvm upgrade --to VERSION&lt;/code&gt; installs the release you name, newer or older, and it asks first, saying when the release is older than the devvm you have. When the devvm you have is a prerelease of a release that isn&amp;rsquo;t out yet, the newest release is older too, and devvm upgrade says so and installs nothing, without failing (&lt;a href="#trying-a-prerelease"&gt;trying a prerelease&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Homebrew installs only its formula&amp;rsquo;s release, so with Homebrew devvm upgrade doesn&amp;rsquo;t take &lt;code&gt;--to&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="trying-a-prerelease"&gt;Trying a prerelease&lt;span class="hx:absolute hx:-mt-20" id="trying-a-prerelease"&gt;&lt;/span&gt;
&lt;a href="#trying-a-prerelease" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A prerelease is a version of devvm that you can try before its release is out, such as a release candidate, &lt;code&gt;0.2.0-rc.1&lt;/code&gt;, or a beta, &lt;code&gt;0.2.0-beta.1&lt;/code&gt;. devvm upgrade and the install script never pick a prerelease as the newest release, and the daily release check never announces one, so you get a prerelease only when you name it or when you install &lt;code&gt;devvm-rc&lt;/code&gt;, Homebrew&amp;rsquo;s formula for prereleases.&lt;/p&gt;
&lt;div class="devvm-callout devvm-callout-note"&gt;
&lt;p class="devvm-callout-title"&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M4 9h3V8H6V5H4v1h1v2H4Zm-3 1h1V9H1Zm1 1h1v-1H2ZM0 9h1V4H0Zm3 3h5v-1H3Zm5-1h1v-1H8ZM1 4h1V3H1Zm8 6h1V9H9ZM2 3h1V2H2Zm3 1h1V3H5Zm5 5h1V4h-1ZM3 2h5V1H3Zm6 2h1V3H9ZM8 3h1V2H8Zm0 0"/&gt;&lt;/svg&gt; Note&lt;/p&gt;&lt;p&gt;The docs at &lt;a href="https://devvm.dev/" target="_blank" rel="noopener"&gt;devvm.dev&lt;/a&gt; are for the newest release. The docs for the next release, which a prerelease comes before, are at &lt;a href="https://next.devvm.dev/" target="_blank" rel="noopener"&gt;next.devvm.dev&lt;/a&gt;, and they change as that release is written, so they can describe more than a prerelease has.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;Versions go in this order: a prerelease comes before its release, a beta before a release candidate, and the numbers in order, so &lt;code&gt;0.2.0-beta.3&lt;/code&gt; comes before &lt;code&gt;0.2.0-rc.1&lt;/code&gt;, then &lt;code&gt;0.2.0-rc.2&lt;/code&gt;, then &lt;code&gt;0.2.0&lt;/code&gt;.&lt;/p&gt;
&lt;h4 data-hextra-search-id="with-homebrew"&gt;With Homebrew&lt;span class="hx:absolute hx:-mt-20" id="with-homebrew"&gt;&lt;/span&gt;
&lt;a href="#with-homebrew" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Homebrew&amp;rsquo;s &lt;code&gt;devvm&lt;/code&gt; formula always names the newest release, and the &lt;code&gt;devvm-rc&lt;/code&gt; formula names the newest prerelease, or the newest release when that&amp;rsquo;s newer. Both install the same &lt;code&gt;devvm&lt;/code&gt; command, so Homebrew installs only one of them at a time. To switch from &lt;code&gt;devvm&lt;/code&gt; to &lt;code&gt;devvm-rc&lt;/code&gt;, uninstall &lt;code&gt;devvm&lt;/code&gt; first, then trust and install &lt;code&gt;devvm-rc&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew uninstall devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew trust --formula devvmhq/tap/devvm-rc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install devvmhq/tap/devvm-rc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To install &lt;code&gt;devvm-rc&lt;/code&gt; when Homebrew hasn&amp;rsquo;t installed devvm before, run only the last two lines. Your images, VMs and settings stay, because they don&amp;rsquo;t live with devvm.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;brew upgrade devvm-rc&lt;/code&gt; moves to the next prerelease once it&amp;rsquo;s out, and to the release once that&amp;rsquo;s out, so &lt;code&gt;devvm-rc&lt;/code&gt; never leaves you on an old prerelease. devvm upgrade runs it for you, after asking, and the daily release check announces each newer prerelease and release. Homebrew installs only its formula&amp;rsquo;s version, so devvm upgrade doesn&amp;rsquo;t take &lt;code&gt;--to&lt;/code&gt; here either.&lt;/p&gt;
&lt;p&gt;To go back to releases only, uninstall &lt;code&gt;devvm-rc&lt;/code&gt; and install &lt;code&gt;devvm&lt;/code&gt; again, after trusting it if you never installed it before:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew uninstall devvm-rc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew trust --formula devvmhq/tap/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install devvmhq/tap/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;devvm&lt;/code&gt; installs the newest release, even when that&amp;rsquo;s older than the prerelease you had.&lt;/p&gt;
&lt;h4 data-hextra-search-id="with-the-install-script"&gt;With the install script&lt;span class="hx:absolute hx:-mt-20" id="with-the-install-script"&gt;&lt;/span&gt;
&lt;a href="#with-the-install-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;To install a prerelease with the install script, run the copy of the script that comes with the prerelease, which installs that prerelease, or give its version to the newest release&amp;rsquo;s script with &lt;code&gt;--version&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://github.com/devvmhq/devvm/releases/download/v0.2.0-rc.1/install.sh &lt;span class="p"&gt;|&lt;/span&gt; bash
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://github.com/devvmhq/devvm/releases/latest/download/install.sh &lt;span class="p"&gt;|&lt;/span&gt; bash -s -- --version 0.2.0-rc.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When the install script installed the devvm you have, &lt;code&gt;devvm upgrade --to 0.2.0-rc.1&lt;/code&gt; installs the prerelease too. Both check a prerelease&amp;rsquo;s signature and checksum as they check a release&amp;rsquo;s.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;While you run a prerelease that the install script installed, devvm upgrade offers the release it comes before once that release is out, and the daily check says so. It never offers a newer prerelease, such as &lt;code&gt;0.2.0-rc.2&lt;/code&gt;, so install one with &lt;code&gt;devvm upgrade --to 0.2.0-rc.2&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;To go back to the newest release before the prerelease&amp;rsquo;s own release is out, name the newest release&amp;rsquo;s version, such as &lt;code&gt;devvm upgrade --to 0.1.0&lt;/code&gt;. devvm upgrade asks first, because that release is older than the prerelease you have.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="devvm-upgrade-json"&gt;devvm upgrade &amp;ndash;json&lt;span class="hx:absolute hx:-mt-20" id="devvm-upgrade-json"&gt;&lt;/span&gt;
&lt;a href="#devvm-upgrade-json" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;devvm upgrade --json&lt;/code&gt; prints what &lt;code&gt;devvm upgrade --check&lt;/code&gt; says as one JSON object, for scripts, as &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; describes, and installs nothing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;current&lt;/code&gt; is the version of the devvm you ran.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;latest&lt;/code&gt; is the newest release&amp;rsquo;s version, which is never a prerelease&amp;rsquo;s, except with Homebrew&amp;rsquo;s &lt;code&gt;devvm-rc&lt;/code&gt;, where it&amp;rsquo;s the newest prerelease&amp;rsquo;s or release&amp;rsquo;s, whichever is newer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;newer&lt;/code&gt; says whether that&amp;rsquo;s newer than &lt;code&gt;current&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;install&lt;/code&gt; is how devvm was installed, &lt;code&gt;install.sh&lt;/code&gt;, &lt;code&gt;homebrew&lt;/code&gt; or &lt;code&gt;other&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;path&lt;/code&gt; is where the devvm you ran is, its links followed.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;current&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;0.1.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;latest&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;0.2.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;newer&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;install&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;install.sh&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;path&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/Users/you/.local/lib/devvm/0.1.0/devvm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="one-devvm"&gt;One devvm&lt;span class="hx:absolute hx:-mt-20" id="one-devvm"&gt;&lt;/span&gt;
&lt;a href="#one-devvm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Install devvm one way, with Homebrew or with the install script, but not both. With two copies, the one that comes first on your &lt;code&gt;PATH&lt;/code&gt; is the one that runs, and &lt;code&gt;brew upgrade devvm&lt;/code&gt; may update the one you don&amp;rsquo;t run. So when Homebrew installed devvm, the install script stops before it downloads anything and says to run &lt;code&gt;brew upgrade devvm&lt;/code&gt; instead, or &lt;code&gt;brew uninstall devvm&lt;/code&gt; first if you want to use the script, and its &lt;code&gt;--force&lt;/code&gt; installs a second copy anyway (&lt;a href="https://next.devvm.dev/docs/internals/install/#the-install-script"&gt;the install script&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;To switch from one way to the other, remove devvm with the command for the way you installed it, as step 5 of &lt;a href="#uninstalling"&gt;Uninstalling&lt;/a&gt; shows, and then install it the other way. Your images, VMs and settings stay, because they don&amp;rsquo;t live with devvm:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# from Homebrew to the install script&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew uninstall devvm &lt;span class="c1"&gt;# or devvm-rc, if that&amp;#39;s the formula you installed&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://github.com/devvmhq/devvm/releases/latest/download/install.sh &lt;span class="p"&gt;|&lt;/span&gt; bash
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# from the install script to Homebrew&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -rf ~/.local/lib/devvm ~/.local/bin/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew trust --formula devvmhq/tap/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install devvmhq/tap/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;After it installs devvm, the script warns when another devvm comes before &lt;code&gt;~/.local/bin&lt;/code&gt; on your &lt;code&gt;PATH&lt;/code&gt;. The warning names that copy&amp;rsquo;s path and says to remove it, or to put &lt;code&gt;~/.local/bin&lt;/code&gt; before its folder in &lt;code&gt;PATH&lt;/code&gt;. &lt;code&gt;devvm doctor&lt;/code&gt; warns the same way when the devvm first on your &lt;code&gt;PATH&lt;/code&gt; isn&amp;rsquo;t the one you ran, naming both, and the warning doesn&amp;rsquo;t make it fail.&lt;/p&gt;
&lt;h2 data-hextra-search-id="uninstalling"&gt;Uninstalling&lt;span class="hx:absolute hx:-mt-20" id="uninstalling"&gt;&lt;/span&gt;
&lt;a href="#uninstalling" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Delete your VMs: &lt;code&gt;devvm ls&lt;/code&gt;, then &lt;code&gt;devvm rm&lt;/code&gt; in each folder. For a &lt;code&gt;--clone&lt;/code&gt; VM, this also removes the &lt;code&gt;devvm&lt;/code&gt; git remote from the repo.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Delete the images: &lt;code&gt;devvm gc&lt;/code&gt;, then &lt;code&gt;devvm images rm&lt;/code&gt; with every name &lt;code&gt;devvm images&lt;/code&gt; lists. Images built &lt;code&gt;--from&lt;/code&gt; a container image need the same &lt;code&gt;--from&lt;/code&gt;: &lt;code&gt;devvm images rm --from node:24 base&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Free Lima&amp;rsquo;s cache. In a terminal, &lt;code&gt;devvm gc --caches&lt;/code&gt; frees devvm&amp;rsquo;s share of it, after asking. If you don&amp;rsquo;t use Lima yourself, you can also empty its cache: Lima keeps Ubuntu&amp;rsquo;s cloud images in &lt;code&gt;~/Library/Caches/lima&lt;/code&gt; on macOS and &lt;code&gt;~/.cache/lima&lt;/code&gt; on Linux, and &lt;code&gt;limactl prune&lt;/code&gt; deletes that whole cache.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Delete your saved secrets: &lt;code&gt;devvm secret rm NAME&lt;/code&gt; for each one &lt;code&gt;devvm secret&lt;/code&gt; lists. On macOS they&amp;rsquo;re in the Keychain under the service &lt;code&gt;devvm&lt;/code&gt;, and on Linux in &lt;code&gt;~/.local/share/devvm/secrets/&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remove devvm itself, with the command for the way you installed it:&lt;/p&gt;
&lt;div class="devvm-install"&gt;
&lt;div class="hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain"&gt;
&lt;div class="hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800" role="tablist"&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-1-1" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-1-1" aria-selected="true" tabindex="0" data-state="selected"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M5 4h1V3h1V2h1V1H6v1H5Zm-3 7h1v-1H2Zm1 1h2v-1H3Zm-2-2h1V5H1Zm4 1h1v-1H5Zm1 1h2v-1H6Zm2-1h1v-1H8ZM2 5h2V4H2Zm7 5h1V9H9ZM4 6h3V5H4Zm4 3h1V6H8ZM7 5h2V4H7Zm2 1h1V5H9Zm0 0"/&gt;&lt;/svg&gt;macOS&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;button class="hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset" id="tabs-tab-tabs-os-tabs-1-2" role="tab" type="button" aria-controls="tabs-panel-tabs-os-tabs-1-2" aria-selected="false" tabindex="-1"&gt;&lt;span class="hx:inline-flex hx:items-center hx:gap-1.5"&gt;&lt;span&gt;&lt;svg class="devvm-icon" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" fill="currentColor" shape-rendering="crispEdges"&gt;&lt;path d="M3 1h5v1H3ZM2 2h1v1H2ZM8 2h1v1H8ZM2 3h1v1H2ZM4 3h1v1H4ZM6 3h1v1H6ZM8 3h1v1H8ZM2 4h1v1H2ZM8 4h1v1H8ZM1 5h1v1H1ZM4 5h3v1H4ZM9 5h1v1H9ZM0 6h1v1H0ZM3 6h1v1H3ZM7 6h1v1H7ZM10 6h1v1H10ZM0 7h1v1H0ZM2 7h1v1H2ZM8 7h1v1H8ZM10 7h1v1H10ZM0 8h1v1H0ZM2 8h1v1H2ZM8 8h1v1H8ZM10 8h1v1H10ZM1 9h2v1H1ZM8 9h2v1H8ZM2 10h7v1H2ZM1 11h3v1H1ZM7 11h3v1H7Z"/&gt;&lt;/svg&gt;Linux&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-1-1" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-1-1" aria-hidden="false" tabindex="0" data-state="selected"&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew uninstall devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you installed &lt;code&gt;devvm-rc&lt;/code&gt;, run &lt;code&gt;brew uninstall devvm-rc&lt;/code&gt; instead. If you installed devvm with the install script, remove it as on Linux.&lt;/p&gt;&lt;/div&gt;&lt;div class="hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block" id="tabs-panel-tabs-os-tabs-1-2" role="tabpanel" aria-labelledby="tabs-tab-tabs-os-tabs-1-2" aria-hidden="true"&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -rf ~/.local/lib/devvm ~/.local/bin/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;script&gt;
(() =&gt; {
const group = document.currentScript.parentElement;
const platform = [navigator.userAgentData?.platform, navigator.platform, navigator.userAgent].join(" ");
if (!/linux/i.test(platform) || /android/i.test(platform)) return;
const select = (elements, attribute, on, off) =&gt;
elements.forEach((element, i) =&gt; {
const selected = i === 1;
element.dataset.state = selected ? "selected" : "";
element.setAttribute(attribute, selected ? on : off);
if (selected) element.tabIndex = 0;
else if (attribute === "aria-selected") element.tabIndex = -1;
else element.removeAttribute("tabindex");
});
select(group.querySelectorAll("[role=tab]"), "aria-selected", "true", "false");
select(group.querySelectorAll("[role=tabpanel]"), "aria-hidden", "false", "true");
})();
&lt;/script&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remove its state: &lt;code&gt;rm -rf ~/.local/share/devvm ~/.config/devvm&lt;/code&gt;. That includes your layers, in &lt;code&gt;~/.config/devvm/layers&lt;/code&gt;, so copy them somewhere first to keep them. It also includes your exports, the agents&amp;rsquo; history that &lt;code&gt;devvm rm&lt;/code&gt; saved, and devvm&amp;rsquo;s agent store, the agents&amp;rsquo; settings in &lt;code&gt;~/.config/devvm/agents&lt;/code&gt; and their logins in &lt;code&gt;~/.local/share/devvm/logins&lt;/code&gt;. On macOS, the Time Machine exclusions that devvm set on its CA folders and logins folders go with the folders.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you let devvm add it, remove the &lt;code&gt;Include ~/.local/share/devvm/ssh_config&lt;/code&gt; line from &lt;code&gt;~/.ssh/config&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Troubleshooting</title><link>https://next.devvm.dev/docs/using/troubleshooting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/troubleshooting/</guid><description>
&lt;p&gt;Each section below starts with what you see, then says what to do, with a link to the details.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-command-fails"&gt;A command fails&lt;span class="hx:absolute hx:-mt-20" id="a-command-fails"&gt;&lt;/span&gt;
&lt;a href="#a-command-fails" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm prints its own steps and sends the output of the commands it runs to a log, and when a step fails, it prints the end of that log. To watch the output as it runs, add &lt;code&gt;-v&lt;/code&gt; or &lt;code&gt;--verbose&lt;/code&gt; to any command:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm -v &lt;span class="c1"&gt;# open this folder&amp;#39;s VM, showing each command&amp;#39;s output&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm -v build base &lt;span class="c1"&gt;# the same for any command&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With &lt;code&gt;-v&lt;/code&gt;, devvm shows each line on standard error as the log gets it, in place of the status line, and it still writes the log. When a step fails with &lt;code&gt;-v&lt;/code&gt;, devvm names the log instead of printing its end again.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The status line,&lt;/strong&gt; which devvm shows in a terminal without &lt;code&gt;-v&lt;/code&gt;, says what devvm is waiting for, such as a command it runs, a check of the VM, a look through a folder or another devvm that&amp;rsquo;s changing the same thing. It also shows how long the wait has run and the log&amp;rsquo;s latest line, and a step that takes more than a few seconds leaves a line with its time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A wait for another devvm&lt;/strong&gt; shows nothing with &lt;code&gt;-v&lt;/code&gt; or without a terminal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A warning&lt;/strong&gt; prints above the status line, and a question takes the status line away until you answer it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The log&lt;/strong&gt; is &lt;code&gt;~/.local/share/devvm/logs/runs/&amp;lt;date&amp;gt;-&amp;lt;time&amp;gt;-&amp;lt;pid&amp;gt;.log&lt;/code&gt;, one for each run that runs a command, which only you can read, and devvm keeps the newest 20, fewer when they take more than 256 MiB together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each command&lt;/strong&gt; appears in it as a &lt;code&gt;+&lt;/code&gt; line with its arguments, followed by its output, and a numbered step adds a &lt;code&gt;# [2/5] &amp;lt;step&amp;gt;&lt;/code&gt; line first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Passwords and a VM&amp;rsquo;s proxy key&lt;/strong&gt; stay out of it, written as &lt;code&gt;user:&amp;lt;password&amp;gt;@&lt;/code&gt; and &lt;code&gt;devvm:&amp;lt;key&amp;gt;@&lt;/code&gt;, including a company proxy&amp;rsquo;s password from your shell&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/overview/#the-run-log"&gt;the run log&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="a-command-is-refused-before-it-runs"&gt;A command is refused before it runs&lt;span class="hx:absolute hx:-mt-20" id="a-command-is-refused-before-it-runs"&gt;&lt;/span&gt;
&lt;a href="#a-command-is-refused-before-it-runs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm checks a command&amp;rsquo;s arguments and flags before it does anything else, so a mistyped one never reaches your VM. When one is wrong, such as a missing argument, one too many, a value the command doesn&amp;rsquo;t take or a flag it doesn&amp;rsquo;t have, devvm says what the command expected, then names that command&amp;rsquo;s own help on the last line:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; devvm ports &lt;span class="m"&gt;5173&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;devvm: The command devvm ports takes [all|none|LIST], not 5173 8080.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;devvm: https://devvm.dev/docs/using/troubleshooting/#a-command-is-refused-before-it-runs
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;Run devvm ports --help to see how to use it.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Nothing has changed at that point, so you can fix the command and run it again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="exit-codes"&gt;Exit codes&lt;span class="hx:absolute hx:-mt-20" id="exit-codes"&gt;&lt;/span&gt;
&lt;a href="#exit-codes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm exits with one of four codes, so a script can tell what happened:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;The command succeeded.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;The command failed, and devvm&amp;rsquo;s error says why.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;devvm refused the command line, such as a bad argument or flag or an unknown command, before anything ran.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;td&gt;The command was interrupted by Ctrl+C or a closed terminal (&lt;a href="#you-pressed-ctrlc"&gt;you pressed Ctrl+C&lt;/a&gt;).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Two programs can take devvm&amp;rsquo;s place and exit with their own codes. Once devvm opens a shell in your VM, the shell replaces devvm, so the code is the shell&amp;rsquo;s, and &lt;code&gt;devvm limactl&lt;/code&gt; exits with limactl&amp;rsquo;s code.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-build-fails"&gt;A build fails&lt;span class="hx:absolute hx:-mt-20" id="a-build-fails"&gt;&lt;/span&gt;
&lt;a href="#a-build-fails" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When an image&amp;rsquo;s build fails in its script, or as the build VM starts or stops, devvm keeps the build VM, stopped and without a record, so you can look inside. devvm&amp;rsquo;s error names the VM and says how to open a shell in it. On Lima, that&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/backends/lima/#running-limactl"&gt;&lt;code&gt;devvm limactl&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm limactl shell --start devvm-img-&amp;lt;key&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;--start&lt;/code&gt; starts the VM first, outside the build&amp;rsquo;s confinement. What happens next depends on the failure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The next build of that image deletes the VM and starts over, and &lt;code&gt;devvm gc&lt;/code&gt; also deletes it.&lt;/li&gt;
&lt;li&gt;A build whose create or clone fails deletes the image, once devvm has shown the end of the log, because there&amp;rsquo;s nothing in the image to look at.&lt;/li&gt;
&lt;li&gt;A first build of base also fails when the packages its VM gives back aren&amp;rsquo;t exactly the packages apt downloaded, each named by its own checksum with apt&amp;rsquo;s entry for it. devvm then keeps none of them, so nothing it didn&amp;rsquo;t check reaches its package cache (&lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Either way, the images under it, which are already built, stay. devvm deletes and builds again any image it finds without its record, such as a failed build&amp;rsquo;s or one devvm couldn&amp;rsquo;t clean up after a crash or a power cut.&lt;/p&gt;
&lt;h2 data-hextra-search-id="not-enough-free-space"&gt;Not enough free space&lt;span class="hx:absolute hx:-mt-20" id="not-enough-free-space"&gt;&lt;/span&gt;
&lt;a href="#not-enough-free-space" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before each build and each new VM, devvm checks the free space on the disk that will hold it, and it refuses when there&amp;rsquo;s less than the step needs. With Lima on macOS, that&amp;rsquo;s 8 GiB for base, 2 GiB for another image or a VM, and from 4 GiB for one shared tool to 8 GiB for all ten, and &lt;a href="https://next.devvm.dev/docs/using/ports-size/#free-space"&gt;free space&lt;/a&gt; gives the numbers for Linux hosts. The message says which folder&amp;rsquo;s disk it checked, how much is free and how much the step needs. Nothing has been built or made yet, so you can make room and run the same command again:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devvm gc&lt;/code&gt; deletes stale and unfinished images and unused shared tool images (&lt;a href="https://next.devvm.dev/docs/using/images/#cleaning-up"&gt;cleaning up&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm images&lt;/code&gt; lists the images and shared tool images with the space each takes, and &lt;code&gt;devvm images rm&lt;/code&gt; deletes those you don&amp;rsquo;t need (&lt;a href="https://next.devvm.dev/docs/using/images/#deleting-images"&gt;deleting images&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ls&lt;/code&gt; lists your VMs, and &lt;code&gt;devvm rm&lt;/code&gt; deletes one. devvm never deletes a VM to make room, because a VM may hold work you haven&amp;rsquo;t saved.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When devvm says it couldn&amp;rsquo;t read the free space, the error after the message says why, such as a folder it can&amp;rsquo;t reach.&lt;/p&gt;
&lt;h2 data-hextra-search-id="you-pressed-ctrlc"&gt;You pressed Ctrl+C&lt;span class="hx:absolute hx:-mt-20" id="you-pressed-ctrlc"&gt;&lt;/span&gt;
&lt;a href="#you-pressed-ctrlc" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ctrl+C, or closing the terminal, stops the command that&amp;rsquo;s running, cleans up what the run left unfinished, and exits with code 130. A second Ctrl+C doesn&amp;rsquo;t stop the cleanup. At a question, Ctrl+C ends the run at once, and devvm doesn&amp;rsquo;t take an answer you type after it, so nothing goes ahead.&lt;/p&gt;
&lt;p&gt;devvm deletes an interrupted new VM, with its state, until its first shell opens, because nothing of yours is in it yet. An interrupted build deletes the image it was building.&lt;/p&gt;
&lt;h2 data-hextra-search-id="base-cant-build-on-lima"&gt;base can&amp;rsquo;t build on Lima&lt;span class="hx:absolute hx:-mt-20" id="base-cant-build-on-lima"&gt;&lt;/span&gt;
&lt;a href="#base-cant-build-on-lima" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On Lima, base starts from a dated release of Ubuntu&amp;rsquo;s cloud image. The first time devvm builds base, it finds the newest release on cloud-images.ubuntu.com and pins it on this machine, then downloads that image, which takes a while on a slow link (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;). What devvm says tells you which of these went wrong:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It can&amp;rsquo;t pin a release.&lt;/strong&gt; The first build needs to reach Ubuntu&amp;rsquo;s list of releases and the release&amp;rsquo;s checksums, and when it can&amp;rsquo;t, devvm says so and pins nothing. Check that you&amp;rsquo;re online and run the command again. When the newest release doesn&amp;rsquo;t boot, devvm says so and builds base from the release before it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It couldn&amp;rsquo;t download the image.&lt;/strong&gt; devvm keeps what came, so check that you&amp;rsquo;re online, or that a company proxy lets the download through, and run the command again, which goes on from where the last try stopped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The server&amp;rsquo;s certificate isn&amp;rsquo;t valid.&lt;/strong&gt; When a CA this machine trusts signed a certificate that&amp;rsquo;s out of date or for another host, devvm says so, for the list of releases and the image alike. Check that this machine&amp;rsquo;s date and time are right, and that nothing on this network, such as a hotel&amp;rsquo;s sign-in page, answers for that host. When the certificate fails for another reason, such as a weak signature from a network that inspects TLS, devvm names that reason, and trying again won&amp;rsquo;t help. A certificate this machine doesn&amp;rsquo;t trust at all needs your company&amp;rsquo;s CA (&lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The release is gone.&lt;/strong&gt; Once an image is pinned, building base again needs devvm&amp;rsquo;s copy of it, Lima&amp;rsquo;s cached copy or the release itself, which Ubuntu removes after a few months, and devvm says when Ubuntu no longer has it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A package is gone or changed.&lt;/strong&gt; Building the same base again also needs the copies of its packages that devvm kept from its first build, and when one of them is gone or changed, devvm names it and builds nothing (&lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When the release or a package is gone, start base again from the newest release and packages:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rebuild base &lt;span class="c1"&gt;# pin the newest cloud image again, and install the newest packages&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="no-package-source-answers"&gt;No package source answers&lt;span class="hx:absolute hx:-mt-20" id="no-package-source-answers"&gt;&lt;/span&gt;
&lt;a href="#no-package-source-answers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The first build of base on this machine gets its packages from Ubuntu&amp;rsquo;s archive, or first from the &lt;a href="https://next.devvm.dev/docs/using/settings/#an-ubuntu-mirror"&gt;mirror you set&lt;/a&gt;. When neither answers, devvm stops at once and says so, without trying again, and it keeps the build VM stopped as for any &lt;a href="#a-build-fails"&gt;failed build&lt;/a&gt;. Check that you&amp;rsquo;re online, and that the mirror&amp;rsquo;s address is right, then run the command again. Building the same base again later needs neither, because devvm installs the packages it kept from the first build.&lt;/p&gt;
&lt;h2 data-hextra-search-id="base-gets-old-package-lists"&gt;Base gets old package lists&lt;span class="hx:absolute hx:-mt-20" id="base-gets-old-package-lists"&gt;&lt;/span&gt;
&lt;a href="#base-gets-old-package-lists" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The first build of base checks that the package lists it got are as new as the Ubuntu cloud image it starts from, because Ubuntu&amp;rsquo;s signed lists don&amp;rsquo;t expire, and a server that stopped updating still serves them. When the lists for one part of the archive, such as &lt;code&gt;resolute-updates&lt;/code&gt;, are more than a day older than the cloud image, devvm refuses them, keeps none of the build&amp;rsquo;s packages and names that part, its date and the image. When you set a &lt;a href="https://next.devvm.dev/docs/using/settings/#an-ubuntu-mirror"&gt;mirror&lt;/a&gt;, devvm names it, so set &lt;code&gt;ubuntu-mirror&lt;/code&gt; to one that&amp;rsquo;s up to date, or remove it to use Ubuntu&amp;rsquo;s archive. Without a mirror, the old lists came from Ubuntu&amp;rsquo;s archive itself, so check that no proxy or cache between you and the archive serves an old copy, then run the command again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-file-devvm-cant-read"&gt;A file devvm can&amp;rsquo;t read&lt;span class="hx:absolute hx:-mt-20" id="a-file-devvm-cant-read"&gt;&lt;/span&gt;
&lt;a href="#a-file-devvm-cant-read" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When devvm can&amp;rsquo;t read one of its settings or state files, it names the file, and the line when the problem is on one. Fix the line or delete the file. &lt;a href="https://next.devvm.dev/docs/using/settings/#your-settings"&gt;Your settings&lt;/a&gt; lists what each file you edit holds, and &lt;a href="https://next.devvm.dev/docs/using/space/#devvms-data-folder"&gt;devvm&amp;rsquo;s data folder&lt;/a&gt; what each file devvm writes holds.&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s own state file, &lt;code&gt;vm.json&lt;/code&gt; in its folder in &lt;code&gt;vms/&lt;/code&gt;, is the one to fix rather than delete, because it&amp;rsquo;s what devvm knows of that VM. While devvm can&amp;rsquo;t read it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every command on that VM fails, and the commands that read every VM leave that VM out and carry on with the rest.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm ls&lt;/code&gt; warns and lists the VM with its name and status alone, when its backend has it, and &lt;code&gt;devvm gc --orphans&lt;/code&gt; never forgets it.&lt;/li&gt;
&lt;li&gt;devvm doesn&amp;rsquo;t know which shared tools such a VM uses or which folders it mounts, so &lt;code&gt;devvm space&lt;/code&gt;, &lt;code&gt;devvm images&lt;/code&gt; and &lt;code&gt;devvm gc&lt;/code&gt; fail and name the file.&lt;/li&gt;
&lt;li&gt;devvm refuses to add a key to its own SSH agent, or to load one into it as a VM starts, because it can&amp;rsquo;t tell whether that VM mounts the key&amp;rsquo;s folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every command on such a VM fails until you fix its file. To find every VM whose state devvm can&amp;rsquo;t read, run doctor:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm doctor &lt;span class="c1"&gt;# warns of each VM whose vm.json, or a section of it, devvm can&amp;#39;t read&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;doctor reads each VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt; and each of its sections as every command on a VM reads them, without changing anything. It names each VM it can&amp;rsquo;t read once, with the file and why, even when it can&amp;rsquo;t read the VM&amp;rsquo;s folder, and such a VM doesn&amp;rsquo;t hide doctor&amp;rsquo;s other warnings, such as a line of another VM&amp;rsquo;s policy file that isn&amp;rsquo;t a rule.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-says-a-newer-release-is-out"&gt;devvm says a newer release is out&lt;span class="hx:absolute hx:-mt-20" id="devvm-says-a-newer-release-is-out"&gt;&lt;/span&gt;
&lt;a href="#devvm-says-a-newer-release-is-out" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you run devvm in a terminal and a newer release is out, devvm says so in one line before it opens the VM, and it opens the VM as usual. Run &lt;code&gt;devvm upgrade&lt;/code&gt; to install the release, or carry on with the devvm you have, because devvm never upgrades on its own. The line comes from devvm&amp;rsquo;s daily check, and &lt;code&gt;devvm doctor&lt;/code&gt; shows the newest release that check found and the day it found it. When you&amp;rsquo;d rather not see the line, set &lt;code&gt;release-check = false&lt;/code&gt; in &lt;code&gt;config.toml&lt;/code&gt;, or &lt;code&gt;DEVVM_NO_RELEASE_CHECK=1&lt;/code&gt; in the environment (&lt;a href="https://next.devvm.dev/docs/using/settings/#the-release-check"&gt;the release check&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;When devvm never says it, even though a newer release is out, the check may not have run yet, because it runs once a day and the line comes from what it found the time before. It also doesn&amp;rsquo;t run while you&amp;rsquo;re offline, without a terminal, with &lt;code&gt;--no-input&lt;/code&gt;, for a devvm built from its source, or for a copy that neither the install script nor Homebrew installed. &lt;code&gt;devvm upgrade --check&lt;/code&gt; asks GitHub at once:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm upgrade --check &lt;span class="c1"&gt;# ask GitHub for the newest release now, and install nothing&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm upgrade &lt;span class="c1"&gt;# install it, after asking&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="a-newer-devvm-changed-devvms-folders"&gt;A newer devvm changed devvm&amp;rsquo;s folders&lt;span class="hx:absolute hx:-mt-20" id="a-newer-devvm-changed-devvms-folders"&gt;&lt;/span&gt;
&lt;a href="#a-newer-devvm-changed-devvms-folders" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s data folder, &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, and its settings folder, &lt;code&gt;~/.config/devvm&lt;/code&gt;, each record their layout version in a file named &lt;code&gt;version&lt;/code&gt;, which says how devvm keeps its files there, and devvm checks both before each command. When either one has a newer version than this devvm&amp;rsquo;s, a newer devvm has changed the folders, so this one refuses to run rather than misread them, and it names the file and both versions. Run the newer devvm, or upgrade this one to it, for example after going back to an older version by mistake. &lt;code&gt;devvm --version&lt;/code&gt;, help and completion still run. An older version is never refused, because devvm changes the folders to its own layout before the command runs, and a folder without a &lt;code&gt;version&lt;/code&gt; file gets this devvm&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/internals/overview/#the-layout-version"&gt;the layout version&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvm-names-set-id-files"&gt;devvm names set-id files&lt;span class="hx:absolute hx:-mt-20" id="devvm-names-set-id-files"&gt;&lt;/span&gt;
&lt;a href="#devvm-names-set-id-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On a Linux host, root in a VM can set the set-user-id and set-group-id bits on files in the project folder, and those bits reach this machine, so such a file runs as its owner for anyone who runs it. devvm names these files when it makes a VM and once a VM is stopped, by devvm stop or found stopped at a launch, but not at a launch into a running VM, because looking through a big folder takes a while. It names the ones that root owns apart from the rest, because those run as root, and it doesn&amp;rsquo;t look in &lt;code&gt;.git&lt;/code&gt; folders.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For a file that root owns, don&amp;rsquo;t run it, and delete it with &lt;code&gt;sudo rm FILE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For any other file, &lt;code&gt;chmod u-s,g-s FILE&lt;/code&gt; clears its bits.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Either way, don&amp;rsquo;t run programs from the project folder outside the VM (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#files-the-vm-writes"&gt;files the VM writes&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="home-isnt-an-absolute-path"&gt;HOME isn&amp;rsquo;t an absolute path&lt;span class="hx:absolute hx:-mt-20" id="home-isnt-an-absolute-path"&gt;&lt;/span&gt;
&lt;a href="#home-isnt-an-absolute-path" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm finds its folders from &lt;code&gt;HOME&lt;/code&gt;, so it stops when &lt;code&gt;HOME&lt;/code&gt; is empty or isn&amp;rsquo;t an absolute path. Set &lt;code&gt;HOME&lt;/code&gt; to your home folder, such as &lt;code&gt;/Users/you&lt;/code&gt; on macOS or &lt;code&gt;/home/you&lt;/code&gt; on Linux, and run devvm again.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-vm-shows-as-unenforced"&gt;A VM shows as unenforced&lt;span class="hx:absolute hx:-mt-20" id="a-vm-shows-as-unenforced"&gt;&lt;/span&gt;
&lt;a href="#a-vm-shows-as-unenforced" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm ls&lt;/code&gt; and &lt;code&gt;devvm network&lt;/code&gt; show a VM&amp;rsquo;s tier as &lt;code&gt;unenforced&lt;/code&gt; when the VM is on a confined tier but devvm didn&amp;rsquo;t start it confined. That happens when it was started outside devvm, such as with &lt;code&gt;devvm limactl start&lt;/code&gt;, or when it has been running since before &lt;code&gt;devvm network&lt;/code&gt; moved it from open to a confined tier, such as with &lt;code&gt;devvm network allowlist&lt;/code&gt;. The VM then reaches the network without its proxy.&lt;/p&gt;
&lt;p&gt;On the VM&amp;rsquo;s next launch, devvm offers in a terminal to restart it confined, and if you decline, it warns and goes on. Without a terminal, or with &lt;code&gt;--no-input&lt;/code&gt;, devvm stops the VM instead, and the next &lt;code&gt;devvm&lt;/code&gt; starts it confined (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-self-check"&gt;the self-check&lt;/a&gt;). To confine it at once:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm restart &lt;span class="c1"&gt;# in the VM&amp;#39;s folder: start it again behind its proxy&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you press Ctrl+C while devvm starts a confined VM, devvm stops the VM and its proxy before it exits, so the VM never runs on without the proxy, and the next &lt;code&gt;devvm&lt;/code&gt; starts both again confined.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-proxy-doesnt-start"&gt;The proxy doesn&amp;rsquo;t start&lt;span class="hx:absolute hx:-mt-20" id="the-proxy-doesnt-start"&gt;&lt;/span&gt;
&lt;a href="#the-proxy-doesnt-start" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A confined VM runs only with its proxy, so when the proxy doesn&amp;rsquo;t start, devvm stops the VM, and the next &lt;code&gt;devvm&lt;/code&gt; starts both again. When devvm refuses before it has stopped the running proxy, such as when your company proxy&amp;rsquo;s password isn&amp;rsquo;t saved, the VM and that proxy run on as long as the proxy still enforces the VM&amp;rsquo;s tier. Otherwise devvm stops the VM.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The proxy didn&amp;rsquo;t start:&lt;/strong&gt; read the log devvm names for why. A VM&amp;rsquo;s is &lt;code&gt;proxy.log&lt;/code&gt; in its logs folder, where the proxy&amp;rsquo;s two processes, its broker and its child, each write their own lines, and a build&amp;rsquo;s is &lt;code&gt;proxy.log&lt;/code&gt; in the build proxy&amp;rsquo;s &lt;code&gt;logs/&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another program took the proxy&amp;rsquo;s port:&lt;/strong&gt; devvm picks another port the next time it starts the VM, so run &lt;code&gt;devvm restart&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy doesn&amp;rsquo;t stop for new settings:&lt;/strong&gt; run &lt;code&gt;devvm stop&lt;/code&gt;, then &lt;code&gt;devvm&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-proxy"&gt;the proxy&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open VM&amp;rsquo;s proxy doesn&amp;rsquo;t answer it:&lt;/strong&gt; the VM runs on, and devvm warns you, because its tools that use the proxy fail, so run &lt;code&gt;devvm restart&lt;/code&gt;, which starts both again.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-proxy-runs-without-a-sandbox"&gt;The proxy runs without a sandbox&lt;span class="hx:absolute hx:-mt-20" id="the-proxy-runs-without-a-sandbox"&gt;&lt;/span&gt;
&lt;a href="#the-proxy-runs-without-a-sandbox" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The part of a VM&amp;rsquo;s proxy that reads the VM&amp;rsquo;s network runs in a sandbox, which is macOS&amp;rsquo;s on macOS, and Landlock and a seccomp filter on Linux. If a VM ever took that part over, the sandbox keeps it from your files, your unix sockets, this machine&amp;rsquo;s services on &lt;code&gt;localhost&lt;/code&gt; and the rest of this machine. When the sandbox can&amp;rsquo;t start, or the kernel has only part of it, the proxy runs with what there is, so the VM keeps its network, and devvm doctor warns for each running VM:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm doctor &lt;span class="c1"&gt;# names each VM whose proxy runs without a sandbox&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tail ~/.local/share/devvm/vms/&amp;lt;hash&amp;gt;/logs/proxy.log &lt;span class="c1"&gt;# the proxy&amp;#39;s own warning, with why&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm restart &lt;span class="c1"&gt;# in the VM&amp;#39;s folder: start the proxy again, sandboxed if it can be&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;sandbox-exec is missing:&lt;/strong&gt; macOS&amp;rsquo;s &lt;code&gt;/usr/bin/sandbox-exec&lt;/code&gt; runs the sandbox, and Lima&amp;rsquo;s hostagent also needs it, so check that it&amp;rsquo;s there, and run &lt;code&gt;devvm restart&lt;/code&gt; once it is.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;sandbox-exec couldn&amp;rsquo;t start it:&lt;/strong&gt; &lt;code&gt;proxy.log&lt;/code&gt; has &lt;code&gt;sandbox-exec&lt;/code&gt;&amp;rsquo;s own error, which says why, such as a profile that this macOS refused. Run &lt;code&gt;devvm restart&lt;/code&gt; once you&amp;rsquo;ve fixed what it names, and if it names devvm&amp;rsquo;s profile, report it as a bug (&lt;a href="#reporting-a-bug"&gt;reporting a bug&lt;/a&gt;), with your macOS version.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its sandbox let it open a file it mustn&amp;rsquo;t:&lt;/strong&gt; the sandbox started but didn&amp;rsquo;t hold, so the proxy runs as if it had none. Report it as a bug (&lt;a href="#reporting-a-bug"&gt;reporting a bug&lt;/a&gt;), with your macOS version.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;This kernel has no Landlock, or an older one, or no seccomp filters:&lt;/strong&gt; on Linux, the proxy gets what the kernel has. Check that Landlock is turned on with &lt;code&gt;cat /sys/kernel/security/lsm&lt;/code&gt;, whose list should name &lt;code&gt;landlock&lt;/code&gt;, and turn it on as your distribution&amp;rsquo;s docs describe, or update the kernel. The proxy is fully confined with the seccomp filter and Landlock&amp;rsquo;s ABI 8 or later, or ABI 6 or 7 with its fix for signals between threads. Then run &lt;code&gt;devvm restart&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An older devvm started it:&lt;/strong&gt; a VM that ran as you upgraded devvm keeps the proxy that the older devvm started, one process without a sandbox, until devvm next opens the VM. Run &lt;code&gt;devvm&lt;/code&gt; in the VM&amp;rsquo;s folder, which starts its proxy again with the sandbox, while the VM runs on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm can&amp;rsquo;t tell:&lt;/strong&gt; devvm doctor reads how the proxy is confined only from the proxy that runs now, which it knows by when the system says it started. When it can&amp;rsquo;t read that, it says it can&amp;rsquo;t tell whether the proxy runs in its sandbox, and why. Run &lt;code&gt;devvm restart&lt;/code&gt; in the VM&amp;rsquo;s folder, and if the warning stays, report it as a bug (&lt;a href="#reporting-a-bug"&gt;reporting a bug&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm can&amp;rsquo;t confine it on this system yet:&lt;/strong&gt; this devvm, or this machine&amp;rsquo;s architecture, has no sandbox for it, though devvm&amp;rsquo;s releases for macOS and for Linux on Intel and Arm have one, so install a release (&lt;a href="https://next.devvm.dev/docs/getting-started/install/"&gt;installing devvm&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;The child&amp;rsquo;s sandbox&lt;/a&gt; has what the sandbox allows and how the proxy decides to run without it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-request-is-blocked"&gt;A request is blocked&lt;span class="hx:absolute hx:-mt-20" id="a-request-is-blocked"&gt;&lt;/span&gt;
&lt;a href="#a-request-is-blocked" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On the allowlist tier, a VM reaches only the hosts on its allowlist, and on the none tier only its agents&amp;rsquo; and secrets&amp;rsquo; hosts. To see what the proxy blocked, run &lt;code&gt;devvm network log --blocked&lt;/code&gt; on this machine, or &lt;code&gt;devvm-why&lt;/code&gt; in the VM. &lt;code&gt;devvm network log --blocked&lt;/code&gt; also shows the &lt;code&gt;devvm network allow&lt;/code&gt; command that allows each host, and the rule applies at once, to the next connection (&lt;a href="https://next.devvm.dev/docs/safety/network/#logs"&gt;logs&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-name-that-doesnt-resolve"&gt;A name that doesn&amp;rsquo;t resolve&lt;span class="hx:absolute hx:-mt-20" id="a-name-that-doesnt-resolve"&gt;&lt;/span&gt;
&lt;a href="#a-name-that-doesnt-resolve" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl https://jenkins.corp.example.com/ &lt;span class="c1"&gt;# in the VM: the host&amp;#39;s full name, not jenkins&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The proxy looks each name up on this machine as it&amp;rsquo;s written, without this machine&amp;rsquo;s DNS search domain, so name the host in full in the tool&amp;rsquo;s URL or settings. What the block&amp;rsquo;s reason says (&lt;a href="https://next.devvm.dev/docs/safety/network/#inside-the-vm"&gt;inside the VM&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;This machine&amp;rsquo;s DNS has no address for the name:&lt;/strong&gt; a rule allows the name, but the proxy couldn&amp;rsquo;t resolve it on this machine. So the block suggests no &lt;code&gt;devvm network allow&lt;/code&gt; command, and &lt;code&gt;devvm network log --blocked&lt;/code&gt; shows &lt;code&gt;-&lt;/code&gt; for it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A name without a dot,&lt;/strong&gt; such as &lt;code&gt;jenkins&lt;/code&gt;, which your other tools may reach as &lt;code&gt;jenkins.corp.example.com&lt;/code&gt;, gets a reason that says to use the full name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The DNS didn&amp;rsquo;t answer in time, or can&amp;rsquo;t resolve the name:&lt;/strong&gt; the block names &lt;code&gt;proxy.log&lt;/code&gt; on this machine, which holds the resolver&amp;rsquo;s error.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="a-tool-that-skips-the-proxy-fails"&gt;A tool that skips the proxy fails&lt;span class="hx:absolute hx:-mt-20" id="a-tool-that-skips-the-proxy-fails"&gt;&lt;/span&gt;
&lt;a href="#a-tool-that-skips-the-proxy-fails" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On a confined tier, devvm&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;transparent mode&lt;/a&gt; sends a tool that ignores the proxy settings to the proxy by the names it looks up, over HTTPS and HTTP, on ports 443 and 80 and the ports your allow rules name. Such a tool still fails in these cases, and &lt;code&gt;devvm network log&lt;/code&gt; shows nothing for it, because the connection never reached the proxy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A connection refused on another port,&lt;/strong&gt; such as &lt;code&gt;ECONNREFUSED&lt;/code&gt; or &lt;code&gt;Connection refused&lt;/code&gt; for &lt;code&gt;db.example.com:5432&lt;/code&gt;. &lt;code&gt;devvm-why&lt;/code&gt; lists the port under the connections the VM refused lately. Give the tool the proxy&amp;rsquo;s address in &lt;code&gt;$HTTPS_PROXY&lt;/code&gt; or its own setting, or, for HTTPS or HTTP on that port, allow the host with that port, such as &lt;code&gt;devvm network allow db.example.com:8443&lt;/code&gt;, which redirects the port within 10 seconds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A protocol that names no host,&lt;/strong&gt; such as a database&amp;rsquo;s or SSH, which the proxy refuses and logs as a refused block of &lt;code&gt;transparent.devvm.proxy&lt;/code&gt;. SSH in the VM goes through the proxy already, and a database client needs a proxy setting of its own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A DNS error,&lt;/strong&gt; such as &lt;code&gt;no such host&lt;/code&gt;, &lt;code&gt;Temporary failure in name resolution&lt;/code&gt;, &lt;code&gt;ENOTFOUND&lt;/code&gt; or &lt;code&gt;EAI_AGAIN&lt;/code&gt;, which means transparent mode is off for the VM (&lt;code&gt;devvm network transparent&lt;/code&gt;), or the VM comes from an image that predates it, which each launch says, and &lt;code&gt;devvm update&lt;/code&gt; makes it again from a newer image. The tool gets the error at once.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some tools read the proxy variables only when a setting of their own turns them on, or never. Turn on the tool&amp;rsquo;s own proxy setting, so that it uses the environment, or give it the address in &lt;code&gt;$HTTPS_PROXY&lt;/code&gt;. Hugo&amp;rsquo;s &lt;code&gt;resources.GetRemote&lt;/code&gt;, for example, uses the proxy only when &lt;code&gt;security.http.proxyFromEnvironment&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; in the site&amp;rsquo;s config (&lt;a href="https://next.devvm.dev/docs/safety/network/#inside-the-vm"&gt;inside the VM&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="an-open-vm-resolves-no-names-after-a-downgrade"&gt;An open VM resolves no names after a downgrade&lt;span class="hx:absolute hx:-mt-20" id="an-open-vm-resolves-no-names-after-a-downgrade"&gt;&lt;/span&gt;
&lt;a href="#an-open-vm-resolves-no-names-after-a-downgrade" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A confined VM&amp;rsquo;s programs ask the VM&amp;rsquo;s own name server directly, through an &lt;code&gt;/etc/resolv.conf&lt;/code&gt; that devvm writes, and devvm puts systemd-resolved&amp;rsquo;s back when the VM runs open (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-resolver"&gt;the VM&amp;rsquo;s resolver&lt;/a&gt;). An older devvm doesn&amp;rsquo;t know that file, so after a downgrade, a VM that was confined and now runs open can keep it and resolve no names. When the VM&amp;rsquo;s &lt;code&gt;/etc/resolv.conf&lt;/code&gt; starts with &lt;code&gt;# devvm:&lt;/code&gt;, launch it with a current devvm, or put systemd-resolved&amp;rsquo;s file back yourself:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;head -1 /etc/resolv.conf &lt;span class="c1"&gt;# in the VM: &amp;#34;# devvm: ...&amp;#34; means devvm&amp;#39;s file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo ln -sfn /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo systemctl restart systemd-resolved&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="a-servers-port-is-taken-in-a-confined-vm"&gt;A server&amp;rsquo;s port is taken in a confined VM&lt;span class="hx:absolute hx:-mt-20" id="a-servers-port-is-taken-in-a-confined-vm"&gt;&lt;/span&gt;
&lt;a href="#a-servers-port-is-taken-in-a-confined-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In a confined VM, transparent mode&amp;rsquo;s programs listen on the stand-in address &lt;code&gt;198.18.0.1&lt;/code&gt;, on port 53 and on ports 61080 and 61443 and 61100 to 61131, so a server of yours that binds one of those ports on every address, such as &lt;code&gt;0.0.0.0:61443&lt;/code&gt;, fails with &lt;code&gt;EADDRINUSE&lt;/code&gt;. Ports 80 and 443 stay free for your own servers. A DNS server of yours on &lt;code&gt;127.0.0.1:53&lt;/code&gt; binds, but gets no lookups, from the VM or through a forward of port 53, because transparent mode sends them to its own names. Move the server to another port, or turn transparent mode off for the VM with &lt;code&gt;devvm network transparent off&lt;/code&gt;, which applies at its next launch (&lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;tools that ignore the proxy&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="behind-a-company-proxy"&gt;Behind a company proxy&lt;span class="hx:absolute hx:-mt-20" id="behind-a-company-proxy"&gt;&lt;/span&gt;
&lt;a href="#behind-a-company-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When this machine reaches the internet only through a company proxy and nothing in a VM or a build gets through, check where devvm finds the proxy. devvm reads &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt; from the shell you run it in, as &lt;code&gt;env | grep -i _proxy&lt;/code&gt; shows, and when that shell sets neither &lt;code&gt;HTTPS_PROXY&lt;/code&gt; nor &lt;code&gt;HTTP_PROXY&lt;/code&gt;, it reads the &lt;code&gt;[proxy]&lt;/code&gt; table of &lt;code&gt;~/.config/devvm/config.toml&lt;/code&gt; instead (&lt;a href="https://next.devvm.dev/docs/safety/network/#behind-a-company-proxy"&gt;behind a company proxy&lt;/a&gt;). A shell without the settings, such as an editor&amp;rsquo;s terminal that didn&amp;rsquo;t load your profile, starts the VM&amp;rsquo;s proxy without a company proxy, unless &lt;code&gt;config.toml&lt;/code&gt; names one. So set the proxy in &lt;code&gt;config.toml&lt;/code&gt;, and it works from every shell:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;https&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://[email protected]:8080&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;http&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://[email protected]:8080&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;no-proxy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;localhost,.example.com&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;config.toml&lt;/code&gt; never holds the company proxy&amp;rsquo;s password. Put only the user in the URL, as above, and save the password with &lt;code&gt;devvm secret set proxy&lt;/code&gt;, which asks for it. Then run devvm again in the folder, which starts the VM&amp;rsquo;s proxy again with the new settings:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm secret &lt;span class="nb"&gt;set&lt;/span&gt; proxy &lt;span class="c1"&gt;# asks for the company proxy&amp;#39;s password&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="c1"&gt;# start the VM&amp;#39;s proxy again with the new settings&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Other messages and cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When a VM&amp;rsquo;s proxy went through a company proxy the last time it started and devvm finds none this time, devvm warns you, names &lt;code&gt;config.toml&lt;/code&gt; and starts the proxy without one, so the VM&amp;rsquo;s requests go directly. Set the proxy in that shell or in &lt;code&gt;config.toml&lt;/code&gt;, then run &lt;code&gt;devvm restart&lt;/code&gt; in the folder.&lt;/li&gt;
&lt;li&gt;When devvm says that &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; or one of &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; keys names an &lt;code&gt;https://&lt;/code&gt; or &lt;code&gt;socks5://&lt;/code&gt; proxy, ask your IT team for the proxy&amp;rsquo;s &lt;code&gt;http://&lt;/code&gt; address, and set that. A company proxy that inspects TLS also needs its CA, as the next section describes.&lt;/li&gt;
&lt;li&gt;Builds behind a company proxy go through a proxy of devvm&amp;rsquo;s, which allows any host. It sends a name that this machine can&amp;rsquo;t look up on to the company proxy, which resolves it (&lt;a href="https://next.devvm.dev/docs/safety/network/#open-vms-and-builds"&gt;open VMs and builds&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="tls-errors-behind-a-company-proxy"&gt;TLS errors behind a company proxy&lt;span class="hx:absolute hx:-mt-20" id="tls-errors-behind-a-company-proxy"&gt;&lt;/span&gt;
&lt;a href="#tls-errors-behind-a-company-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When apt, &lt;code&gt;npm install&lt;/code&gt;, &lt;code&gt;pip install&lt;/code&gt;, &lt;code&gt;git clone&lt;/code&gt; over HTTPS or an image&amp;rsquo;s build fails with an error such as &lt;code&gt;certificate verify failed&lt;/code&gt;, &lt;code&gt;self-signed certificate in certificate chain&lt;/code&gt; or &lt;code&gt;unable to get local issuer certificate&lt;/code&gt;, the network you&amp;rsquo;re on may inspect TLS. Ask your IT team for the CA&amp;rsquo;s certificate, or export it from this machine&amp;rsquo;s store, such as Keychain Access on macOS. Put it in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt; and open the VM again (&lt;a href="https://next.devvm.dev/docs/using/settings/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt;):&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir -p ~/.config/devvm/ca &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; cp company-root.pem ~/.config/devvm/ca/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm &lt;span class="c1"&gt;# open the VM again, which now trusts the CA&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When resolving the shared tools&amp;rsquo; versions fails because this machine doesn&amp;rsquo;t trust a server&amp;rsquo;s certificate, mise&amp;rsquo;s lines in the run log end with &lt;code&gt;invalid peer certificate: UnknownIssuer&lt;/code&gt;. On Linux, put the CA in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt;, or add it to this machine&amp;rsquo;s own store, as &lt;code&gt;update-ca-certificates&lt;/code&gt; does on Debian and Ubuntu, and run devvm again:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# on a Debian or Ubuntu host, not in the VM (Fedora: /etc/pki/ca-trust/source/anchors/ and sudo update-ca-trust)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo cp company-root.pem /usr/local/share/ca-certificates/company-root.crt &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo update-ca-certificates&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A bundle that &lt;code&gt;SSL_CERT_FILE&lt;/code&gt; names in devvm&amp;rsquo;s environment works too, because that mise reads it in place of the system&amp;rsquo;s. On macOS, open the CA&amp;rsquo;s certificate in Keychain Access and set it to be trusted, because the part of that mise that checks where each tool&amp;rsquo;s release was built trusts only what macOS trusts.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm doctor&lt;/code&gt; says so when &lt;code&gt;HTTPS_PROXY&lt;/code&gt; or &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;proxy.https&lt;/code&gt; is set and the folder has no CA certificates. Many proxies don&amp;rsquo;t inspect TLS, so that line isn&amp;rsquo;t a problem in itself. When devvm refuses a file in the folder, it names the file, and you take out anything that isn&amp;rsquo;t a CA certificate, such as a private key or a server&amp;rsquo;s certificate.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-listed-port-isnt-forwarded"&gt;A listed port isn&amp;rsquo;t forwarded&lt;span class="hx:absolute hx:-mt-20" id="a-listed-port-isnt-forwarded"&gt;&lt;/span&gt;
&lt;a href="#a-listed-port-isnt-forwarded" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When a program on this machine already has a port that the VM lists, devvm warns that the VM doesn&amp;rsquo;t forward it, and the VM runs on without it. Stop that program, then run &lt;code&gt;devvm restart&lt;/code&gt;, or change the VM&amp;rsquo;s ports with &lt;code&gt;devvm ports&lt;/code&gt;, and devvm forwards the port once it&amp;rsquo;s free (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;ports&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;devvm warns about two other reasons too, each in its own words, and &lt;code&gt;devvm ports&lt;/code&gt; repeats the warning while the VM runs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The VM already forwards 256 ports&lt;/strong&gt;, the most it forwards at once. Stop the servers you don&amp;rsquo;t need in the VM, or list fewer ports with &lt;code&gt;devvm ports&lt;/code&gt;, and devvm forwards the port within about 10 seconds of the VM forwarding fewer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;This machine doesn&amp;rsquo;t let devvm use the port.&lt;/strong&gt; On Linux, only root can listen on a port below 1024, so a listed port such as 80 isn&amp;rsquo;t forwarded. Have the server in the VM listen on a port from 1024 up and list that port instead.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="too-many-vms-at-once"&gt;Too many VMs at once&lt;span class="hx:absolute hx:-mt-20" id="too-many-vms-at-once"&gt;&lt;/span&gt;
&lt;a href="#too-many-vms-at-once" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;At most 17 VMs run at once, because each VM&amp;rsquo;s ssh is on one of the 17 ports that every browser refuses, so no page in your browser can reach it. A start past that fails and names the VMs that run on those ports, so stop one of them first:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm stop &lt;span class="c1"&gt;# in a running VM&amp;#39;s folder&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm ls &lt;span class="c1"&gt;# which VMs run&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A stopped VM can give up its port to a VM that starts, and it gets another at its own next start. When the message says the ports are taken on this machine without naming your VMs, one of these has them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;VMs that are starting or building.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A running VM that lists them to forward,&lt;/strong&gt; which you change with &lt;code&gt;devvm ports&lt;/code&gt; in its folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another program,&lt;/strong&gt; such as another user&amp;rsquo;s on this machine, whom you&amp;rsquo;d ask to end it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A VM that an older devvm started keeps its old ssh port until you stop it and start it again, and devvm warns of it at each launch until then (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;the ssh port&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-vm-wont-boot"&gt;A VM won&amp;rsquo;t boot&lt;span class="hx:absolute hx:-mt-20" id="a-vm-wont-boot"&gt;&lt;/span&gt;
&lt;a href="#a-vm-wont-boot" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A Lima VM that doesn&amp;rsquo;t answer over ssh within a minute of starting is stopped. Read the end of its console log before you start it again, because every start overwrites the log:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tail -n &lt;span class="m"&gt;100&lt;/span&gt; ~/.local/share/devvm/lima/&amp;lt;vm&amp;gt;/serialv.log&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The log is &lt;code&gt;serialv.log&lt;/code&gt;, or another &lt;code&gt;serial*.log&lt;/code&gt;, in the VM&amp;rsquo;s folder in devvm&amp;rsquo;s Lima home, which is &lt;code&gt;~/.local/share/devvm/lima/&amp;lt;vm&amp;gt;/&lt;/code&gt; unless you set &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/backends/lima/#limits"&gt;Lima&amp;rsquo;s limits&lt;/a&gt;). A log that passed 10 MiB while the VM ran has its earlier lines in the same name with &lt;code&gt;.1&lt;/code&gt; added, and the log then starts with a long run of empty bytes, so &lt;code&gt;tail&lt;/code&gt; reads it better than an editor does.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-vm-whose-creation-didnt-finish"&gt;A VM whose creation didn&amp;rsquo;t finish&lt;span class="hx:absolute hx:-mt-20" id="a-vm-whose-creation-didnt-finish"&gt;&lt;/span&gt;
&lt;a href="#a-vm-whose-creation-didnt-finish" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When devvm stops after it made a VM but before the VM was ready, such as when you press Ctrl+C at the wrong moment, devvm never starts that VM. The VM never opened a shell, so nothing of yours is in it. In a terminal, devvm asks whether to delete the VM and make it again, with no as the default. Without a terminal, with &lt;code&gt;--no-input&lt;/code&gt; or when you answer no, devvm keeps the VM and says so, and you run &lt;code&gt;devvm rm&lt;/code&gt; to delete it, then &lt;code&gt;devvm&lt;/code&gt; to make it again:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm rm &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; devvm &lt;span class="c1"&gt;# delete the unfinished VM, after asking, then make it again&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;While another devvm is still making the folder&amp;rsquo;s VM, such as one waiting for your answers in another terminal, &lt;code&gt;devvm&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; in that folder refuse at once and say so. Finish or stop the other devvm, then run the command again: once the VM is made, &lt;code&gt;devvm&lt;/code&gt; opens it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-folder-is-gone"&gt;The folder is gone&lt;span class="hx:absolute hx:-mt-20" id="the-folder-is-gone"&gt;&lt;/span&gt;
&lt;a href="#the-folder-is-gone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you delete or move a project folder, its VM stays and keeps its disk, and &lt;code&gt;devvm ls&lt;/code&gt; writes &lt;code&gt;(gone)&lt;/code&gt; after its folder. To keep the VM, move the folder back to its path. To delete it, run &lt;code&gt;devvm rm VM&lt;/code&gt; with the name that &lt;code&gt;devvm ls&lt;/code&gt; lists, in any folder. devvm asks first, and when the VM is stopped and has an agent, it needs &lt;code&gt;--no-export&lt;/code&gt;, because starting the VM to export the history would make the folder again (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-vm-whose-folder-is-gone"&gt;a VM whose folder is gone&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-folder-is-on-a-disk-that-isnt-connected"&gt;The folder is on a disk that isn&amp;rsquo;t connected&lt;span class="hx:absolute hx:-mt-20" id="the-folder-is-on-a-disk-that-isnt-connected"&gt;&lt;/span&gt;
&lt;a href="#the-folder-is-on-a-disk-that-isnt-connected" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When a project folder is on an external disk, a USB stick or a network share that isn&amp;rsquo;t connected, &lt;code&gt;devvm ls&lt;/code&gt; writes &lt;code&gt;(not connected)&lt;/code&gt; after its folder, and &lt;code&gt;devvm space&lt;/code&gt; names the VM. Connect the disk and the VM works as before. If you mean to delete the VM, run &lt;code&gt;devvm rm VM&lt;/code&gt; in a terminal and answer yes, because devvm refuses without one, even with &lt;code&gt;--force&lt;/code&gt;, as the disk may still hold the project&amp;rsquo;s work (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-on-a-disk-that-isnt-connected"&gt;a folder on a disk that isn&amp;rsquo;t connected&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-folder-was-made-again"&gt;The folder was made again&lt;span class="hx:absolute hx:-mt-20" id="the-folder-was-made-again"&gt;&lt;/span&gt;
&lt;a href="#the-folder-was-made-again" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you delete a project folder and make a new one at the same path, such as by cloning another repo there, devvm refuses the old folder&amp;rsquo;s VM. Run &lt;code&gt;devvm rm&lt;/code&gt; to delete the old VM, or &lt;code&gt;devvm adopt&lt;/code&gt; to give it to the new folder (&lt;a href="https://next.devvm.dev/docs/using/vms/#a-folder-made-again"&gt;a folder made again&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="an-outdated-vm-or-newer-shared-tools"&gt;An outdated VM, or newer shared tools&lt;span class="hx:absolute hx:-mt-20" id="an-outdated-vm-or-newer-shared-tools"&gt;&lt;/span&gt;
&lt;a href="#an-outdated-vm-or-newer-shared-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm warns on each launch when an image the VM was made from has changed, and when there are newer shared tools than the VM&amp;rsquo;s, and it leaves the VM as it is. Both warnings name &lt;code&gt;devvm update&lt;/code&gt;, which moves the VM to the newest shared tools first, without asking. Then, only when the VM&amp;rsquo;s image has changed, it makes the VM again from the new image, keeping its home folder, the project folder and its settings, after asking (&lt;a href="https://next.devvm.dev/docs/using/images/#outdated-vms"&gt;outdated VMs&lt;/a&gt;). &lt;code&gt;devvm tools update&lt;/code&gt; moves the VM to the newest shared tools alone (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;adding and removing tools&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-download-doesnt-check-out"&gt;A download doesn&amp;rsquo;t check out&lt;span class="hx:absolute hx:-mt-20" id="a-download-doesnt-check-out"&gt;&lt;/span&gt;
&lt;a href="#a-download-doesnt-check-out" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm checks Ubuntu&amp;rsquo;s cloud image and its own mise against checksums before it uses them, and it refuses a download that doesn&amp;rsquo;t match. A cloud image that doesn&amp;rsquo;t match is downloaded again from nothing once before devvm refuses it, as a download that went on from an earlier try may have joined two versions of the server&amp;rsquo;s file. Ubuntu&amp;rsquo;s checksums must also carry a valid signature from Ubuntu&amp;rsquo;s cloud image key, which devvm checks itself, with nothing to install. When devvm refuses one, try again later, and if it keeps failing, the server or the network between may be serving something else. In the same way, when &lt;code&gt;devvm rebuild base&lt;/code&gt; finds Ubuntu&amp;rsquo;s list of releases ending before the release that base starts from, it says so and keeps that release (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-new-tool-release-isnt-there-yet"&gt;A new tool release isn&amp;rsquo;t there yet&lt;span class="hx:absolute hx:-mt-20" id="a-new-tool-release-isnt-there-yet"&gt;&lt;/span&gt;
&lt;a href="#a-new-tool-release-isnt-there-yet" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A shared tool&amp;rsquo;s newest release is sometimes not published for every platform yet, such as for a few days after a Node release. devvm then uses the newest older version that is, and says so, and the next daily check tries the newest again. When a release has no download for a VM&amp;rsquo;s platform yet, try again the next day (&lt;a href="https://next.devvm.dev/docs/internals/images/#versions"&gt;versions&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-shared-tool-doesnt-mount"&gt;A shared tool doesn&amp;rsquo;t mount&lt;span class="hx:absolute hx:-mt-20" id="a-shared-tool-doesnt-mount"&gt;&lt;/span&gt;
&lt;a href="#a-shared-tool-doesnt-mount" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When a VM can&amp;rsquo;t mount one of its shared tools, devvm stops the launch with an error that names the VM and the tools, and the VM keeps running. That happens when the tool&amp;rsquo;s image is missing from the folder that devvm keeps the shared tools in, such as after you deleted it by hand, or when the VM can&amp;rsquo;t mount the image. devvm doesn&amp;rsquo;t let the VM download the tool in its place, because that copy would be the VM&amp;rsquo;s own, a download you didn&amp;rsquo;t ask for, and one that the VM&amp;rsquo;s tier may block.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm tools update &lt;span class="c1"&gt;# in the project folder: build the missing tools, then open the shell&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When the VM has the newest versions, &lt;code&gt;devvm tools update&lt;/code&gt; builds those, and otherwise it builds the newest versions and moves the VM to them. If the launch still stops, the run log says why the VM couldn&amp;rsquo;t mount the image (&lt;a href="#a-command-fails"&gt;a command fails&lt;/a&gt;). A tool that doesn&amp;rsquo;t mount never keeps the VM from booting. The VM mounts the tools it can and boots as usual, and only devvm&amp;rsquo;s launch stops (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-share"&gt;the share&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="reporting-a-bug"&gt;Reporting a bug&lt;span class="hx:absolute hx:-mt-20" id="reporting-a-bug"&gt;&lt;/span&gt;
&lt;a href="#reporting-a-bug" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When none of this fixes it, open an issue on &lt;a href="https://github.com/devvmhq/devvm/issues/new/choose" target="_blank" rel="noopener"&gt;devvm&amp;rsquo;s issue tracker&lt;/a&gt; and choose its form for bugs, features, toolchains, built-in layers or docs. The bug report asks for what &lt;code&gt;devvm --version&lt;/code&gt;, &lt;code&gt;devvm doctor&lt;/code&gt; and &lt;code&gt;limactl --version&lt;/code&gt; print, your OS and its version, the command you ran with what it printed, and the run log (&lt;a href="#a-command-fails"&gt;a command fails&lt;/a&gt;). devvm hides a VM&amp;rsquo;s proxy key and passwords in the log, but it can still hold folder names, host names and a command&amp;rsquo;s output, so read it before you paste it. A security problem goes to &lt;a href="https://github.com/devvmhq/devvm/security/advisories/new" target="_blank" rel="noopener"&gt;private vulnerability reporting&lt;/a&gt; instead, never to a public issue.&lt;/p&gt;</description></item><item><title>Known limits</title><link>https://next.devvm.dev/docs/using/limits/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/using/limits/</guid><description>
&lt;p&gt;These are the things devvm can&amp;rsquo;t do, everywhere, on Linux hosts and on Intel Macs.&lt;/p&gt;
&lt;h2 data-hextra-search-id="everywhere"&gt;Everywhere&lt;span class="hx:absolute hx:-mt-20" id="everywhere"&gt;&lt;/span&gt;
&lt;a href="#everywhere" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;devvm runs on macOS and Linux only,&lt;/strong&gt; not on Windows (&lt;a href="https://next.devvm.dev/docs/getting-started/install/#requirements"&gt;requirements&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared tools are read-only,&lt;/strong&gt; so a tool can&amp;rsquo;t update itself or add components, for example with &lt;code&gt;rustup component add&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A layer goes in and comes out by making the VM again.&lt;/strong&gt; A layer&amp;rsquo;s script changes the VM&amp;rsquo;s disk, so &lt;code&gt;devvm layer add&lt;/code&gt; gives a VM more layers by making it again, and everything on its disk but its home folder is lost (&lt;a href="https://next.devvm.dev/docs/using/images/#adding-layers-to-a-vm"&gt;details&lt;/a&gt;). &lt;code&gt;devvm layer rm&lt;/code&gt; takes layers out in the same way (&lt;a href="https://next.devvm.dev/docs/using/images/#taking-layers-out-of-a-vm"&gt;details&lt;/a&gt;). Shared tools go in with &lt;code&gt;devvm tools add&lt;/code&gt; and come out with &lt;code&gt;devvm tools rm&lt;/code&gt;, and the VM&amp;rsquo;s disk stays as it is (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#adding-and-removing-tools"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt; takes only Debian-, Ubuntu- and Alpine-based images,&lt;/strong&gt; and Alpine, Debian 12 (&lt;code&gt;node:24&lt;/code&gt;) and Ubuntu before 26.04 on arm64 build with unpinned packages (&lt;a href="https://next.devvm.dev/docs/using/from/#supported-images"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent folders&lt;/strong&gt; that you make or delete on this machine reach a running VM only after a restart, which devvm offers (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#mounts"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ports&lt;/strong&gt; are forwarded over TCP only, and forwarding every port means every port from 1024 up. You can tunnel UDP over a forwarded TCP port with socat (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Links between VMs&lt;/strong&gt; carry TCP over IPv4 alone, and a container in a VM reaches them only with &lt;code&gt;--network host&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/using/links/#ports"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tools that ignore the proxy settings&lt;/strong&gt; reach a confined VM&amp;rsquo;s proxy only over HTTPS and HTTP to a host by name, on ports 443 and 80 and up to 32 more that your allow rules name. Other ports, protocols that name no host in their first bytes, such as a database&amp;rsquo;s, addresses in URLs, HTTP/3 alone and IPv6 alone need the tool&amp;rsquo;s own proxy settings, and a client that doesn&amp;rsquo;t trust the VM&amp;rsquo;s CA sees a certificate error for a blocked HTTPS host (&lt;a href="https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Changing a running VM&amp;rsquo;s ports&lt;/strong&gt; closes the connections that are open through its forwards (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;With Lima,&lt;/strong&gt; project paths can&amp;rsquo;t contain commas, folder names in VM names are cut short, and disks grow but never shrink (&lt;a href="https://next.devvm.dev/docs/backends/lima/#limits"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File watchers in a Lima VM&lt;/strong&gt; don&amp;rsquo;t see the edits you make on this machine, only those made in the VM, so set a dev server that should reload on your edits to poll the project folder (&lt;a href="https://next.devvm.dev/docs/backends/lima/#file-watchers"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="linux-hosts"&gt;Linux hosts&lt;span class="hx:absolute hx:-mt-20" id="linux-hosts"&gt;&lt;/span&gt;
&lt;a href="#linux-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.git&lt;/code&gt; protection is read-only in the VM&amp;rsquo;s view, not a lock on the host&amp;rsquo;s files, so after a git command on this machine replaces &lt;code&gt;.git/config&lt;/code&gt; while the VM runs, the VM can change or replace the new file until devvm locks it again. devvm names each such file when the VM stops (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#when-git-on-this-machine-replaces-a-locked-file"&gt;details&lt;/a&gt;). A VM whose &lt;code&gt;.git/config&lt;/code&gt; or hook has another name doesn&amp;rsquo;t start, and the VM can&amp;rsquo;t rename a file between the working tree and &lt;code&gt;.git&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#linux-hosts"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Where the kernel doesn&amp;rsquo;t let devvm use a user namespace, such as on Ubuntu 23.10 and newer, there&amp;rsquo;s no &lt;code&gt;.git&lt;/code&gt; protection. devvm warns about it at each launch, and it names the &lt;code&gt;.git&lt;/code&gt; hooks and config that changed, but only after the fact, so use &lt;code&gt;--clone&lt;/code&gt; there (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#when-linux-cant-lock"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;VMs mount the project folder with 9p instead of virtiofs, so file watchers in a VM also miss the VM&amp;rsquo;s own changes in the folder&amp;rsquo;s subfolders, and need polling there (&lt;a href="https://next.devvm.dev/docs/backends/lima/#file-watchers"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;New VMs cache the project folder with the &lt;code&gt;none&lt;/code&gt; mode, because Linux&amp;rsquo;s 9p client loses data with Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt;. A VM made before devvm chose &lt;code&gt;none&lt;/code&gt; keeps &lt;code&gt;mmap&lt;/code&gt;, with a warning at each launch, until you run &lt;code&gt;devvm mount-cache none&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/backends/lima/#the-project-folders-cache"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;A program can&amp;rsquo;t map a file in the project folder for shared writing, and gets &lt;code&gt;Invalid argument&lt;/code&gt;, such as LMDB, which Parcel&amp;rsquo;s &lt;code&gt;.parcel-cache&lt;/code&gt; and Gatsby&amp;rsquo;s cache use, numpy&amp;rsquo;s &lt;code&gt;memmap&lt;/code&gt; in &lt;code&gt;r+&lt;/code&gt; or &lt;code&gt;w+&lt;/code&gt; mode, Java&amp;rsquo;s read-write mappings and the mold linker. Keep their files on the VM&amp;rsquo;s own disk, or use a &lt;code&gt;--clone&lt;/code&gt; VM (&lt;a href="https://next.devvm.dev/docs/backends/lima/#programs-that-map-files-for-writing"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;SQLite&amp;rsquo;s WAL mode fails in the project folder unless the connection sets &lt;code&gt;PRAGMA locking_mode=EXCLUSIVE&lt;/code&gt; first, while SQLite&amp;rsquo;s default journal works. Use a &lt;code&gt;--clone&lt;/code&gt; VM for a project that needs WAL mode, as its repo is on the VM&amp;rsquo;s own disk, or keep the database outside the folder (&lt;a href="https://next.devvm.dev/docs/backends/lima/#sqlite-and-the-cache"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Set-id bits that root in a VM sets on files in the project folder reach the host, and devvm names such files when it makes a VM and once a VM is stopped (&lt;a href="https://next.devvm.dev/docs/using/troubleshooting/#devvm-names-set-id-files"&gt;what to do&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm keeps your secrets in files under &lt;code&gt;~/.local/share/devvm/secrets/&lt;/code&gt;, which only you can read, instead of the Keychain (&lt;a href="https://next.devvm.dev/docs/using/settings/#devvms-state"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;devvm has no Time Machine to keep VMs&amp;rsquo; CAs out of, so keep &lt;code&gt;~/.local/share/devvm/vms&lt;/code&gt; out of your backups (&lt;a href="https://next.devvm.dev/docs/internals/security/#secrets-stay-on-the-host"&gt;details&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="intel-macs"&gt;Intel Macs&lt;span class="hx:absolute hx:-mt-20" id="intel-macs"&gt;&lt;/span&gt;
&lt;a href="#intel-macs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm has a release for Intel Macs, which the install script and Homebrew install, but nobody has tested it on one yet. The tested systems are Apple silicon Macs and Linux on arm64 and x86_64, so on an Intel Mac, VMs, &lt;code&gt;--from&lt;/code&gt; and the network tiers&amp;rsquo; confinement may fail in ways that devvm&amp;rsquo;s tests haven&amp;rsquo;t caught.&lt;/p&gt;</description></item><item><title>devvm</title><link>https://next.devvm.dev/docs/cli/devvm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/cli/devvm/</guid><description>
&lt;p&gt;Open a shell in this folder&amp;rsquo;s VM, creating it first&lt;/p&gt;
&lt;h2 data-hextra-search-id="synopsis"&gt;Synopsis&lt;span class="hx:absolute hx:-mt-20" id="synopsis"&gt;&lt;/span&gt;
&lt;a href="#synopsis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Open a shell in this folder&amp;rsquo;s VM, at the same path, and create the VM first when the folder has none. devvm shows what a new VM gets, and in a terminal you can customize its toolchains, coding agents, layers, tier, ports and size, which &amp;ndash;tools, &amp;ndash;agents, &amp;ndash;layers, &amp;ndash;network, &amp;ndash;ports, &amp;ndash;cpus, &amp;ndash;memory and &amp;ndash;disk choose without asking. The VM mounts only this folder read-write, and with &amp;ndash;clone it gets its own clone of the repo instead.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;devvm [flags]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="examples"&gt;Examples&lt;span class="hx:absolute hx:-mt-20" id="examples"&gt;&lt;/span&gt;
&lt;a href="#examples" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; devvm # open this folder&amp;#39;s VM, choosing what a new one gets
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; devvm --agents claude # create the VM with Claude Code and the toolchains the folder needs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; devvm --tools node --agents none --layers docker # create the VM with node and the docker layer alone
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; devvm --clone # create the VM with its own clone of this repo
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; devvm ls # list every VM&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="options"&gt;Options&lt;span class="hx:absolute hx:-mt-20" id="options"&gt;&lt;/span&gt;
&lt;a href="#options" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --agents LIST the LIST of coding agents a new VM gets, such as claude,codex, or none (default: devvm setup&amp;#39;s)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --clone create the VM with its own clone of this repo, or of each repo in this folder, instead of mounting the folder
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --cpus N the N CPUs the VM gets (default: devvm size -g, else the image&amp;#39;s)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --disk GiB the VM&amp;#39;s disk in GiB, at least the image&amp;#39;s (default: devvm size -g, else the image&amp;#39;s)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --from IMAGE the container IMAGE base starts from, such as node:24, instead of Ubuntu&amp;#39;s cloud image (default: $DEVVM_FROM)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -h, --help help for devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --here use this folder&amp;#39;s own VM, never that of a folder it&amp;#39;s inside
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --layers LIST the LIST of layers a new VM&amp;#39;s image gets, bottom first, such as docker,mine, or none (default: devvm setup&amp;#39;s)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --memory GiB the VM&amp;#39;s memory in GiB, such as 16 or 16G (default: devvm size -g, else the image&amp;#39;s)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --network TIER the network TIER a new VM gets: open, internet, allowlist or none, or learn for internet while it learns the hosts it needs (default: devvm network -g&amp;#39;s, else allowlist)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --no-devcontainer create the VM without reading the folder&amp;#39;s devcontainer.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --no-git-protect create the VM without .git protection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --no-input never ask, and fail where devvm would ask, naming the flag that answers it
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --parent use the VM of the nearest folder this one is inside, even across a git repo of its own
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --ports PORTS the PORTS the VM forwards: all, none or a list like 5173,8000-8010 (default: devvm ports -g, else all)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --repos LIST the repos a --clone VM of a folder of repos gets: all, none or a LIST of their paths, such as frontend,backend (default: a picker in a terminal)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --ssh-agent create the VM with your SSH agent forwarded, so anything in it can use your keys while you&amp;#39;re connected
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --ssh-config add devvm&amp;#39;s Include line to ~/.ssh/config without asking
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --tools LIST the LIST of toolchains a new VM gets, such as node,python, or none (default: those the folder&amp;#39;s files call for)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --unsafe-folder mount a folder devvm refuses, such as your home folder
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -v, --verbose show the output of the commands devvm runs instead of a status line
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --version print devvm&amp;#39;s version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="docs"&gt;Docs&lt;span class="hx:absolute hx:-mt-20" id="docs"&gt;&lt;/span&gt;
&lt;a href="#docs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/getting-started/commands/"&gt;The docs page for devvm&lt;/a&gt; explains it in full.&lt;/p&gt;
&lt;h2 data-hextra-search-id="see-also"&gt;See also&lt;span class="hx:absolute hx:-mt-20" id="see-also"&gt;&lt;/span&gt;
&lt;a href="#see-also" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_adopt/"&gt;devvm adopt&lt;/a&gt;: Give this folder the VM made for an earlier folder or path&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_agent/"&gt;devvm agent&lt;/a&gt;: Fill devvm&amp;rsquo;s store of the agents&amp;rsquo; settings and logins that every VM gets&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_build/"&gt;devvm build&lt;/a&gt;: Build an image and the images under it, unless they&amp;rsquo;re built&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_clone/"&gt;devvm clone&lt;/a&gt;: Show or change whether this folder&amp;rsquo;s VM has its own clone of the repo&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_code/"&gt;devvm code&lt;/a&gt;: Open this folder&amp;rsquo;s VM in VS Code over Remote-SSH&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_completion/"&gt;devvm completion&lt;/a&gt;: Print the shell completion script for bash, zsh or fish&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_cursor/"&gt;devvm cursor&lt;/a&gt;: Open this folder&amp;rsquo;s VM in Cursor over Remote-SSH&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_desktop/"&gt;devvm desktop&lt;/a&gt;: Open this folder&amp;rsquo;s VM&amp;rsquo;s desktop in a VNC viewer&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_doctor/"&gt;devvm doctor&lt;/a&gt;: Check what devvm needs on this machine&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_gc/"&gt;devvm gc&lt;/a&gt;: Delete stale images, unused tools, old files and the Nix cache over its cap&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_git-protect/"&gt;devvm git-protect&lt;/a&gt;: Show or change .git protection for this folder&amp;rsquo;s VM&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_group/"&gt;devvm group&lt;/a&gt;: Show the group this folder&amp;rsquo;s VM is in&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_history/"&gt;devvm history&lt;/a&gt;: List the saved exports of agents&amp;rsquo; history&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_host/"&gt;devvm host&lt;/a&gt;: Get this folder&amp;rsquo;s VM ready for ssh and editors, and show its host name&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_images/"&gt;devvm images&lt;/a&gt;: List the images and the shared tools&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_layer/"&gt;devvm layer&lt;/a&gt;: Make image layers of your own, or change this folder&amp;rsquo;s VM&amp;rsquo;s layers&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_limactl/"&gt;devvm limactl&lt;/a&gt;: Run Lima&amp;rsquo;s limactl for debugging, which starts VMs unconfined, whatever their tier&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_link/"&gt;devvm link&lt;/a&gt;: List this folder&amp;rsquo;s VM&amp;rsquo;s links to your other VMs&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_ls/"&gt;devvm ls&lt;/a&gt;: List the project VMs&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_mount-cache/"&gt;devvm mount-cache&lt;/a&gt;: Show or change how this folder&amp;rsquo;s VM caches its project folder&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_network/"&gt;devvm network&lt;/a&gt;: Show or change the network tier of this folder&amp;rsquo;s VM&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_paste/"&gt;devvm paste&lt;/a&gt;: Send the clipboard&amp;rsquo;s image, PDF or copied file to this folder&amp;rsquo;s VM&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_ports/"&gt;devvm ports&lt;/a&gt;: Show or change which ports this folder&amp;rsquo;s VM forwards&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_rebuild/"&gt;devvm rebuild&lt;/a&gt;: Build an image again, and delete the old one&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_restart/"&gt;devvm restart&lt;/a&gt;: Restart this folder&amp;rsquo;s VM and open a shell in it&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_retention/"&gt;devvm retention&lt;/a&gt;: Show or change what devvm deletes on its own&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_rm/"&gt;devvm rm&lt;/a&gt;: Delete this folder&amp;rsquo;s VM, or a VM whose folder is gone&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_secret/"&gt;devvm secret&lt;/a&gt;: List the secrets kept on this machine, for VMs to use&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_setup/"&gt;devvm setup&lt;/a&gt;: Choose base&amp;rsquo;s features, and new VMs&amp;rsquo; size, network tier, coding agents and layers&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_size/"&gt;devvm size&lt;/a&gt;: Show or change this folder&amp;rsquo;s VM&amp;rsquo;s size&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_space/"&gt;devvm space&lt;/a&gt;: Show what devvm keeps on this machine and the space it takes&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_ssh-agent/"&gt;devvm ssh-agent&lt;/a&gt;: Show or change SSH agent forwarding for this folder&amp;rsquo;s VM&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_stop/"&gt;devvm stop&lt;/a&gt;: Stop this folder&amp;rsquo;s VM&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_tools/"&gt;devvm tools&lt;/a&gt;: Show or choose this folder&amp;rsquo;s VM&amp;rsquo;s shared tools&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_update/"&gt;devvm update&lt;/a&gt;: Bring this folder&amp;rsquo;s VM up to date, then open a shell in it&lt;/li&gt;
&lt;li&gt;&lt;a href="https://next.devvm.dev/docs/cli/devvm_upgrade/"&gt;devvm upgrade&lt;/a&gt;: Install devvm&amp;rsquo;s newest release&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>