WSL2 NAT Mode Found Causing Periodic Host-Wide Network Drops on Windows
A developer discovered that WSL2's default NAT-based virtual network switch was intermittently conflicting with the host machine's real network adapter, causing brief but complete network outages every few minutes across the entire Windows system. Switching WSL2 to mirrored networking mode via the .wslconfig file resolved the issue by allowing the WSL2 interface to share the host's actual network identity rather than operating behind a separate virtual switch. Separately, several seemingly reasonable .wslconfig tuning settings — including a custom kernel command line, oversized swap, and an experimental memory reclaim option — were found to cause full WSL virtual machine crashes under memory pressure. The safer alternative for adjusting memory behavior is a sysctl drop-in configuration file applied at boot, rather than kernel command-line overrides. The developer also outlined a recovery sequence for when WSL fails to launch, involving a full shutdown via PowerShell, a service restart, and isolating third-party tools with WSL integrations as a potential source of conflict.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in