What the Windows Subsystem for Linux (WSL) Is vs. a Virtual Machine
The Windows Subsystem for Linux (WSL) is a powerful compatibility layer developed by Microsoft that allows you to run native Linux command-line tools, utilities, and applications directly on Windows—without the need for a traditional virtual machine (VM) or dual-boot setup. Introduced in Windows 10 and enhanced in Windows 11, WSL enables seamless integration between Windows and Linux environments.
Unlike a virtual machine, which runs a full Linux operating system inside a simulated hardware environment using software like VirtualBox or VMware, WSL operates at the kernel level. It translates Linux system calls into ones that Windows can understand, allowing Linux binaries to run natively alongside Windows processes. This eliminates the overhead of running a full guest OS, resulting in faster performance, lower memory usage, and quicker startup times.
Here are the key differences:
Feature | WSL | Virtual Machine |
---|---|---|
Resource Usage | Low (shares kernel resources) | High (dedicated CPU, RAM, disk) |
Startup Speed | Near-instant (seconds) | Slower (1–3 minutes) |
Integration with Windows | Excellent (shared files, clipboard, network) | Limited (requires shared folders or network) |
GUI Application Support | Available (with WSLg in WSL 2) | Full support |
Disk Space | Minimal (1–2 GB per distro) | Large (10–20 GB+) |
Hardware Access | Partial (via Windows) | Full (with proper drivers) |
WSL comes in two versions: WSL 1 and WSL 2. WSL 1 translates Linux system calls directly to Windows, while WSL 2 uses a lightweight utility VM with a real Linux kernel for better performance and full system call compatibility. Despite using a VM internally, WSL 2 is optimized for efficiency and feels just as fast as WSL 1 for most tasks.
In short, if you’re a developer, student, or Linux enthusiast who wants to use Bash, SSH, apt, and other Linux tools without leaving Windows, WSL is the ideal solution. It’s not meant to replace full VMs for complex server simulations or GUI-heavy Linux desktops, but it excels at command-line development, scripting, and learning Linux.
Step-by-Step Installation Tutorial from the Microsoft Store
Installing WSL has never been easier. Microsoft now hosts Linux distributions directly in the Microsoft Store, making setup fast and user-friendly. Follow these steps to get started:
- Enable WSL on Windows:
Press Windows + X and select Windows PowerShell (Admin) or Terminal (Admin). Run:wsl –installThis single command enables the necessary features, installs WSL 2, sets it as default, and downloads Ubuntu as the default distribution. - Restart your computer:
After the command finishes, restart your PC when prompted. This applies the necessary system changes. - Launch your Linux distribution:
After reboot, Windows will finish setting up Ubuntu. A terminal window will open asking you to:- Create a new username (e.g.,
john
) - Set a password (you won’t see characters as you type)
- Create a new username (e.g.,
- Alternative: Install from Microsoft Store manually:
If the automatic install fails or you want a different distribution:- Open the Microsoft Store.
- Search for Ubuntu, Debian, Kali Linux, or openSUSE.
- Click Get or Install.
- After download, click Launch to set up your user account.
- Verify installation:
Open Start and search for your Linux distro (e.g., “Ubuntu”). Click it to launch the terminal. You should see a prompt like:john@DESKTOP-XXXXXX:/mnt/c/Users/john$This means WSL is working correctly.
You can now run Linux commands, install software via apt
, and access your Windows files—all from a terminal that starts in seconds.
Optional: To install WSL manually (for older Windows versions), run:
dism.exe /online /enable-feature /featurename:Microsoft-VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
.
The 10 Basic Linux Commands You Need to Know to Get Started
Once WSL is installed, you’ll interact with it using the Linux terminal. Here are the 10 essential commands every beginner should learn:
- pwd – Print Working Directory
Shows your current location in the file system.
pwd - ls – List files and directories
Displays contents of the current folder.
Usels -la
to show hidden files and details.
ls
ls -la - cd – Change Directory
Navigate between folders.
cd Documents
cd .. # Go back one level
cd ~ # Go to home directory - mkdir – Make Directory
Create a new folder.
mkdir projects - touch – Create a file
Creates an empty file.
touch notes.txt - cat – Display file contents
Shows the content of a file.
cat notes.txt - cp – Copy files
Copies a file to another location.
cp file1.txt file2.txt - mv – Move or rename files
Renames or moves a file.
mv oldname.txt newname.txt
mv file.txt ~/Documents/ - rm – Remove files
Deletes a file (use carefully!).
rm unwanted.txtUserm -r foldername
to delete a directory and its contents. - sudo apt update && sudo apt upgrade – Update system packages
Updates the package list and upgrades installed software (Ubuntu/Debian).
sudo apt update
sudo apt upgrade
These commands form the foundation of Linux navigation and file management. Practice them in your WSL terminal to build confidence. Remember: Linux is case-sensitive, so MyFile.txt
and myfile.txt
are different.
How to Access Your Windows Files from the Linux Terminal
One of WSL’s most powerful features is seamless file system integration. You can access your entire Windows file system directly from the Linux environment.
In WSL, Windows drives are mounted under /mnt/
. For example:
/mnt/c/
→ Your C: drive/mnt/d/
→ D: drive (if present)/mnt/c/Users/YourName/Desktop
→ Your Windows Desktop/mnt/c/Program Files
→ Program Files folder
To navigate to your Windows Desktop:
john
with your actual Windows username.
You can read, edit, and create files from Linux that appear instantly in Windows Explorer. For example:
Conversely, you can access your Linux files from Windows at:
However, avoid editing Linux system files (like those in /etc
or /usr
) using Windows apps. File permission and line-ending differences can cause issues. Always use Linux tools (e.g., nano
, vim
) when working inside the WSL environment.
You can also launch Windows programs from WSL. For example:
explorer.exe .
/mnt/c/Windows
, /mnt/c/Program Files
, or system folders. This can break Windows or installed applications.
Installing a Distribution Like Ubuntu in Less Than 10 Minutes
Installing a Linux distribution such as Ubuntu via WSL is incredibly fast and straightforward. From start to finish, the entire process takes less than 10 minutes on a stable internet connection.
Step-by-Step Timeline (Under 10 Minutes)
- 0–2 min: Open PowerShell as Admin
Search for “PowerShell”, right-click, and choose “Run as administrator”. - 2–3 min: Run the Install Command
Type:wsl –install -d UbuntuThis installs only Ubuntu, skipping the default if multiple distros are available. - 3–6 min: Download and Extract
Windows downloads the Ubuntu package from the Microsoft Store and sets up the filesystem. No user input needed. - 6–7 min: Restart Your PC
After installation, restart when prompted. This enables WSL 2 and the virtual machine platform. - 7–9 min: Set Up Your Linux User
After reboot, Ubuntu launches automatically. Create your username and password when prompted. - 9–10 min: Update Packages
Run:sudo apt update && sudo apt upgrade -yThis ensures your system is up to date.
That’s it! You now have a fully functional Ubuntu environment running inside Windows. You can:
- Install Python, Node.js, Git, and other dev tools with
apt
. - Run a web server with
python3 -m http.server 8000
. - Edit files using
nano script.py
orvim app.js
. - Use SSH to connect to remote servers.
To install other distributions, replace Ubuntu
with:
Debian
Kali-Linux
openSUSE-Leap
Arch
(via manual install)
You can even run multiple distributions simultaneously. Each has its own filesystem and settings, but all share the same WSL backend.
WSL transforms Windows into a hybrid development platform, combining the familiarity of Windows with the power of Linux. Whether you’re learning Bash, building web apps, or exploring cybersecurity tools, WSL provides a smooth, efficient, and integrated experience—no virtualization overhead required.
wsl --update
periodically. This ensures you have the latest kernel and security patches.