This page contains frequently used command or instructions that might come in handy for using, setting up or in general dealing with WSL in window.
This has been mostly copied from microsoft’s website, but it’s a simplified version:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Cick Here to download.
wsl --set-default-version 2
Open Microsoft store , search Ubunutu
and install whatever version you want, 20.04 or 18.04.
This is take from this answer.
It’s a 4 step process:
mkdir D:\backup
wsl --export Ubuntu D:\backup\ubuntu.tar
wsl --unregister Ubuntu
mkdir D:\wsl
wsl --import Ubuntu D:\wsl\ D:\backup\ubuntu.tar
#### Register the old user:
cd %userprofile%\AppData\Local\Microsoft\WindowsApps
ubuntu config --default-user <username>