Introduction
Running Ubuntu on Windows 11 has never been easier, thanks to WSL (Windows Subsystem for Linux). Whether you’re a developer, student, or enthusiast, this guide gives you the exact commands to install and run Ubuntu with just a few steps. No dual boot. No virtual machine. Just pure Linux inside Windows.
Step-by-Step Guide to Install Ubuntu on WSL/WSL2
Open Command Prompt (as Administrator) and follow the commands below:
Check Existing WSL Installations
wsl -l -v
This lists the installed Linux distributions and shows whether they’re using WSL 1 or WSL 2.
View All Available Linux Distributions
wsl --list --online
You’ll see a list like:
- Ubuntu
- Debian
- Kali-Linux
- Ubuntu-20.04
- Ubuntu-22.04
Install Ubuntu (Choose One from the List)
wsl --install -d (NAME)
You can replace “NAME” with a version like Ubuntu-22.04
depending on your need.
Once done, Windows will set up Ubuntu and ask you to create a username and password.
Update & Upgrade Your Ubuntu System
Once inside Ubuntu (in the terminal), run:
sudo apt update
sudo apt upgrade -y
This ensures your system is up to date with the latest packages.
Install Gedit (Graphical Text Editor)
sudo apt install gedit -y
Check Gedit Version
gedit --version
Launch Gedit
gedit
Note: If Gedit doesn’t open with GUI, make sure you’ve installed WSLg (GUI support). It comes built-in with Windows 11.
Final Thoughts
With WSL2 and Ubuntu, you get the best of both worlds — Linux power inside Windows 11. Whether you’re coding, compiling, or learning Linux, this setup gets you started in minutes.
Frequently Asked Questions (FAQ)
1. What is WSL and WSL2?
WSL (Windows Subsystem for Linux) lets you run Linux directly on Windows without a virtual machine. WSL2 is the upgraded version with better performance and full system call compatibility.
2. Do I need to enable anything before using WSL?
Windows 11 automatically enables required features when you use wsl --install
. But manually, you’d need to enable “Windows Subsystem for Linux” and “Virtual Machine Platform”
7. Why won’t Gedit launch with a GUI?
Make sure you’re using WSLg (GUI support for WSL2), which is included by default in Windows 11.
8. Can I use WSL for development?
Absolutely. It’s great for Python, Node.js, web development, Docker, and integrates smoothly with VS Code.
9. How do I uninstall Ubuntu from WSL?
Run the following command:
wsl --unregister Ubuntu