Skip to main content

running_under_wsl2

Function running_under_wsl2 

Source
pub fn running_under_wsl2() -> bool
Expand description

true when running inside WSL2 (a real Linux kernel on Hyper-V).

Under WSL2:

  • ZNS/CSD commands are rejected by the Hyper-V storage emulation.
  • Port 4242 is behind NAT by default. Enable Mirrored Mode in ~/.wslconfig:
    [wsl2]
    networkingMode=mirrored