Have you ever wished you could use Linux commands on your Windows computer without setting up a virtual machine or switching systems?
That’s exactly what WSL2 — the Windows Subsystem for Linux version 2 — lets you do!
But why would anyone want Linux inside Windows in the first place?
Here’s why it’s such a game-changer:
- Most servers and cloud systems use Linux. Azure, AWS, and Google Cloud primarily run Linux-based environments. Learning Linux helps you understand the same systems used in real production environments.
- Access Linux-only tools and commands. Many developer tools — such as
bash,ssh,curl,grep, andapt— are native to Linux and don’t work the same way on Windows. - Cross-platform testing and development. You can check how your applications behave in both Windows and Linux without switching machines.
- Learn Linux without a dedicated PC. Ideal for students, cloud beginners, and developers who want to get comfortable with the Linux terminal.
💡 What Is WSL2?
WSL2 stands for Windows Subsystem for Linux version 2.
It’s a feature built into Windows that lets you run a full Linux operating system inside Windows — no dual booting, no heavy virtual machines, and no complex setup.
It gives you a real Linux terminal (like Ubuntu or Debian) directly on your Windows desktop.
Imagine having:
- PowerShell and Linux Bash in the same computer.
- Access to Linux tools like
curl,grep,ssh, andgitnatively. - The ability to build and test cloud and DevOps tools like Terraform, Docker, and Kubernetes — exactly as they run on real servers.
🧠 Why Do You Need WSL2?
Here’s why developers, cloud engineers, and students love WSL2:
- Same environment as servers. Most cloud servers and CI/CD pipelines (like GitHub Actions, Azure Pipelines, and AWS CodeBuild) run on Linux. Learning or testing your tools in WSL2 ensures your scripts behave exactly the same in production.
- Run Linux tools natively on Windows. You can run both Windows and Linux commands side by side — no VM, no reboot.
- Fast and lightweight. WSL2 uses a small built-in virtual machine that’s optimized — it’s much faster than using VirtualBox or VMware.
- Perfect for cloud and DevOps tools. Tools like Terraform, Azure CLI, GitHub CLI, and Docker all work flawlessly inside WSL2.
- Easy file sharing. You can access your Windows files inside Linux (
/mnt/c/...) and even open your Linux projects in VS Code.
🖥️ Supported Windows Operating Systems and Versions
Not all versions of Windows support WSL2, but most modern ones do.
| Operating System | WSL2 Supported? | Notes |
|---|---|---|
| Windows 11 (Home, Pro, Enterprise, Education) | ✅ Yes | Fully supported out of the box |
| Windows 10 (version 2004 or later, build ≥19041) | ✅ Yes | Works after updating |
| Windows 8 / 7 | ❌ No | Not supported |
| Windows Server (2019 or later) | ⚙️ Partial | Requires manual setup |
| Windows 11 S Mode / SE | ⚠️ No | Must switch out of S Mode |
🔍 How to Check Your Windows Version
Press Win + R, type:
winver
and hit Enter.
If your version is Windows 10 version 2004+ or any Windows 11 version, you’re ready for WSL2.
⚙️ How to Set Up WSL2 (Step-by-Step)
🪟 Step 1 — Open PowerShell as Administrator
Right-click on Start → Windows PowerShell (Admin)
🧩 Step 2 — Install WSL2
Run this single command:
wsl --install
This will:
- Enable required Windows features
- Install the Linux kernel
- Download and install Ubuntu (default Linux distribution)
- Set WSL2 as your default version

