Your Windows PC Just Got a Linux Brain
You’re staring at a command prompt, trying to run a bash script or use a tool like grep or awk. Maybe you’re a developer needing a proper Unix environment for your project, or a student following a tutorial that assumes you’re on Linux. The frustration is real. You don’t want to dual-boot, deal with a slow virtual machine, or switch computers entirely.
What if you could run a full-fledged Linux terminal and tools directly inside Windows, seamlessly? That’s exactly what the Windows Subsystem for Linux, or WSL, delivers. It’s not an emulator. It’s a genuine compatibility layer that lets you run native Linux command-line tools, utilities, and applications right alongside your Windows files and programs.
This guide will walk you through every step to install WSL on Windows 10 or Windows 11. We’ll cover the simple one-command method, the manual approach via the Control Panel, and how to get your first Linux distribution up and running. By the end, you’ll have a powerful Linux environment integrated into your Windows workflow.
What Exactly Is Windows Subsystem for Linux?
Before we dive into installation, it helps to understand what you’re setting up. WSL is a feature developed by Microsoft that creates a lightweight virtualized environment within Windows. It translates Linux system calls into Windows ones in real-time, allowing Linux binaries to run natively.
There are two versions: WSL 1 and WSL 2. WSL 1 provided a translation layer for Linux system calls. WSL 2, which is now the default and recommended version, uses a real Linux kernel running in a lightweight utility virtual machine (VM). This brings full system call compatibility, dramatically faster file system performance, and support for Docker containers and more.
For almost all users today, you’ll want WSL 2. It’s faster, more compatible, and receives all the latest updates and features from Microsoft. This guide will focus on installing WSL 2.
Prerequisites for a Smooth Installation
Let’s ensure your system is ready. The requirements are minimal for modern Windows systems.
You need to be running a supported version of Windows 10 or Windows 11. Specifically, you need:
– Windows 10 version 2004 (Build 19041) or higher, or Windows 11.
– 64-bit architecture.
– Virtualization capabilities must be enabled in your BIOS/UEFI. This is usually on by default on most modern PCs and laptops.
To check your Windows version, press the Windows key + R, type “winver”, and hit Enter. A window will pop up showing your version and build number.
The One-Command Installation Method (Windows 10 Build 19041+ & Windows 11)
If you’re on a sufficiently updated version of Windows, the process is incredibly simple. Microsoft has packaged everything into a single command.
Open PowerShell or Windows Terminal as an Administrator. You can do this by right-clicking the Start button and selecting “Windows Terminal (Admin)” or “PowerShell (Admin)”.
In the administrator window, type or paste the following command and press Enter:
wsl –install
This one command does several things automatically:
– Enables the required “Windows Subsystem for Linux” optional feature.
– Enables the “Virtual Machine Platform” optional feature.
– Downloads and installs the latest Linux kernel update package for WSL 2.
– Sets WSL 2 as your default version.
– Downloads and installs the default Linux distribution, which is Ubuntu.
After the command runs, you will be prompted to restart your computer. Go ahead and restart. Once your PC boots back up, you should see a terminal window for Ubuntu launching automatically. It will ask you to create a new Unix username and password. This account is separate from your Windows account and is for the Linux environment.
And that’s it. You now have a fully functional Ubuntu Linux distribution running via WSL 2. You can start using the terminal immediately.
Manual Installation Steps for Older Systems or Control
If the wsl –install command doesn’t work for you, or if you prefer to enable the components manually, you can follow this step-by-step process. It’s also useful if you want to understand what’s happening under the hood.
Step 1: Enable the Windows Subsystem for Linux Feature
The first component is the core WSL feature. You can enable it via PowerShell or the classic Control Panel.
Using PowerShell (Admin), run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Alternatively, you can use the GUI. Search for “Turn Windows features on or off” in the Start menu. In the window that opens, find “Windows Subsystem for Linux” in the list, check the box next to it, and click OK. Windows will apply the change and likely ask you to restart.
Step 2: Enable the Virtual Machine Platform Feature
This is required for WSL 2. Again, you can use PowerShell or the GUI.
In PowerShell (Admin), run:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
In the “Turn Windows features on or off” GUI, check the box for “Virtual Machine Platform”. If you used the GUI for Step 1, you’ll need to open it again, check this new box, and click OK.
After enabling both features, restart your computer when prompted.
Step 3: Download and Install the Linux Kernel Update Package
WSL 2 requires a separate Linux kernel. Download the latest installer from the official Microsoft website.
Visit the Microsoft WSL documentation page and look for the “Download the latest WSL2 Linux kernel update package” link, or directly download it. The file is usually named something like “wsl_update_x64.msi”.
Run the downloaded .msi file. It’s a simple installer—just click “Next” and “Finish” to install the Linux kernel on your machine.
Step 4: Set WSL 2 as Your Default Version
Open PowerShell or Command Prompt (no admin rights needed for this step). Run the following command to set WSL 2 as the default architecture for any new distributions you install.
wsl –set-default-version 2
You might see a message saying WSL 2 requires an update to its kernel component. If you completed Step 3, you should be fine. If not, it will provide a link to download the kernel package.
Step 5: Install Your Chosen Linux Distribution
Now for the fun part: picking your Linux flavor. The most common and beginner-friendly choice is Ubuntu, but you have options.
Open the Microsoft Store app on your Windows machine. In the search bar, type “Linux”. You’ll see several official distributions like Ubuntu, Debian, openSUSE, and Kali Linux.
Click on the one you want (e.g., “Ubuntu”) and hit the “Get” or “Install” button. The Store will download and install the distribution. This process is just like installing any other app from the Store.
Step 6: Launch Your Distribution and Set It Up
Once the installation from the Store is complete, you can launch it from the Start menu. The first launch will take a minute as it unpacks the files and sets up the instance on your machine.
A terminal window will open, and you’ll be asked to create a new user account and password for this Linux environment. This user is a standard Linux user with sudo privileges. Choose a username and password—remember this password, as you’ll need it for administrative tasks (using sudo) within Linux.
After this initial setup, your WSL distribution is ready to use. The terminal will start in your home directory.
Verifying Your Installation and Basic Commands
Let’s confirm everything is working correctly and explore some essential WSL commands.
Open your Linux distribution terminal (e.g., Ubuntu). To check the WSL version your distribution is using, run this command from within the Linux terminal:
wsl.exe –list –verbose
You can also run this from a Windows PowerShell window. It will list all your installed distributions and show which version of WSL (1 or 2) each is using. You should see your distribution listed with a “2” under the “VERSION” column.
To check your Linux version, run:
cat /etc/os-release
This will display details about the Linux distribution you installed.
Essential WSL Management Commands
From a Windows PowerShell or Command Prompt, you can manage your WSL environments with these useful commands:
– wsl –list or wsl -l: Lists all installed Linux distributions.
– wsl –set-version
– wsl –shutdown: Immediately terminates all running WSL distributions and the virtual machine.
– wsl –terminate
– wsl –export
– wsl –import
These commands give you full control over your WSL instances from the Windows side.
Accessing Windows Files from Linux and Vice Versa
One of WSL’s greatest strengths is seamless file system integration.
From within your Linux terminal, your Windows drives are automatically mounted. You can access your C: drive at /mnt/c/. So, your Windows user folder would be at /mnt/c/Users/YourWindowsUsername/. You can navigate, read, and write to these locations just like any Linux directory.
From Windows, you can access your Linux files. Open File Explorer and type the following into the address bar:
\\wsl$
This will show a network location for each running WSL distribution. You can browse the Linux file system graphically, copy files back and forth, and even open Linux files in Windows applications like VS Code.
A crucial warning: Do not create or modify Linux files using Windows apps and tools from within the /mnt/c/… mount point. Always use the \\wsl$ path or work from within the Linux terminal. Directly manipulating Linux files from the Windows side via /mnt/ can corrupt data because the two file systems handle metadata differently.
Troubleshooting Common WSL Installation Issues
Even with a straightforward process, you might hit a snag. Here are solutions to common problems.
The “wsl” command is not recognized
This means the WSL optional feature is not enabled. Go back to the manual installation steps and ensure you have enabled “Windows Subsystem for Linux” using PowerShell or the Control Panel, and then restarted your computer.
Error 0x80370102 when starting a distribution
This error typically means virtualization is disabled in your BIOS/UEFI. You need to restart your computer, enter the BIOS setup (usually by pressing F2, Del, or F10 during boot), find the virtualization setting (often called Intel VT-x, AMD-V, SVM, or Virtualization Technology), and enable it. Save and exit the BIOS.
WSL 2 installation is incomplete
If you set the default version to 2 but your distribution still runs as version 1, you might be missing the Linux kernel update package. Revisit Step 3 of the manual installation, download the .msi, and install it. Then run “wsl –set-version Ubuntu 2” (replace “Ubuntu” with your distro name) to convert it.
Slow file system performance in /mnt/c/
This is a known issue with WSL 2 when accessing Windows files. For projects you work on heavily from Linux, consider storing them inside the Linux file system (e.g., in your home folder) for much better performance. You can still access them from Windows via \\wsl$.
Choosing Between WSL 1 and WSL 2
While WSL 2 is the default for good reason, there are niche cases where WSL 1 might be preferable.
Use WSL 2 if you need full system call compatibility, are working with Docker, need faster performance for operations within the Linux file system, or are using any modern Linux tooling. This covers 95% of use cases.
Consider WSL 1 only if you require extremely fast cross-file-system performance between Windows and Linux files and you don’t need features like a real Linux kernel or Docker support. WSL 1 offers better integration for files stored on the Windows drive.
You can have distributions using different versions. You can convert a distribution at any time using the “wsl –set-version” command mentioned earlier.
Next Steps After Installation
With WSL running, a world of possibilities opens up. Here’s what to do next.
First, update your Linux distribution. Run the standard commands:
sudo apt update && sudo apt upgrade
If you’re on Ubuntu or Debian, this will fetch the latest package lists and upgrade all installed software to their newest versions.
Install essential development tools. For example, to get a basic Python, Git, and build-essential environment, run:
sudo apt install git python3 python3-pip build-essential
Install Windows Terminal from the Microsoft Store. It’s a modern, fast, and feature-rich terminal that manages PowerShell, Command Prompt, and all your WSL distributions in one beautiful application with tabs and panes.
Finally, integrate WSL with Visual Studio Code. Install the “Remote – WSL” extension in VS Code. This allows you to open a folder inside your WSL distribution and use VS Code as if it were running natively on Linux, with full IntelliSense, debugging, and extension support.
Unlocking a New Development Workflow
Installing the Windows Subsystem for Linux transforms your Windows PC into a hybrid powerhouse. You’re no longer limited by the Windows command line or forced to context-switch between operating systems. You can run Linux-specific web servers, use Unix scripting tools, develop cross-platform applications, and follow Linux-based tutorials without leaving your primary desktop environment.
The installation process, whether via the single magic command or the manual steps, is designed to be accessible. The integration is deep, from file system access to graphical application support with proper setup. Start with the default Ubuntu, get comfortable in the terminal, and explore the vast ecosystem of Linux software now at your fingertips. Your development environment just became significantly more powerful and flexible.