Skip to content

S12-05 - WSL

Purpose: How wb works inside a WSL 2 distribution on a Windows host (FR16-wslFR16-wsl: WSL on WindowsOn a Windows host, wb run inside a WSL 2 distribution works on repositories in that distribution, using the VMs and services of the Windows host.).

On a Windows host, wb inside a WSL 2 distribution is a client of the Windows host’s wb-hostd.

Linux wb checks for WSL (internal/platform). In WSL it never starts services or VMs inside the distribution.

  1. wb starts the Windows wb.exe relay through WSL interop.
  2. wb speaks gRPC over the relay’s standard input and output.
  3. wb.exe connects to wb-hostd over its named pipe, as the Windows user.

Authentication is then the same as in native use. This doesn’t need networking configuration in WSL. A Hyper-V socket channel is a possible later optimization (spike X12-wsl-channelX12-wsl-channel: WSL client channelwb in WSL 2 relaying through wb.exe relay over interop standard streams: terminal fidelity, window resizing, throughput of the git transport, latency to the first prompt.).

The WSL-side wb owns the terminal. It relays the terminal inside the gRPC stream, so Windows console behavior doesn’t apply.

The repository stays in the WSL filesystem, and wb-hostd never reads it (S08-10-wslS08-10-wsl: WSLHow the fetches of the git round trip cross between a WSL distribution and the Windows side.).

  • wb.exe fetches the selected refs into the Windows-side export.git, as its only writer. It fetches from a git upload-pack that it starts in the distribution through wsl.exe. So wb-hostd is never the fetch client.
  • wb land and wb diff fetch in the distribution from a git upload-pack on the Windows-side landing repository. wb.exe runs that upload-pack after it checks the repository.

A project’s identity includes the distribution name (S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command.). The same path in two distributions is then two projects.

The Windows side must have Wraith Box installed and wb setup done. The WSL-side wb explains this if wb.exe is missing.

Status: Draft