In a terminal, limactl shell of a stopped VM asks whether to start it, yes by default (Lima 2.3.0, reproduced under a pty), and that start is Lima's own: no proxy or sandbox-exec profile (no QEMU wrapper on Linux), no pins, and no folderChanged, so the project folder's mount, by path on Linux's 9p, follows a link put at the path or makes a folder that's gone again. devvm opens a shell (Shell) and runs an agent's login (Exec) on the terminal after bringUp, so a guest that powered itself off between the two got that question. This is the start path the self-check's restart was suspected of: that restart goes through startOnce, but limactl shell didn't.
The limactl builder, which every limactl command of devvm's goes through, now gives limactl shell --start=false, which Lima has had since 2.0.0-rc.0 (devvm's oldest is 2.2): a stopped VM's shell or command fails at once ("instance is stopped"), without asking, and devvm's next launch starts it with every check. devvm limactl, which passes its arguments on as given, is unchanged.
TestShellNeverStarts checks Exec's, Shell's and the builder's limactl shell, and fails without the change; the lima package's and the CLI scripts' expected limactl shell calls name the flag, their negative patterns too, so none turns vacuous. Docs: How it works' Lima page's A stopped VM's shell; the changelog's Security hardening gets the line, its summary widened to cover both of its lines, and the release page its section.
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]>
Every question is a msg.Question that declares what answers it where
devvm can't ask: AnsweredBy("--force") names a flag or command, which the
refusal names (no_input), and RefusedWith(msg.X(...)) gives a question no
flag answers its own refusal. msg.AnswerFor and its table go.
The Reporter's Ask, Confirm and Answer, and the UI's Secret, take a
Question and return a *msg.Refusal where they can't ask: with --no-input,
without a terminal, or at the end of the input, one refusal for all three
causes. Commands return it through the failure path (showFailure ->
UI.Refused: the question, then the refusal); nothing dies on an unanswered
question any more. Questions with a usual answer fall back on it instead:
network policy on, restart no, history import later, the Include line
warned, an unenforced VM stopped, the first run's size kept.
Gone: confirmed() in cli (4 callers), force_needed and no_input_terminal,
vm.Env.CanAsk and ui.CanAsk, vm's interactive, setup's terminal, the
Reporter's StdinIsTerminal/StdoutIsTerminal and the Fake's StdoutTerminal,
and every caller's terminal check (18 in vm, netpolicy, build and
sshconfig; 3 CanAsk; 1 interactive; 2 in cli). The picker's check
(CanPick) stays in the picker, which keeps its choices with --no-input
too; setup and the first run's agents and the new-VM summary still read
CanPick, because what they save or say depends on whether the picker
showed.
A Question's About context (the network policy's, a secret's howto, the
restart's changes, the size's host) is said only when it's asked.
devvm update asks before its tools change, so a refusal leaves the VM as
it is.
The CLI tests answer through a terminal (ttyin) or, explicitly, with a
test build's DEVVM_PIPED_ANSWERS=1, a line of input each.
Tests: ui's TestConfirm, TestAsk, TestAnswer, TestPromptsOnlyAtATerminal,
TestSecret, TestNoInput, TestNoTerminal, TestNoAnswer, TestPipedAnswers,
TestRefusedInterrupted, TestPickNoInput; msg's TestQuestionRefused,
TestQuestionAbout; cli's agreement test TestQuestionsDeclareAnswers (every
AnsweredBy names devvm's flags and commands, every RefusedWith a message,
no Question made otherwise) and TestCheckAnswer; vm's
TestSizeChoiceRefused; testscript prompts.txtar (each cause, a refusal of
its own, piped answers).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm update first takes devvm tools update's step (Tools.update, split out
of Tools.Update), which needs no remake because shared tools are mounted.
Then, only when the VM's image chain changed, it names what changed
(vm_changed) and asks to make the VM again through the shared remake
(canRemake, agreed and remakeNow, split out of remakeTo). Only newer tools:
recorded and a shell, with no question. Nothing newer: vm_current. A no keeps
the VM with its newer tools and opens a shell when there were some. Without a
terminal or --force, an outdated VM is refused before the tools change.
devvm tools update stays the tools-only command, and newer_tools names
devvm update.
devvm layer add and devvm layer rm move to the root help's Change your VM
group, listed by both names, while layer and layer new stay under Images:
commandGroups takes a subcommand's path, addGroups adds the group to its
parent too, and the usage template lists it in the root's group.
Tests: TestUpdateTools (tools only, both without a terminal, declined,
agreed, neither), update.txtar's tools-only, no-terminal and declined cases,
TestHelpGroupsAndDocs's groups for layer add, layer rm and layer --help, and
an e2e check that devvm update on a current image never makes the VM again.
TestRemakeDone still proves a failed delete of the old machine keeps the
remake recorded. Docs: commands, images' Outdated VMs, toolchains,
troubleshooting, coding agents, internals and contributing; the cli skill's
tree; the CLI reference regenerated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generic usage errors (an argument too many or missing, an unknown flag)
left 14 CLI scripts: TestUsageErrorsEveryCommand checks every command
for them, TestShowCommandsTakeJSON for which commands take no --json,
and root.txtar keeps one through the binary. e2e drops five checks that
exercise no VM: retention's settings (retention.txtar), a second gc
(gc.txtar), ls and size --json (TestJSONShapes, beside e2e's text
checks), devvm code with a stub (host_code.txtar) and a CA file that
isn't a certificate (ca.txtar, trust's TestRead).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm update [--force|--no-export|--clean-home] (internal/cli/update.go)
is the shared remake with the VM's own image name: Lifecycle.Update calls
toRemake, decides with build.Builds.Outdated (WarnIfOutdated's check, now
its owner) whether the chain's keys changed, says vm_current and does
nothing when they didn't, else names what changed (vm_changed) and calls
remakeTo. --from VMs are judged on the recorded digest and built with
build's lookup. The remake's flags are one adder (addRemakeFlags) for
devvm layer add and devvm update. vm_outdated names devvm update.
Co-Authored-By: Claude Opus 5.5 <[email protected]>