Home Ubuntu How to Install Ubuntu on Windows Using WSL

How to Install Ubuntu on Windows Using WSL

This blog will offer an optimal solution for installing the latest as well as a specific version of Ubuntu in your Windows by using WSL.

What is WSL?

WSL (stands for “Windows Subsystem for Linux“) is a feature of Microsoft Windows that allows the user to run Linux distribution alongside Windows by utilizing a compatibility layer. It was released in 2016, however, the current version is WSL 2, which supports numerous Linux distributions including Ubuntu, Debian, and Fedora.

WSL is a beneficial feature for developers as it eliminates the need for extra hardware, virtualization, or dual-boot setups to manage Linux file systems or to access Linux command-line and tools.

With WSL, one can seamlessly switch between Windows and Linux workflows, enabling them to take advantage of Linux-specific tools while still enjoying the features of Windows as their primary operating system.

Let’s start the installation process of Ubuntu on Windows by using WSL 2.

Enable Windows Subsystem for Linux on Windows

To enable WSL, press the “Windows Logo + S” keys and search “Turn Windows features on or off”, then, click on the “Open” option.

Turn Windows Features
Turn Windows Features

The Windows feature dialogue box will open. Here, locate the option “Windows Subsystem for Linux” and select the checkbox associated with it. Finally, click on the “OK” button:

Enable Windows Subsystem for Linux
Enable Windows Subsystem for Linux

Now restart your Windows to enable WSL.

Install Ubuntu on Windows via WSL

The process of installing Ubuntu on Windows by using WSL is quite straightforward.

To install the latest version of Ubuntu by utilizing WSL, simply run “Windows PowerShell” as administrator:

Windows PowerShell
Windows PowerShell

Then, type the command listed below to automatically install and set up WSL along with the default version of Ubuntu:

$ wsl --install

This command takes care of everything including turning on the required features of Windows, installing the WSL Linux kernel update package, and setting up Ubuntu.

Install Ubuntu on Windows
Install Ubuntu on Windows

Once the installation process completes, reboot your Windows system to access Ubuntu. After the reboot, the further installation and launching process of Ubuntu will automatically start and will consume some time, so wait for its completion:

Launching Ubuntu on Windows
Launching Ubuntu on Windows

The next step is to provide the username for Ubuntu (22.04) and also set its password. After it, you will be able to execute Ubuntu commands:

Setup Ubuntu on Windows
Setup Ubuntu on Windows

Let’s try this by executing, the apt update command:

$ sudo apt update
Update Ubuntu on Windows
Update Ubuntu on Windows

It is visible that your Ubuntu has started the process of updating the local repository cache.

Install Specific Ubuntu Version on Windows via WSL

However, if you want to install a specific previous version of Ubuntu on Windows. Then, head to Microsoft Store after following the previous steps or simply enables the Windows Subsystem for Linux as shown in the “Enable WSL” section of this blog:

Microsoft Store
Microsoft Store

In the Microsoft store, search for the desired version of Ubuntu. For instance, let’s search “Ubuntu 18.04”:

Search Ubuntu on Microsoft Store
Search Ubuntu on Microsoft Store

Then, click on the “Get” button and wait for the completion of the installation process:

Install Ubuntu via Windows Store
Install Ubuntu via Windows Store

Once the Ubuntu is installed, click on the “Open” button:

Open Ubuntu on Windows
Open Ubuntu on Windows

The Ubuntu 18.04 will launch successfully, now set its username and password:

Start Ubuntu on Windows
Start Ubuntu on Windows

You can even check the version of installed Ubuntu by executing the command mentioned below:

$ lsb_release -a 
Check Ubuntu on Windows
Check Ubuntu on Windows

Now close the terminal to shut down Ubuntu.

You can search Ubuntu to view and open your already installed Ubuntu from the Start Menu.

Search Ubuntu on Windows
Search Ubuntu on Windows
Conclusion

WSL (Windows Subsystem for Linux) is a feature offered by Microsoft that allows the user to run a Linux distribution alongside Windows 10. It supports many Linux distributions including Ubuntu, Fedora, and Debian.

This guide provided a solution for installing the latest/specific version of Ubuntu on Windows by using WSL.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.