Install Windows Subsystem for Linux on Windows 11 and Run GUI Apps

How to Install the Windows Subsystem for Linux on Windows 11

Want to install Install the Windows Subsystem for Linux on Windows 11. Read this article to find out the easiest method to do so. By running a single command you will be able to install Ubuntu on your Windows PC/Laptop.

Microsoft is slowly integrating other OS functionality to Windows to make it more useful. Recently in Windows 11, Microsoft introduced Windows Subsystem for Android to run Android Apps in Windows. You can even install Play Store as well through WSA. But, you need WSL to install it. Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 11 and Windows 10. In simple words, with WSL, you can run Linux GUI Apps in Windows. So now you don’t need to dual boot in order to run or test Linux apps. It’s quite good for developers.

A year back, Microsoft announced WSL 2, which brings real Linux kernel, through a subset of Hyper-V features. There are two ways to install a Linux bash shell in Windows. You can either manually enable WSL and install the Linux distro.

Or, you can install Windows Subsystem for Linux using the command. Using the command to install WSL is the easiest way, so let’s get started with it.

Install Windows Subsystem for Linux on Windows 11

Enable Developer Mode

Before we start WSL installation make sure developer mode is enabled. WSL & WSA is not designed for normal Windows users. So to make them work, you have to enable developer mode from Windows settings.

  1. Open Windows Search, and search for Developer Settings. Developer Settings will appear in search results. Click on Open.
  1. Windows 11 Developer Settings page will now get open. Do Enable Developer Mode from it.
  1. Once you enable developer mode. A confirmation window will appear, click on Yes.
Enable Windows 11 Developer Mode
  1. That’s it, developer mode is now enabled. Let’s move to the WSL Installation Process.

Install WSL with Ubuntu

By default, WSL gets installed with the latest version of Ubuntu. Ubuntu is one of the stable Linux Distro. Though, you can also install a Linux distro of your choice.

  1. Right-Click on the Windows 11 start button and then click on Windows Terminal (Admin).
Run Windows Terminal as Administrator

UAC window will appear to click on Yes.

  1. Windows PowerShell/Terminal window will get open. First type the following command in it, and hit enter to change directory to C Drive.
cd C:/
  1. After that, run the following command to install WSL with Ubuntu.
wsl --install
Install Windows Subsystem for Linux with Ubuntu Windows 11
  1. The above command will install Windows Subsystem for Linux, WSL kernel, GUI App support, and Ubuntu one by one.
  1. If due to some reason above command doesn’t work then run the following command.
Alternative Command to Install WSL - wsl.exe --install -d ubuntu
  1. Once all things get installed, you will get a message to reboot your system. So now do restart Windows 11.
  1. Once Windows get restarted. Automatically Ubuntu installation window will get appear.
  1. And, once Ubuntu gets installed. It will ask you to enter the UNIX username and password.
Setup UNIX username and password - Ubuntu Installation Sucessful
  1. Setup the username and password of your choice. Also, do remember the password. Once you set up user information, WSL installation will get completed.
  1. You will now be able to see the installed ubuntu version and other information.
Ubuntu 20.04 LTS installed on Windows 11

Check WSL Version

You can also check WSL Version and Installed Distro Information by running the following command in Windows Terminal. Don’t forget to change the directory to C before running the command.

wsl --list --verbose
Check WSL Version

Install Specific Linux Distro

If you don’t want to install and use a specific Linux Distro, that is also possible.

  1. Open Windows Terminal again by right-clicking on the start button.
  1. Once Windows Terminal gets open, first change the directory to C.
cd C:\
Change Directory
  1. Now, type the following command to list down all available Linux distro for Windows Subsystem for Linux.
wsl --list --online
Windows Subsystem for Linux available Linux Distro
  1. For instance, I am going to install Debian. You just have to replace the name of the distro in the following command.
wsl --install --d debian
Install debian on Windows 11
  1. That’s it, Debin will now get downloaded and get installed automatically. Since the WSL component is already installed, so you don’t have to restart Windows this time.
  1. Once Debian gets installed, Debian’s GNU/Linux window will appear. And, it will ask UNIX username and password.
Debian Installed setup username and password

7. Enter new UNIX and Password for Debian. And, Installation successful message will appear.

Update Windows Subsystem for Linux (WSL)

It is optional to update Windows Subsystem for Linux. But, I will suggest you update. Sometimes, Microsoft releases an important update, like a kernel update. It is necessary to update from time to time, in order to work Linux bash shell work flawlessly.

  1. Open Windows Terminal/PowerShell window and do type the following command.
wsl --update
  1. This command will check and download updates automatically.
  1. After updating WSL, do type the following command to shutdown all running Linux distro
wsl --shutdown
Shutdown all distro and restart Windows to update kernel
  1. Now restart Windows PC to apply WSL updates.

Install Linux GUI Apps on Windows 11

Yes, you can run certain Linux GUI Apps in Windows 11 through Commands.

  1. First, we will run a command to install all components required to install Linux GUI Apps.
  1. Click on the Start button and open a Linux distro that you’ve installed. I am opening Ubuntu here.
Run Linux Distro
  1. Once the Ubuntu bash shell gets open, run this command to install the required components.
sudo apt-get update
Update Linux Distro Components
  1. Ubuntu will now ask for the UNIX password that you have entered during installation. Type password and press enter.
  1. Now wait for all updates to get installed.
  1. Now we are going to type a command to install the gedit text editor.
sudo apt-get install gedit -y
Install Gedit on Linux

-y command will suppress many prompts here.

  1. The process will now take time. Once installation gets complete. You just have to type the application name to open it.
  1. Type gedit and press enter to run gedit text editor. Alternatively, you can search for Text Editor (Ubuntu) in Windows search.
Open Gedit

That’s it, now you can run Linux GUI Apps on Windows by running commands. Ok, so this was the method to install Windows Subsystem for Linux on Windows and install WSL updates.