Languages
[Edit]
EN

WSL - convert WSL 1 Ubuntu to WSL 2

2 points
Created by:
martineau
1380

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

 

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join