wsl 1 distro to wsl2 code example
Example 1: wsl2 ubuntu
wsl.exe --set-version Ubuntu 2
Example 2: wsl convert to wsl2
wsl --set-version <Distro> 2
# For setting all future distributions to use WSL 2
wsl --set-default-version 2
wsl.exe --set-version Ubuntu 2
wsl --set-version <Distro> 2
# For setting all future distributions to use WSL 2
wsl --set-default-version 2