How to Install Ubuntu in WSL 1 in Just 3 Steps

WSL stands for Windows Subsystem for Linux and it is a feature that allows developers to install Linux distros in Windows where they can run Linux commands, applications, and utilities. WSL 2 is the newest version of WSL which is generally fast and more compatible.  However, some might want to use WSL 1 as it is more compatible with older versions of Windows, it provides better performance across OS file systems and it runs with current versions of VMWare and VirtualBox. In this article, I will show you how to install Ubuntu in WSL 1. In addition, follow this article to know how to install Ubuntu in WSL 2. Furthermore, you can see this article to know how to install Ubuntu in WSL using GUI.

Key Takeaways

  • Enabling the WSL feature in Windows.
  • Installing Ubuntu in Windows using WSL.
  • Checking installed distros and their corresponding WSL version.

Requirements

  • Windows Operating System.
  • Command Prompt.
  • Stable Internet Connection.

Process Flow Chart

[OS Used Throughout the Tutorial: Windows 11]Process flow chart for "wsl install ubuntu"

3 Steps to Install Ubuntu in WSL 1

Here I will show how to install Ubuntu in WSL 1 in three steps.

Step 01: Enable WSL in Windows

In the beginning, I will enable the WSL feature in my Windows by the following steps.

Steps to Follow >

➊ Search the Command Prompt, left-click on the mouse, and then select “Run as administrator” to open it as administrator.Opening Command Prompt❷ To enable WSL, copy the following command and press ENTER:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
EXPLANATION
  • exe: Services Windows images, such as updating, adding or removing features.
  • /online: Specifies that the command should be applied to the running operating system.
  • /enable-feature: Enables a specific Windows feature.
  • /featurename:Microsoft-Windows-Subsystem-Linux: Name of the feature being enabled.
  • /all: Enables all the parent features of the specified feature.
  • /norestart: Prevents the computer from automatically restarting after the feature is installed.
Enabling WSL feature for "wsl install ubuntu"You should see the “The operation completed successfully” message at the end of the process.

❸ Again, to enable Virtual Machine Platform, insert the following command and hit ENTER:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
EXPLANATION
  • exe: Services Windows images, such as updating, adding or removing features.
  • /online: Specifies that the command should be applied to the running operating system.
  • /enable-feature: Enables a specific Windows feature.
  • /featurename:VirtualMachinePlatform: Name of the feature being enabled.
  • /all: Enables all the parent features of the specified feature.
  • /norestart: Prevents the computer from automatically restarting after the feature is installed.
Enabling the Virtual Machine Platform featureWait until you see the “The operation completed successfully” message. This process will enable the Virtual Machine Platform feature which allows users to run virtual machines natively on Windows.

❹ Then restart the computer.

Step 02: Install Ubuntu in WSL

Now I will install Ubuntu on WSL. However, you can install other distros as well.

Steps to Follow >

➊ At first, write the following command to list all the available distros and press ENTER:

wsl --list --online
EXPLANATION
  • wsl: Manages WSL.
  • –list: Lists installed or available distros.
  • –online: Lists only those distros which can be downloaded online.
Listing available Linux distrosHere, you can see the “Name” and “FRIENDLY NAME” of all the available distros. I will install “Ubuntu-22.04”.

❷ Now copy the following command to install Ubuntu and hit ENTER:

wsl --install Ubuntu-22.04
EXPLANATION
  • wsl: Manages WSL.
  • –install: Installs a new Linux distro.
  • Ubuntu-22.04: Name of the distro which is being installed.

❸ Give your username.

❹ Finally, set a password.Installing UbuntuRemember, this whole process can take a while. You should see the “Installation successful!” message and at the end, you will see a Ubuntu shell where you can run Linux commands.

Step 03: Change WSL Version

As I am showing you how to install Ubuntu in WSL 1, I will now change the WSL version to 1, which is 2 by default mostly.

Steps to Follow >

❶ First, open the Command Prompt as “Run as administrator

❷ Write the following command and hit ENTER:

wsl --set-version Ubuntu-22.04 1
EXPLANATION
  • wsl: Manages WSL.
  • –set-version: Sets WSL version of a distro.
  • Ubuntu-22.04: Name of the distro.
  • 1: WSL version.
Setting WSL versionThis process may take some time. Wait for the “The operation completed successfully” message.

❸ (Optional) To list the installed distros and their corresponding WSL version, use the following command:

wsl --list --verbose

OR,

wsl -l -v
EXPLANATION
  • wsl: Manages WSL.
  • -l,–list: LIsts distros that are currently installed.
  • -v,–verbose: Shows additional information.
Listing installed distros with their wsl versionAs you can see, the WSL version for Ubuntu is 1 which was our goal.

❹ Now you should find Ubuntu in your Windows like below.Finding Ubuntu in Windows

Conclusion

WSL is a useful feature as you don’t need to install an additional virtual machine to run Linux distros. In addition, it is lightweight and consumes less system resources. In this article, I have provided all the steps to install Ubuntu in WSL 1. Hopefully, you find this article helpful.

People Also Ask

Where is Ubuntu WSL installed?
The Ubuntu WSL is installed on a virtual disk named ext4.vhdx and it can be found under %userprofile%\AppData\Local\Packages\Canonical…\LocalState\ext4.vhdx
Is WSL installed?
To check if WSL is installed, you can use the command wsl -l -v in Powershell or Windows Command Prompt. This will show all the installed Linux distros and corresponding WSL versions.
Is WSL a virtual machine?

WSL feature allows a user to run Linux distro in Windows. It is not a virtual machine, however, it uses a virtual machine platform.

Do I need to enable Hyper V for WSL?
You don’t need to enable Hyper-V for WSL, however, you need to enable the Virtual Machine Platform feature.

Related Articles

Rate this post
Walid Al Asad

Hello Everyone! I am Walid Al Asad. Currently, I am working at a tech company named Softeko as a Linux Content Developer Executive. I live in Dhaka, Bangladesh. I have completed my BSc. in Mechanical Engineering from Bangladesh University of Engineering and Technology (BUET). You can find me on LinkedIn, and ResearchGate. Read Full Bio

Leave a Comment