Windows Subsystem for Linux (WSL) lets you run native Linux command‑line tools directly on a Windows 10 machine without the overhead of a virtual machine. Whether you’re a developer who wants to test Bash scripts, a sysadmin needing quick access to Linux utilities, or simply a curious tech enthusiast, this guide will walk you through enabling WSL from scratch. The steps are beginner‑friendly, use real commands, and include tips to avoid the most common pitfalls.
What You’ll Need
- A Windows 10 PC running version 1903 (Build 18362) or later.
- Administrator privileges on the machine.
- An internet connection to download the Linux distribution.
- Basic familiarity with the Command Prompt or PowerShell.
- Patience – the process only takes a few minutes.
Step 1: Verify Windows Version and Enable Developer Mode
Open Settings → System → About and confirm that the “Version” number is 1903 or higher. If you’re on an older build, run Windows Update first.
Next, enable Developer Mode, which removes certain restrictions for installing optional features. Press Win + I to open Settings, go to Update & Security → For developers, and select Developer mode. Click Yes on the confirmation dialog.
Step 2: Turn On the “Windows Subsystem for Linux” Feature
There are two ways to enable the feature: via the GUI or PowerShell. The PowerShell method is quicker and works reliably.
Open PowerShell **as Administrator** (right‑click the Start button → Windows PowerShell (Admin)) and run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
The command returns a success message. If you prefer the GUI, open Control Panel → Programs → Turn Windows features on or off, scroll down, check “Windows Subsystem for Linux”, and click OK**.
Step 3: Enable the Virtual Machine Platform (Required for WSL 2)
WSL 2 offers a real Linux kernel, faster file system performance, and full system‑call compatibility. To use it, you must enable the “Virtual Machine Platform” feature.
In the same elevated PowerShell window, execute:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
After the command finishes, **restart your computer** to apply the changes.
Step 4: Set WSL 2 as the Default Version
Once the system restarts, open PowerShell (no admin needed) and type:
wsl --set-default-version 2
If you see the message “WSL 2 is now the default version,” you’re ready to install a Linux distro. If the command fails, double‑check that you’re on Windows 10 version 1903 or later and that the Virtual Machine Platform is enabled.
Step 5: Install a Linux Distribution from the Microsoft Store
Launch the Microsoft Store, search for “Linux,” and choose a distribution—Ubuntu, Debian, Kali, openSUSE, etc. For beginners, **Ubuntu 22.04 LTS** is a solid choice.
Click Get → Install. The download size is usually under 1 GB, and installation completes in a few minutes.
Step 6: Initialize Your New Linux Environment
After the store finishes, click **Launch** (or open the Start menu and type the distro’s name). The first launch will finish the installation and prompt you to create a UNIX username and password. Choose something memorable; this account is separate from your Windows credentials.
Once you see a Bash prompt (e.g., username@hostname:~$), you have a fully functional Linux shell inside Windows.
Common Mistakes to Avoid
Skipping the restart. Both the WSL and Virtual Machine Platform features require a reboot. Forgetting this step leaves you with cryptic errors like “WSL 2 requires a newer kernel”.
Using an unsupported Windows version. WSL 2 is unavailable on builds older than 1903. If you can’t upgrade, you can still use legacy WSL 1, but many modern tutorials assume WSL 2.
Running the PowerShell commands without admin rights. Without elevation, DISM will silently fail, and you’ll waste time troubleshooting.
Choosing a non‑default distro and then expecting the same command set. Some distributions use different package managers (e.g., yum vs apt). Stick with Ubuntu for the simplest experience.
Tips and Tricks
• Access Windows files from Linux. Inside WSL, the Windows C: drive is mounted at /mnt/c. For example, cd /mnt/c/Users/YourName/Documents lets you edit Windows files with Linux tools.
• Run Windows executables from Bash. Type notepad.exe or explorer.exe . directly in the Linux terminal.
• Upgrade an existing WSL 1 distro to WSL 2. Use wsl --set-version distro-name 2. Replace distro-name with the name shown by wsl -l -v.
• Allocate more resources. If you need more RAM or CPU for intensive tasks, edit .wslconfig in your Windows user folder (e.g., C:UsersYourName.wslconfig) and add:
[wsl2] memory=4GB processors=2
Then run wsl --shutdown and restart the distro.
Frequently Asked Questions
Can I run graphical Linux applications on WSL?
Yes. Starting with Windows 10 build 21364, WSL supports GUI apps out of the box. Install the mesa-utils package, enable the WSLg feature, and launch apps like gedit directly from Bash.
Do I need to reinstall my distro after a Windows update?
No. Windows updates rarely affect the Linux filesystem. However, major feature updates may require you to re‑enable the optional components (WSL and Virtual Machine Platform) if they were reset.
Is WSL a replacement for a full Linux VM?
For most development and scripting tasks, WSL is faster and uses fewer resources than a virtual machine. If you need kernel modules, low‑level hardware access, or a different init system, a traditional VM (Hyper‑V, VirtualBox) is still the better choice.
Conclusion
Enabling Windows Subsystem for Linux on Windows 10 opens a powerful bridge between two ecosystems. By following the six clear steps—checking your Windows version, turning on the required features, setting WSL 2 as default, installing a distro, and initializing it—you’ll have a native‑like Linux environment in minutes. Keep an eye on common mistakes, leverage the tips for smoother workflow, and you’ll soon be running Bash scripts, Docker containers, and even Linux GUI apps without ever leaving Windows. Happy coding!
Photo by Antonis Georgiou on Unsplash






