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 Enabled and wsl.exe still answers "Windows-Subsystem fuer Linux ist nicht installiert" - which is precisely the state devBuilder04 was in. wsl --install / wsl --update cannot fix it here, because they deploy an MSIX and Windows refuses MSIX deployment under LOCAL SYSTEM - the same wall the winget-via-Chocolatey attempt hit. NETSetup runs as SYSTEM, so that path can never work in an install.

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 (WslInstallerUrl), never a literal here. With no URL configured this falls back to wsl --install, which only succeeds when a human runs it interactively.

The download uses curl.exe -C - in a resume loop, NOT Invoke-WebRequest. Guests on some Proxmox hosts silently truncate large transfers: measured on osisaLib03, the 247 MB MSI arrived as 64.7 MB and nothing raised an error - msiexec simply had nothing valid to install. Do not "simplify" this back to a single-shot download.

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)
Table 1. Parameters
Name Type Description

host

ISystemHost

Host to configure.

installerUrl

string

Optional WSL2 MSI URL (see WslInstallerUrl). When given, the MSI is downloaded and installed with msiexec - the only path that works under LOCAL SYSTEM.

Returns: bool — True when a reboot is needed to finish the install.