til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Up and Downgrade

Since two versions of WSL exist, it is possible to up and downgrade.

You can downgrade single images from WSL2 to WSL1 and vice-verse.

To see what WSL versions your images have:

C:\Users\jonasbn>wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-18.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2
  kali-linux             Stopped         2

You can set the WSL version for an image:

C:\Users\jonasbn>wsl --set-version kali-linux 1
Conversion in progress, this may take a few minutes...
C:\Users\jonasbn>wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-18.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2
  kali-linux             Stopped         2

And when you list afterwards, you can observe that the version of the WSL for the image has changed.

C:\Users\jonasbn>wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-18.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2
  kali-linux             Stopped         1

Resources and References

  1. dev.to: “Upgrading from WSL1 to WSL2” by Aditya Kanekar
  2. Microsoft: “Windows Subsystem for Linux Installation Guide for Windows 10”