porthole

VS Code Integration

Porthole now exposes two separate integration surfaces for VS Code:

They solve different problems and can be used together.

Integration Modes

Containers Extension

The VS Code Containers extension works against the Docker-compatible API exposed by the tray host.

Current tray transports:

For VS Code, the most reliable path today is the HTTP endpoint via DOCKER_HOST.

Dev Containers Extension

The Dev Containers extension still expects a Docker CLI for several workflows. Porthole provides a CLI shim in src/porthole-cli for that surface.

The shim currently implements these commands:

Add these settings in your VS Code settings.json.

Containers Extension Settings

{
  "containers.environment": {
    "DOCKER_HOST": "tcp://127.0.0.1:23751"
  }
}

Why this matters:

Dev Containers Extension Settings

Point the Dev Containers extension at the Porthole CLI shim:

{
  "dev.containers.dockerPath": "C:\\porthole-cli\\porthole-cli.exe"
}

If you are running from source instead of an installed copy, use the built executable path for your environment.

Example:

{
  "dev.containers.dockerPath": "C:\\repos\\porthole\\src\\porthole-cli\\bin\\Debug\\net8.0-windows10.0.19041.0\\porthole-cli.exe"
}

Combined Example

{
  "dev.containers.dockerPath": "C:\\porthole-cli\\porthole-cli.exe",
  "containers.environment": {
    "DOCKER_HOST": "tcp://127.0.0.1:23751"
  }
}

Session Model

The active session is central to how Porthole behaves.

For Dev Containers support, Porthole also uses a dedicated session name:

That session is used for the CLI shim and for devcontainer-oriented runtime operations.

Hidden wslc --session Parameter

Porthole discovered and now depends on a hidden global wslc switch:

wslc --session <name> <command>

This is important because unscoped wslc calls do not reliably target the session that VS Code integrations are using.

Examples:

wslc --session porthole-devcontainers list --all --format json
wslc --session porthole-devcontainers inspect <container-id>
wslc --session porthole-devcontainers exec <container-id> sh -lc "echo hello"
wslc --session porthole-devcontainers images --format json

Porthole uses this session-scoped path in the tray backend for:

Without --session, the Docker-compatible API can resolve the wrong inventory or miss the devcontainer session entirely.

Supported Docker API Calls

These routes are currently implemented by the tray bridge:

Outstanding Work

The bridge is intentionally narrow today. The following areas still need more work for broader Docker compatibility:

Validation and Troubleshooting

Verify the Tray Bridge

Test-NetConnection 127.0.0.1 -Port 23751
Invoke-WebRequest -UseBasicParsing http://127.0.0.1:23751/v1.52/_ping

Verify the CLI Shim

porthole-cli version
porthole-cli ps --all

Common Failure Modes

If the Containers extension still does not work:

If Dev Containers still fails:

If session-local inventory looks wrong: