Repository navigation
fix(minvmd,minimal): key a named VM's known_hosts entry on the alias ssh connects with - #1843
Conversation
…ssh connects with The known_hosts writer keyed every entry on the fixed provider-instance name local-minvmd0, while the ssh readers (attach and Zed setup) derive the host alias from the socket's parent directory basename. For a named VM that basename is the VM name, so session exec/attach/Zed failed with "No ED25519 host key is known for <name>" and host key verification failed. Add a single ssh_host_alias helper in crates/paths and use it in all three sites so the writer and readers can never disagree on the alias. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthroughSSH host aliases now come from provider-directory basenames through a shared helper. Attach, Zed session setup, and READY beacon handling use the derived alias. Tests cover default and named VM directory layouts. ChangesSSH Host Alias Resolution
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No merge-blocking issue is identified for named-VM SSH host lookup. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
A rabbit checked the host name twice, Comment |
…r name A bare VM name (dev, work) as the ssh host argument matches the user's own ~/.ssh/config Host blocks, so options such as ControlMaster or User could route an attach to a real machine. Named VMs now use <vm>.local-minvmd0; the default VM keeps local-minvmd0. A known_hosts path with no provider-dir parent is now a debug assertion, not a silent normal path.
There was a problem hiding this comment.
Approved per norrie's instruction: CodeRabbit approved, no open threads, independent review applied, lanes green.
… net forward, as attach does (gominimal#2626) NET-058 says a box name alone decides which VM a verb looks in, and attach honours it: the selected VM's daemon first, then every VM's socket. `min session exec`, `min session run` and `min net forward` still looked only in the selected VM, so a box activated with `--vm` was listed by `min ls` and reachable by attach, and exec answered "No session found matching" (lab scenario 720, every main since the named-VM work landed). The three go through the resolution attach uses, generalised by the verb that leads its one announcing line; attach keeps its wrapper and its text. The hand-off then runs over the owning VM's socket. NET-058 names the verbs it now covers. Refs: gominimal#1843 (the host-key half of the same report) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABUuDTmA
Defect
On a named VM (
min --vm <name>),session exec, attach, and Zed setupfailed with
No ED25519 host key is known for <name> ... Host key verification failed.The known_hosts writer keyed every entry on the fixed provider-instance
name
local-minvmd0, while the ssh readers derive the host alias from thesocket's parent directory basename. For a named VM that basename is the VM
name, so the two disagreed and the key lookup failed.
Change
Add a single
ssh_host_aliashelper incrates/pathsand use it in allthree sites — the minvmd known_hosts writer, the attach client, and Zed
setup — so the writer and readers can never disagree on the alias.
The default VM keeps the alias
local-minvmd0. A named VM gets<vm>.local-minvmd0rather than the bare VM name: ssh matches its hostargument against the user's
~/.ssh/configHostblocks, so a bare namesuch as
devcould pick upControlMaster,Useror forwarding optionsmeant for a real machine. VM names never contain
., so the namespacedform cannot clash.
Verification
cargo fmt --all --check— cleancargo clippy -p paths -p minvmd -p minimal-client -p minimal --no-deps -- -D warnings— cleancargo build --workspace --locked— cleancargo test -p paths -p minvmd -p minimal-client --locked— pass(new tests cover the named-VM alias in all three crates)
Summary by CodeRabbit