Files
devvm/internal/msg/docs.go
T
w3cjandClaude Opus 5.5 83726f6a56 feat(smolvm): ssh for editors
ssh for editors is emulated on smolvm, and reviewed: devvm ssh, devvm code,
--clone and the ssh config's entries work as on Lima.

- sshd: sshd.sh installs openssh-server in base after its scripts (from the
  snapshot they pin; before them, the live archive's systemd libraries broke
  Docker's install) and deletes its host keys; prepare.sh sets the user's
  password to * (sshd without PAM refuses a locked account's keys). Both are in
  base's key.
- Start: Confinement.SSH (set by vm.start when Require lets ssh through)
  forwards guest port 22 from a host loopback port (Confinement.SSHPort, else
  the recorded one while free, else a new one; never one of the VM's own
  forwards: smolvm_ssh_port_forwarded), then services.sh makes new ed25519
  host keys at every start, writes the VM's only authorized key and devvm's
  own sshd config (VM's user only, publickey only, local forwarding only, no
  remote forwarding, tunnels or X11; SetEnv of /etc/environment and the
  proxy's variables, by name), and starts sshd. The record's ssh_up is cleared
  before each start and set once sshd runs; SSH answers only then.
- An image without sshd (probed before services.sh) starts without ssh,
  warned (smolvm_no_sshd).
- Keys: one per VM, smolvm/vms/<vm>.key (mode 600, OpenSSH format made in Go,
  its public half read back from it), deleted with the VM. SSH returns
  127.0.0.1, the port, the user, IdentityFile, IdentitiesOnly yes,
  PreferredAuthentications publickey.
- Ports: smolvm forwards at most 64 per machine, so a VM's own are at most
  63; port 22 in --ports is refused (smolvm_port_ssh).
- Shared ssh entries (Lima too): ForwardX11 no, ForwardX11Trusted no, Tunnel
  no, PermitRemoteOpen none, AddKeysToAgent no, ProxyJump none, ProxyCommand
  none, UpdateHostKeys no, HashKnownHosts no; no IgnoreUnknown (its first
  value would replace a user's Host * one), so devvm needs OpenSSH 8.7 or
  newer. sshconfig.Write skips a backend whose ssh isn't usable
  (backend.Allowed); vm.reach checks the backend's SSH.
- netpolicy: freePort avoids every VM's forwarded ports, and a stopped VM's
  ssh_port is picked again when it's one of its own.
- Lima: layers/base.sh writes /etc/ssh/sshd_config.d/00-devvm.conf (local
  forwarding only, no remote forwarding, tunnels or X11), which changes base's
  image key on Lima and smolvm.
- Messages: smolvm_port_ssh, smolvm_no_ssh, smolvm_no_sshd,
  smolvm_ssh_port_forwarded.
- Tests: unit (keys and their parsing, Start with and without ssh, port reuse
  and collisions, ssh_up, no sshd, Allowed, entries under a user's Host * with
  an IgnoreUnknown through the real ssh -G, netpolicy forwards); testscript
  smolvm.txtar (forward, services args, entry, pinned keys, devvm ssh, no
  sshd, port 22) and ssh.txtar (entry options); e2e smolvm: entry and
  loopback-only forward, listening ports, net backend pinned (virtio-net with
  a forward, TSI without), pinned host keys of each VM's own and new ones per
  start, a changed key refused, environment, agent off with ssh -A as the
  control, password/keyboard-interactive/other key/root/other user refused,
  remote forwarding refused, sshd -T, a hostile sshd that gets no display and
  no key through a Host * asking (command-line controls, and ssh -R shown not
  covered), devvm ssh and code, another VM's key refused, a squatted port, no
  sshd, stop and rm, --clone seed/fetch/push/rm, and under network policy ssh
  on ssh_port with the proxy's variables, no way out through local or remote
  forwards (with controls), DNS no-leak with the forward and the nettop DNS
  control on a machine without one; e2e Lima: its sshd's forwarding refused,
  the entry's options under a hostile Host *.
- Docs: smolvm.md (ssh for editors), backends.md, security.md (ssh into VMs,
  remote forwards you ask for), ssh.md, install.md (OpenSSH 8.7), design.md
  (the design note: the guarantee, what keeps a session from carrying the VM
  out, DNS detection by net backend, not covered: remote forwards you ask
  for), limits.md, testing.md, contributing.md; AGENTS.md gotchas.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 13:43:00 -06:00

178 lines
9.9 KiB
Go

package msg
// docs links messages to the docs page that says more: message ID to
// "page#anchor", a page in docs/content/docs and a heading on it. devvm
// prints the page's address on the line after the message's text.
// TestDocLinks checks every entry.
var docs = map[string]string{ //nolint:gosec // message IDs and pages, not credentials
"backend_lacks": "backends#missing-and-unreviewed-features",
"backend_unreviewed": "backends#missing-and-unreviewed-features",
"backend_unreviewed_used": "testing#unreviewed-emulations",
"backend_unknown": "backends#choosing-a-backend",
"backend_unknown_default": "backends#choosing-a-backend",
"backend_unknown_vm": "backends#choosing-a-backend",
"smolvm_missing": "smolvm#requirements",
"smolvm_missing_fix": "smolvm#requirements",
"smolvm_broken": "smolvm#requirements",
"smolvm_broken_fix": "smolvm#requirements",
"smolvm_old": "smolvm#requirements",
"smolvm_old_fix": "smolvm#requirements",
"smolvm_host_unsupported": "smolvm#requirements",
"smolvm_machine_foreign": "smolvm#its-machines",
"smolvm_from_registry_only": "smolvm#building-images",
"smolvm_mount_colon": "smolvm#what-devvm-sets-on-a-vm",
"smolvm_too_many_ports": "smolvm#what-devvm-sets-on-a-vm",
"smolvm_no_agent": "smolvm#what-devvm-sets-on-a-vm",
"smolvm_port_ssh": "smolvm#ssh-for-editors",
"smolvm_no_ssh": "smolvm#ssh-for-editors",
"smolvm_no_sshd": "smolvm#ssh-for-editors",
"smolvm_ssh_port_forwarded": "smolvm#ssh-for-editors",
"smolvm_script_failed": "smolvm#looking-inside",
"lima_missing": "lima#requirements",
"lima_broken": "lima#requirements",
"lima_old": "lima#requirements",
"lima_host_unsupported": "lima#requirements",
"qemu_missing": "lima#requirements",
"lima_missing_fix": "lima#requirements",
"lima_broken_fix": "lima#requirements",
"lima_old_fix": "lima#requirements",
"qemu_missing_fix": "lima#requirements",
"lima_arch_unsupported": "lima#requirements",
"macos_old": "lima#requirements",
"no_kvm": "lima#requirements",
"kvm_access": "lima#requirements", "lima_global_config": "lima#a-lima-home-of-its-own",
"vm_has_networks": "lima#a-lima-home-of-its-own",
"lima_home_too_long": "lima#limits",
"mount_comma": "lima#limits",
"disk_shrink": "lima#limits",
"image_in_use": "lima#clones-and-overlays",
"qemu_refused": "lima#confinement",
"start_no_ssh": "lima#limits",
"no_ubuntu_image": "images#ubuntus-cloud-image",
"ubuntu_bad_signature": "images#ubuntus-cloud-image",
"ubuntu_unsigned": "images#ubuntus-cloud-image",
"unknown_layer": "images#layers",
"layer_name_invalid": "customizing#your-own-layers",
"layer_name_reserved": "customizing#your-own-layers",
"layer_created": "customizing#your-own-layers",
"base_features": "customizing#choosing-features",
"base_features_none": "customizing#choosing-features",
"unknown_feature": "customizing#choosing-features", "feature_shadowed": "customizing#your-own-features",
"script_failed": "images#build-logs-and-interrupts",
"rebuild_replaces": "images#rebuilding",
"vm_outdated": "images#outdated-vms",
"bad_path": "lima#limits",
"vm_name_no_room": "backends#vm-names",
"vm_other_folder": "commands#a-folder-made-again",
"vm_other_folder_rm": "commands#a-folder-made-again",
"vm_other_folder_adopt": "commands#a-folder-made-again",
"vm_unfinished": "commands#an-existing-vm",
"no_terminal_confirm": "commands#adding-to-a-vm",
"add_layer_failed": "commands#adding-to-a-vm",
"size_next_start": "commands#an-existing-vm",
"ports_next_start": "commands#an-existing-vm",
"rm_export_failed": "coding-agents#history",
"history_not_exported": "coding-agents#history",
"git_replaced": "git-protection#on-each-launch",
"git_appeared": "git-protection#on-each-launch",
"git_embedded_new": "git-protection#on-each-launch",
"git_hooks_unlocked": "git-protection#on-each-launch",
"unsafe_folder": "security#only-the-project-folder",
"unsafe_folder_inside": "security#only-the-project-folder",
"cpus_not_number": "commands#size-and-ports",
"size_not_gib": "commands#size-and-ports",
"too_many_cpus": "commands#size-and-ports",
"too_much_memory": "commands#size-and-ports",
"port_invalid": "commands#size-and-ports",
"ports_list_needed": "images#ports",
"ports_rm_all": "images#ports",
"no_image_for": "images#which-image-a-new-vm-gets",
"net_direct_route": "network#the-self-check",
"net_unenforced_stop": "network#the-self-check",
"net_unenforced": "network#the-self-check",
"net_off_log": "network#turning-it-on-or-off",
"net_off_policy": "network#turning-it-on-or-off",
"net_flag_ignored": "network#turning-it-on-or-off",
"net_on_old_tokens": "network#turning-it-on-or-off",
"net_off_next_start": "network#turning-it-on-or-off",
"not_a_rule": "network#rules",
"proxy_start_failed": "network#the-proxy",
"proxy_port_taken": "network#the-proxy",
"net_proxy_down_stopped": "network#the-proxy",
"no_secret": "network#secrets",
"codex_login_kept": "network#agents-logins-and-settings",
"opencode_login_kept": "network#agents-logins-and-settings",
"setid_files": "security#what-it-doesnt-protect",
"git_protect_needs_macos_new": "git-protection#linux-hosts",
"git_protect_on_needs_macos": "git-protection#linux-hosts",
"git_protect_running": "git-protection#turning-it-on-or-off",
"git_unlocked": "git-protection#turning-it-on-or-off",
"git_protect_flag_ignored": "git-protection#turning-it-on-or-off",
"git_locked_strict": "git-protection#strict",
"git_config_failed": "git-protection#strict",
"git_commondir": "git-protection#what-a-lock-cant-stop",
"git_worktree_stray": "git-protection#what-a-lock-cant-stop",
"git_not_locked": "git-protection#whats-locked",
"git_lock_raced": "git-protection#whats-locked",
"git_hooks_path": "git-protection#not-covered",
"git_include_inside": "git-protection#not-covered",
"git_hook_link_inside": "git-protection#not-covered",
"git_gitdir_outside": "git-protection#not-covered",
"ssh_remote_hint": "ssh#agent-forwarding",
"agent_on_risk": "ssh#agent-forwarding",
"agent_devvm_risk": "ssh#devvms-own-agent",
"agent_no_keys": "ssh#devvms-own-agent",
"agent_key_changed": "ssh#devvms-own-agent",
"agent_key_unpinned": "ssh#devvms-own-agent",
"agent_key_no_fingerprint": "ssh#devvms-own-agent",
"agent_key_mounted": "ssh#devvms-own-agent",
"agent_lifetime_invalid": "ssh#devvms-own-agent",
"agent_confirm_needs_askpass": "ssh#devvms-own-agent",
"ssh_include_yourself": "ssh#ssh-access-by-name",
"no_code_command": "ssh#devvm-ssh-and-devvm-code",
"clone_not_top": "clone#requirements",
"clone_no_commits": "clone#requirements",
"clone_detached": "clone#requirements",
"clone_needs_new_vm": "clone#requirements",
"remotes_taken": "clone#the-remote",
"fetch_until": "clone#the-remote",
"no_terminal_fetch": "clone#deleting-the-vm",
"saved_names_taken": "clone#deleting-the-vm",
"remote_kept": "clone#deleting-the-vm",
"no_terminal_delete": "clone#deleting-the-vm",
"tools_need_resolve": "images#versions",
"mise_checksum": "images#versions",
"tool_stepped_back": "images#versions",
"tool_no_download": "images#versions",
"tools_check_failed": "images#versions",
"newer_tools": "images#versions",
"tool_unbuilt": "images#building-tools",
"tool_bad_output": "images#building-tools",
"share_lock_held": "images#building-tools",
"tools_not_images": "images#building-tools",
"custom_layer_remove": "images#adding-and-removing-tools",
"agent_dir_comma": "lima#limits",
"agent_dirs_added": "coding-agents#mounts",
"agent_dirs_removed": "coding-agents#mounts",
"no_claude_token": "coding-agents#claude-code-login",
"claude_token_invalid": "coding-agents#claude-code-login",
"no_github_token": "network#secrets",
"not_setup_token": "coding-agents#claude-code-login",
"secret_unuse_copied": "network#secrets",
"keychain_save_failed": "network#secrets",
"login_copy_failed": "network#agents-logins-and-settings",
"config_redacted": "coding-agents#keys-in-settings-files",
"config_not_copied": "coding-agents#keys-in-settings-files",
"claude_mcp_secrets_copied": "coding-agents#mcp-servers",
"bad_from": "from#digests",
"from_unreachable": "from#digests",
"from_cached_unreachable": "from#digests",
"from_not_found": "from#images-only-docker-has",
"from_cached_not_found": "from#images-only-docker-has",
"docker_only": "from#images-only-docker-has",
"docker_image_changed": "from#images-only-docker-has",
"convert_failed": "from#supported-images",
"convert_bad_output": "from#the-image-is-untrusted",
"from_ignored": "from",
}