How to upgrade from WSL 1 to WSL 2

visibility 254 access_time 4 months ago languageEnglish timeline Stats
timeline Stats
Page index 2.32

WSL is a very powerful tool to allow developers to use Linux features on Windows machines. The latest version is WSL 2.WSL 2 uses the latest virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine (VM). For more information about WSL 1 and 2 differences, refer to Comparing WSL 1 and WSL 2 | Microsoft Docs.

Upgrade from WSL 1 to 2

Run the following command will show the current installed distros:

wsl -l -v

The command prints out the distros with versions in my Windows machine:

As shown in the above screenshot, I have multiple different versions of distro installed. 

To upgrade from WSL1 to WSL2, we can simply run the following command:

wsl --set-version <distro name> 2

For example, the following command upgrade my Ubuntu-18.04 distro to WSL 2.

wsl --set-version Ubuntu-18.04 2
It make takes a few minutes to complete.
Once it is done, you can use list command `wsl -l -v` to check the version. 
copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext
Apache Spark 3.0.0 Installation on Linux Guide
visibility 5,508
thumb_up 1
access_time 2 years ago
Apache Spark 3.0.0 Installation on Linux Guide