Overview
The Windows Subsystem for Linux (WSL) lets you run a real Linux distribution, such as Ubuntu, directly on Windows, without a separate virtual machine app or dual-booting. You get a full Linux command line with Linux tools, package managers, and programming languages, alongside your normal Windows apps and files.
The current version, WSL 2, runs a genuine Linux kernel in a lightweight, managed virtual machine that starts in seconds. Microsoft made WSL open source in 2025. WSL is widely used by developers, data scientists, and students who need Linux tools on a Windows computer. In this guide you will install WSL and Ubuntu, then practice using Linux and moving files between Linux and Windows.
wsl --install, sets up WSL and Ubuntu. After a restart, you create a Linux username and password and have a working Linux terminal on Windows.
Requirements
- Windows 11, or Windows 10 version 2004 (build 19041) or later. Windows 10 version 21H2 or later is recommended. To check, press Windows + R, type
winver, and press Enter. - Hardware virtualization enabled in your computer's UEFI/BIOS (on by default on most computers).
- Administrator privileges.
- Internet access and about 2–4 GB of free disk space.
Important Notes
- WSL works on Windows 10 and 11 Home as well as Pro.
- WSL is not intended to run inside a Windows virtual machine. Install it on a physical Windows computer.
- Mac users don't need WSL; macOS's Terminal already provides a Unix command line. For a full Linux system, see the Linux guide.
WSL Installation Instructions
Work through the tabs in order.
Installing WSL and Ubuntu
Click the tabs above in order. Allow about 15–30 minutes, including a restart.
The guide covers these major tasks:
- Open PowerShell as administrator.
- Run
wsl --install. - Restart Windows.
- Create your Linux username and password.
- Update Ubuntu.
- Learn the basic WSL commands.
Beginner Example: Linux and Windows Working Together
Open Ubuntu and type the commands below. Text after # is a comment; you don't need to type it.
Step 1: Look around Linux
whoami # your Linux username
pwd # your Linux home folder, /home/<username>
cat /etc/os-release # which Linux distribution and version you are running
uname -r # the Linux kernel version (it mentions WSL2)
See the Linux guide for more everyday commands such as ls, cd, mkdir, and cp.
Step 2: Create a project in Linux and run a program
Ubuntu includes Python 3. Create a folder and a small Python program:
mkdir -p ~/projects/hello
cd ~/projects/hello
echo 'import platform; print("Hello from", platform.system(), platform.release())' > hello.py
python3 hello.py
Output (your kernel version will differ):
Hello from Linux 6.6.87.2-microsoft-standard-WSL2
Step 3: Open Linux files from Windows
While in the hello folder, run:
explorer.exe .
Windows File Explorer opens the Linux folder. You can also find all your Linux files under Linux in File Explorer's navigation pane, or by typing \\wsl$ in the address bar.
Step 4: Reach Windows files from Linux
Your Windows drives appear in Linux under /mnt. Your C: drive is /mnt/c:
ls /mnt/c/Users # Windows user folders
cp hello.py /mnt/c/Users/<YourWindowsName>/Documents/ # copy a file to Windows Documents
Replace <YourWindowsName> with your Windows user folder name from the first command. The file now appears in your Windows Documents folder.
Step 5: Install a Linux tool
Install software with Ubuntu's package manager, exactly as on a regular Linux computer. For example, install tree and the SQLite command-line tool:
sudo apt install tree sqlite3 -y
tree ~/projects
sqlite3 --version
python3 hello.py prints a line ending in WSL2, explorer.exe . opens the folder in File Explorer, and hello.py appears in your Windows Documents folder.
Tips for Working in WSL
- Keep Linux projects in your Linux home folder (
~), not under/mnt/c. Linux tools run much faster on Linux files. - Install the WSL extension in Visual Studio Code, then type
code .in a Linux folder to edit it in VS Code. - To exit Linux, type
exitor close the window.
Next Steps
- Practice more commands with the Linux guide.
- Install Git inside WSL with
sudo apt install git. - Install development tools such as Java, PHP, or R inside Ubuntu with
apt. - Read Microsoft's WSL documentation.
- WSL runs a real Linux distribution on Windows 10 and 11, including Home editions.
- Install it with
wsl --installin an administrator PowerShell, then restart. - Your Linux username and password are separate from your Windows account.
- Linux files live in your Linux home folder; Windows files are under
/mnt/c.