Skip to content

Connect with VS Code

rsi code creates an RSI Box, prepares VS Code Remote Tunnels, and opens VS Code in your browser at /root/workspace. The Box connects outbound, so no SSH endpoint or inbound port is needed. You can also connect from desktop VS Code.

You need the rsibox CLI with a selected project, team credits, and a GitHub account. VS Code setup requires a Linux Box with unrestricted gateway internet access. The command does not change an existing Box’s network policy.

Run rsi code --help to check that your CLI includes this command. If it reports an unknown command, use the manual setup below until you have a CLI release that includes code.

Run on your local machine:

rsi code

New Boxes default to:

Setting Default Override
Name vscode --name
CPU 2 cores --cores
Memory 4 GiB --memory-mb (MiB)
Disk 50 GiB --disk-mb (MiB)
Lifetime 24 hours --life
GPU None --accelerator

The lifetime starts when the Box first reaches running; queueing and startup do not count. Creation is rejected if the duration exceeds your team’s limit or available credits; use the maximum in the error to choose a shorter --life. The command prints the Box ID as soon as creation is accepted and the actual expiration time when VS Code is ready. Keep the ID to reconnect or stop the Box.

To request a GPU and a shorter lifetime:

rsi code --accelerator rtx5080 --life 2h

GPU names use the same catalog names as other CLI commands.

For a new Box, the CLI asks you to accept Microsoft’s VS Code Server license terms before creating resources. Setup then installs the official VS Code CLI and prints a GitHub device-login URL and code when authorization is needed.

Open that URL, enter the displayed code, approve access, and leave rsi code waiting. This authorizes the Box with VS Code’s tunnel service, separately from your rsibox login. The browser editor may also ask you to sign in; use the same GitHub account.

The CLI shows creation progress, Preparing VS Code…, installation confirmation, and a spinner while waiting for authorization or a connection. Redirected output shows progress messages without animation. A transient tunnel-status probe timeout keeps waiting instead of ending setup. When the tunnel confirms it is connected, the CLI prints ✓ VS Code ready, emits the editor URL, opens your browser, and returns. The tunnel continues running inside the Box.

The editor URL is the only output on stdout. Progress, device authorization, Box identity, expiration, and stop instructions go to stderr.

To accept the license without an interactive terminal prompt, add --accept-server-license-terms. This flag does not complete GitHub authorization for you.

Replace sb_xxx with the compute ID printed by rsi code or listed by rsi box ls:

rsi code sb_xxx

The command reuses the installed VS Code CLI and an online editor tunnel, including one started with the manual steps below. If the tunnel is offline, it starts or reconnects using the saved login. If authorization has expired, follow the new login prompt. Concurrent invocations share the managed tunnel.

An existing Box keeps its resources and expiration. Creation options such as --life, --disk-mb, and --accelerator are rejected when you supply a Box ID. This command does not restart a stopped Box.

To print the editor URL without opening your browser:

rsi code sb_xxx --no-browser

--no-browser suppresses opening the editor; license acceptance and GitHub authorization may still be needed. For a new Box in a noninteractive terminal, accept the license explicitly:

rsi code --no-browser --accept-server-license-terms

Install Microsoft’s Remote - Tunnels extension, run Remote Tunnels: Connect to Tunnel from the Command Palette, and select the tunnel using the same GitHub account. Its name is the segment after /tunnel/ in the editor URL printed by rsi code.

Open /root/workspace via File → Open Folder, and use Terminal → New Terminal to run commands inside the Box. rsi code opens the browser by default; it does not automatically launch desktop VS Code.

Ctrl+C stops the local wait without stopping the Box. Setup may still be running inside it. Once you have a Box ID, reconnect with that ID instead of creating another Box:

rsi code sb_xxx

If creation fails before an ID is confirmed, the error includes a retry command with the original --idempotency-key and options. Reuse that command and the same project to recover the original request. Recovery commands appear on failure, rather than in normal setup output. For automation that must survive losing the terminal output, supply and retain your own --idempotency-key before starting creation.

