How to Set a Linux distro version to WSL 1 or WSL 2 in Windows 10
Microsoft has ported WSL 2 to Windows 10 version 1909, and version 1903. Initially, it was exclusively available in Windows 10 version 2004. Now users who have installed two older releases of the OS can upgrade Windows Subsystem for Linux to the latest generation and get benefits from using it.
WSL 2 is a new version of the architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware, but still provides the same user experience as in WSL 1 (the current widely available version).
Advertisеment
It ships a real Linux kernel with Windows that will make full system call compatibility possible. This is the first time a Linux kernel is shipped with Windows. WSL 2 uses the latest virtualization technology to run its Linux kernel inside of a lightweight utility virtual machine (VM). In order to make it available for more Windows 10 users, Microsoft has made it available for two previous releases of the OS.
All its key features will be available, including
- File system performance now on par with Mac and Linux speeds
- Improved System Call Support for all Linux applications notably: Docker, FUSE, rsync, etc.
- Full Linux kernel
- Docker Desktop has added support to use WSL 2 as its engine
Builds 18362.1049
and 18363.1049
or higher are required to get WSL2 working. They are released with KB4571748.
You can set the desired WSL version to be used by default for new WSL instances, or set an installed distro to a specific WSL platform.
Set Linux Distro Version to WSL 1 or WSL 2 for new instances
- Open PowerShell as Administrator.
- To set WSL 2 as your default version for new instances, type and run:
wsl --set-default-version 2
. - To set WSL 1 as your default version for new instances, type and run:
wsl --set-default-version 1
. - You are done.
Note: Some of the legacy WSL distros are not designed to run under WSL 2. You need to uninstall them manually. Here is the list of WSL 2 -compatible distros.
- Ubuntu
- Ubuntu 16.04 LTS
- Ubuntu 18.04 LTS
- Ubuntu 20.04 LTS
- openSUSE Leap 15.1
- SUSE Linux Enterprise Server 12 SP5
- SUSE Linux Enterprise Server 15 SP1
- Kali Linux
- Debian GNU/Linux
- Fedora Remix for WSL
- Pengwin
- Pengwin Enterprise
- Alpine WSL
Well, you can instead to convert an existing distro to version 1 or 2. Here's how to find WSL versions for your installed distros.
Find WSL Versions for Installed Linux Distros
- Open PowerShell as Administrator.
- Run the command:
wsl --list --verbose
. - See the 'version' column value.
You are done.
Finally, here's how to change the WSL version for a distro.
To Set Linux Distro Version to WSL 1 or WSL 2 in Windows 10,
- Open PowerShell as Administrator.
- To set WSL 2 as the distro version for the specific instance, run the command
wsl --set-version <distro_name> 2
. - Substitute the <distro_name> portion with the actual Linux name you are using, e.g. Ubuntu:
wsl --set-version Ubuntu 2
. - To convert a distro to WSL 1, issue the command
wsl --set-version <distro_name> 1
, e.g. for Ubuntu run:wsl --set-version Ubuntu 1
.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!
Advertisеment
when i was converting kali to wsl 2 , it is taking 1 to 2 hr and then i was very irritated and then i closed it.
please solve this. your website is really helpful
Thank you so much. >> wsl –set-version Ubuntu 1 << this is what I was looking for
Same issue with me converting form wsl2 to wsl1 takes hours, not sure wht is the issue
Thank you so much! I have been having this issue for a while and could not get it fixed!
#WSL2 network issues: Ubuntu cannot resolve names for Internet IP.
PS C:\WINDOWS\system32> wsl -l -v
NAME STATE VERSION
* Ubuntu Stopped 2
#Convert WSL2 to original WSL1 for Ubuntu to solve internet issues.
PS C:\WINDOWS\system32> wsl –set-version ubuntu 1
PS C:\WINDOWS\system32> wsl -l -v
NAME STATE VERSION
* Ubuntu Running 1
wsl –set-version Ubuntu 2
There is no distribution with the supplied name.
Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND
YOU ARE RETARDED ?!? OR WHAT ?!?
I am sorry but it is not me who is retarded here.
Your setup doesn’t have a distro named “Ubuntu”