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.).
Design
Section titled “Design”On a Windows host, wb inside a WSL 2 distribution is a client of
the Windows host’s wb-hostd.
Detection
Section titled “Detection”Linux wb checks for WSL (internal/platform). In WSL it never starts
services or VMs inside the distribution.
Channel
Section titled “Channel”wbstarts the Windowswb.exe relaythrough WSL interop.wbspeaks gRPC over the relay’s standard input and output.wb.execonnects towb-hostdover 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.).
Terminal
Section titled “Terminal”The WSL-side wb owns the terminal. It relays the terminal inside the
gRPC stream, so Windows console behavior doesn’t apply.
Repository
Section titled “Repository”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.exefetches the selected refs into the Windows-sideexport.git, as its only writer. It fetches from agit upload-packthat it starts in the distribution throughwsl.exe. Sowb-hostdis never the fetch client.wb landandwb difffetch in the distribution from agit upload-packon the Windows-side landing repository.wb.exeruns thatupload-packafter it checks the repository.
Project identity
Section titled “Project identity”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.
Requirement
Section titled “Requirement”The Windows side must have Wraith Box installed and wb setup done. The
WSL-side wb explains this if wb.exe is missing.
Decisions
Section titled “Decisions”No services or VMs inside WSL
Section titled “No services or VMs inside WSL”- Why: the WSL distribution shares one kernel with every other distribution of the user, so it isn’t a sandbox (SEC01-separate-kernelSEC01-separate-kernel: Separate kernelThe agent runs in a hardware-virtualized guest with its own kernel, never sharing a kernel with the host or with another environment of the user (for example a WSL distribution).).
Status: Draft