WSL: What is and How to Use the Windows Subsystem for Linux

For many years, the only ways to use Linux together with Windows have been to either install a Dual-Boot with the two operating systems (being able to use only one at a time), or mount a virtual machine with the second operating system in she. Linux and Microsoft have been rivals for many years, and have been vying to gain the trust of users. However, and for the good of all, this rivalry has become friendship, and for some time now we can do what we have never imagined before: install Linux on Windows 10. This is WSL.

WSL, Windows Subsystem for Linux , or Windows Subsystem for Linux, is a feature introduced in Windows 10 that allows us to install a Linux Kernel directly on the Microsoft operating system. This is possible thanks to Microsoft’s Hyper-V virtualization, and by doing so we will be able to access all the commands and all the terminal programs of this operating system directly from a CMD window.

WSL: How to Use the Windows Subsystem for Linux

The installation of Bash Linux on Windows is a very fast and simple process that hardly requires any configuration. In addition, it is very safe, because although you can access the Windows file system and interact with the Microsoft operating system, nothing we do in this Linux can make Windows 10 stop working. A simple reinstallation of Linux will return everything to normal operation. Also, since only the Kernel is loaded, it is a very light implementation that hardly influences the general performance of the PC.

WSL Advantages

The Windows Subsystem for Linux can be useful both for amateur users who are beginning to take their first steps in this operating system and for advanced users and system administrators.

The main purpose of WSL is to enable system administrators, and programmers, to use all Linux tools and services directly from Windows without having to virtualize anything else or mount complicated infrastructures. In the end, we will be able to do everything we could do if we installed Linux on a virtual machine or another PC, and we used it from terminal or TTY. All Linux commands should work fine in Windows, like apt or dpkg. We can even compile code directly from here with the advantages that Linux provides in this regard.

But this implementation is also useful for users who are taking their first steps within Linux systems. Thanks to it, any user can have all the Linux tools at their fingertips without having to configure or virtualize anything. And, in addition, you will be sure that if something goes wrong, you will only have to reinstall the distro in WSL, since Windows 10 will not be compromised.

Furthermore, although it is not yet available, in the future it will even be possible to run programs with a graphical interface .

Disadvantages and limitations

One of the main limitations of WSL is that it is not a native Kernel, but depends on Hyper-V . And this brings with it a series of problems and inconveniences, such as, for example, scalability and performance when executing certain tasks. We should also bear in mind that WSL1 does not have kernel-level support , so some programs, like Docker, will not work. This has already been fixed in WSL2.

Network connectivity works in WSL, but it must go through several layers. This implies a considerable loss of performance when executing processes that operate at a low network level. And, in addition, there are peripherals that do not work properly due also to how Hyper-V controls this Linux.

WSL1 vs WSL2

With the May 2020 update for Windows 10, Microsoft brought WSL2 users, an updated and improved version of WSL1. The main difference between the first version and the second version of this subsystem is that while the first version ran at an intermediate layer between the hardware and the operating system, WSL2 now has its own Hyper-V virtual machine which, along with A Kernel specially compiled for this purpose, allows much better interaction with system calls, improving performance and all the possibilities it offers us.

WSL2 has a native hypervisor that allows you to run a real Kernel directly in Windows . With this, all performance problems and compatibility with services and programs are solved, even achieving a performance improvement of up to 500% when performing certain tasks. The input and output of data has also been improved considerably, and can even be accessed from the file explorer itself, and it is also much faster and easier to change the distribution.

WSL2 vs virtual machine

So what advantages (and disadvantages) does WSL2 bring compared to installing Linux on a virtual machine like VirtualBox or VMware? The first difference is that, while Linux in a virtual machine is isolated, WSL2 is fully integrated with Windows, so both systems can interact with each other. Also, the Windows Subsystem can load Linux in just one second, while a virtual machine is considerably slower when it comes to booting the system.

The consumption of resources is also very considerable. While WSL2 is very light and consumes very little RAM , a virtual machine consumes much more resources in this regard.

