[ Windows 10 ] How to Upgrade the WSL Version from 1 to 2 for the Distribution package installed

 In my previous post we have discussed steps for setting up WSL in windows 10 machine with Ubuntu Package. If we have not specified the WSL version that we require before installing the distribution package most likely WSL version will be 1.

The problem with WSL version 1 is that it does not come with entire Linux package and there is no container support on its own that means that for running docker daemon process we have to depend on Docker Desktop which is installed in the host machine.

Know Which Version of WSL Is Installed


Lets now see how we can check the wsl distribution package version which is installed with the help of below command: 

wsl -l -v

This has to be entered in the PowerShell in the admin mode.

WSL version

you are seeing the version field as 2 because i have already migrated from version 1 to version 2.

For migrating the installed distribution package from version 1 to 2 there are some prerequisite packages that needs to be installed.

Once this is installed on the machine then the next step is to Check whether the Virtualization is enabled in the machine. This can be checked from the Task Manager as shown in the figure below:

Virtualization Enabled


If its Enabled then we have to enable the Virtual Machine Platform from the Turn Windows Features On/Off as shown in the figure below:

Enabling Virtual machine platform

Upgrade WSL Version


Click on OK and restart the system. Once its done we can execute the command to migrate to WSL version 2 for the same distribution package. The command is given below:

wsl --set-version <package name> 2


The package name corresponds to the distribution package which is installed in the machine in our case its ubuntu 20.04.The command has to be executed in the PowerShell with admin privilege's. This takes few minutes to complete, once done you can verify the version using the command wsl -l -v .



Comments

Popular posts from this blog

Creating RESTful Minimal WebAPI in .Net 6 in an Easy Manner! | FastEndpoints

Mastering Concurrency with Latches and Barriers in C++20: A Practical Guide for Students

Graph Visualization using MSAGL with Examples