WslHelper
Installs the WSL2 runtime. Without it Docker Desktop installs fine and then has no Linux engine at all - the exact state devBuilder04 was left in (Docker CLI present, engine pipe absent), which is why a NETBase container deployment could not run on it.
|
Note
|
Deliberately DISM-first: the two optional-feature enables are offline-safe and are what makes the reboot productive. But features are NOT a runtime. MEASURED on devBuilder05 (2026-08-31): both features report The way through is the MSI Microsoft publishes on github.com/microsoft/WSL/releases: an MSI installs fine as SYSTEM. Its URL is a config value ( The download uses A reboot is ALWAYS required after the features flip; the caller decides when to take it. |
public static class WslHelper
1. Methods
1.1. InstallWsl(ISystemHost, string)
Enables the WSL + VirtualMachinePlatform features and pulls the WSL2 kernel. Idempotent - a node that already has WSL just reports it.
public static bool InstallWsl(ISystemHost host, string installerUrl = null)
| Name | Type | Description |
|---|---|---|
host |
ISystemHost |
Host to configure. |
installerUrl |
string |
Optional WSL2 MSI URL (see |
Returns: bool — True when a reboot is needed to finish the install.