VS Code Extension

WSL Remote

A VS Code extension that lets VSCodium and other VS Code builds without Microsoft's Remote - WSL extension open folders in WSL.

The problem it solves

Microsoft's Remote - WSL extension is not available in VSCodium or in other VS Code builds that do not ship it. WSL Remote lets these editors open any folder in the Windows Subsystem for Linux: it opens folders and workspaces inside a WSL 2 distribution and runs the editor's own server there, such as codium-server for VSCodium.

WSL Remote is an independent, Apache-2.0-licensed implementation. It is not affiliated with Microsoft or with the jeanp413.open-remote-wsl extension.

Main features

  • Several ways to open a folder: the Remote Explorer view, the status bar menu, the command palette, and Reopen Folder in WSL.
  • Reliable server installation: the editor's server is downloaded into the distribution, verified against the publisher's checksum when one is available and extracted atomically. Installations by several windows are serialized with a lock, so a crash or a second window never leaves a half-installed server behind.
  • One server per window: the server runs as a child of the editor. When the window closes or the editor exits, the server stops and nothing stays behind in the distribution. After a dropped connection, the window reconnects to the running server instead of starting a new one.
  • Port forwarding: when WSL does not forward localhost (NAT mode with localhostForwarding=false), the connection and the forwarded ports go to the distribution's IP address instead. In NAT mode the server then listens on all interfaces, an address reachable only from this computer; in mirrored mode it listens on loopback. A connection token protects it either way.
  • server-env-setup hook: before the server starts, ~/.vscodium-server/server-env-setup is sourced inside the distribution, just as Microsoft's extension does with ~/.vscode-server/server-env-setup. Variables exported there reach the remote extension host and every terminal; PlanSwap uses this to give each editor its own CODEX_HOME.
  • Compatible server layout: the server runs from the same directory and writes its pid to the same file as Microsoft's and jeanp413's extensions, so tools that locate or restart the server through them keep working.
  • Works across distributions: on Alpine, on distributions without which or with an unusual PATH, and with distribution names containing dots and dashes.
  • Settings: set environment variables for the remote extension host from the Windows side, list extensions to install in the distribution on first start, and change the server download URL, the connection host and the timeouts. WSL: Show Log shows what the setup script did.

Who it is for

VSCodium users, and users of other VS Code builds without Microsoft's Remote - WSL extension, who work inside WSL 2.

What you need

  • Windows 10 21H1 or later, or Windows 11, with WSL 2.
  • wget or curl and tar inside the distribution; on Alpine, libstdc++ as well.
  • Install WSL Remote from Open VSX or the Visual Studio Marketplace, or from a .vsix file on the GitHub releases page.
  • The resolvers API proposal must be enabled. On first start WSL Remote offers to add itself to enable-proposed-api in argv.json, backing the file up first. The editor must then be quit completely and started again; Reload Window is not enough.
  • Do not install it next to Microsoft's ms-vscode-remote.remote-wsl or jeanp413.open-remote-wsl: each of them resolves wsl+ windows, and two resolvers for the same authority conflict.
  • To run codium . from a plain WSL shell, export VSCODE_WSL_EXTENSION_ID=n2ns.wsl-remote in your shell profile inside the distribution.
VSCodium WSL Remote development Open source