When installation finishes, restart your computer.
🐧 Step 3 — Verify WSL Installation and Linux Setup
Before opening Ubuntu, let’s make sure that WSL 2 and the Linux distribution were installed correctly.
Sometimes the WSL engine installs successfully, but Ubuntu doesn’t — so this quick check prevents confusion later.
🔍 Step 3.1 — Verify WSL 2 Installation
Open PowerShell (normal mode is fine) and run:
wsl --status
You should see output similar to one of the following examples:
✅ Example 1 — Everything is set up correctly
Default Version: 2
Kernel version: 5.15.133.1
This means WSL 2 is installed and ready to use.
The Kernel version line shows the version of the Linux kernel that WSL 2 is using.
WSL 2 includes a real Linux kernel (maintained by Microsoft) running inside a lightweight virtual machine, allowing Linux tools and containers to behave exactly like they do on a native Linux system.
📝 If you don’t see the “Kernel version” line yet:
That’s perfectly normal — it usually appears after you install and open Ubuntu for the first time.
Once Ubuntu is running, you can check it anytime with:uname -rExample output:
5.15.133.1-microsoft-standard-WSL2
ℹ️ Example 2 — Message about WSL 1 not supported
Default Version: 2
WSL1 is not supported with your current machine configuration.
Please enable the "Windows Subsystem for Linux" optional component to use WSL1.
This is not an error.
It simply means WSL 2 is active, but the older WSL 1 feature isn’t turned on.
You don’t need WSL 1 for modern development or cloud work, so you can safely ignore this message.
📝 Optional:
If you ever need WSL 1 for compatibility reasons, run:dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartThen restart your computer once.
⚠️ Example 3 — WSL command not recognized
'wsl' is not recognized as an internal or external command
This means WSL isn’t installed on your system yet.
To fix this, go back to Step 2 — Install WSL 2, follow the installation process again, and then rerun:
wsl --status
Once you see “Default Version: 2,” you’re ready to move on to checking for Ubuntu in the next step.
🧩 Step 3.2 — Check If Ubuntu Is Installed
Next, list your installed Linux distributions:
wsl -l -v
If you see:
NAME STATE VERSION
* Ubuntu Stopped 2
✅ Ubuntu is already installed and ready to open — you can move to Step 4.
If you see:
Windows Subsystem for Linux has no installed distributions.
You can resolve this by installing a distribution with the instructions below:
Use 'wsl.exe --list --online' to list available distributions
and 'wsl.exe --install <Distro>' to install.
⚠️ That means Ubuntu didn’t install automatically. Let’s fix that in Step 3.3.
🧰 Step 3.3 — Install Ubuntu Manually (If Missing)
If your system shows
There are no installed distributions.
it means Ubuntu didn’t install automatically with WSL. Let’s install it manually.
Check available Linux distributions
Run this command in PowerShell to see what’s available for installation:
wsl --list --online
You’ll get output like this:
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.
NAME FRIENDLY NAME
AlmaLinux-8 AlmaLinux OS 8
AlmaLinux-9 AlmaLinux OS 9
AlmaLinux-Kitten-10 AlmaLinux OS Kitten 10
AlmaLinux-10 AlmaLinux OS 10
Debian Debian GNU/Linux
FedoraLinux-42 Fedora Linux 42
SUSE-Linux-Enterprise-15-SP6 SUSE Linux Enterprise 15 SP6
SUSE-Linux-Enterprise-15-SP7 SUSE Linux Enterprise 15 SP7
Ubuntu Ubuntu
Ubuntu-24.04 Ubuntu 24.04 LTS
archlinux Arch Linux
kali-linux Kali Linux Rolling
openSUSE-Tumbleweed openSUSE Tumbleweed
openSUSE-Leap-16.0 openSUSE Leap 16.0
Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
OracleLinux_7_9 Oracle Linux 7.9
OracleLinux_8_10 Oracle Linux 8.10
OracleLinux_9_5 Oracle Linux 9.5
openSUSE-Leap-15.6 openSUSE Leap 15.6
This list may vary slightly depending on your Windows build and network connection.
Choose your distribution
We’ll use Ubuntu 24.04 LTS (Noble Numbat) — the latest Long-Term Support release and the current default image for GitHub Actions and Azure Pipelines.
It includes a newer Linux kernel, updated packages, and improved performance while still offering the stability of an LTS release (supported until April 2029).
📝 Note:
Ubuntu 22.04 LTS is still available if you need compatibility with older tutorials or on-prem setups.
You can switch at any time by reinstalling withUbuntu-22.04.
Install Ubuntu 24.04 LTS
Run:
wsl --install -d Ubuntu-24.04
This command will:
- Download and install Ubuntu 24.04 LTS
- Configure it to run under WSL 2
- Automatically launch Ubuntu to finish setup
During installation
You’ll see something like this:
Downloading: Ubuntu 24.04 LTS
Installing: Ubuntu 24.04 LTS
Distribution successfully installed. It can be launched via 'wsl.exe -d Ubuntu-24.04'
Launching Ubuntu-24.04...
Provisioning the new WSL instance Ubuntu-24.04
This might take a while...
Create a default Unix user account: heartin
New password:
Retype new password:
passwd: password updated successfully
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
heartin@HeartinAW:/mnt/c/WINDOWS/system32$
This means the installation and provisioning are happening in one step — no need to open Ubuntu separately yet.
At this stage:
- Enter your preferred Linux username (e.g.,
heartin) - Set a password (input will be hidden while typing)
This creates your default Linux user account, similar to the first-user setup on a full Linux machine.
- After setup, Ubuntu will open automatically at a prompt such as:
heartin@HeartinAW:/mnt/c/WINDOWS/system32$
That means you’re now inside your Ubuntu 24.04 LTS environment running under WSL 2 🎉
Try Your First Linux Command
Now that you’re in Ubuntu, run the following command to verify your version:
lsb_release -a
Expected output:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble
Explanation:
- The “No LSB modules are available” message is normal and not an error — it simply means the optional Linux Standard Base package isn’t installed.
- The remaining lines confirm that you’re running Ubuntu 24.04.3 LTS (Noble Numbat), the latest Long-Term Support version as of 2025.
Verify Installation (from PowerShell)
If you close Ubuntu or return to PowerShell by typing exit, you can confirm the installation anytime with:
wsl -l -v
Expected output:
NAME STATE VERSION
* Ubuntu-24.04 Stopped 2
It means:
- Version 2 → it’s using WSL 2, the correct subsystem
- Ubuntu-24.04 → your installed Linux distribution
- Stopped → it’s currently not running (because you exited)
Login back to Ubuntu from PowerShell
To open it again later, run:
wsl -d Ubuntu-24.04
or simply as following if Ubuntu is your only installed distribution:
wsl
✅ You’ve now successfully installed and configured Ubuntu 24.04 LTS under WSL 2 — your Linux environment is ready to use!
Verify installation
Once done, confirm that everything was installed correctly:
wsl -l -v
Expected output:
NAME STATE VERSION
* Ubuntu Running 2
✅ You’ve successfully installed and configured Ubuntu 24.04 LTS under WSL 2 — your Linux environment is ready to use!
🐧 Step 4 — Open Ubuntu
Once Ubuntu 24.04 LTS is installed and configured, you can open it anytime — just like any other Windows application.
🪟 Option 1 — Open from Start Menu
- Click the Start Menu (Windows icon in the taskbar).
- Type “Ubuntu” in the search bar.
- Click Ubuntu 24.04 (App) to launch your Linux terminal.
When Ubuntu opens, you’ll see a prompt like:
heartin@HeartinAW:~$
That means you’re now inside your Ubuntu environment running under WSL 2 — ready to use Linux commands right from Windows!
⚙️ Option 2 — Open Using PowerShell or Command Prompt
You can also start Ubuntu directly from PowerShell or Command Prompt by typing:
wsl -d Ubuntu-24.04
If Ubuntu is your only installed distribution, you can simply run:
wsl
🔁 Switching Between Ubuntu and PowerShell
- To return to PowerShell, type:
exitThis closes your Ubuntu session but keeps your installation intact. - To reopen Ubuntu, run:
wsl -d Ubuntu-24.04or open it again from the Start Menu.
💡 Tip — Confirm You’re in Ubuntu
If you’re unsure which shell you’re in, type:
uname -a
If the output mentions “Linux” or “Ubuntu”, you’re in your WSL environment.
If it shows “Microsoft Windows” or “PowerShell”, you’re back in Windows.
✅ You now know how to open, close, and switch between Ubuntu and PowerShell on Windows 11 using WSL 2.
In the next step, you can start installing developer tools like Terraform, Azure CLI, or Git inside your Linux terminal.
🚀 What You Can Do Next
Now that WSL 2 and Ubuntu 24.04 LTS are set up, you can start using your Linux environment for real-world DevOps and cloud tasks.
Here are some ideas to get started:
- 🧱 Install Terraform, Azure CLI, and Git to begin building and managing cloud infrastructure.
- 💻 Use Visual Studio Code with the Remote – WSL extension for a seamless Linux development experience on Windows.
- 🐳 Run Docker Desktop, which integrates directly with WSL 2 for containerized development.
These tools together create the same environment used by professional cloud and DevOps engineers — all on your local laptop.
✅ Quick Summary
| Step | Command | Purpose |
|---|---|---|
| Check Windows version | winver | Ensure your version supports WSL 2 |
| Install WSL | wsl --install | One-step setup for WSL 2 and Ubuntu |
| Check version | wsl -l -v | Confirm that WSL 2 is active |
| Launch Linux | Start → Ubuntu 24.04 LTS | Open and begin using your Linux environment |
🏁 Final Thoughts
WSL 2 is a game-changer for anyone learning or working in cloud computing, DevOps, or software development.
It bridges the gap between Windows and Linux — giving you the power, performance, and flexibility of both worlds.
Once WSL 2 is set up, you’ll be ready to explore tools like Terraform, Docker, and Azure DevOps inside a real Linux environment — all without ever leaving Windows.
🎁 Bonus: Resetting Your Ubuntu Password in WSL2
Forgot your Ubuntu password? Don’t worry — you can reset it easily without reinstalling anything.
Follow these simple steps:
🪟 Step 1 — Open PowerShell as Administrator
Right-click the Start Menu → select Windows PowerShell (Admin) or Terminal (Admin).
🧰 Step 2 — Start WSL as the Root User
Run this command to open Ubuntu directly as root:
wsl -u root
Alternatively, if you have multiple Linux distributions, you can specify the name like this: wsl -d Ubuntu-24.04 -u root
🔑 Step 3 — Reset Your Password
Once inside the root shell, run:
passwd <your-username>
For example:
passwd heartin
Then enter your new password twice (it won’t show as you type).
🚪 Step 4 — Exit and Reopen Ubuntu
Type:
exit
Then relaunch Ubuntu normally:
wsl
Now you can log in and use your new password with sudo commands as usual.
💡 Tip:
If you’re not sure what your username is, you can check it by listing home directories:
ls /home
That will show all user accounts inside your WSL environment.
All the commands and instructions worked successfully i look forward to learning more.
WSL 2 uses a lightweight virtual machine with a real Linux kernel, offering faster file system performance and better compatibility with Linux software compared to WSL 1.