Home Windows Subsystem for Linux (WSL) Install Windows Subsystem For Linux With Single Command

Install Windows Subsystem For Linux With Single Command

Quick and Easy Guide to Installing Windows Subsystem for Linux.

By sk
Published: Updated: 2.9K views

Installing Windows Subsystem for Linux (WSL) was previously too complicated. You need to install multiple packages and turn on multiple settings to get WSL working on Windows 10. However, Microsoft has now simplified the WSL installation process!! You can install Windows Subsystem for Linux with single command in Windows 10 version 2004 and higher.

Craig Loewen, program manager of Windows developer platform, has revealed that this functionality is officially available in the latest Windows Insider Preview builds.

To avail this single command WSL installation feature, your system must be running Windows 10 version 2004 or higher, and have the KB5004296 update installed.

Install KB5004296 Update in Windows

Go to Windows update center and click "Check for Updates" button. You might see an available optional quality update. Make sure it has the same number as KB5004296 as shown in the below screenshot.

Click Download and Install button to apply this update.

Install KB5004296 update in Windows
Install KB5004296 update in Windows

After installing the update, reboot your Windows system to apply the changes.

If you have outdated Windows system, you may not see the above update in the first time. First, you need to download and update all available updates in your Windows 10 or 11 system and reboot it to apply all the updates.

Update Windows OS
Update Windows OS

And then once again click the "Check for Updates" button. This time you might see KB5004296 update. Install it and reboot your system.

Install Windows Subsystem for Linux with Single Command

Now, open Command prompt with administrator privilege. To do so, right click on the command prompt and choose Run as administrator option.

Run command prompt as administrator in Windows
Run command prompt as administrator in Windows

From the command prompt, run the following command to install Windows Subsystem for Linux:

wsl --install

This command will automatically enable the required WSL optional features, install the Ubuntu Linux distribution by default, and install the latest WSL Linux kernel version in your machine.

Install Windows Subsystem for Linux with single command in Windows
Install Windows Subsystem for Linux with single command in Windows

Once the Ubuntu installation is completed, reboot your system.

As you may noticed, WSL will download and install Ubuntu Linux by default If no option is specified. You can also install other Linux distributions as well.

To view the list of WSL supported Linux distributions, run the following command in PowerShell or Windows Command Prompt.:

wsl --list --online

You will get the list of available Linux distributions to install.

List available Linux distributions in WSL
List available Linux distributions in WSL

To install a specific Linux operating system with WSL, use -d option like below:

wsl --install -d <DistroName>

Replace <DistroName> with the name of the Linux distribution from the previous list.

Example:

wsl --install -d Debian

Here is a few more commands to manage WSL and installed Linux distributions.

Update the WSL Linux kernel manually:

wsl --update

Roll back to the previous WSL kernel version:

wsl --update rollback

Display the general information about the status of the Windows Subsystem for Linux installation:

wsl --status

This command will displays the details such as default distribution type, default distribution, and kernel version etc.

For more details, check WSL help section:

wsl --help

This will display WSL help manual with list of WSL commands and options.

Conclusion

The recent feature update to install WSL with single command is very useful to someone who wants to quickly setup WSL on a Windows machine. Microsoft dev team has just made it very easier to install Windows Subsystem for Linux in Windows 10 and 11 operating systems.

Resource:

1 comment

Jalal Hajigholamali August 7, 2021 - 11:42 am

Hi,
Thanks a lot
nice article

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More