Skip to content

feat: enroll SSH sandboxes without a manual installer #3666

Description

@adhyaay-karnwal

The workflow

I want to run BB threads on a remote sandbox I already have SSH access to (Daytona, E2B, a VM, or similar), without SSHing in myself, downloading BB, and running the machine installer by hand.

Today the path is: create the vendor sandbox, SSH in, copy the Manual machine setup command, run it, wait for the daemon. That is the whole bootstrap, and every new sandbox vendor repeats it.

What happens today

Settings → Machines offers this laptop plus Manual machine setup. Manual setup prints an install.sh command that you must run on the target.

Modal is a first-class plugin that allocates compute and bootstraps over Modal exec. There is no shared SSH transport, so Daytona/E2B/other SSH boxes cannot enroll the same way. Each vendor plugin would have to reinvent bootstrap even though core already has experimental_machines.bootstrap({ executor }).

What you would expect

  1. Install an official plugin.
  2. Pass an SSH destination (user@host, SSH config alias, optional port).
  3. BB SSHs in, checks node/npm/curl, and core-installs the daemon.
  4. The host shows up as a machine; new threads can use a composed project checkout on it.

CLI shape:

bb ssh-sandbox probe --destination [email protected] --json
bb machine create --provider ssh-sandbox --inputs '{"destination":"[email protected]"}' --json
bb thread spawn --project <id> --environment-provider ssh-sandbox --machine-inputs '{"destination":"[email protected]"}' --prompt "..."

Keys stay in ssh-agent or an optional server-local identityFile setting. Machine inputs stay non-secret.

Context and alternatives

  • Workaround: Manual machine setup on every sandbox.
  • Modal already proves the bootstrap-over-executor pattern; this is the SSH equivalent for user-owned hosts.
  • Vendor-specific Daytona/E2B plugins can come later and reuse the same core bootstrap; they are not required for the first path.
  • I searched open and closed issues for SSH/Daytona/E2B machine enrollment and did not find a duplicate.

AGENT GENERATED

Activity

  1. added
    host
    plugins
    on Sep 14, 2026
  2. bb-slop-cop commented on Sep 14, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Type: Feature, Priority: Medium, Effort: High, and labels: host, plugins. No existing classifications were present; all values were verified after writing.

    Manual enrollment provides a workaround. Adding SSH provisioning introduces a new integration and credential-handling design. No reproduction report or pull request: this is new functionality, so the rule’s bug-only steps do not apply.

    AGENT GENERATED

  3. lanjak commented on Nov 25, 2026

    @lanjak
    Contributor

    Hi, I'd like to build this and have a plan, so here is the shape before I prototype it. #3667 was closed by the contributor gate, not on its merits, so I've reused its executor approach on top of core's experimental_machines.bootstrap({ executor }).

    The main difference from #3667 is where ssh runs. #3667 runs it on the bb server, with an optional server-local identityFile. I'd run the system ssh on an enrolled machine the user picks ("Connect from"), normally their desktop, so the user's own keys, agent, ssh_config and ProxyJump work as they are. No key leaves that machine, and the server stores none. SSH is only the setup channel. After setup, the daemon connects through the normal server access route.

    Shape:

    • Plugin: a built-in machine-ssh plugin with an ssh machine provider, on the existing machine-provider contract. No daemon protocol change.
    • Flow: Add machine, then Over SSH. Pick a host from ~/.ssh/config or type user@host.
      • bb captures the host key, without offering any credential, and shows its SHA256 fingerprint for the user to confirm. It pins the key in a bb-owned known_hosts file and never writes ~/.ssh/known_hosts.
      • It then installs and enrols the daemon over SSH.
    • Later: Reconnect re-runs the installer over the same path, which also updates a daemon that couldn't update itself.
    • CLI and SDK:
      • bb ssh hosts, bb ssh probe <host> and bb ssh add <host> --host-key SHA256:...
      • bb machine create --provider ssh
      • the same calls in the SDK
    • Agents: agents may add only hosts that are already trusted, or use a fingerprint the user gave them. They can never trust a new key on their own.

    Two changes to the shared installer, because they also affect manual installs over SSH:

    1. Enable linger for Linux user-scope installs, with a BB_INSTALL_NO_LINGER=1 opt-out. Without it, a user unit installed from an SSH session stops when the last session ends.
    2. Set HOME for root system units (Linux root systemd daemon starts child CLIs without HOME #7591).

    Out of scope for v1: password and MFA hosts, and a bb-managed Node on targets that lack Node 22.19+.

    Two questions:

    • Running ssh on a chosen machine rather than the server: does that fit how you want machine providers to work?
    • Turning linger on by default for all Linux user installs: OK, or should it be opt-in?

    I'll link a prototype from my fork here. Checked against main at 562cbc3972.

  4. lanjak commented on Nov 25, 2026

    @lanjak
    Contributor

    Prototype: main...lanjak:bb:machine-ssh (13 commits on fb045a0466, each passes typecheck and lint, and the app builds). It follows the shape in my comment above, with the deviations listed below. No PR until we agree on it.

    What is in it:

    • Plugin: built-in bb--machine-ssh, with an ssh machine provider. No daemon protocol change.

    • Add machine, then Over SSH:

      • pick an alias from ~/.ssh/config or type user@host
      • bb captures the host key without offering any credential and shows its SHA256 fingerprint
      • after you confirm, it pins the key in a bb-owned known_hosts file, and every ssh call uses CheckHostIP no so nothing is copied into ~/.ssh/known_hosts
      • it checks Node 22.19+, including nvm, fnm, asdf, mise and Volta installs, then installs and enrols the daemon
    • Later: Reconnect and "Update over SSH" re-run the installer. Remove uninstalls over SSH. If the host is unreachable, it says what was left behind.

    • CLI and SDK: bb ssh hosts|probe|add and bb machine create --provider ssh, with the same calls in the SDK.

    • Core changes:

    • Installer:

      The last three fix bugs that are also on main.

    Deviations from my earlier comment:

    • Agent threads and new host keys: agent threads can't trust a new host key at all, even with a fingerprint the user gave them, because the server cannot tell where a fingerprint came from. This is a guardrail based on the caller thread, not a security boundary. An agent that drops the header or calls the HTTP API directly is not stopped, and the docs say so.
    • Confirming in the CLI: bb ssh add has no interactive confirm. A new key needs --host-key SHA256:....
    • No connection reuse: there is no SSH ControlMaster reuse yet, so hardware-key or 1Password agents may ask several times during one add.

    Checked on fresh libvirt VMs (Fedora 45 and Debian 13):

    • key auth through ssh-agent and an alias, then a real Claude Code thread that wrote a file and ran commands on the new machine
    • ProxyJump with a fish login shell
    • root with SELinux enforcing, through a reboot and removal
    • linger with and without polkit, and the opt-out
    • nvm under bash and zsh
    • Node 20 refused
    • a changed host key refused on probe, add and reconnect
    • a route answering 403 refused
    • removal with the VM off (about 15 s)

    Not run yet: macOS, bb Connect or HTTPS routes, the desktop app, musl or non-systemd targets, tcsh, and Windows.

    Found while testing, on main too: the server does not start while a machine setup is pending. The startup recovery sweep waits for the machine lifecycle sweep, and a machine in setup makes it wait 60 s, which equals the launcher's 60 s health timeout. Happy to file it as its own issue.

  5. lanjak commented on Dec 2, 2026

    @lanjak
    Contributor

    Update: I rebased the prototype onto 4d7a9af609. Same link: main...lanjak:bb:machine-ssh (head 4eab2ceebd, still no daemon protocol change).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hostplugins

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions