Skip to content
Kittipong R edited this page Sep 8, 2020 · 3 revisions

Install WSL2

You will need Win10 build 2004 or later

Enable WSL and Virtual Machine Platform

Run in PowerShell with administrator privilege

### Enable WSL
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

### Win10 (2004)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

### Select WSL2
wsl --set-default-version 2

Reference:

Install App and OS

In Microsoft Store, install...

  • Windows Terminal
  • Linux OS

[Optional] Update Port Reservation

As for Sept 2020, Hyper-V has a way of dynamically reserving thousands of ports that are normally used by different apps (sub-10K range). This sometimes make apps failed after a restart due to reservations. To fix this problem, we will move its reservation to 40K+ range.

### Show what ports are being reserved
netsh int ipv4 show excludedportrange protocol=tcp

netsh int ipv6 show excludedportrange protocol=tcp

### Change the range for dynamic ports
netsh int ipv4 set dynamic tcp start=49152 num=16384

netsh int ipv6 set dynamic tcp start=49152 num=16384

### Prevent port reservation
reg add HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange /d 0 /f

Reference:

Clone this wiki locally