I run Windows all day and I need Linux most days. WSL is how those two facts stop fighting each other. It gives you a real Linux kernel, real package management, and access to your Windows files, without a virtual machine to babysit or a dual boot to reboot into.
I have written a fair number of WSL posts over the years, so this page pulls them together in the order you would actually need them. If you are brand new to it, start with the install below and come back for the rest.
Two companion guides cover the Windows side: PowerShell for automating it, and Windows Administration for building and domain-joining the machines themselves.
Start Here: One Command
On any current build of Windows 10 or 11, installing WSL is a single command in an elevated terminal. It enables the required features, fetches the kernel, and installs Ubuntu as the default distribution:
# install WSL with the default distro (Ubuntu) wsl --install # see what else is available wsl --list --online # install a specific distro instead wsl --install Ubuntu-24.04
Reboot when it asks, and you will be prompted to create a Linux username and password on first launch. The older manual route, enabling Windows features by hand and side-loading the distro, still works and is written up in the install guides below if you need to understand what that one command is doing.
The Guides
🔧 Getting Started
📁 Working With Files
⚙️ Managing Distributions
🔄 Restarting & Fixing
Most WSL problems are solved by restarting one distro rather than everything. That guide covers --terminate, --shutdown and the service restart, in that order.
📦 Installing Things Inside Ubuntu
The Commands Worth Memorising
| Command | What it does |
|---|---|
wsl -l -v | List every distro with its version and whether it is running. The first thing to run when something is wrong. |
wsl --terminate <Distro> | Stop one distribution and leave the rest alone. |
wsl --shutdown | Stop everything, including the WSL 2 virtual machine. Takes Docker Desktop with it. |
wsl -d <Distro> | Start a session in a specific distribution. |
wsl -s <Distro> | Set the default distribution. |
wsl --set-version <Distro> 2 | Move a distribution between WSL 1 and WSL 2. |
wsl --unregister <Distro> | Delete a distribution and everything in it. No undo. |
explorer.exe . | Run inside WSL to open the current Linux folder in Windows File Explorer. |
Two Things That Catch People Out
Your Windows drives live under /mnt. The C: drive is /mnt/c, so a Windows path like C:\temp is /mnt/c/temp from inside Linux. Going the other way, your Linux files are reachable from Windows at \\wsl.localhost\<Distro>\ (the older \\wsl$\ form still works).
Docker Desktop lives in WSL too. That is why wsl --shutdown is a bigger hammer than people expect: it stops your containers as well. If only one distribution is misbehaving, terminate that one instead.
Frequently Asked Questions
WSL 1 or WSL 2, which should I use?
WSL 2 by default. It runs a real Linux kernel and handles Linux workloads properly. The one case for WSL 1 is heavy file access across the Windows boundary, which WSL 1 does faster because there is no virtual machine in the way. You can move a distribution either way with wsl --set-version.
Does WSL slow my machine down?
Only while it is running. WSL 2 starts its virtual machine on demand and releases memory back when distributions are idle. If you want it gone until next time, wsl --shutdown stops everything.
Which Ubuntu version should I install?
The newest LTS available to you. Run wsl --list --online to see the current options, then install by name, for example wsl --install Ubuntu-24.04. The older guides on this site were written against 20.04, which has now reached the end of its standard support, but the steps are the same.
Can I run SQL Server in WSL?
Yes, SQL Server has run on Linux since SQL Server 2017, and WSL 2 is a reasonable place to try it on a laptop. For anything resembling production work I would use a proper Linux host or a container, not WSL.
If SQL Server is part of your day job, my current work lives over at sqldba.blog: production DBA scripts, an error library and the SSMS guide.
Leave a Reply