EN
WSL - convert WSL 1 Ubuntu to WSL 2
2
points
In this short article, we would like to show how to convert WSL 1 Ubuntu to WSL 2.
Quick solution, from command line we execute:
wsl --set-version Ubuntu 2
Practical end to end usage example
1. View the list of distros and states (Ubuntu is Running, version 1):
PS C:\Users\john> wsl -l -v
NAME STATE VERSION
* docker-desktop Running 2
Ubuntu Running 1
wsl-vpnkit Running 2
docker-desktop-data Running 2
2. Convert WSL 1 Ubuntu to WSL 2:
PS C:\Users\john> wsl --set-version Ubuntu 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
3. View the list of distros and states, again, (Ubuntu is Stopped, version 2):
PS C:\Users\john> wsl -l -v
NAME STATE VERSION
* docker-desktop Running 2
Ubuntu Stopped 2
wsl-vpnkit Running 2
docker-desktop-data Running 2
4. Start Ubuntu disto:
PS C:\Users\john> wsl -d Ubuntu
5. View the list of distros and states, again, (Ubuntu is Running, version 2):
PS C:\Users\john> wsl -l -v
NAME STATE VERSION
* docker-desktop Running 2
Ubuntu Running 2
wsl-vpnkit Running 2
docker-desktop-data Running 2