How to install Windows Subsystem for Linux (WSL)

Advertisements by Google

On Windows 10, the Windows Subsystem for Linux (WSL) is a feature that creates a lightweight environment that allows you to install and run supported versions of Linux (such as Ubuntu, OpenSuse, Debian, etc.) without the complexity of setting up a virtual machine or different computer.

Although you won’t get a graphical interface, this approach enables developers and network administrators to use a long list of command tools and services (such as vim, tmux, andemacs, sshd, Apache, and MySQL), and run Bash shell scripts written in Python, Ruby, C#, F#, and many others using a command console.

Install WSL with a Command

Microsoft has made this process extremely simple on Windows 11. You can enable the Windows Subsystem for Linux and install a Linux distribution like Ubuntu with a single command.

To do this, you will need to use a command-line window with Administrator permissions. We’ll do this with the Windows Terminal, although you can also just launch Command Prompt.

To launch a Windows Terminal with Administrator permissions, right-click the Start button on the taskbar or press Windows+X and click “Windows Terminal (Admin).” (You can also find the Windows Terminal shortcut in your Start menu—right-click it and select “Run as Administrator.”) Agree to the User Account Control prompt that appears.

Right-click the Start button and select "Windows Terminal (Admin)."

To enable the Windows Subsystem for Linux and install Ubuntu, which is the default distribution, just run the following command:

wsl --install

When the process is complete, Windows will ask you to reboot your PC. Restart your computer. You’ll be able to use your Linux system after you do. (You can right-click the Start menu and click Shut Down or Sign Out > Restart to quickly reboot.)

Run the "wsl --install" command.

To list other available Linux distributions, run the following command instead. This lists (-l) distributions that are available online (-o).

wsl -l -o

You can install a Linux distribution of your choice by running the following command, replacing “Name” with the name of the Linux distro, as displayed in the “Name” column:

wsl --install -d Name

For example, to install Debian instead of Ubuntu, you’d run:

Advertisements by Google
wsl --install -d Debian

You can also run this command multiple times to install several Linux distributions on your system.

List available Linux distributions and install one.

Once your computer has rebooted, you can launch the Linux distro that you installed from your Start menu.

Launch the "Ubuntu" shortcut.

You’ll also find it as an option in the Windows Terminal app. Click the down arrow to the right of the new tab “+” button on the tab bar and select the Linux distribution that you installed.

Tip: If you don’t see the Linux distribution that you installed in the Windows Terminal, launch it from your Start menu first. After it completes its first-run setup process, it will appear here.
Click the down arrow and select your Linux distribution.

Now, you can use the Linux shell just as if you were sitting in front of a PC Linux—or as if you were remotely connected to a server running Linux. You’ll just need to know Linux commands.

The Slow Way: Enable WSL and Install a Distro

You can also enable the Windows Subsystem for Linux (WSL) the older way. This takes more clicking, and we recommend just running the command above.

To do this, open your Start menu and search for “Windows features.” (You can press the Windows key to open the Start menu and just start typing.) Launch the “Turn Windows Features On or Off” shortcut.

Enable the “Windows Subsystem for Linux” checkbox here and click “OK.” You will be prompted to reboot your computer.

Enable the "Windows Subsystem for Linux" option and click "OK."

After you do, open the Microsoft Store app and search for the Linux distribution that you want to use. For example, you might search for “Ubuntu.”

Install the Linux distribution that you want to use (like Ubuntu) as you would any other application. Just click the “Install” button on its Store page.

You can now launch it from your Start menu just as if it were installed from the command above.

Install Ubuntu from the Microsoft Store.

Advertisements by Google

Related Posts

Leave a comment

Privacy Preferences
When you visit our website, it may store information through your browser from specific services, usually in form of cookies. Here you can change your privacy preferences. Please note that blocking some types of cookies may impact your experience on our website and the services we offer.
%d bloggers like this: