Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10

Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10
4 min read

If you are using both Linux and Windows, then sometimes the familiar UNIX tools are missing in the Windows shell. These little helpers make life so much easier. That's why it's nicer to have option of installing a full-fledged Linux on Windows for some time. From this Linux, we can also edit the Windows files directly.

The entire installation can easily be carried out with Windows on-board tools. Here is a step-by-step guide to install Ubuntu shell under Windows.

Activate Windows Subsystem for Linux

First we have to activate the functionality for the Windows Subsystem for Linux (WSL for short), to do this we need to start Windows PowerShell as administrator: Then press the Windows key (or select the Windows menu with the mouse) and search by entering Windows PowerShell this shell and then run it as administrator.

Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10
Start Windows PowerShell as administrator

In Windows PowerShell we need to enter this command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

With this we enable this feature under Windows and then have to restart the system:

Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10
Reboot after adjustment

After restarting Windows we can go straight to the installation of Ubuntu. For this we use the current version 20.04 LTS - where LTS stands for Long Time Support, which ensures that there will be updates for this Linux version for five years.

Install Ubuntu 20.04 LTS

Conveniently, we can find the current Ubuntu directly in the Microsoft Store and install it directly from there. To do this, open the Microsoft Store and look for Ubuntu 20.04.

Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10
Ubuntu 20.04 LTS in the Microsoft Store

After the download is finished, you can start the Linux environment directly from the shop with a click on Start.

The new Linux system is now initializing and a short time later it asks us for a username and a corresponding password. Please note: this is an account that is independent of the Windows user, so you can choose a different username and password.

Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10
After the initialization, a new user must be created

We can now open an Ubuntu shell at any time from the Windows menu or simply start it ubuntu2004.exe in a Windows shell.

Getting started in the Ubuntu Shell

And then we can work with the Ubuntu shell as usual. As a first small test, we're looking for updates:

sudo apt-get update

After entering our password, the package list is updated as usual.

Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10
The Ubuntu package list is updated

And now we can already install the new Ubuntu packages by entering the following:

sudo apt-get upgrade

Install Ubuntu with the Windows Subsystem for Linux (WSL) on Windows 10

This process should be carried out regularly so that the Linux remains up to date.

What is where?

By default, we are in our own home directory in our Ubuntu shell. However, this is not the same as our home directory under Windows. Within the Ubuntu shell we find our Windows directory under:

 /mnt/c/Users/WIN-USERNAME

Under Windows our Ubuntu Home directory is located at the somewhat cryptic address:

%LOCALAPPDATA%\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\LIN-USERNAME

What's in it?

Everything. So everything you would find under a normal Ubuntu or any other Linux. And if something is missing, you can install it as normal sudo apt-get install $PAKETNAME.

What is not working?

Finally, I would like to point out the things that don't just work with our new Linux. Basically, no graphical programs work from the shell (unless you install your own X server under Windows). It also doesn't work to access the network interface directly, for example for the tool mtr. Since Windows does not start the Linux system automatically every time it boots and it is not use systemd, we cannot use our own services within the Linux environment.

For the small Linux shell, however, the system is excellent, if you want to use most UNIX tools in the shell and not on a GUI.

In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Jacob Enderson 4.1K
I'm a tech enthusiast and writer, passionate about everything from cutting-edge hardware to innovative software and the latest gadgets. Join me as I explore the...
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up