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.
Process flow chart to install Ubuntu in WSL 1:
[OS Used Throughout the Tutorial: Windows 11]
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:
- Search the Command Prompt, left-click on the mouse, and then select “Run as administrator” to open it as administrator.
- To enable WSL, copy the following command and press ENTER:
You should see the “The operation completed successfully” message at the end of the process.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Again, to enable Virtual Machine Platform, insert the following command and hit ENTER:
Wait 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.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- 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. Follow the steps carefully:
- At first, write the following command to list all the available distros and press ENTER:
Here, you can see the “Name” and “FRIENDLY NAME” of all the available distros. I will install “Ubuntu-22.04”.
wsl --list --online
- Now copy the following command to install Ubuntu and hit ENTER:
wsl --install Ubuntu-22.04
- Give your username.
- Finally, set a password. Remember, 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:
- First, open the Command Prompt as “Run as administrator”.
- Write the following command and hit ENTER:
This process may take some time. Wait for the “The operation completed successfully” message.
wsl --set-version Ubuntu-22.04 1
- (Optional) To list the installed distros and their corresponding WSL version, use the following command:
wsl --list --verbose
As you can see, the WSL version for Ubuntu is 1 which was our goal.
wsl -l -v
- Now you should find Ubuntu in your Windows like below:
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
What are the steps to install Ubuntu in WSL 1?
To install Ubuntu in WSL 1, follow these 3 steps:
- Enable WSL in Windows.
- Install Ubuntu in WSL.
- Change the WSL version to 1.
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?
No, WSL is not a virtual machine. It allows a user to run a Linux distro in Windows. However, it uses a virtual machine platform.
Do I need to enable Hyper V for WSL?
No, you don’t need to enable Hyper-V for WSL, however, you need to enable the Virtual Machine Platform feature.
- 3 Methods to Uninstall Ubuntu from WSL
- How to Install Ubuntu in WSL2 in Just 3 Steps
- How to Install Ubuntu in WSL Using GUI [3 Steps]