And, while it is true that a virtual machine offers more control and more customization options , Windows Subsystem for Linux only runs when we need it, and only loads the processes and services necessary for what we need to do.

If we do not know which system to use, we recommend using a virtual machine when:

  • Let’s need to get the most out of Linux.
  • Let’s have scalability forecast based on production levels.
  • We want to use an operating system with graphical interface and applications.
  • Let’s go to make intensive use of the network where performance is essential.

And we can opt for WSL when:

  • We want to run basic Linux commands.
  • We want to spend little memory and few PC resources.
  • Let’s need storage efficiency.
  • We don’t want / can / know how to use virtual machines.
  • We want quick access to the file system, and to interact with the Windows file system directly.

How to activate Bash in Windows 10

The process to use Linux from Windows 10 is mainly divided into two parts. The first of these is to activate the Linux Subsystem for Windows. To do this, in the search section of Windows 10 we must search for ” Windows Features ” in order to open the tool that allows us to enable or disable advanced system tools and services.

Abrir características de Windows 10

In the new window that will appear we will have to activate two boxes. The first one will be Hyper-V , in order to activate the Windows 10 hypervisor, and the second one will be the Windows Subsystem for Linux .

We accept the changes, we restart the PC when requested, and when the computer starts up again, it will be ready to run Linux. If we prefer, we can do the same by running the following command in a PowerShell window with Administrator permissions:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Activar WSL desde PowerShell

And, with the arrival of WSL2, we can also activate this console with a simple CMD command:

wsl --install

Instalar WSL2

Download Linux on Windows 10

We already have WSL activated, but at the moment it is useless. In order to start using it, we have to download the distro that we want to install in our Windows 10. Although little by little there are more distros adapted to this subsystem, the number of available alternatives is still quite limited. And it is not worth downloading them from any site, but we have to download them from the Microsoft Stores.

We can find all the distros for WSL from the Microsoft Store by typing “Linux” in the store browser.

Linux en la MS Store

The main distributions that we can find are the following.

Developer: Canonical Group Limited
Price: Free


Developer: SUSE
Price: Free


Developer: SUSE
Price: Free


Developer: Kali Linux
Price: Free


Developer: The Debian Project
Price: Free


Developer: agowa338
Price: Free


We download the distro we want from the store and install it in Windows 10. It would be ready to start using it. But first of all we are going to make sure that we use version 2 of WSL to be able to enjoy its advantages. We can do this by opening a PowerShell window with Administrator permissions and executing the following command, changing “distro” by the name of the distro that we have downloaded.

wsl --set-version distro 2

If we don’t know the name of the distro, we can see all the ones we have installed with the command:

wsl --list --quiet

This command will take a few minutes to execute. When it finishes, we will already have our WSL2 with the distro that we have chosen ready to use it.

First use

The first time we open the distro, it will start an automatic installation and configuration process . This process will not take long, and at one point it will ask us to specify the username and password that we want to give it.

After this initial configuration, our Linux inside Windows 10 will be ready to use it. But first of all, we must update it. We can do this easily just like updating Linux on a real computer or a virtual machine. It will be enough to execute:

sudo apt update && sudo apt upgrade

Ubuntu Subsistema Linux para Windows

How to open Linux in Windows 10

Thanks to WSL we will be able to use Windows tools and programs directly from CMD or PowerShell. To do this, we simply have to run the “wsl” command, followed by the command we want to run, in the PowerShell window. For example, “wsl ls” will show us the content of the current directory.

But if we want to have direct access to the terminal of the Linux distro, then what we must do is find the launcher of the installed distro in the Windows start menu, and run it from there. We can also run the command “bash.exe” from PowerShell to launch the full Linux implementation on Windows.

The WSL console will have an appearance similar to that of a Linux terminal , and we will differentiate it because, in addition to the distro logo appearing in the title bar of the window, we can see that the lines begin with user @ team.