If setup still fails, inspect the Box and the raw tunnel log:

rsi box get sb_xxx
rsi box exec sb_xxx -- tail -n 100 /root/.rsibox-code/tunnel.log

/root/.rsibox-code/status.log records timed-out status probes and is created only when a probe times out. These logs belong to the managed rsi code setup; a manually started tunnel may not have them. Share only the relevant error lines, removing device codes and other sensitive output.

Closing the editor or the local terminal does not stop the Box or its billing. Download any files you need with file transfer, then stop the Box:

rsi box stop sb_xxx

Stopping releases resources and discards the disk. The stop request may return before shutdown finishes; billing stops when resources are released. You can remove any offline tunnel entry from VS Code’s Remote Explorer. The manual cleanup commands below also show how to unregister a tunnel and sign out before stopping the Box.

Use these steps with an older CLI or when you need to inspect each setup stage yourself. Keep the Box ID and idempotency key in the same terminal session.

Run on your local machine:

create_key=$(python -c 'import uuid; print(uuid.uuid4().hex)')
box=$(rsi box create --name vscode \
--cores 2 --memory-mb 4096 --disk-mb 51200 \
--network gateway --life 24h --idempotency-key "$create_key")
echo "$box"

Keep $box for cleanup. If creation is interrupted, retry with the same key and options. The 24-hour lifetime starts once the Box reaches running. If that duration exceeds your team’s limit or available credits, creation is rejected; choose a shorter --life using the maximum in the error message.

From the same local terminal:

rsi box exec --timeout 180 "$box" -- sh -c '
set -eu
case "$(uname -m)" in
x86_64) platform=cli-alpine-x64 ;;
aarch64) platform=cli-alpine-arm64 ;;
*) echo "Unsupported architecture"; exit 1 ;;
esac
mkdir -p /opt/vscode /root/workspace
curl -fL "https://code.visualstudio.com/sha/download?build=stable&os=$platform" \
-o /tmp/vscode-cli.tar.gz
tar -xzf /tmp/vscode-cli.tar.gz -C /opt/vscode
'
rsi box exec --timeout 600 "$box" -- \
/opt/vscode/code tunnel user login --provider github

Open the printed GitHub device-login URL, enter the code, and wait for the command to finish. This authenticates the Box with VS Code’s tunnel service (separate from your rsibox login).

Next, start the tunnel (this accepts Microsoft’s VS Code Server license terms):

rsi box exec --timeout 86400 "$box" -- \
/opt/vscode/code tunnel --name "rsibox-${box#sb_}" \
--accept-server-license-terms

This command streams tunnel output and prints a URL such as https://vscode.dev/tunnel/rsibox-…. Keep the terminal open to follow its logs. The tunnel execution has a 24-hour timeout and can end earlier if the Box stops or expires.

  • Browser: open the printed URL and sign in with the same GitHub account.
  • Desktop VS Code: install Microsoft’s Remote - Tunnels extension, run Remote Tunnels: Connect to Tunnel from the Command Palette, and select your Box’s tunnel using the same GitHub account.

Open /root/workspace via File → Open Folder, and use Terminal → New Terminal to run commands inside the Box.

Closing VS Code does not stop the Box or its billing—the Box keeps running until you stop it or its lifetime ends. If device login times out, rerun the login command for a fresh code.

Download any files you need with file transfer. Then, in another local terminal, replace BOX_ID with the ID from step 1:

rsi box exec --timeout 60 BOX_ID -- sh -c '
set -e
/opt/vscode/code tunnel kill
/opt/vscode/code tunnel unregister
/opt/vscode/code tunnel user logout
'
rsi box stop BOX_ID

This unregisters the tunnel, logs out the Box, and releases its resources (discarding its disk). If tunnel cleanup fails, stop the Box anyway and remove any offline tunnel from VS Code’s Remote Explorer.