Installing a Linux distribution within Windows with WSL 2

Ronaldo B.July 27, 20222 min read

In 2015, Satya Nadella, the current CEO of Microsoft, made a statement that left many people surprised. He said that "Microsoft loves Linux". And in recent years, the Software Giant has been increasingly developing solutions that help us work with the Linux Operating System. For example, in 2016, WSL (Windows Subsystem for Linux) was created. It is a module of Windows 10 that allows us to create a Linux environment inside our Windows computer. But with one detail: we don’t need to use any kind of virtual machine tools, like VirtualBox. Our own machine starts to support Linux commands. Incredible, isn’t it?

In this article, we will see how simple it is to enable this feature on our computer and install an Ubuntu system on WSL.

Installing WSL

To enable this feature on our computer, we can type in our search menu the phrase “Turn Windows features on or off”.

Windows features activation option

Or if you prefer, you can go to Control Panel > Programs > Turn Windows features on or off.

Windows features activation option from Control Panel

The next window that will open will show a list of Windows features. We will select the option “Windows Subsystem for Linux”. Then we will click “Ok”.

Option to start the Windows Subsystem for Linux

You will be prompted to restart the computer for the changes to take effect.

After restarting Windows, we will access the Microsoft Store.

Option to open the Microsoft Store

When opening this application, we will search for the distribution we want. In our case, we will search for "Ubuntu" and choose Ubuntu 20.04 LTS:

Ubuntu distribution option in the Microsoft Store

We chose version 20.04, but you can use the version you want.

We will see an option to install the application, which may appear as "Get" or "Install".

Option to install Ubuntu on Windows

After downloading and installing the application, it will already be available for us in the list of applications:

Ubuntu 20.04 in the list of applications on Windows

By clicking on this application, Ubuntu will start. We will be able to add our username and password and then we will see a success message informing us that Ubuntu was installed successfully:

Message indicating that Ubuntu was successfully installed on Windows

Very simple, isn’t it?

In this article, we learned how to install a Linux Operating System on our Windows, without needing any external tools for virtual machines.

With this application installed, we will be able to run tests or even program on Ubuntu without many difficulties ?.

See you in the next article.

Keep learning with Hcode

Sign up for the course platform and follow the next blog guides.