DEV Community

S3CloudHub
S3CloudHub

Posted on

Install Ubuntu on Windows Subsystem for Linux (WSL) with Ease

Introduction
Running Ubuntu on Windows has never been easier, thanks to the Windows Subsystem for Linux (WSL). In this guide, I’ll show you how to install Ubuntu on WSL through the Microsoft Store.

Image description

What is WSL?
WSL is a compatibility layer developed by Microsoft, enabling users to run native Linux binaries directly on Windows. WSL 2, the latest version, offers a full Linux kernel and provides greater performance compared to its predecessor. With WSL, you can enjoy the best of both worlds — Linux tools alongside your Windows workflow.

Step 1: Enable Windows Subsystem for Linux
Before installing Ubuntu, you’ll need to enable WSL on your Windows machine. Here’s how:

  1. Open PowerShell as Administrator: Press Windows Key + X and select Windows PowerShell (Admin) from the menu.
  2. Enable WSL:

In the PowerShell window, run the following command:

wsl --install
Enter fullscreen mode Exit fullscreen mode

This command automatically enables both WSL and Virtual Machine Platform, which is required for WSL 2.

3.Restart Your PC:
After running the command, restart your system to apply the changes.

Step 2: Install Ubuntu from Microsoft Store
Now that WSL is enabled, it’s time to install Ubuntu.

  1. Open Microsoft Store:
    Press the Windows Key and type Microsoft Store in the search bar. Open the Store from the results.

  2. Search for Ubuntu:
    In the Microsoft Store, search for Ubuntu. You’ll find several versions like Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, and more. Choose the version you’d like to install and click Get.

  3. Install Ubuntu:
    Once you’ve selected your preferred version, click the Install button. The installation process will begin and might take a few minutes, depending on your internet speed.

Step 3: Set Up Ubuntu
After installation, you can launch Ubuntu and configure it.

  1. Open Ubuntu:
    Once Ubuntu is installed, you’ll find it in your Start Menu. Click on Ubuntu to open the terminal.

  2. Create a User Account:
    The first time you run Ubuntu, you’ll be prompted to create a username and password. This will serve as your default user for future logins.

  3. Update Your System:
    After setting up your user, update your Ubuntu installation by running the following commands:

sudo apt update
sudo apt upgrade
Enter fullscreen mode Exit fullscreen mode

Step 4: Switching Between WSL 1 and WSL 2
By default, WSL installs version 2, but you can switch between WSL 1 and WSL 2 as needed.

  1. Check WSL Version: To check which version of WSL you’re running, use the command:
wsl -l -v
Enter fullscreen mode Exit fullscreen mode

2.Set Default WSL Version:
If you want to switch to WSL 1 or WSL 2, you can set your default version by running:

wsl --set-version Ubuntu-20.04 2
Enter fullscreen mode Exit fullscreen mode

Replace Ubuntu-20.04 with your installed version, and 2 with either 1 or 2 depending on your preference.

Step 5: Enjoy the Power of Linux on Windows
You’ve successfully installed Ubuntu on WSL! Now, you can run Linux commands, use development tools like Git, Docker, and Python, or experiment with bash scripts — all from your Windows machine.

Some key benefits of WSL include:

  • No need for dual-booting or virtual machines.
  • Seamless integration with Windows — access Windows files from Linux and vice versa.
  • Lightweight and fast, especially with WSL 2’s full Linux kernel.

Explore more detailed content and step-by-step guides on our YouTube channel:-
image alt text here

Conclusion
Installing Ubuntu on Windows Subsystem for Linux via the Microsoft Store is simple and efficient. Whether you’re a developer looking to test code in a Linux environment or a curious user eager to explore Ubuntu’s capabilities, WSL makes it incredibly easy to get started.

Connect with Us!
Stay connected with us for the latest updates, tutorials, and exclusive content:

WhatsApp:-https://www.whatsapp.com/channel/0029VaeX6b73GJOuCyYRik0i
facebook:-https://www.facebook.com/S3CloudHub
youtube:-https://www.youtube.com/@s3cloudhub

Connect with us today and enhance your learning journey!

Top comments (0)