Files
docs-next/docs/using/index.xml
T

3714 lines
696 KiB
XML
Raw 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 – Using devvm</title><link>https://next.devvm.dev/docs/using/</link><description>Recent content in Using devvm on devvm</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://next.devvm.dev/docs/using/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.&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. 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. Each launch installs it 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. 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;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 and Claude Code&amp;rsquo;s downloads: &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;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Claude Code&amp;rsquo;s telemetry hosts aren&amp;rsquo;t on its allowlist, because blocking them costs nothing. 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. 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;. 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;p&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;/p&gt;
&lt;p&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;/p&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.&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 role="img" aria-label="Diagram"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
flowchart TD
home[&amp;#34;the agents&amp;#39; files&amp;lt;br&amp;gt;in your home folder&amp;#34;]
subgraph store[&amp;#34;devvm&amp;#39;s agent store&amp;#34;]
folders[&amp;#34;settings folders:&amp;lt;br&amp;gt;skills, plugins…&amp;#34;]
files[&amp;#34;settings files&amp;lt;br&amp;gt;and logins&amp;#34;]
end
subgraph guest[&amp;#34;The VM&amp;#34;]
links[&amp;#34;linked into ~&amp;#34;]
copies[&amp;#34;copies in ~&amp;#34;]
own[&amp;#34;its own history&amp;#34;]
end
home -- &amp;#34;devvm agent import,&amp;lt;br&amp;gt;never your history&amp;#34; --&amp;gt; store
folders -- &amp;#34;mounted&amp;lt;br&amp;gt;read-only&amp;#34; --&amp;gt; links
files -- &amp;#34;copied on every&amp;lt;br&amp;gt;launch, without&amp;lt;br&amp;gt;your secrets&amp;#34; --&amp;gt; copies
copies -- &amp;#34;devvm agent save,&amp;lt;br&amp;gt;after a diff and a yes&amp;#34; --&amp;gt; store
own -- &amp;#34;devvm history export,&amp;lt;br&amp;gt;devvm rm&amp;#34; --&amp;gt; export[&amp;#34;a .tar.gz&amp;lt;br&amp;gt;on this machine&amp;#34;]
export -. &amp;#34;devvm history import,&amp;lt;br&amp;gt;or yes when a new VM&amp;lt;br&amp;gt;offers it&amp;#34; .-&amp;gt; own
&lt;/pre&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,plugins}&lt;/code&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), 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;/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 import copies only the paths in the table above, 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;. 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. 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. devvm says which agents it imported and where, and an agent you named that your home folder has nothing of gets a warning.&lt;/p&gt;
&lt;p&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;, and it never follows a link out of it. A link to a file inside the folder becomes a copy of that file, and a link that leads out of the folder, by a relative or an absolute path, or to a folder, is left out with a warning that names it. A login file that&amp;rsquo;s a link is left out with a warning too. So when your settings live elsewhere, such as in a dotfiles repo with links into &lt;code&gt;~/.claude&lt;/code&gt;, copy them into the store yourself.&lt;/p&gt;
&lt;p&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. A replacement writes each file again and takes out what your home folder no longer has, but it keeps the store&amp;rsquo;s folders, so a running VM&amp;rsquo;s mounts still show them. 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;/p&gt;
&lt;p&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;/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. It 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;/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 plugin or writing a skill there, &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.&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;The save reads only the settings in the table above 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. 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="#mounts"&gt;mounts&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Before it saves anything, devvm shows what would change. 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. 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. 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. 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. 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.&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, and 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 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.&lt;/p&gt;
&lt;p&gt;The VM&amp;rsquo;s &lt;a href="#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;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. Absolute paths in them, such as Claude Code&amp;rsquo;s plugin paths, still work. This machine enforces read-only, so even root in the VM can&amp;rsquo;t write to them. 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;). 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;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;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;).&lt;/p&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;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&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. When the login ends without a new login in the store, devvm says so and fails.&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 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 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. 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. The VM gets placeholders whatever its network tier.&lt;/p&gt;
&lt;p&gt;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;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;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. The proxy reads them from the login files in devvm&amp;rsquo;s store as it needs them and refreshes ChatGPT logins there, 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. The proxy puts in opencode&amp;rsquo;s API keys for the providers that &lt;a href="#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. 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;). 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. 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;/p&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 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 runs the agent&amp;rsquo;s own ChatGPT login in the VM, on your terminal: &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. When you approve the login there, 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. When another program on this machine has port 1455, devvm refuses and names &lt;code&gt;--device-code&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;--device-code&lt;/code&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;/p&gt;
&lt;p&gt;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. 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 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. devvm then 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;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.&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;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 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="#claude-code-login"&gt;Claude Code login&lt;/a&gt;).&lt;/p&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;p&gt;The login 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="#logging-in-with-devvm-agent-login"&gt;logging in with devvm agent login&lt;/a&gt;). It 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. 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="#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;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. 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;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;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;/p&gt;
&lt;p&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;/p&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;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. 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.&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. 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;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"&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 &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; and pi&amp;rsquo;s sessions, &lt;code&gt;~/.pi/agent/sessions&lt;/code&gt;, in the VM, 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.&lt;/p&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;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; 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.&lt;/p&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. 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/internals/design/#opencodes-database-in-history-exports"&gt;how&lt;/a&gt;). 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. 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;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;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. 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;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;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;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; and &lt;code&gt;~/.pi/agent/sessions&lt;/code&gt;, starts with &lt;code&gt;/&lt;/code&gt; or has a &lt;code&gt;..&lt;/code&gt; part, devvm imports nothing and says so. 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, as the export makes it, or leaves the database out when the VM has no &lt;code&gt;sqlite3&lt;/code&gt;. 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;
&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;, &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. 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;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>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;.&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 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; 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;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;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;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;/p&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;/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;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>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 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; 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;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;h2 data-hextra-search-id="devvm-host-and-devvm-code"&gt;devvm host and devvm code&lt;span class="hx:absolute hx:-mt-20" id="devvm-host-and-devvm-code"&gt;&lt;/span&gt;
&lt;a href="#devvm-host-and-devvm-code" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&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.&lt;/p&gt;
&lt;p&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;/p&gt;
&lt;h3 data-hextra-search-id="vs-code"&gt;VS Code&lt;span class="hx:absolute hx:-mt-20" id="vs-code"&gt;&lt;/span&gt;
&lt;a href="#vs-code" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Over Remote-SSH, VS Code reaches further than ssh:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ports.&lt;/strong&gt; It forwards the ports that programs it starts 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 its terminals, its tasks and an agent.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Git sign-in.&lt;/strong&gt; It answers git&amp;rsquo;s credential prompts in the VM with your GitHub sign-in in VS Code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm turns both off in VS Code&amp;rsquo;s settings for the VM, &lt;code&gt;~/.vscode-server/data/Machine/settings.json&lt;/code&gt; in the VM. 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; and keeps the file&amp;rsquo;s 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.&lt;/p&gt;
&lt;p&gt;The VM can change that file back, so for a VM you don&amp;rsquo;t trust, also set the three in your own VS Code settings on this machine. 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;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 or to log in to servers. It can&amp;rsquo;t copy them. Turn it on for one VM when you need git over SSH there.&lt;/p&gt;
&lt;div role="img" aria-label="Diagram"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
flowchart TD
choice{{&amp;#34;devvm ssh-agent&amp;#34;}}
choice -- &amp;#34;off, the default&amp;#34; --&amp;gt; off[&amp;#34;no agent:&amp;lt;br&amp;gt;git over SSH fails&amp;#34;]
choice -- &amp;#34;on&amp;#34; --&amp;gt; on[&amp;#34;your agent, while&amp;lt;br&amp;gt;you&amp;#39;re connected&amp;#34;]
choice -- &amp;#34;devvm&amp;#34; --&amp;gt; own[&amp;#34;devvm&amp;#39;s own agent,&amp;lt;br&amp;gt;with only the keys&amp;lt;br&amp;gt;you added&amp;#34;]
&lt;/pre&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. For a VM started outside devvm, such as with &lt;code&gt;limactl start&lt;/code&gt;, they follow the current choice. 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;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. The entries name it as the agent, so an editor forwards it however the editor was started.&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>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;/p&gt;
&lt;p&gt;A VM never takes a port that a program on this machine already has, a port that another VM lists, or a port that devvm uses for its VMs&amp;rsquo; ssh and proxies. 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. 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;/p&gt;
&lt;p&gt;If the forwarder can&amp;rsquo;t start, devvm warns you and names its log, and the VM runs on without forwarded ports.&lt;/p&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;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;/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 only in a terminal, and only when no size is set and you didn&amp;rsquo;t give &lt;code&gt;--cpus&lt;/code&gt; or &lt;code&gt;--memory&lt;/code&gt;. It asks once, because that run also chooses base&amp;rsquo;s features, and devvm asks only before they&amp;rsquo;re chosen. 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, and 0.5 GiB for each tool&lt;/td&gt;
&lt;td&gt;9 GiB, 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 needs 8 GiB. Each build checks again before it starts, so the first VM on a Mac, which builds base, needs 8 GiB free.&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. 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;
&lt;p&gt;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;&lt;code&gt;devvm doctor&lt;/code&gt; also warns when that disk 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;</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. On macOS, devvm also locks the folder&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; hooks and config against changes from the VM (&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 role="img" aria-label="Diagram"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
flowchart TD
none([&amp;#34;no VM&amp;#34;]) -- &amp;#34;devvm&amp;#34; --&amp;gt; running([&amp;#34;running&amp;#34;])
running -- &amp;#34;devvm restart,&amp;lt;br&amp;gt;devvm update&amp;#34; --&amp;gt; running
running -- &amp;#34;devvm stop&amp;#34; --&amp;gt; stopped([&amp;#34;stopped&amp;#34;])
stopped -- &amp;#34;devvm,&amp;lt;br&amp;gt;devvm restart,&amp;lt;br&amp;gt;devvm update&amp;#34; --&amp;gt; running
running -- &amp;#34;devvm rm&amp;#34; --&amp;gt; deleted([&amp;#34;deleted&amp;#34;])
stopped -- &amp;#34;devvm rm&amp;#34; --&amp;gt; deleted
outdated@{ shape: braces, label: &amp;#34;When its image changes, a VM&amp;lt;br&amp;gt;is outdated, and it keeps&amp;lt;br&amp;gt;its image until devvm update.&amp;#34; }
running ~~~ outdated
&lt;/pre&gt;
&lt;/div&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;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, such as a new size for a running VM, a change into or out of the open tier, a change to its SSH agent forwarding, or the config folders of an agent that &lt;code&gt;devvm tools add&lt;/code&gt; added, and a restart applies them.&lt;/p&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. When the VM&amp;rsquo;s agent folder mounts are among the changes, the default answer is yes (&lt;code&gt;[Y/n]&lt;/code&gt;), because an agent you just added needs its folders. Otherwise the default is no (&lt;code&gt;[y/N]&lt;/code&gt;), because the VM is already running and you may only want its shell. 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;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;).&lt;/p&gt;
&lt;p&gt;devvm deletes the VM made for an earlier folder at this path only after you confirm (&lt;a href="#a-folder-made-again"&gt;a folder made again&lt;/a&gt;). In a folder without a VM of its own, &lt;code&gt;devvm rm&lt;/code&gt; acts on the VM of the nearest folder with one that this folder is inside, and it names that VM and deletes it only after you confirm (&lt;a href="#a-subfolder"&gt;a subfolder&lt;/a&gt;). devvm asks these questions only in a terminal, and &lt;code&gt;--force&lt;/code&gt; never answers them. 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;, &lt;code&gt;strict&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;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;When you run &lt;code&gt;devvm&lt;/code&gt; in such a subfolder, such as &lt;code&gt;~/some-project/src&lt;/code&gt;, devvm 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;). &lt;code&gt;devvm --here&lt;/code&gt; makes a new VM for the subfolder instead, and so does &lt;code&gt;devvm --clone&lt;/code&gt;, which makes the subfolder&amp;rsquo;s own clone VM. Once the subfolder has its own VM, devvm opens that one. 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;/p&gt;
&lt;p&gt;The other commands that act on this folder&amp;rsquo;s VM, such as &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;, 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 rm&lt;/code&gt; is the exception, because it 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. The commands that give the VM more access ask in the same way, because the parent folder&amp;rsquo;s project may not expect them. They are &lt;code&gt;devvm secret use&lt;/code&gt;, &lt;code&gt;devvm ssh-agent on&lt;/code&gt; and &lt;code&gt;devvm ssh-agent devvm&lt;/code&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;code&gt;devvm network allow&lt;/code&gt;, &lt;code&gt;devvm network rm&lt;/code&gt; when it removes a deny, and &lt;code&gt;devvm git-protect off&lt;/code&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;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;code&gt;devvm adopt&lt;/code&gt; acts only on the VM made for this folder&amp;rsquo;s own path, never on a parent folder&amp;rsquo;s.&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;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;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. 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 change the nested project&amp;rsquo;s files, &lt;code&gt;.git&lt;/code&gt; included wherever &lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt; doesn&amp;rsquo;t cover it, and 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. 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. Find what replaced the folder, move the project folder back to its path, and run the command again. 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 it, 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;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;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. When you answer yes, 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. When you answer no, 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;). Without a terminal, 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;/p&gt;
&lt;p&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. 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. 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. The folder&amp;rsquo;s path in the VM changes with it.&lt;/p&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. &lt;code&gt;codex resume --all&lt;/code&gt; lists the sessions of every folder, the old path&amp;rsquo;s included, and &lt;code&gt;codex resume&lt;/code&gt; with a session&amp;rsquo;s ID resumes that session wherever it started. 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, which devvm knows by its device, inode and birth time (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;), and when nothing is at the old path any more, or only a symlink to the new path. It never offers a VM to a copy of the folder, which is another folder, or to a folder on a file system that may give a new folder the inode number of a deleted one. That leaves folders 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. devvm also offers no VM for a folder that another user owns, or a &lt;code&gt;--clone&lt;/code&gt; VM, which keeps its own clone of the repo at the old path inside the VM. 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;. 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;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;. 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;&lt;code&gt;devvm rm VM&lt;/code&gt; 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. Given this folder&amp;rsquo;s own VM, it does what &lt;code&gt;devvm rm&lt;/code&gt; does. It also refuses a name that isn&amp;rsquo;t one of your VMs, and 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;). When the VM&amp;rsquo;s state names this folder but the folder has a VM of its own, which only a state changed by hand can do, devvm refuses it 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;/p&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>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 base and the layers bring, adding layers to a VM, how the shared tools work, what a new VM gets, and how to rebuild, list and delete 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 role="img" aria-label="Diagram"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
flowchart TD
ubuntu[&amp;#34;Ubuntu&amp;#39;s cloud image,&amp;lt;br&amp;gt;or a --from image&amp;#34;] --&amp;gt; base[&amp;#34;base, with&amp;lt;br&amp;gt;the features you chose&amp;#34;]
base --&amp;gt; docker[&amp;#34;docker, a layer&amp;lt;br&amp;gt;on base&amp;#34;]
base -. &amp;#34;a copy&amp;#34; .-&amp;gt; vm1[&amp;#34;VM of base,&amp;lt;br&amp;gt;with node&amp;#34;]
docker -. &amp;#34;a copy&amp;#34; .-&amp;gt; vm2[&amp;#34;VM of docker,&amp;lt;br&amp;gt;with node and claude&amp;#34;]
tools[(&amp;#34;shared tools:&amp;lt;br&amp;gt;node, claude…&amp;#34;)] -- &amp;#34;mounted&amp;lt;br&amp;gt;read-only&amp;#34; --&amp;gt; vm1 &amp;amp; vm2
&lt;/pre&gt;
&lt;/div&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, 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;).&lt;/p&gt;
&lt;p&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;base 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. 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. 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;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;. A layer&amp;rsquo;s name is made of lowercase letters, digits and dashes, starts with a letter or digit, and 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. devvm refuses any other name in an image, and it refuses a layer whose script is missing. &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;).&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 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. 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;).&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 when 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. It also refuses when the VM&amp;rsquo;s backend can&amp;rsquo;t run one of the layers, when the VM&amp;rsquo;s creation didn&amp;rsquo;t finish, and for 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;/p&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, and everything it keeps for the VM: 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. It also keeps the VM&amp;rsquo;s 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. The VM gets new SSH host keys, which devvm pins as it does for any new VM, and 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.&lt;/p&gt;
&lt;p&gt;devvm keeps the VM&amp;rsquo;s home folder too. It reads the 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. What other shells in the VM write after devvm reads the folder is lost, so close them first. 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;. 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. devvm keeps only files, folders and symlinks, without setuid bits, and nothing from a filesystem mounted inside your home. &lt;code&gt;--clean-home&lt;/code&gt; gives the VM the new image&amp;rsquo;s home folder instead.&lt;/p&gt;
&lt;p&gt;Everything else on the VM&amp;rsquo;s disk is lost: the packages you installed with apt, programs installed outside your home, Docker&amp;rsquo;s images, containers and volumes, the Nix store, and the processes that ran in it. 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.&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;, works in the same steps and 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 the layers left. It also refuses &lt;code&gt;base&lt;/code&gt;, a shared tool&amp;rsquo;s name, which &lt;code&gt;devvm tools rm&lt;/code&gt; takes out instead, and a name that isn&amp;rsquo;t a layer. 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="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 role="img" aria-label="Diagram"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
flowchart TD
run[&amp;#34;devvm in a folder&amp;lt;br&amp;gt;without a VM&amp;#34;] --&amp;gt; defaults[&amp;#34;the defaults: the folder&amp;#39;s toolchains,&amp;lt;br&amp;gt;devvm setup&amp;#39;s agents and layers&amp;#34;]
defaults --&amp;gt; flags[&amp;#34;each flag given replaces its part:&amp;lt;br&amp;gt;--tools, --agents, --layers, --network, --cpus, --memory&amp;#34;]
flags --&amp;gt; summary[&amp;#34;the summary says what the VM gets&amp;#34;]
summary --&amp;gt; term{{&amp;#34;a terminal, without --no-input,&amp;lt;br&amp;gt;and something left to choose?&amp;#34;}}
term -- &amp;#34;no&amp;#34; --&amp;gt; copy
term -- &amp;#34;yes&amp;#34; --&amp;gt; ask{{&amp;#34;Customize it? [y/N]&amp;#34;}}
ask -- &amp;#34;Enter&amp;#34; --&amp;gt; copy
ask -- &amp;#34;y&amp;#34; --&amp;gt; pick[&amp;#34;the list, then the tier,&amp;lt;br&amp;gt;then the CPUs, memory and disk&amp;#34;] --&amp;gt; copy
copy[&amp;#34;its image built if it isn&amp;#39;t,&amp;lt;br&amp;gt;and the VM is a copy of it,&amp;lt;br&amp;gt;with its shared tools mounted&amp;#34;]
&lt;/pre&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;Then 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, unless you gave &lt;code&gt;--network&lt;/code&gt;, 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;). Next, 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. 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;/p&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;. 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. devvm skips the list when &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, skips the tier when you give &lt;code&gt;--network&lt;/code&gt; or saved a tier, skips the ports when you give &lt;code&gt;--ports&lt;/code&gt;, and skips the CPUs, the memory or the disk when you give &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt; or &lt;code&gt;--disk&lt;/code&gt;. devvm doesn&amp;rsquo;t ask at all when the flags give every part, the ports, the CPUs, the memory and the disk, and the tier is given or saved. It doesn&amp;rsquo;t ask about the tier on a backend whose VMs can only be open, either.&lt;/p&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;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;/p&gt;
&lt;p&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;/p&gt;
&lt;p&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;/p&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, such as &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;, for &lt;code&gt;--tools&lt;/code&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;, for &lt;code&gt;--layers&lt;/code&gt;, and &lt;code&gt;devvm size&lt;/code&gt; for &lt;code&gt;--cpus&lt;/code&gt;, and for &lt;code&gt;--from&lt;/code&gt; and &lt;code&gt;--no-devcontainer&lt;/code&gt; it names none. 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;. Up and down, or &lt;code&gt;k&lt;/code&gt; and &lt;code&gt;j&lt;/code&gt;, move. In a list where you choose several, such as the toolchains, coding agents and layers, space chooses or unchooses the row under the cursor, and &lt;code&gt;a&lt;/code&gt; chooses every row, or unchooses them all when they&amp;rsquo;re all chosen already. In a list where you choose one, such as the network tiers, moving chooses it. Enter confirms. 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. At a question with a value in brackets, such as a size, Enter keeps that value.&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.&lt;/p&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 rebuild, 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;p&gt;&lt;code&gt;devvm update&lt;/code&gt; brings this folder&amp;rsquo;s VM up to date in two steps. First 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;). Then, 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. 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;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;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. 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. 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;/p&gt;
&lt;p&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;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;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/from/"&gt;&lt;code&gt;--from&lt;/code&gt;&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 each also names the &lt;a href="https://next.devvm.dev/docs/backends/"&gt;backend&lt;/a&gt; that has it or built it, &lt;code&gt;lima&lt;/code&gt;. An image&amp;rsquo;s &lt;code&gt;digest&lt;/code&gt; is the full SHA-256 of what its base started from, and &lt;code&gt;sized&lt;/code&gt; says whether devvm knows its size. A tool image&amp;rsquo;s &lt;code&gt;built&lt;/code&gt; says whether devvm has built it, and only a built one has &lt;code&gt;backend&lt;/code&gt; and &lt;code&gt;libc&lt;/code&gt;. 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;. &lt;code&gt;total&lt;/code&gt; is the disk the images and shared tools take together, &lt;code&gt;unused_tools&lt;/code&gt; is the part the unused tool images take, and &lt;code&gt;nix_cache&lt;/code&gt; has the shared Nix cache&amp;rsquo;s files, the disk they take and its cap.&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;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;p&gt;&lt;code&gt;devvm gc&lt;/code&gt; deletes four things. The first is what &lt;code&gt;devvm images&lt;/code&gt; lists as stale or unfinished. The second is the shared tools it lists as &lt;code&gt;unused&lt;/code&gt;. The third is 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. The fourth is 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. 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.&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. 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;, that VM may not list the tools it picked yet, so gc keeps every current shared tool that no VM has, names them, and deletes the rest of what it would. Run it again once that&amp;rsquo;s done. A tool that devvm is still building never reaches gc, because gc waits for the build to finish before it lists anything. A VM that has a deleted tool builds it again when it needs it.&lt;/li&gt;
&lt;li&gt;The devvm making a VM holds a lock from before it picks the VM&amp;rsquo;s tools until the VM&amp;rsquo;s state lists them, and the system lets go of that lock as soon as that devvm ends, so one that crashed or that you killed never leaves gc keeping tools. A devvm that starts to make a VM while &lt;code&gt;devvm gc --tool-images&lt;/code&gt; runs, or while retention deletes shared tools, waits for it to finish and says it&amp;rsquo;s waiting. In a terminal, gc holds that lock while it asks you, so answer it first.&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, the VM&amp;rsquo;s setup can&amp;rsquo;t mount it. devvm then 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;/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 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;). 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>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 fails when the file&amp;rsquo;s checksum doesn&amp;rsquo;t match.&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;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;uname -m&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; in
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; x86_64&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;arch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;amd64 &lt;span class="nv"&gt;sha256&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$mailpit_sha256_amd64&lt;/span&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; aarch64&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;arch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;arm64 &lt;span class="nv"&gt;sha256&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$mailpit_sha256_arm64&lt;/span&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; *&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;mailpit: no build for &lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;uname -m&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;2&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="m"&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="k"&gt;esac&lt;/span&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;$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="nv"&gt;$sha256&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. 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 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>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 and the API keys that VMs get as they are, 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;# 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;code&gt;network&lt;/code&gt; is 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;code&gt;ports&lt;/code&gt; is &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;code&gt;features&lt;/code&gt; lists the &lt;a href="https://next.devvm.dev/docs/using/customizing/#choosing-features"&gt;features&lt;/a&gt; that base gets, &lt;code&gt;agents&lt;/code&gt; the &lt;a href="#coding-agents-for-new-vms"&gt;coding agents&lt;/a&gt; that new VMs get, and &lt;code&gt;layers&lt;/code&gt; the &lt;a href="#layers-for-new-vms"&gt;layers&lt;/a&gt; that new VMs get, bottom first. &lt;code&gt;cpus&lt;/code&gt; is a whole number, and &lt;code&gt;memory&lt;/code&gt; and &lt;code&gt;disk&lt;/code&gt; are 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. The &lt;code&gt;[retention]&lt;/code&gt; keys are 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;/p&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. 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;). 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). 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;). Every VM with the agent gets the change at its next launch. 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="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;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;p&gt;A mirror can&amp;rsquo;t give base a package that Ubuntu didn&amp;rsquo;t publish. apt checks every list and package against Ubuntu&amp;rsquo;s archive key whichever server sends it, and refuses one that doesn&amp;rsquo;t match, and devvm checks them against that key again on this machine before it keeps any package. A mirror that&amp;rsquo;s behind, or one that&amp;rsquo;s lying, can still serve lists older than Ubuntu&amp;rsquo;s, because Ubuntu&amp;rsquo;s signed lists don&amp;rsquo;t expire. devvm refuses lists more than a day older than the Ubuntu cloud image base starts from, and it 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;). devvm compares the lists with the cloud image&amp;rsquo;s date, not with today&amp;rsquo;s, so a mirror that fell behind after that date can still give base packages older than Ubuntu&amp;rsquo;s, and you should only set a mirror you trust to keep up. Only the first build of each base uses the mirror, 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. 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 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 (&lt;a href="https://next.devvm.dev/docs/using/upgrading/#trying-a-prerelease"&gt;trying a prerelease&lt;/a&gt;). 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, and it announces a newer prerelease or release, whichever is newest. It 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. 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;/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;p&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;/p&gt;
&lt;p&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;/p&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;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&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;p&gt;Ages are &lt;a href="https://next.devvm.dev/docs/using/command-line/#flags-and-values"&gt;durations&lt;/a&gt;, a whole number of minutes, hours, days or weeks, such as &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;. Sizes are 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, such as &lt;code&gt;500M&lt;/code&gt; or &lt;code&gt;20G&lt;/code&gt;, as &lt;code&gt;devvm space&lt;/code&gt; shows them. 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. 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 it deletes something, devvm says what in one line. 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. When two devvms start at once, only one of them applies the settings.&lt;/p&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. When a file holds anything else, 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, devvm refuses the whole folder and names the file. It sends only the certificates it read out of a file, never the rest of the file. devvm doesn&amp;rsquo;t follow links there, so copy each certificate into the folder rather than linking to it. When a &lt;code&gt;*.pem&lt;/code&gt; or &lt;code&gt;*.crt&lt;/code&gt; file is a link, or the folder itself is one, devvm refuses the whole folder and names the link, 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 also refuses the folder, naming the file, when it can&amp;rsquo;t read a file there or the folder itself.&lt;/p&gt;
&lt;p&gt;Every project VM trusts these CAs in its system&amp;rsquo;s store from its next launch, and so does every VM that devvm builds an image or shared tools in. 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. On every &lt;a href="https://next.devvm.dev/docs/safety/network/"&gt;network tier&lt;/a&gt;, the VM&amp;rsquo;s proxy also trusts them for the connections it makes itself, and so does the refresh of a coding agent&amp;rsquo;s login that 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. devvm also resolves the shared tools&amp;rsquo; versions on this machine, with a mise of its own that it downloads once, and 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. devvm&amp;rsquo;s other connections from this machine, such as checking an image&amp;rsquo;s registry or Ubuntu&amp;rsquo;s image, 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;p&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;/p&gt;
&lt;p&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.&lt;/p&gt;
&lt;p&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;/p&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. It refuses a folder that is or holds 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. It also refuses a folder inside one of devvm&amp;rsquo;s own folders, because a VM there could rewrite the scripts that every image build runs, or the files that devvm runs on this machine.&lt;/p&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;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 values a message fills in, such as a VM&amp;rsquo;s name, a path, a port or a count, are bold, so they stand out from the words around them. An error&amp;rsquo;s &lt;code&gt;devvm:&lt;/code&gt; label is red and a warning&amp;rsquo;s is yellow, a doc link is blue and underlined, and the &lt;code&gt;==&amp;gt;&lt;/code&gt; before what devvm did is bold. When a step fails, the end of the run log that devvm prints is dim, and so is the log&amp;rsquo;s latest line on the status line and each line that &lt;code&gt;-v&lt;/code&gt; shows. The mark a slow step leaves when it&amp;rsquo;s done is green.&lt;/p&gt;
&lt;p&gt;The tables that devvm ls, devvm images, devvm space and devvm doctor print are colored too. Each table&amp;rsquo;s header row and the totals row are bold, and a state is green when it&amp;rsquo;s good, such as current, Running or native, yellow when it needs your attention, such as stale, unused, Stopped or emulated, and red when something is wrong, such as an unenforced tier or an unreviewed emulation. Digests, image keys and a feature a backend doesn&amp;rsquo;t have, which devvm doctor lists as none, are dim, and names, paths, sizes and counts stay in your terminal&amp;rsquo;s usual color. The columns line up the same with colors or without.&lt;/p&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>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, which have no &lt;a href="https://next.devvm.dev/docs/safety/git-protection/#linux-hosts"&gt;&lt;code&gt;.git&lt;/code&gt; protection&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 branches 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;git fetch devvm &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 role="img" aria-label="Diagram"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
sequenceDiagram
participant R as Your repo
participant V as The VM&amp;#39;s clone
R-&amp;gt;&amp;gt;V: devvm --clone pushes&amp;lt;br&amp;gt;every local branch
Note over V: you or an agent&amp;lt;br&amp;gt;commit in the VM
V-&amp;gt;&amp;gt;R: git fetch devvm gives&amp;lt;br&amp;gt;devvm/#lt;branch#gt;
Note over R: review,&amp;lt;br&amp;gt;then merge
R-&amp;gt;&amp;gt;V: devvm rm looks for&amp;lt;br&amp;gt;commits not fetched
V-&amp;gt;&amp;gt;R: fetched into&amp;lt;br&amp;gt;saved/devvm/#lt;branch#gt;
Note over R,V: the VM is deleted,&amp;lt;br&amp;gt;and its remote removed
&lt;/pre&gt;
&lt;/div&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 and a branch checked out, not a detached HEAD.&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 push would copy 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, 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;git is installed on this machine. The VM&amp;rsquo;s images already have it.&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 pushes every local branch into it. When the folder is a git worktree, devvm pushes only the worktree&amp;rsquo;s branch and that branch&amp;rsquo;s upstream, if it has one, and leaves the repo&amp;rsquo;s other branches on this machine. The push goes over ssh to the VM itself and checks the host keys devvm pinned for it. 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 the push anywhere else (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#what-a-lock-cant-stop"&gt;how the push connects&lt;/a&gt;). devvm checks out your current branch in the clone, and your shell opens there.&lt;/p&gt;
&lt;p&gt;Apart from a worktree&amp;rsquo;s upstream, which can be a remote-tracking branch such as &lt;code&gt;origin/main&lt;/code&gt;, devvm copies only your local branches. Tags, uncommitted changes, and untracked or ignored files such as &lt;code&gt;.env&lt;/code&gt; and &lt;code&gt;node_modules&lt;/code&gt; stay on this machine. devvm warns you about uncommitted changes, so you can commit them and send them later with &lt;code&gt;git push devvm BRANCH&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If the copy fails, for example because the VM can&amp;rsquo;t be reached, devvm tries again the next time you run it in the folder.&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;Fetching runs nothing from the VM on this machine. git only receives objects and updates the &lt;code&gt;devvm/*&lt;/code&gt; branches, or creates new &lt;code&gt;saved/devvm/*&lt;/code&gt; branches 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;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;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;/p&gt;
&lt;p&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;/p&gt;
&lt;p&gt;The agents also share the VM&amp;rsquo;s ports, 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;/p&gt;
&lt;p&gt;The agents in one VM share 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. 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="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;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;If the clone has branches with commits this repo hasn&amp;rsquo;t fetched, devvm names them and offers to fetch them into new local branches named &lt;code&gt;saved/devvm/&amp;lt;branch&amp;gt;&lt;/code&gt;. It 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;If the clone or a worktree inside its folder has uncommitted changes, 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. devvm skips a worktree whose folder is gone or that git would prune, and it doesn&amp;rsquo;t check worktrees outside the clone&amp;rsquo;s folder. When the clone has more than 100 worktrees, devvm checks the first 100 and asks before deleting the VM, even if none of them has changes.&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;).&lt;/p&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;, 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 under &lt;code&gt;saved/devvm/&lt;/code&gt;, whoever fetched it. devvm names each branch it creates, and they&amp;rsquo;re yours to review, merge or delete, as with &lt;code&gt;git branch -D saved/devvm/main&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The saved branches are named after the remote, as &lt;code&gt;saved/&amp;lt;remote&amp;gt;/&amp;lt;branch&amp;gt;&lt;/code&gt;, and devvm never overwrites a branch. When a branch is in the way, devvm 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;).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm rm --force&lt;/code&gt; skips only the question whether to delete the VM at all, and both checks still run. &lt;code&gt;devvm rm --no-export&lt;/code&gt; skips the export of the agents&amp;rsquo; history, and it also leaves both checks as they are.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm rm --no-clone-check&lt;/code&gt; skips 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. Use it when a check can&amp;rsquo;t read the clone, such as when git in the VM is broken, 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; needs a folder that &lt;code&gt;--clone&lt;/code&gt; takes (&lt;a href="#requirements"&gt;requirements&lt;/a&gt;), and devvm refuses before it changes anything when the folder isn&amp;rsquo;t one. Your work is in the folder, so only the VM&amp;rsquo;s disk is lost. 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;). Once the new VM is ready and the old one is deleted, devvm 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, 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;/p&gt;
&lt;p&gt;&lt;code&gt;devvm clone off&lt;/code&gt; loses the clone, which is on the VM&amp;rsquo;s disk, so first it checks the clone as &lt;code&gt;devvm rm&lt;/code&gt; does (&lt;a href="#deleting-the-vm"&gt;deleting the VM&lt;/a&gt;). 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. The new VM mounts the folder again 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. Before the new VM first starts, and before devvm locks &lt;code&gt;.git&lt;/code&gt;, it removes the remote 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;/p&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, run &lt;code&gt;devvm clone off&lt;/code&gt;, then that command, then &lt;code&gt;devvm clone on&lt;/code&gt;.&lt;/p&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;</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 role="img" aria-label="Diagram"&gt;
&lt;pre class="mermaid hx:mt-6"&gt;
flowchart TD
subgraph ports[&amp;#34;Its ports&amp;#34;]
direction TB
flag[&amp;#34;--ports&amp;#34;] -- &amp;#34;or else&amp;#34; --&amp;gt; fwd[&amp;#34;your ports, with&amp;lt;br&amp;gt;forwardPorts added&amp;#34;]
end
subgraph base[&amp;#34;Its base starts from&amp;#34;]
direction TB
from[&amp;#34;--from&amp;#34;] -- &amp;#34;or else&amp;#34; --&amp;gt; image[&amp;#34;the file&amp;#39;s image&amp;#34;]
image -- &amp;#34;or else&amp;#34; --&amp;gt; env[&amp;#34;$DEVVM_FROM&amp;#34;]
env -- &amp;#34;or else&amp;#34; --&amp;gt; ubuntu[&amp;#34;Ubuntu&amp;#39;s cloud image&amp;#34;]
end
&lt;/pre&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>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. 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. 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;/p&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;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;The link&amp;rsquo;s next connection is refused, while connections that are open stay until they close.&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;p&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;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;/p&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;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 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.&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;p&gt;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;. It starts with the desktop and runs until the VM stops.&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.&lt;/p&gt;
&lt;p&gt;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. VNC passwords are eight characters at most, and devvm lets a viewer try one password a second, so guessing it would take thousands of years.&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;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;/p&gt;
&lt;p&gt;&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 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;Debian and Ubuntu images:&lt;/strong&gt; their 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;Alpine images:&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 image, by its digest. When the image&amp;rsquo;s tag moves to a new image, devvm builds the tools it gives those VMs next again, on the new image.&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. 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;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 &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, 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. devvm&amp;rsquo;s builds fill it, but it can also hold your own downloads, 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;p&gt;devvm never prunes these caches on its own. &lt;code&gt;devvm gc --caches&lt;/code&gt; frees devvm&amp;rsquo;s share of them, which is what devvm&amp;rsquo;s builds put there and 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. 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. 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;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;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&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;, and its link session&amp;rsquo;s output, &lt;code&gt;links.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&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, 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;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;p&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;/p&gt;
&lt;p&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: &lt;code&gt;logs.runs&lt;/code&gt; keeps that many run logs instead of 20, &lt;code&gt;history.age&lt;/code&gt; and &lt;code&gt;history.count&lt;/code&gt; delete old exports of agents&amp;rsquo; history, &lt;code&gt;tools.unused-age&lt;/code&gt; deletes current shared tools that no VM has had for that long, and &lt;code&gt;orphans.age&lt;/code&gt; forgets VMs that their backend no longer has. &lt;code&gt;nix-cache.size&lt;/code&gt; sets the shared Nix cache&amp;rsquo;s cap, and each time retention runs, it deletes the cache&amp;rsquo;s least recently used files while it takes more than that. 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;/p&gt;
&lt;p&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;/p&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;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;/li&gt;
&lt;li&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;/li&gt;
&lt;li&gt;&lt;strong&gt;Its state changed in the last hour,&lt;/strong&gt; because the VM may still be being made.&lt;/li&gt;
&lt;/ul&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;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 leaves on your machine when it&amp;rsquo;s killed, which are the ones nothing listens on.&lt;/p&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 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, and devvm never deletes it, because the other devvm may still use it. To delete one yourself, run &lt;code&gt;devvm limactl delete NAME&lt;/code&gt;.&lt;/p&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. When devvm builds base, Lima downloads Ubuntu&amp;rsquo;s cloud image into that cache, which is 600 to 900 MB for each release, and on macOS it also keeps a copy 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. devvm deletes something in it only when you run &lt;code&gt;devvm gc --caches&lt;/code&gt;. Lima keeps each download in a folder named by the SHA-256 of its address, and gc frees only the folders of Ubuntu&amp;rsquo;s cloud images at the address devvm downloads base from, for its Ubuntu release, that no image record of devvm&amp;rsquo;s names and that haven&amp;rsquo;t changed in the last hour. A cloud image that one of your own Lima VMs downloaded from that same address can be among them, and Lima downloads it again the next time it needs it. 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.&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;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;/p&gt;
&lt;p&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;/p&gt;
&lt;p&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;/p&gt;
&lt;p&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;/p&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. They are &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, 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, a command giving the VM of a folder this one is inside more access, and &lt;code&gt;devvm agent save&lt;/code&gt; saving a VM&amp;rsquo;s settings for every VM. Where devvm can&amp;rsquo;t ask, each of them refuses and says what to run instead.&lt;/p&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 object&amp;rsquo;s first field is &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt;, and the page for each command lists its other fields with an example. 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;/p&gt;
&lt;p&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. A list with nothing in it is &lt;code&gt;[]&lt;/code&gt;, never &lt;code&gt;null&lt;/code&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;. 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;/p&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 devvm&amp;rsquo;s release key can&amp;rsquo;t check a release&amp;rsquo;s signature, 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 signature, &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, and checks that devvm&amp;rsquo;s release key signed it for that release&amp;rsquo;s version. The key is built into the devvm you have, so a replaced release can&amp;rsquo;t bring its own.&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;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;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;p&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;/p&gt;
&lt;p&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;/p&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 it names &lt;code&gt;devvm-rc&lt;/code&gt; in both commands when that&amp;rsquo;s the formula you installed. It stops whether or not it runs in a terminal, and its &lt;code&gt;--force&lt;/code&gt; installs a second copy anyway.&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;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 it sends the output of the commands it runs to a log instead of the terminal. When a step fails, devvm prints the end of the log.&lt;/p&gt;
&lt;p&gt;To see the commands&amp;rsquo; output as they run, add &lt;code&gt;-v&lt;/code&gt; or &lt;code&gt;--verbose&lt;/code&gt; to any command, as in &lt;code&gt;devvm -v build base&lt;/code&gt; or &lt;code&gt;devvm -v&lt;/code&gt;. devvm then shows each line on standard error as the log gets it, without the status line, and it still writes the log. The lines 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. 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;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, and devvm keeps the newest 20. 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 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;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. Once Lima has started the VM, devvm replaces each password there 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.&lt;/p&gt;
&lt;p&gt;In a terminal and without &lt;code&gt;-v&lt;/code&gt;, a status line shows the step, how long it has run, and the log&amp;rsquo;s latest line. A step that takes more than a few seconds leaves a line with its time.&lt;/p&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.&lt;/p&gt;
&lt;p&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. 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;/p&gt;
&lt;p&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;/p&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, so that build needs to reach Ubuntu&amp;rsquo;s list of releases and the release&amp;rsquo;s checksums. When it can&amp;rsquo;t, devvm says so and pins nothing, so 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. Once an image is pinned, building base again needs Lima&amp;rsquo;s cached copy of it or the release itself, which Ubuntu removes after a few months, and devvm rebuild base pins the newest again (&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;Building the same base again also needs the copies of its packages that devvm kept from its first build. When one of them is gone or changed, devvm names it and builds nothing, and &lt;code&gt;devvm rebuild base&lt;/code&gt; makes a new base with the newest packages (&lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt;).&lt;/p&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, every command on that VM fails, and the commands that read every VM leave that VM out and carry on with the rest. &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. 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. devvm also 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;/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;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;).&lt;/p&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 says the proxy didn&amp;rsquo;t start, read the log it names for why. When it says another program took the proxy&amp;rsquo;s port, devvm picks another port the next time it starts the VM, so run &lt;code&gt;devvm restart&lt;/code&gt;. When the proxy doesn&amp;rsquo;t stop for new settings, 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;). An open VM runs on when its proxy doesn&amp;rsquo;t answer it, 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;/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-host-on-the-allowlist-doesnt-resolve"&gt;A host on the allowlist doesn&amp;rsquo;t resolve&lt;span class="hx:absolute hx:-mt-20" id="a-host-on-the-allowlist-doesnt-resolve"&gt;&lt;/span&gt;
&lt;a href="#a-host-on-the-allowlist-doesnt-resolve" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On a confined tier, a tool that doesn&amp;rsquo;t go through the proxy fails with a DNS or connection error, 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;, even for a host that the VM&amp;rsquo;s rules allow, and &lt;code&gt;devvm network log&lt;/code&gt; and &lt;code&gt;devvm-why&lt;/code&gt; show nothing for it, because the request never reached the proxy. The VM can&amp;rsquo;t resolve names or connect out on its own, so a tool works only through the proxy, and 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="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;p&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;/p&gt;
&lt;p&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;/p&gt;
&lt;p&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;/p&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;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. 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;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 its console log before you start it again, because every start overwrites the log. 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;).&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;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. 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;p&gt;Run &lt;code&gt;devvm tools update&lt;/code&gt; in the project folder. It builds the tools that are missing and then opens the shell. When the VM has the newest versions, devvm 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;).&lt;/p&gt;
&lt;p&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;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;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;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></channel></rss>