Skip to content
Module 9 · RemoteVerified 2 Nov 2026

Dev Tunnels & GitHub Environments

Keep an agent working on your machine and steer it from anywhere, or give the cloud coding agent the setup it needs.

Connection chooser

Pick your goal

Pick the situation closest to yours.
Two meanings of GitHub Environments
GitHub Environments (VS Code)Repository environment “copilot”
WhatRemote connection to a registered machineSecrets and variables for the coding agent
WhereRemote Connections in VS CodeRepo → Settings → Environments
StatusPreviewPart of the coding agent

Security first

Never combine an unauthenticated tunnel with auto-approved tools. Connected clients get trusted access to your machine, and traffic is not end-to-end encrypted.
  1. Install the CLI and sign in

    bash
    code tunnel --accept-server-license-terms

    Sign in with the same GitHub account when prompted. Leave it running.

  2. Name the tunnel

    bash
    code tunnel --name my-dev-box

    Pick a name you will recognise from the remote client.

  3. Keep it as a service

    bash
    code tunnel service install

    Starts at login so the tunnel survives a reboot.

  4. Confirm access control

    bash
    code tunnel status

    Tunnels should require authentication. Never expose an anonymous tunnel together with Allow all.

.github/workflows/copilot-setup-steps.yml
name: "Copilot Setup Steps"
on: workflow_dispatch
jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
      - run: npm ci
Troubleshooting
SymptomCheck
Tunnel does not appear in the clientIs it running, and is it the same GitHub account on both sides?
Connection drops overnightThe host must stay awake. Check sleep settings or use a cloud session.
Agent cannot reach a private serviceNetwork rules on the host apply. Check sandbox network settings.
Coding agent cannot install dependenciesCheck the copilot-setup-steps job runs on its own, and that required secrets live in the copilot environment.