Each launch and each devvm agent login claude copied the store's VM copy
of Claude Code's OAuth login (claudeAiOauth only) over the VM's
~/.claude/.credentials.json, where Claude Code also keeps its logins to
MCP servers (mcpOAuth: their tokens and, mid-login, the PKCE verifier).
So an MCP login failed when the VM was set up again before it finished,
and a finished one was gone at the next launch.
The setup now gets the copy as claude-credentials.json (claudeSyncName),
and sync.sh's merge_claude_credentials merges it in the VM: the copy's
claudeAiOauth replaces the VM's (or takes it out when the copy has none),
every other key of the VM's file stays. It reads the VM's file with one
jq call (--slurpfile, so two JSON values or a non-object are caught) and
writes it whole, mode 600, through a mktemp file in ~/.cache, which no
history export or remake carries, then mv; a failed cat or mv removes
the temp file and fails the setup. A link, or a file that's empty, not
JSON or not one object, is replaced by the copy and said (a link removed
first, so mv never writes through it into a folder); a folder is left
and said.
With a Claude Code token (setup-token), devvm sends no copy, as before,
so the VM's file stays as it is: Claude Code prefers the token in its
environment, and a leftover login's placeholder gets the token at
api.anthropic.com and nothing at the connectors' host.
mcpOAuth stays in the VM: devvm agent save reads only settings and the
.claude.json allowlist, history export excludes .credentials.json
(HistoryExcludes) and import skips it, and a remake leaves login files
out (homeSkips), all unchanged.
Tests: TestStageClaudeOAuthMerged (the copy is staged to merge, never at
home/.claude/.credentials.json); TestClaudeSyncNamesMerged (sync.sh
merges each claudeSyncName name into its place); guest.txtar runs
merge_claude_credentials (mcpOAuth and other keys kept, claudeAiOauth
replaced or removed, a key with a \u escape, empty, not JSON, two values,
an array, a link to a file or folder, a folder, a failed move, the
warnings, mode 600, no temp left); agent_login.txtar reads the new name.
Docs: Coding agents' MCP servers' logins (real tokens the VM's code can
read, never leaving it) and its Copies, How it works' Claude Code's
login and the network page's sentences, what a VM made again keeps, the
sync.sh header, and the safety pages' claim that a VM never holds a
refresh token, narrowed to the logins devvm keeps.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
vmname.VM is the name of every machine devvm runs on a backend: a
project VM, an image's machine (devvm-img-<key>), a build VM and a
remake's aside. Fields, parameters, results and map keys that held a VM's
name as a string now hold a VM, from the backend interface down to the
CLI's --json structs, whose output is byte for byte the same.
Boundary parsers, the only places a string becomes a VM:
- vmname.Parse: a project VM's name (state's vm.json name, export file
names, devvm _links's argument, the forwarder's -vm, project.Nth)
- vmname.ParseListed: one path element, for what a backend lists
- VM.UnmarshalText: JSON (Lima's list, proxy config and events, links'
targets in state, link lists); empty stays no VM
- vmname.Image(key), VM.Aside(), and typed constants for Lima's build VMs
- msg.M.VM: the VM a message's function took, read back
vmname's functions on names became methods (Hash, Slug, Short, Aside,
AsideHash, ImageKey, IsProject); Lima's image prefix moved to vmname;
vmname.Join joins VM lists. Messages' vm and vm_name fields are typed
by the generator. Seven messages whose field took something else became
what= (backend_lacks, backend_unreviewed, backend_unreviewed_used,
starting, deleting, configuring, running_script) and rm_vm_failed's
name=: the text is unchanged, the names-mode scripts follow.
Review.RequireFor names an image or the tools being built.
Typed sites per package (added lines with vmname.VM, non-test): msg 347
(generated), vm 124, lima 48, backendtest 32, vmssh 31, netpolicy 22,
backend 16, gitprotect 14, proxy 11, cli 11, project 10, state 8,
ports 6, paths 3, sshagent 2, sshconfig 2, tools 2.
The structure test's owners rule now fails on a field, parameter or
result named for a VM (vm, vms, otherVM, vmName) typed string, []string
or map[string]…, and on converting anything but a literal to vmname.VM
outside the files it lists; internal/stubtest is free. depguard holds
internal/vmname to the standard library, and the proxy may import it.
ParseListed and UnmarshalText refuse a name starting with -, which would read as a flag in limactl's argv, and vmname.Image refuses a key that's empty, holds a / or NUL, or makes a project VM's name, so Lima's ImageSize and DeleteImage no longer check it themselves. The check also fails on a *string VM name and an alias of vmname.VM, and says what it doesn't see.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each coding agent gets one definition, an agents.Def in a new stdlib-only
leaf package, internal/agents, and everything else iterates over
agents.Defs: agentlogin's format per login kind, secrets' login kinds,
settings' [pass-keys], image.SharedTools, the vm package's store tables
and scripts, and cli's help lists. The VM copies of every login file,
their bindings, the store's layout, the scripts and the CLI reference
stay the same byte for byte, as golden tests made before the refactor
show.
The agents' guest variables leave base.sh for /etc/devvm/agents.sh,
written at every launch, so every image rebuilds once. Messages are
merged per agent (login_kept, login_passed, login_withheld,
login_oauth_withheld, agent_login_key_only). The structure test's new
names rule fails on an agent's name or login kind as a literal outside
internal/agents, and literals on one holding an agent's folder. Docs
link the supported coding agents rather than listing them, and
Contributing gains Adding a coding agent.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds pi (earendil-works/pi) as a shared coding agent beside Claude
Code, Codex and opencode: --agents pi, devvm tools add pi, the new-VM
picker and devvm setup offer it. Its network policy allows pi.dev; base
sets PI_SKIP_VERSION_CHECK=1 and PI_TELEMETRY=0 and installs fd-find,
so base and every image on it build again once. The agent store mounts
and copies pi's settings, with keys redacted as JSON.
pi's auth.json is a new login kind: its API keys for Anthropic, OpenAI
and OpenRouter become per-VM placeholders the proxy fills in (devvm
agent login pi --api-key --provider PROVIDER), and everything else is
withheld by default, unless config.toml's [pass-keys] lists the
provider. pi's own account logins aren't supported, and pi has no musl
build, so a musl VM refuses it (image.ToolDef.GlibcOnly). Its sessions
go into devvm history export and import.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The history export keeps at most 2 GiB: past it, devvm stops the VM's
command, removes the partial file and keeps no export. devvm history
export fails with history_too_large; devvm rm, devvm rm VM and a remake
warn with it and go on. opencode's import of devvm's logins (devvm agent
login) is read up to 1 MiB, then stopped and refused
(opencode_import_too_much). Each VM command adds at most 4 MiB to the
run log (Env.vmLog), then a "devvm: truncated" line.
agentsave's bounded writer is the one owner, in bounded.go: it takes in
vm's capped, and with a cancel it fails every write past its max, so a
command that keeps writing ends. Its buffer is a field: embedded, it gave
the writer bytes.Buffer's ReadFrom, which io.Copy (os/exec's copy of a
command's output) used in place of Write, so no cap held, agent save's
128 MiB included. vmssh's capped had the same flaw, fixed the same way.
Env.HistoryMax, and DEVVM_HISTORY_MAX in a test build, stand in for the
export's cap in tests. The stub guest's opencode-floods and
history-floods switches write without end.
Tests: TestBounded (io.Copy too), TestVMLog, TestExportTooLarge,
TestRemakeHistoryTooLarge, TestImportLoginsTooMuch, TestShellFloods,
vmssh's capped through io.Copy; history_import.txtar (an export that never
ends: export fails, rm deletes and warns, the run log truncated) and
agent_login.txtar (opencode's import floods).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chrome, Chromium and Firefox ignore the password in HTTP(S)_PROXY, so in
devvm desktop they asked for the proxy's username and password on every
site. The guest setup now writes devvm-local-proxy, which socat (now in
the desktop layer) serves on 127.0.77.1:3128, the VM's loopback alone.
For each connection it reads the request's head, drops the client's
Proxy-Authorization and Proxy-Connection, adds the VM's password and
sends it to devvm's proxy, then socat carries the rest both ways. It
takes only CONNECT HOST:PORT and absolute http(s):// requests, the
latter with Connection: close, so each connection's one request carries
the password. devvm-desktop starts it and points the Xfce session's
http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY at it; on Xfce,
Chrome and Chromium read those, and Firefox reads them first with its
default system proxy setting. A blocked host still gets the proxy's 403.
- proxy.LocalProxyAddr, LocalProxyPort, IsLocalProxyAddr: the one owner
of the address, sent to the guest as DEVVM_LOCAL_PROXY (vm.localProxy).
- vmssh: the port forwarder never forwards a server on 127.0.77.1.
- Tests: netpolicy's TestLocalProxy runs sync.sh's script (bash 3.2 on
macOS) against a fake proxy: the password replaced, Connection: close,
a tunnel, the 403 passed on, origin-form and junk refused with 400
before any connection; TestListeners, TestIsLocalProxyAddr,
TestLocalProxy (vm), sync.txtar. e2e desktop (tests/e2e.sh, still the
bash section): the session's variables, the listener on 127.0.77.1
alone, curl without a password to github.com, example.com's 403 over
CONNECT and plain HTTP, 400 for origin form, nothing on this
machine's 3128.
- Docs: using/desktop.md (Browsers), internals/desktop.md (The local
proxy), design.md's desktop note, ports.md, network.md's setup.
Security review (security-audit skill, guidance mode, local IPC and
proxy request handling):
- Fixed by design: devvm forwards every VM port by default, so a local
proxy on 127.0.0.1 would have put a password-less route to the VM's
proxy, and its secrets, on the host's localhost for every local user.
The forwarder now skips the local proxy's address on every port.
- The password goes only to the VM's proxy, whose address is fixed in
the script, never to an address a request names, in the one header
the local proxy adds; devvm's proxy strips Proxy-Authorization before
forwarding. It's never in a process's arguments (bash builtins only).
- Web pages: requests from a page to the loopback are origin form,
refused with 400 before any connection; a page can't send CONNECT or
an absolute-form line, and DNS rebinding changes only Host.
- No new power in the VM: the same password is in /etc/environment;
the script is mode 700, the VM user's.
- Residual: a program in the VM can hold up to 256 connections slowly
(30 s a line, 100 headers), only against the VM's own browsing; an
ssh -L the user types to 127.0.77.1:3128 would expose it, as any
forward they choose.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every VM gets its CA, its proxy setup and placeholders, whatever its
tier, so even an open VM never holds a real secret: a request that goes
around its proxy carries only the placeholder.
- vm/sync.go: the open branches of stage go (the agents' logins copied
as they are, the ClaudeCopy for unconfined VMs and its MCP warning,
real values in ~/.config/devvm/env); stageNet is stageSecrets, run
for every VM, and the salt is every VM's.
- netpolicy: Prepare readies the CAs, salt and secret files on every
tier, and the proxy config carries the CAs and bindings on every tier;
dropCA and its caller are gone, so a VM keeps its CAs as its tier
changes.
- Removed without a caller left: the messages secret_unuse_copied,
net_on_old_tokens and claude_mcp_secrets_copied;
secrets.Store.ClaudeCopy and MCPSecrets; agentlogin.MCPSecrets,
claudeSecrets and argsHoldSecrets; settings.CompanyProxy.ConfigOnly.
- Tests: TestPrepareOpen (open has CAs, salt, secrets; CAs kept across
tiers), TestInterceptOpen (an open proxy puts secrets in, 421 for
another host), TestStageSecretsEveryTier (every tier's setup sends
the VM's CAs, the guard against a tier's own path); sync, ca, network
and secret scripts for open VMs.
- e2e: network checks that an open VM holds no real secret (its proxy
puts the token in over TLS the VM verifies, a direct request carries
only the placeholder and gets a 401); project checks an open VM's
placeholder, and its company-CA checks allow for the VM's own CAs in
/etc/ssl/devvm.pem.
- Docs: safety/network (tiers, secrets), internals/network, the design
note's tiers threat check, attack vectors, coding agents, first VM,
staying safe, contributing; devvm secret's help.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The command line names the four network tiers. --network TIER (open,
internet, allowlist or none) chooses a new VM's tier, checked before
anything runs (arg_not_choice). devvm network open|internet|allowlist|none
gives the folder's VM a tier through Net.SetTier, and devvm network -g
takes the tiers and ask. config.toml's and settings.json's network is ask
or a tier (settings.NetworkChoices, checked against netpolicy.TierNames
by a test, since settings can't import netpolicy).
The question on creation is Proxy.Choose(vm): net_about says what each
tier reaches, net_ask asks for one (Answer, AnsweredBy("--network")),
Enter or a refusal gives allowlist, and an answer that isn't a tier is
warned of (net_tier_unknown) and asked again. devvm setup's picker
offers ask and the four tiers (network_default_open, _internet,
_allowlist, _none). On an existing VM, --network is ignored with the
devvm network TIER command that changes it.
devvm network --json: policy is the tier or unenforced, and each policy
file whose denies alone apply (internet and none) has denies_only: true,
as the text output's "(denies only)", so a script can tell a file's
denies from all of its rules without knowing the tier rules.
Messages reworded: net_tier_backend (--network open), net_open_policy
(devvm network allowlist), net_about, net_ask, network_default*,
net_default_failed, network_failed, setting_already's and
widen_parent_vm*'s descriptions. safety/network's "Choosing a tier"
replaces its on/off section; docs, the cli skill, testscripts and e2e
use the new forms, and e2e's internet and none checks go through devvm
network.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A VM's network is one of four tiers, open, internet, allowlist and none,
in its state's net section (netpolicy.Tier), in place of on/off. Every
VM has its proxy. Confined tiers start on NetProxy; open starts on the
backend's own network with its proxy set in the guest
(Confinement.GuestProxy): on Lima no Seatbelt profile and no QEMU
wrapper, the proxy at 192.168.5.2 on both hosts, propagateProxyEnv off.
The proxy: Config.Open (every host and address, no floor, no
policies), Config.DenyPolicies (files whose denies alone apply), the
rule port :* (any port), and ** matching address literals (the floor
still holds). Policies per tier (netpolicy.PolicySet): internet is
network/internet.policy (**:*) plus your denies; none is the agents'
built-in policies, the secrets' hosts and your denies; open none.
Links: a client links only to a target on its tier or a stricter one,
and a group's VMs are all on one tier. The self-check per tier: open
asks its proxy through the guest's settings and warns
(net_proxy_unreachable). devvm ls and devvm network show the tier. A
backend without egress-proxy offers open alone (net_tier_backend).
devvm network on/off and --network-policy/--no-network-policy map to
allowlist/open. Design note, threat check and docs; e2e in the network
and link sections.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A folder move records the path the agents' state is under in the VM's
state (the moved section, set in recordMove under the VM's lock: the
first move's old path, kept through more moves, cleared by a move back).
The VM's next setup gets a moved file with both paths and their Claude
Code slugs (claudeMoved, claudeSlug), and guest/claude.sh's
claude_project_moved renames ~/.claude/projects/<old slug> to the new
one, or merges into it without replacing anything, and moves
~/.claude.json's projects entry (claude_json_project_move, kept on its
own for reuse). Once the setup succeeds, followed clears the section.
The slug is Claude Code's own rule (2.1.318's sanitizePath): every
UTF-16 unit but an ASCII letter or digit a dash; over 200, cut and
ended with "-" and abs(h*31+u, int32) in base 36.
Tests: TestClaudeSlug, TestClaudeMoved, TestClaudeProjectMoved,
TestMovedTo, TestFollowed, TestMoveHere's record and its clearing,
move.txtar, e2e project's moved checks. Docs: commands.md's moved
folder (Claude Code, Codex, opencode), internals overview.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm set SSH_AUTH_SOCK process-wide from the finder's inspect, each
start and a new VM's plan, so later limactl calls and every background
process devvm spawned got whichever VM's agent was set last: a run that
reached several VMs (a group's sync, a link's change) could hand one VM
another's agent, and ssh-add -l checked the wrong agent.
- vm: Env.useAgent is gone; Env.agentSocket maps a choice to its socket
(devvm's, the user's from Environ, or none). The finder's found carries
agent, set by inspect and by bringUp from the confinement it returns;
found.exec passes it. start sets Confinement.AgentSocket for every mode,
runningConfinement takes the running mode and sets it too, and the sync,
devcontainer commands, --clone's seed, home copy, export, desktop and
the shell carry it.
- backend: ExecOpts.Agent, ShellOpts (Shell takes it), AgentSocket ""
means none; the backend never reads devvm's SSH_AUTH_SOCK.
- lima: limactl removes SSH_AUTH_SOCK from every command; Exec, Shell
and start (confine) set the VM's own; a degraded start's check carries
it.
- daemon: Spawn drops SSH_AUTH_SOCK from the child environment.
- Guard: forbidigo bans os/syscall Setenv, Unsetenv and Clearenv outside
tests and daemon/status.go; testdata/lint breaks it.
- Tests: TestAgentPerVM (two VMs, devvm's and the user's, in one run),
TestDetach (no agent), TestExecAndShell and TestProfileAgent (Lima's
per-command env), TestUpSSHAgent and TestOpenAgent check the shell's
and Exec's agents and that devvm's environment stays as it started.
- Docs: internals/security.md (how the agent travels), contributing's
forbidigo list and owners table.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With network policy, an opencode OAuth login devvm doesn't bind (Copilot
Enterprise, a provider it doesn't know) reached the VM with its refresh
token, against network policy's promise that a VM never holds one, and
opencode's config folder's files that aren't settings, such as a .env,
were copied unredacted.
The VM's copy of opencode's auth.json now has devvm-redacted for such a
login's access and refresh tokens, and devvm warns
(opencode_login_withheld); API keys for providers devvm doesn't know stay
as they are, warned as before. File.VMCopy returns a VMFile (Data, Kept,
Withheld). With network policy, the VM doesn't get opencode's files that
are neither settings nor Markdown (withheld in sync.go), each named with
config_not_copied; AGENTS.md and other Markdown still go.
Tests: TestOpencodeUnboundOAuthWithheld (failing before), TestWithheld,
TestVMCopies's opencode_login_withheld, sync.txtar's opencode .env and
AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Start takes what a VM's state asks of it, backend.Want (its size, agent
folders, agent forwarding and ports), beside its Confinement, and a
stopped VM's start changes only what differs, in one limactl edit with
the confinement's own edits. CreateVM makes the VM as its spec's Want
says (VMSpec embeds Want). SetSize, SetAgentDirs and SetAgentForwarding
go, and with them vm_not_stopped: devvm size, ssh-agent and the agent
mounts save to the state, and the next start applies them. A pure
backend.Validate keeps the early refusal (disk_shrink) before anything
changes.
Lima's ports record (vms/<hash>/backend/ports) goes: which ports a VM
forwards is vm.json's ports.forward alone, passed in Start's Want and in
SetPorts, which now changes only a running VM's forwarder.
Tests: backend TestValidate, TestFakeStartValidates; lima TestWantEdits,
TestStartWantInOneEdit, TestSetPortsNoEdit, TestCreateVM and the
forwarder tests on Want's ports, the real-Lima scenario's combined edit;
vm tests read Start's Want; size, ports, up, up_size, layout and
gc_orphans scripts.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm takes no IMAGE word any more than any other: in a terminal a new VM's
toolchains, coding agents and layers are checked in one picker, under three
headings, before the network-policy question; --tools, --agents and
--layers (each an exact list, or none) skip it, and a part left out takes
its default: the detected toolchains, devvm setup's agents, no layers (a
devcontainer.json's features still count). Without a terminal, or with
--no-input, the VM gets the defaults and new_vm_gets says so in one line.
devvm setup --agents (and its first-run question) chooses new VMs' agents.
devvm tools in a terminal opens the same picker for the VM, its layers
fixed, and turns the changes into tools add and rm.
An image is base and layers only: tools are the VM's tool_names state key.
build, rebuild and images rm refuse a shared tool (tool_not_layer), and
devvm build builds no tool images. devvm ls gains a TOOLS column and
--json tools. gc's --tools is --tool-images, so --tools has one meaning.
Gone: image.Reserved, checkWord's image half (devvm WORD is no_command or
no_command_like, did-you-mean over commands, msg.Closest), the lacks path
in internal/vm/existing.go, and the messages vm_lacks_tools,
vm_lacks_layer, layer_is_command, layer_name_command, no_image_for,
no_command_or_image*, tools_not_images, tools_not_images_rm, detected,
vm_is_now (vm_tools_now), secret_with_image (secret_with_claude).
New: ui.Pick takes headed sections with fixed rows, ui.CanPick,
vm.PickPart/PickRow/AgentsChoice/CheckPart (internal/vm/parts.go),
state.KeyToolNames, state.ReadAgents/WriteAgents, paths.Dirs.Agents,
project.DetectFiles. Image keys are unchanged in form: images never held
tools; docker.sh's and nix.sh's comments changed, so those layers rebuild.
Docs: the home page's quick start steps, diagram (sandbox.svg), cards and
FAQ; README; getting started; using (images' What a new VM gets, coding
agents' Running an agent, settings' agents); internals; contributing;
the cli skill; AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
internal/stubtest puts testdata/stubs first on PATH with a folder of its
own (New, New with only some stubs), reads and writes the stubs' files
(Calls, Reset, Touch, Write, Read, Path, Log) and has one ExecRunner. It
replaces the stub setups of the Lima, Docker and smolvm backends' tests,
vm's --clone tests and platform's Keychain tests, and the backends' own
execRunner, reset and touch copies. The structure test holds it to tests
and to importing only internal/msg.
msg.IDOf and msg.NamesOf replace the names(), isMsg, id and shown helpers
and the errors.AsType checks that only read a message's ID or names;
msg.Recorder replaces the inline recorders tests set as Info, Warn or Say.
backendtest.Stored replaces the four stored fakes with disks.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A value a VM made reached the terminal unfiltered wherever a caller
forgot msg.Shown, such as the errors passed as err.Error() and a link's
name. Four cleaners did the job in different ways: msg.Shown (quoting),
ui's printable and oneLine, netpolicy's oneLine and the port
forwarder's log (which let C1 through, in UTF-8).
msg.Printable and msg.OneLine are now the one cleaner: they drop C0 but
newline and tab (OneLine drops those too), DEL and C1, in UTF-8 or as a
lone byte. Every message value goes through OneLine as the message
renders, in Text, Segments and names mode, so no caller can forget it,
and msg.Shown is gone with its 68 calls. The status line, the run log's
end and verbose output, Pick, devvm network log, the forwarder's log and
a clone's status lines use them too.
Tests: TestPrintable and TestValuesArePrintable (internal/msg), the
hostile-value segments test, TestLogLimit (internal/backend/vmssh) with
C1 in UTF-8 and as a lone byte; TestCheckLinks and
TestNewVMOtherRepoAndCommondir expect the cleaned values.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
In a VM with network policy, an HTTP client that honors HTTP_PROXY now
reaches a link through the VM's proxy, so a link added while the VM runs
works at once and nothing restarts. The ssh remote forward stays the
transport for every link; the proxy is a second entrance to the same
host socket, and devvm _links's per-connection checks apply to both.
- devvm _links writes every link the client has, carried or not, to
run/<vm>.links.json (proxy.LinkList, mode 600, written whole) whenever
they change or the file is gone; it stays after the session, so a link
with no socket is refused rather than asked of the rules. Forget
removes it with the VM.
- devvm _proxy -links FILE reads it per request (regular file, no
symlink, owner-only writes, 1 MiB, version 1, O_NONBLOCK), before any
rule: CONNECT and absolute-form http, exact match after lower case and
one trailing dot, NAME and NAME.devvm.internal. An entry counts only
when its socket is proxy.LinkSocket(list folder, -vm, addr, port) and
its address is in 127.77.0.0/16. Bytes pass as they are: no SNI check,
interception, secrets or rules; absolute form goes in origin form
without the proxy's headers, one connection per request, cancelled
with the client's request; https in absolute form gets 400. No event
for a carried link (devvm _links logs link); a dead socket gets 502
and link_refused "not carried", after retries for a full backlog. Any
other name under devvm.internal is refused (403, a refused block).
- vmssh.Links.Socket uses proxy.LinkSocket and LinkHash (same names).
- The link socket's accept loop only accepts, and hands a burst on whole
(5 ms quiet, 50 ms at most, or 257 waiting) before relays start, as
fork-heavy relay starts let macOS's 128 backlog overflow unlogged;
past the cap, refused in the loop with link_limit. Temporary accept
errors back off instead of ending the link.
- NO_PROXY is localhost,127.0.0.1,::1 everywhere: netpolicy.LinkEnv and
linksNoProxy are gone, netpolicy.NoProxy is a constant, the start only
checks the links (checkStartLinks). No dockerd or nix-daemon restart
and no limactl edit on link changes. assets/guest/sync.sh: comment only.
- devvm network log's help says link events land there for every VM.
- Docs: using/links.md, safety/network.md, internals/network.md (Links
through the proxy, -links), ports.md, lima.md, design.md (the proxy's
entrance, the burst, threat-check rows for the proxy path, links added
while running and untouched bytes, the sshd row reworded, Not covered),
contributing, internal/proxy/README.md.
- Tests: proxy TestLinkConnect, TestLinkConnectUntouched, TestLinkForward,
TestLinkGone, TestLinkListRefused, TestLinkDomainRefused,
TestNoLinksFile, TestLinkSocket; vmssh TestLinksBurst, TestLinksList;
netpolicy TestNoProxy and the -links argument; e2e lk_proxy_added and
lk_proxy_own, and lk_cap's burst without pacing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every VM's sshd (base.sh's 00-devvm.conf, services.sh) allows remote
forwards of TCP ports only on 127.77.0.0/16: AllowTcpForwarding all,
GatewayPorts clientspecified, PermitListen 127.77.*:*. Remote socket
forwards, tunnels and X11 stay refused. The setup sets
ip_unprivileged_port_start to 0 where it's 1024, writes the VM's links in
a marked /etc/hosts block in place (Docker's is a bind mount), and puts
DEVVM_NO_PROXY in every NO_PROXY it writes.
The links come from Env.Links (nil: none), a list of GuestLink {Addr,
Names}, checked on the host by checkLinks (link_setup_invalid) before the
start's NO_PROXY (netpolicy.LinkEnv) and the setup's hosts file. design.md,
security.md, smolvm.md and docker.md describe the sshd rule; e2e checks
it with rfwd_links on every backend, and low ports on Alpine and smolvm.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After a failed setup, devvm reads /run/devvm/tools-unmounted from the VM
with a command of its own. Root in the VM could make that read hang, so
it now has its own 10 s timeout (unmountedWait, readUnmounted), after
which no tool counts and the error is sync_failed.
guest/sync.sh removes that report as its first command, so a report left
from the VM's boot isn't read after a failure that comes before
devvm-tools runs.
Tests: TestReadUnmountedWait (a read in time counts; a hung one gives up
after its wait); guest.txtar checks sync.sh's first command.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A tool image missing from the share, or one the VM couldn't mount or
link, used to be skipped with a line on stderr, and mise's auto_install
then downloaded the same version into the VM on first use. Now the
launch stops with a message naming the VM and the tools.
- assets/guest/tools.sh: tries every listed image, removes a failed
one's empty mount point, says why on stderr, lists the failed files
in /run/devvm/tools-unmounted (removed at the start of each run) and
exits 1. Link failures (Docker's unpacked folders) count too.
- assets/guest/sync.sh: its devvm-tools call failing fails the setup.
- assets/container/services.sh: a devvm-tools failure doesn't stop a
smolvm or Docker start; the launch's setup reports it.
- internal/vm/sync.go: after a failed setup, syncer.unmounted reads the
VM's report with its own Exec (capped at 16 KiB, unmountedMax), and
reported keeps only whole lines that are one of the VM's own tool
files from its state, so the message carries devvm's values, never
the VM's text. The setup's output still goes straight to the run log
(a pipe would wait on processes the setup leaves running).
- internal/tools: label is exported as Label; VMs.Update builds the
VM's tool images that the share lacks even when they're the newest,
so devvm update repairs a missing image.
- Message tools_unmounted (tools, vm), linked to
using/troubleshooting#a-shared-tool-doesnt-mount.
- Docs: troubleshooting "A shared tool doesn't mount"; images.md's
shared tools and devvm update; internals/images.md "The share" has
the mechanism; design.md says why.
- Tests: TestReported (internal/vm), TestUpdate rebuilds a missing
newest image, guest.txtar runs tools.sh with stubbed mount commands,
sync.txtar checks tools_unmounted and that other report lines don't
count (limactl stub: $STUB_DIR/sync-fails-with), e2e's tools section
moves node's image out of the share and back.
Co-Authored-By: Claude Opus 5.5 <[email protected]>