On this page
Overview
VM Bridge runs T3 Code and OpenCode agents on cloud VMs. Pair an unchanged T3 Code app with VM Bridge once, or run vb opencode in a repository. VM Bridge creates, wakes and sleeps VMs on your sandbox provider, and sends each repository and thread to the right one.
- Repositories share VMs. A repository goes on a VM that has room, and VM Bridge makes a new VM only when none does. A busy repository spreads over up to 4 VMs.
- A VM sleeps after it has been idle for a set time, and wakes when you send a message or an OpenCode prompt.
- Several providers at once: boxd, Instabox, Daytona, Boat, Railway, E2B, Freestyle, Superserve, Kubi and Vast.ai. Pick one per repository, or let new VMs use the default.
- Everything is set up from a web dashboard behind one password: provider keys, GitHub, agent sign-ins and device pairing.
- T3 Code needs no changes. To the app, VM Bridge looks like a single T3 server.
- vb opencode opens OpenCode in your terminal while the agent works in its own worktree on a VM.
Install
VM Bridge runs on macOS and Linux. You need an account with one of the supported providers, and T3 Code on the devices you want to pair, or OpenCode 2 on the computers you run vb opencode from. One command installs the server, the dashboard and the command line, as one file in ~/.local/bin with vb as a short name:
curl -fsSL https://raw.githubusercontent.com/vkpdeveloper/vmbridge/main/install.sh | sh
Then run vmbridge and open the setup link it prints. To update later, run vmbridge update.
To build from source instead, with Bun 1.4.4 or newer:
git clone https://github.com/vkpdeveloper/vmbridge cd vmbridge bun install bun run compile # dist/vmbridge ./dist/vmbridge
No machine of your own? Run VM Bridge on Cloudflare Workers instead. You need a Cloudflare account, and the free Workers plan is usually enough. The deploy screen asks for a dashboard password and an encryption key.
Deploy to CloudflareThe Cloudflare guide covers the secrets, what gets deployed, limits and cost.
Run
On first start in a terminal, VM Bridge prints a one-time setup link for each address. It opens onboarding, where you choose a dashboard password of at least 8 characters. The link only goes to a terminal, never to a log, so for the background service set VMBRIDGE_PASSWORD for the first start, or run vmbridge password.
Data lives in ~/.vmbridge. Set VMBRIDGE_HOME to move it. The background service uses launchd on macOS and systemd on Linux, and writes its log to ~/.vmbridge/vmbridge.log.
$ vmbridge service install --port 3774On Linux, the systemd user service runs only while you are logged in. To keep it running after you log out, run loginctl enable-linger $USER.
Open /dashboard on any address VM Bridge printed and log in with your password. Accounts has three tabs.
- Providers. Add one or more providers and paste their keys. VM Bridge checks each key before saving it. The first one you add is the default.
- GitHub. A personal access token so agents can clone, push and open pull requests.
- Agent sign-in. Sign in to Codex with ChatGPT and to Claude with your Claude account, or add a token or an OpenCode key.
Under Settings, VMs you choose the size for new VMs (by default each provider's own default, listed under Providers below), how many idle minutes before a VM sleeps (5 by default), and the T3 version to install on VMs. Under Repositories you can send a repository to a given provider and VM size.
Under Settings, Devices, name the device and create a pairing link. In T3 Code, add a remote environment and paste the link.
- Each link works once and expires after 15 minutes.
- Pairing swaps the link for a token that only that device holds. VM Bridge stores a hash of it.
- Remove a device under Settings, Devices to sign it out right away.
Run vb opencode inside a repository. VM Bridge finds or adds its project, picks a VM as it would for a new thread, makes a worktree there and opens OpenCode in it.
$ vb opencode- Add an OpenCode API key in Accounts first. OpenCode on the VMs uses its models.
- It needs OpenCode 2 on this computer: npm install -g @opencode/cli.
- Each run gets its own worktree on a new opencode/ branch, from your current branch if origin has it, else the default branch. --branch picks another.
- OpenCode's sidebar shows the repository, the branch and how far it is from the default branch, its pull request with checks and review, and the VM with its state. Dev servers the agent starts on the VM open on localhost here.
- When you close OpenCode, VM Bridge removes the worktree in the background, unless it has uncommitted or untracked files, commits that are not pushed, or an OpenCode agent still working. A worktree on a sleeping VM stays too.
- vb opencode resume lists the worktrees still on the VMs, last used first, with each one's branch, pull request and whether its VM is running, without waking any. Pick one and OpenCode opens on its VM, in the session you last prompted there.
- On the computer VM Bridge runs on, it signs itself in. On another, run vb login once with a pairing link from Devices.
- vb is a short name for vmbridge.
To connect an OpenCode app to a project yourself:
- Open a VM on the dashboard and choose Connect OpenCode next to its repository.
- In the OpenCode app, choose Connect to a server and paste the address and password, or scan the dialog's QR code from your phone.
In a terminal, put the password in OPENCODE_PASSWORD and run:
$ opencode --server https:/ / bridge.example.com/ opencode/ my-project- A sleeping VM wakes on the first request, so a prompt in OpenCode wakes it.
- Agents keep running after OpenCode closes. The VM sleeps once no OpenCode agent is running and nothing has used it for the idle time.
- The dashboard lists each VM's OpenCode sessions beside its T3 Code threads.
- Each QR code works once, for 10 minutes. The QR code appears only when VM Bridge has an address other devices can reach.
- New password, in the same dialog, signs out every OpenCode client of that project.
- OpenCode uses only the OpenCode key. Codex and Claude sign-ins stay with T3 Code.
T3 Code keeps one connection to VM Bridge. VM Bridge keeps one connection to the T3 server on each awake VM, and routes each request by its project or thread.
- Answered by the bridge. Config, the project list and threads on sleeping VMs come from VM Bridge in about 1 ms.
- Forwarded to a VM. Messages, file browsing and Git status go to the thread's VM, about 156 to 320 ms away depending on the provider.
- New projects. Opening a repository clones it onto a VM with room, as described below, and registers it with T3 there. Only when no VM has room does VM Bridge create one, install Node, T3 and the agent CLIs, and start T3. A new VM takes from about 16 seconds on Daytona to 95 on E2B.
- New threads. Each goes to the least loaded of its project's VMs with room, as described below.
- Running threads stay put. A thread's worktree, branch and unpushed changes live on its VM, so it never moves. Branch lists show branches from all of a project's VMs, and a new thread from a branch only one VM has starts on that VM. Extra VMs sleep like any other and are never deleted on their own.
VMs are not tied to one repository. A repository that needs a VM goes on an existing VM of the provider and size it uses, as long as that VM has room:
- fewer than 2 running turns per vCPU
- under 80% of its memory used
- at least 3 GB of disk free
The least loaded awake VM with room comes first, then a sleeping one with room. VM Bridge creates a new VM only when none has room. Each repository gets its own folder on the VM, such as /workspace/my-app.
- New threads and OpenCode worktrees follow the same rules, so a busy repository spreads over up to 4 VMs, including VMs other repositories use.
- If no VM can be added, the thread runs on the least loaded VM and says it may be slow. VM Bridge tries adding a VM again after 10 minutes.
- A thread's worktree, branch and unpushed changes live on its VM, so a running thread never moves. A new thread from a branch only one VM has starts on that VM.
- Deleting a VM on the dashboard names every repository on it first.
A VM counts as idle when no device has used it and nothing is waiting on it: no running agent turn, queued work, pending approval enabled automation or busy OpenCode agent. After the idle minutes you set, VM Bridge saves each thread on that VM and puts it to sleep. The threads stay readable in T3 Code while it sleeps.
Send a message in a sleeping thread and T3 Code shows Waking the boxd VM... until the VM answers. Then the message goes through as usual. A prompt or request from OpenCode wakes a sleeping VM the same way.
Each provider also has its own idle or time limit as a safety net in case VM Bridge is offline. Railway, Kubi and Vast.ai have none, so VM Bridge never sets one there.



- boxd wakes a paused VM on any traffic, so VM Bridge closes its connection before it pauses one.
- Daytona uses container sandboxes, which stop rather than pause. Files stay, and T3 starts fresh on wake.
- Boat VMs start in the Boat environment you choose.
- Railway has no pause. Sleep saves a checkpoint and removes the VM. Wake creates a new VM from it. Railway needs an account or workspace API token and an environment ID.
- Instabox uses the agent-browser template.
- E2B fixes CPU and memory per template. VM Bridge builds one template per size in your account the first time you use that size, which takes about 15 s.
- Kubi stops a VM to sleep it, and starting it again reboots it, so T3 starts fresh on wake. VMs are persistent by default. A disposable VM, picked in the Kubi settings, is deleted after 7 days asleep. The API key needs read, exec, power and network.
- Vast.ai rents one NVIDIA GPU per VM from independent hosts, the cheapest verified on-demand machine that fits the size. Sleep stops the VM and you pay only for its disk. A sleeping VM wakes only if its host's GPU is still free. VM Bridge reaches it over SSH, so it needs the
sshcommand and does not run on Cloudflare Workers. - Freestyle, Superserve and Kubi have one machine size, so small, medium and large are the same VM.
Agents and git sign in only with what you add in Accounts, never with sign-ins from the VM provider. Each agent sign-in is a profile saved, encrypted, in ~/.vmbridge/main.db. Each agent uses one profile at a time, and VMs get it when they start.
Git on each VM signs in to GitHub with the token and commits as your GitHub account, using GitHub's private noreply email. SSH remotes such as git@github.com:you/app.git go over HTTPS with the token. The GitHub CLI, gh, is installed and signed in, so agents can open pull requests.
VM Bridge refreshes the Codex sign-in before it expires and gives the new tokens to every awake VM, so VMs never sign each other out.
Signing in with your Claude account makes the same one-year token as claude setup-token. Approve on claude.ai, then paste the code it shows into the dashboard.
Under Settings, Environment in the dashboard, add variables every VM gets. T3, the agents and the commands they run see them, and so do login and interactive shells on the VM, such as over SSH.
- An awake VM restarts T3 to apply a change as soon as nothing runs on it. A running turn finishes with the values it started with.
- A sleeping or stopped VM applies it when it wakes, before T3 serves anything.
- A new VM has them before T3 first starts.
- VM cards show Update pending until a VM has the latest values.
Values are kept with VM Bridge's other secrets and are never shown again: to change one, set it anew. On the VM they live in a file only the VM user can read. Names VM Bridge sets itself, or that would break shells, are refused: for example PATH, HOME, CLAUDE_CONFIG_DIR, CODEX_HOME, GH_TOKEN and anything starting with T3CODE_ or VMBRIDGE_.
Skills
Under Skills in the dashboard, press Add skill to install one from skills.sh, or use the This machine tab to install one found in ~/.claude/skills, ~/.agents/skills or ~/.codex/skills. Every VM gets every installed skill:
- Awake VMs get it right away, even during an agent turn, without restarting T3 or the agents.
- A sleeping or stopped VM gets it when it wakes, before T3 starts serving.
- A new VM has every skill before T3 first starts.
- Edits to a skill on this machine reach the VMs within a few seconds. A skills.sh skill changes only when you press Update.
- Removing a skill takes it off every VM. Skills put on a VM some other way, and a skill with the same name already there, are left alone.
Switch on Sync all to install every skill in those folders. New skills there follow within a few seconds, and one deleted here comes off the VMs. When two folders hold the same skill name, the first in the order above wins, and skills over 5 MB are skipped. Turning it off keeps what it installed until you remove it. skills.sh skills are not affected.
Claude Code picks up new skills in a running session. Codex notices changes on its own; if a skill does not show, start a new thread. skills.sh skills download as text files.
The Instructions tab of the Skills page lists each agent's global file found on this machine. Switch one on and every VM gets it, at the path that agent reads, on the same terms as skills: awake VMs right away, sleeping VMs before they serve anything on wake, new VMs at setup, and edits here within a few seconds.
Only files that exist here are copied, so an agent without one gets none. Switching a file off, or deleting it here, takes it off the VMs. VM Bridge only replaces or removes a file it wrote: a file a VM already had, or one edited on the VM, is left alone. The files stay in memory on this machine and are never logged.
VM Bridge answers on this machine and on Tailscale by default. Your local network is off until you turn it on under Settings, Addresses, or start with --host 0.0.0.0 for every network. --host 127.0.0.1 keeps it on this machine.
Turn on Tailscale HTTPS under Settings, Addresses to reach VM Bridge from anywhere on your tailnet with a certificate.
Cloudflare Tunnel gives VM Bridge an HTTPS address on the public internet, so you can reach it from anywhere without opening a port. It runs through cloudflared, Cloudflare's free tool. Install it, and the switch shows up under Settings, Addresses:
brew install cloudflared
The tunnel is off until you turn it on, because anyone on the internet can then reach your login page. Your dashboard password, pairing links and the one-time setup link still protect everything behind it. Once it is on, its address appears with the others: in Settings, in the links vmbridge run prints and in pairing links.
- With your own domain, VM Bridge makes a tunnel named
vmbridge-plus the first 8 characters of its ID, and adds the DNS record for your hostname. It never replaces a record you already have. - Its config and the tunnel's credentials live in
~/.vmbridge/cloudflared. A dashboard tunnel's token is kept with your other secrets. - cloudflared connects to VM Bridge on a port of its own on this machine, picked the first time you turn the tunnel on and kept after that. Settings shows it: point a dashboard tunnel's hostname at
http://localhost:plus that port. If another app takes the port, VM Bridge picks a new one, and you update the dashboard tunnel to match. - Free addresses cannot stream live updates, so the dashboard refreshes every 5 seconds there. Your own domain and dashboard tunnels update live.
- VM Bridge only believes the visitor address and HTTPS details Cloudflare adds when they arrive on the tunnel's port from this machine. Failed logins are counted per visitor, so one person cannot lock everyone out.
- While it is on, the tunnel starts and stops with VM Bridge, including when you close its terminal. If cloudflared stops on its own, VM Bridge starts it again after a second, waiting longer after each failure, up to a minute. Its warnings and errors go to the VM Bridge log with tokens hidden.
- Everything is in
~/.vmbridge/main.db, readable only by your user. On Cloudflare it is in the Durable Object's storage instead. - The dashboard API never returns a saved secret. You can replace a key, not read it back.
- Logs record which call went where and how long it took. They never hold message contents or tokens.
- Each T3 server on a VM requires its own session token on every request, and only VM Bridge holds it. Public preview URLs show nothing without it.
- Requests to VMs refuse redirects, so a token can never be sent to another site.
VM Bridge encrypts everything sensitive it saves, by default, with AES-256-GCM and a key that only your install has.
- Encrypted: provider keys, the GitHub token, environment variables for VMs, each VM's T3 token, installed skill files and agent sign-ins.
- Not encrypted: chat history, queued messages, logs and settings. They stay in files only your user can read.
On first start VM Bridge makes a random key and saves it in ~/.vmbridge/encryption.key, readable only by your user. To use your own key, set VMBRIDGE_ENCRYPTION_KEY to 32 random bytes in base64. It takes the place of the file.
$ openssl rand -base64 32The key file sits next to your data, so a copy of the whole folder holds both. Keeping the key outside the folder, in VMBRIDGE_ENCRYPTION_KEY, is stronger.
Back up the key somewhere apart from your data, such as a password manager: the contents of encryption.key, or the value you set. To restore it, put the file back or set the variable again.
VM Bridge will not start with the wrong key or without its key, so it never overwrites what you saved. If the key is lost, no one can read those values again, you included: start with a new data folder and add your provider keys, agent sign-ins, environment variables and GitHub token again.
Updating from a version without encryption encrypts your saved data on first start. After that, older versions can't read it, so don't go back to one.
Develop
bun run dev # server and dashboard, restarted on change bun run check # typecheck and tests
apps/server: the T3 gateway, the fleet of VMs, providers and the dashboard API.apps/web: the dashboard.apps/cli: thevmbridgecommand.apps/landing: this site.packages/contracts: types shared by the server and the dashboard.
Still stuck?
The FAQ answers the common questions. Anything else, open an issue on GitHub.