Introduction

One of the biggest disagreements I’ve encountered in my short journey in the development world is whether to use Windows or Linux. Most people use the second option but many still use Windows for other reasons and don’t use Linux frequently. That’s why Microsoft developed WSL (Windows Subsystem for Linux) which allows us to emulate a Linux inside Windows.

This is extremely useful as it will allow us to unify the consoles and use all the commands and connect your preferred environment and work as if you were on a Linux system.

Requirements

  • Have Windows updated to at least version 2004.
  • Enable HYPER-V virtualization in the BIOS (For this you will have to enter the BIOS and change it manually according to your PC model)

Process

To check your Windows version press Windows + R key and type: winver. This will let you see the most recent version installed.

Now we’re going to search in Windows for “Turn Windows features on or off” and check the 2 that we see in the image:

If you want to know what distributions you have installed we would have to open a console and type the command wsl –list

We proceed to install any distribution, in my case I will use Debian, which I will download from the official Microsoft store

We now have Debian installed on our system, when we start it a console will appear where we will already have WSL installed. We register with lowercase username and password.

So far there is no problem, but it would be advisable to update WSL to WSL2, which offers us better performance by incorporating a real Linux kernel.

To do this we have to execute a command from Debian

In my case an error occurred that asks me to update the kernel. To do this I went to the Microsoft page and downloaded an .msi file which you simply run and accept.

With this we execute the previous command again and it will work

👏We would now have WSL2 with Debian installed on our Windows system 👏