Linux is an operating system just like Windows or macOS and is preferred by people like professional developers or network operators. Although Linux is not limited to professional use as many people like coders would want to use Linux for its open-source nature and other functionalities. But if you have been using Windows as your OS for a long time, switching to Linux can be quite a hassle.
Here comes the Windows Subsystem for Linux. It can be considered as a middle ground because the Windows Subsystem for Linux is an environment which after setting up, will allow you to run Linux command lines and applications, just without a graphical interface. This article will show you how easily you can set up Windows Subsystem for Linux on your computer and use it.
What is WSL or Windows Subsystem for Linux?
Windows Subsystem for Linux is the name of the feature, that after enabling creates a virtual environment to run Linux distributions. The benefit of using this feature is that you will not have to flush the Windows OS for it which allows you to simultaneously run Windows and also distribute Linux like a virtual machine. Depending on the distribution of Linux you choose to use, you might or might not get a graphical interface.
The WSL allows virtualization of a Linux distribution or kernel, on top of the Windows platform. There are multiple distributions or kernels are available in Windows OS like Kali Linux, Ubuntu, Debian, and AlpineWSL. With the virtualized kernel you perform multiple actions like run application, act as a Virtual Machine, and have similar functions, etc.
Enabling Windows Subsystem for Linux from the Control Panel
First, search for ‘Control Panel’ in the Start Menu search and select it from the search results.
On the Control Panel window, click on ‘Programs’.
After that, under the Programs and Features section, select the ‘Turn Windows feature on or off’ option.
A new window called ‘Windows Features’ will appear. Scroll down in the features list, tick the box before ‘Windows Subsystem for Linux’ and then select ‘OK’.
After you press OK, windows will automatically start to download and install the feature. A new window, called ‘Windows Features’ will appear where you can monitor the download process.
After the download is finished, you have to restart your computer to finish the installation process. Click on ‘Restart now’ to quickly restart your computer.
Enabling Windows Subsystem for Linux via the Windows PowerShell
Windows PowerShell is an administrative tool that can be used to run command lines. That is what we need to do in order to install the Windows Subsystem for Linux. Running the following command will automatically begin the installation process.
To start, first, go to Start Menu search and type ‘Windows Powershell’. Right-click on the app from the search results and select the ‘Run as Administrator’ option.
On the PowerShell window, copy & paste the following command and then press ‘Enter’ on your keyboard.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
After you press Enter on your keyboard, PowerShell will ask you to restart your computer. Press Y on your keyboard and then Enter to initiate the restart.
Download a Linux Distribution
Now that you have enabled and installed Windows Subsystem for Linux, all you need is to download a Linux distro or distribution to start using Linux on your computer. Thankfully, you don’t have to go search on the web to download a distro from a third-party site. In Windows 11, you can download the Linux distro right from the Microsoft Store.
Open the Microsoft Store by searching for it in Windows Search and selecting it from the search results.
On the Microsoft Store window, type Ubuntu in the search bar located on the top of the window and select the app from search results.
Once the application page opens, click on the blue ‘Get’ button.
After you click on ‘Get’ the Linux distro will be downloaded and now you can run Linux commands and applications on your Windows 11 computer.
How to Uninstall Windows Subsystem for Linux
To uninstall Windows Subsystem for Linux completely from your system, you have to start by removing the distro first. In order to do this, first press Windows+i to open the Settings menu. On the Settings window, select ‘Apps’ from the left panel and then select ‘Apps & features’ from the right panel.
After that, scroll down on the apps list and locate ‘Ubuntu’ or the distro that you have installed from Microsoft Store. Click on the 3 vertical dots and then select ‘Uninstall’.
After that, click on ‘Uninstall’ and the distro will be removed from your computer.
After you have uninstalled the distro, now it is time to disable the Windows Subsystem for Linux. To do that, open up the Control Panel once again by searching for it in the Start Menu search.
On the Control Panel window, click on ‘Programs’.
After that, under the Programs and Features section, click on the ‘Turn Windows features on or off’.
A new window will appear called ‘Windows Features’. From there deselect the box before ‘Windows Subsystem for Linux’ and then click on ‘OK’.
Now you have completely removed the ‘Windows Subsystem for Linux’ from your computer. You should restart your computer after pressing ‘OK’ to complete the uninstallation process.
This is how you enable or Disable the WSL or Windows Subsystem for Linux on your Windows 11 computer.