How to Set Up the Linux Subsystem on Windows, Manage It, and Install Different Distributions

| 3 min read

Introduction

Greetings dear readers, and welcome to a new article ✨.

In this article, we’ll discuss how to enable or install the Windows Subsystem for Linux (WSL) — or download it if it’s not present (especially if you’re using Windows 10), along with some useful commands and how to install various supported distributions.

All this and more will be covered here — so get ready and let’s begin!

Requirements for Using the Windows Subsystem for Linux

Here are the requirements to use or install WSL:

  • Technical requirements: A processor that supports x64 architecture.
  • RAM: Minimum 4GB (16GB or more is recommended).
  • Virtualization: Must be enabled (configured through BIOS).
  • Software requirements: You must have Windows 11 or Windows 10 version 19041 or newer.

    You can always check your Windows version by searching for the app winver.


Before Installation

You’ll need to enable two important Windows features. From the Start menu, search for Turn Windows features on or off and enable the following options:

  1. Virtual Machine Platform.
  2. Windows Subsystem for Linux.

After enabling them, restart your computer and continue with installation…

Installation Process

Using the terminal (called “terminal” on Windows 11), or if you’re on Windows 10 you can install it from the Microsoft Store.

Quick note: Before installing any distribution, update the WSL package to avoid issues:

wsl --update

Now, to install Ubuntu (the default distribution for WSL) enter:

wsl --install -d ubuntu
  • If you receive an error saying the (wsl) command isn’t recognized (this happens on Windows 10), it means the package isn’t installed. To fix this, run:
winget install Microsoft.WSL

Note: It’s best to run as admin user to avoid problems.

If you don’t want to use the terminal, you can simply search for (Ubuntu) in the Microsoft Store and download it from there.

Once Ubuntu finishes downloading, you’ll be asked to reboot. After that, open the terminal and launch the Linux terminal with:

wsl -d ubuntu

On your first launch, you’ll be prompted to set a username and password. Congratulations, you are officially a Linux user!


How to Install Other Distributions?

It’s straightforward — just list the available distributions using this command:

wsl --list --online

Then choose the one you want from the list of supported distributions. For example, to install Kali Linux:

wsl --install -d kali-linux

Once the installation is complete, you’ll have a new distribution to use!


Some Important Commands

  • To view all installed distributions:
wsl --list
  • To show more details about distributions, like their status, default distribution, and whether they’re running:
wsl --list --verbose

You’ll notice a star next to Ubuntu — that means it’s the default. You can change the default with the following:

  • To change the default distribution:
wsl --set-default [distro name]
  • To shut down all distributions:
wsl --shutdown
  • To shut down a specific distribution:
wsl --terminate [distro name]
  • To remove a specific distribution:
wsl --unregister [distro name]

Does WSL Support GUI Applications?

Absolutely! You can test this by installing, for example, the GNOME text editor:

sudo apt update && sudo apt install -y gnome-text-editor

Conclusion

Finally, thank you dear reader for making it to the end of this blog post. I hope you enjoyed it, and until next time, I wish you well and good health! Goodbye 🖤.