dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Microsoft Official WSL2 Linux kernel update package for x64 machines
wsl --set-default-version 2
wsl --set-version <distribution name> <versionNumber>
wsl --set-version Debian 2
wsl --set-default-version 2
Create a new file identified by '.wslconfig' in the user's root folder, include the necessary settings for it to work on your computer.
[wsl2]
memory=2GB # How much memory to assign to the WSL2 VM.
processors=5 # How many processors to assign to the WSL2 VM.
kernel= # An absolute Windows path to a custom Linux kernel.
swap= # How much swap space to add to the WSL2 VM. 0 for no swap file.
swapFile= # An absolute Windows path to the swap vhd.
localhostForwarding= # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).