How to install Windows Subsystem for Linux(WSL2) on Windows 11

In this article, we will see how to install Windows Subsystem for Linux on Windows 11.

The Windows subsystem lets developers run a GNU/Linux environment including most command-line tools, utilities and applications directly on Windows.

We can do following activities with Windows Subsystem for Linux on Windows 11:

  • Run common command-line tools such as sed, awk, grep or other binaries.
  • Run bash shell scripts and GNU/Linux command-line applications like vim,emacs,tmux, nano and languages NodeJS, Javascript, Python Ruby,C/C++,Go,Rust,..
  • Install additional software using our own GNU/Linux distribution manager.
  • Invoke Windows applications using a Unix-like command line shell.

Invoke GNU/Linux applications on Windows.

Install Windows Subsystem for Linux(WSL) on Windows 11

WSL installation requires to restart Windows 11 machine. So, we must have permissions to restart the Windows 11 machine.

1. Open command prompt or PowerShell as administrator.

2. Run the following command on either command prompt or PowerShell.
Following command will enable the required optional components, downloads the latest Linux kernel, and sets WSL as our default and downloads Ubuntu.

wsl --install

How to install Windows Subsystem for Linux(WSL) on Windows 11

PS C:\windows\system32> wsl --install Installing: Windows Subsystem for Linux Windows Subsystem for Linux has been installed. Downloading: WSL Kernel Installing: WSL Kernel WSL Kernel has been installed. Downloading: GUI App Support Installing: GUI App Support GUI App Support has been installed. Downloading: Ubuntu The requested operation is successful. Changes will not be effective until the system is rebooted.

3. Reboot the Windows 11 machine to effect the changes.

4. After reboot, open PowerShell as administrator and run the following command to check the list of Linux distributions and version of WSL.

wsl -l -v

5. To find the list of available WSL distros run the following command.

wsl --list --online

6. To install the WSL with a specific distro on Windows 11 run the following command.

Here Distro-Name can be any of the following
Ubuntu
Debian
kali-linux
openSUSE-42
SLES-12
Ubuntu-16.04
Ubuntu-18.04
Ubuntu-20.04

wsl --install -d DISTRO-NAME

After install, we have to restart Windows 11 machine.

Update WSL kernel on Windows 11

To update the WSL kernel to the latest version. we have to run following command.

wsl --update

So in this article, we have seen how to install WSL2(Window subsystem for Linux) on Windows 11 step by step.

Leave a Reply

Your email address will not be published. Required fields are marked *