If you’re a developer, sysadmin, or even a curious learner, chances are you’ve heard of Linux. But what if you’re on Windows and want to use Linux without setting up dual boot or a virtual machine?
That’s where WSL (Windows Subsystem for Linux) comes in. With WSL, you can run a full Linux distribution like Ubuntu directly inside your Windows environment — without leaving Windows!
✅ What You’ll Learn
- What is WSL and why it matters
- Differences between WSL1 and WSL2
- How to install WSL and Ubuntu
- First steps after installation
- How Linux and Windows interact inside WSL
💡 What is WSL?
WSL (Windows Subsystem for Linux) is a compatibility layer that lets you run Linux binaries natively on Windows. You get access to a real Linux kernel and tools like bash, apt, nano, and gcc.
There are two versions:
- WSL 1 – Translates Linux system calls to Windows. Faster for file access.
- WSL 2 – Full Linux kernel running in a lightweight VM. Better performance and compatibility.
💬 Recommendation: Use WSL 2 — it’s the latest and most powerful.
🔧 How to Install WSL & Ubuntu (Step-by-Step)
🟢 Step 1: Enable WSL Feature
Open PowerShell as Administrator and run:
wsl --install
This will:
- Install WSL 2
- Enable Virtual Machine Platform
- Install Ubuntu by default
If Ubuntu doesn’t install automatically, use:
wsl --install -d Ubuntu
For older systems, enable manually:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
🟢 Step 2: Set Ubuntu as Default (Optional)
wsl --set-default Ubuntu
🟢 Step 3: Check WSL Version
wsl --list --verbose
Output:
NAME STATE VERSION
* Ubuntu Running 2
If still version 1, convert with:
wsl --set-version Ubuntu 2
🧭 First Time Running Ubuntu
- Open Ubuntu from the Start Menu.
- Wait for setup and installation.
- Create your
usernameandpasswordwhen prompted.
You’re now inside Ubuntu running inside Windows 🎉
🗃️ Accessing Files
🔹 Access Windows Files from Linux
cd /mnt/c/Users/YourName/Desktop
ls
🔹 Access Linux Files from Windows
In File Explorer, go to:
\\wsl$\Ubuntu
🛠️ Basic WSL Commands
| Command | Purpose |
|---|---|
wsl |
Opens WSL default shell |
wsl -l -v |
List installed distros and versions |
wsl --shutdown |
Shut down all WSL instances |
wsl -d Ubuntu |
Launch specific distro |
wsl --update |
Update WSL kernel |
📂 Folder Structure of Linux
/home/yourusername– User’s home directory/etc– Configuration files/var/log– System logs/usr/bin– Linux executable commands/mnt/c– Windows C drive
🤔 Common Questions
❓ Do I need to dual boot now?
No! WSL runs side-by-side with Windows.
❓ Can I install GUI apps?
Yes, WSL 2 supports GUI apps. For example:
sudo apt install gedit
gedit
❓ Is it safe to use WSL?
Yes, it’s isolated and officially supported by Microsoft.
🧪 Quick Practice
Try these inside your Ubuntu terminal:
pwd
ls /
cd /mnt/c/Users
whoami
uname -a
✅ Summary
You’ve now:
- Understood WSL
- Installed Ubuntu on Windows
- Learned to run and manage WSL
- Explored file sharing between Linux and Windows
You’re ready to move forward and explore Linux commands and usage.
▶️ Coming Up Next
Chapter 2 – Linux File System and Navigation Commands
We’ll dive into Linux folders, paths, and how to navigate with commands like cd, ls, and pwd.
