Getting WSL (Windows Subsystem for Linux) up and running on Windows 11 is pretty straightforward once you get the hang of it. It’s a game-changer if you want to run Linux commands without dual-booting or messing around with virtual machines. Usually, you just turn on a few features, pick your distro, and you’re away. But, of course, Windows love throwing in a few hoops to jump through, so here’s a real-world guide to help dodge some common snags.
Step-by-Step Tutorial: How to Install WSL on Windows 11
This is the plan — enable WSL, choose your distro, and start running Linux commands. Sounds easy, right? Sometimes a bit of troubleshooting helps, especially after big Windows updates or if some features aren’t turned on by default.
Step 1: Open PowerShell as Administrator
Hit the start button, type “PowerShell,” then right-click and choose Run as administrator. Don’t skip this, or you might run into permission headaches later, especially since you’re fiddling with system features.
Why it helps: Without admin rights, the commands to enable WSL or turn on features won’t work. It’s just quicker and less annoying to run it straight away. Sometimes, Windows won’t prompt you if you don’t run as admin, and you’ll be scratching your head.
Step 2: Enable WSL
Type this into PowerShell: wsl --install
and hit Enter.
On newer Windows 11 setups, wsl --install
will turn on the Virtual Machine Platform, install WSL, and even ask if you want to install the default Linux distro (usually Ubuntu). If it doesn’t work, you might need to turn on some Windows features manually:
Dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Dism /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
After running these, if wsl --install
stalls or fails, a quick reboot usually sorts it out — because, of course, Windows loves making things awkward.
Step 3: Restart Your PC
This step’s non-negotiable if you didn’t reboot after turning on features. Sometimes, the install just won’t go ahead until you give Windows a quick kick. Expect a reboot, have a cuppa, and be patient (or hope your reboot doesn’t hang, because Windows can be a bit temperamental).
Step 4: Pick a Linux Distro
Once you’re back online, head to the Microsoft Store or run wsl --list --online
in PowerShell to see what’s on offer. One setup had Ubuntu show up instantly, another took a bit longer. Pick what you like — Ubuntu, Debian, Kali, you name it. Just search “Linux” in the Store.
Tip: if you want a specific version, say Ubuntu 20.04 instead of the latest, find it with wsl --list --online
and install with wsl --install -d Ubuntu-20.04
.
Step 5: Launch and Finish Setting Up
Open your new distro from the Start menu. It’ll pop up a terminal asking you to set up a user name and password — typical Linux stuff. Once done, you’re all set.
You’ll see a prompt like username@hostname:~$
. Now, you can run Linux commands, install apps with apt-get
or your distro’s package manager, and get stuck into Linux—right inside Windows. First time might be a bit slow or quirky, but it usually smooths out after a reboot or two.
Tips for Installing WSL on Windows 11
- Make sure Windows 11’s up to date—older builds can cause dramas with WSL. Check Settings > Windows Update and grab all the updates.
- Turn on Hyper-V if your hardware can handle it (via Turn Windows features on or off) — though for WSL 2, you’ll probably already have it if Virtual Machine Platform is on.
- Run
wsl --update
now and then to keep WSL fresh. Old versions can cause issues with GUI apps or new features. - You can list all installed Linux distros with
wsl --list --verbose
or see what’s available online withwsl --list --online
. - If WSL is running slow or refusing to start, try Windows key + R, type
services.msc
, then restart LxssManager (the WSL service). Sometimes, WSL gets stuck, and a restart helps.
Frequently Asked Questions
What is WSL, and why should I bother?
It’s Windows’ way of running Linux without the faff of virtual machines. Devs love it because you get Linux tools right inside Windows — no dual-booting or containers needed. It’s dead handy for testing, scripting, or just having a Linux environment on the side.
Can I run graphical Linux apps on WSL?
Yep, WSL 2 now supports GUI apps natively, so you can run a Linux app with a window just like on a real Linux desktop. Might need a few tweaks, but it works a treat.
How do I stay up to date?
Run wsl --update
regularly and keep your distro’s packages current — like sudo apt update && sudo apt upgrade
for Ubuntu. Sometimes updates cause hiccups, but usually, just doing regular updates keeps it smooth.
Can I run multiple distros?
For sure. Install a few for different projects or testing. They can run side-by-side, and switch between them with wsl -d DistroName
.
How do I uninstall a distro?
Head to Settings > Apps, find the distro, and hit *Uninstall*. Or from PowerShell, use wsl --unregister DistroName
. Sometimes remnants stick, but a clean uninstall usually does the trick.
Summary
- Open PowerShell as admin (don’t skip this bit).
- Type
wsl --install
and let Windows do the heavy lifting. - Reboot if needed — often it’s a must.
- Pick a distro from the Microsoft Store or with
wsl --list --online
. - Launch it, set up your user/pass, and you’re away.
Hopefully, this helps cut a few hours off your setup. Windows and Linux aren’t always the best mates straight away, but once it’s done, it’s dead handy. Good luck diving into Linux on Windows 11!