What Is WSL? Windows Subsystem for Linux Explained
By Mirko Peters ·
What Is WSL? The Windows Subsystem for Linux explained for admins and developers: WSL 1 vs WSL 2, install with wsl --install, when to pick WSL, a VM or Dev Box, and the file, memory and networking pitfalls.
WSL, the Windows Subsystem for Linux, is a Windows feature that runs a real Linux distribution, Ubuntu by default, next to your Windows apps. You get Bash, apt, grep, Python and the rest of the Linux toolchain without dual boot and without managing a separate virtual machine.
Key points
- WSL runs a Linux distribution next to Windows. WSL 2 is the default and uses a real Linux kernel in a managed, lightweight VM.
- One elevated command, wsl --install, enables the required features and installs Ubuntu. It needs Windows 10 version 2004 (build 19041) or later, or Windows 11.
- Keep project files in the file system of the tools you use. Crossing /mnt/c from Linux tools is the slow path in WSL 2.
- By default WSL 2 may use 50% of Windows memory plus swap of 25%. Cap it in %UserProfile%\.wslconfig.
- NAT is the default network mode. Mirrored mode on Windows 11 22H2 or later helps with VPNs and LAN access.
- Microsoft builds WSL for inner-loop development, not for production. Intune can control it with a dedicated set of settings.
This article covers the two WSL versions, the install, the choice between WSL, a full VM and Dev Box, and the pitfalls I see most often: slow file access, memory use and networking.
What is WSL 2, and how does it differ from WSL 1?
WSL 1 translated Linux system calls for Windows. WSL 2 runs a full Linux kernel in a managed Hyper-V virtual machine that starts and stops on its own. WSL 2 is the default for new distributions. Microsoft's comparison:
| Feature | WSL 1 | WSL 2 |
|---|---|---|
| Integration between Windows and Linux | Yes | Yes |
| Fast boot, small footprint vs. traditional VMs | Yes | Yes |
| Full Linux kernel, full system call compatibility | No | Yes |
| systemd support | No | Yes |
| Managed VM | No | Yes |
| Performance across OS file systems | Yes | No |
| Runs next to VMware and VirtualBox | Yes | VMware 15.5.5+ only, VirtualBox unsupported |
Microsoft reports that early WSL 2 builds were up to 20x faster than WSL 1 when unpacking a zipped tarball, and about 2-5x faster for git clone, npm install and cmake. That gain only holds on the Linux file system.
My rule of thumb: use WSL 2 unless your files must live on the Windows drive and Linux tools work on them all day. That is the main case for WSL 1. Microsoft also lists serial ports, strict memory limits and a host-network IP as reasons.
How to install WSL
You need Windows 10 version 2004 or later (build 19041 and higher) or Windows 11. Home editions work too. Open PowerShell as administrator and run:
wsl --install
Then restart. The command enables the Virtual Machine Platform and Windows Subsystem for Linux features and installs Ubuntu. Useful follow-ups:
wsl --list --onlineshows the distributions you can install.wsl --install -d <Distro>installs a different one.wsl --list --verboseshows installed distributions and their WSL version.wsl --set-default-version 2sets the version for new distributions.wsl --set-version <Distro> 1or2converts an existing one.wsl --updateupdates WSL itself. WSL moved from an inbox Windows component to the Microsoft Store, so it updates outside the Windows release cycle.- If an install hangs at 0.0%,
wsl --install --web-download -d <Distro>downloads the distribution first.
WSL runs on x64 and Arm64. On managed devices, IT may have blocked WSL by policy. That is a company setting, not a broken laptop.
WSL vs a full VM vs Dev Box
Here is how I decide:
| Need | WSL 2 | Full Hyper-V VM | Microsoft Dev Box |
|---|---|---|---|
| Linux CLI, scripts, Azure tooling on your laptop | Best fit | Works, more overhead | Overkill |
| Own IP on the LAN, full control of networking | Needs mirrored mode or port proxy | Best fit | Not the goal |
| Serial ports | Not supported | Yes | Not the goal |
| Isolated, centrally managed cloud workstation | No | No | Yes, but retiring |
| Production workloads | No | On a server or in Azure | No |
Microsoft says WSL is built for inner-loop development and recommends the WSL container API for production apps that use Linux runtimes. Microsoft Dev Box retires on 18 September 2028, and its closing-down period started on 14 September 2026. Microsoft points customers to Windows 365 instead.
My recommendation: give developers WSL 2 on their managed device first. Reach for a full VM only when you need real network identity or hardware access, and do not start new Dev Box projects.
Pitfall 1: the /mnt/c file system trap
Windows drives appear in Linux under /mnt/, so C:\Users\you\Project becomes /mnt/c/Users/you/Project. Windows sees Linux files under \\wsl$ in File Explorer. Both directions work, but crossing them is slow in WSL 2. It hurts most with thousands of small files, such as node_modules.
Microsoft's guidance is clear: store files in the file system of the tools you use. Linux tools get /home/<user>/Project. PowerShell and Windows apps get C:\. The VS Code WSL extension lets you keep the project in Linux and still edit it from Windows.
Pitfall 2: memory and disk
WSL 2 defaults are generous. Memory is 50% of Windows memory, processors match the Windows logical processor count, and swap is 25% of memory, rounded up to the nearest GB. A 16 GB laptop gives Linux up to 8 GB plus 4 GB swap. Older WSL 2 builds kept cached pages until the instance shut down.
Set limits in %UserProfile%\.wslconfig, which does not exist by default:
[wsl2]
memory=6GB
swap=2GB
[experimental]
autoMemoryReclaim=gradual
sparseVhd=true
Current builds set autoMemoryReclaim to dropCache by default, which releases that cache. sparseVhd=true makes newly created virtual disks sparse. Changes apply once the VM has fully stopped, typically about 8 seconds after you close all shells, or right after wsl --shutdown. Note that wsl --shutdown stops every running distribution.
Pitfall 3: networking modes
WSL uses NAT by default. Windows reaches a Linux web server on localhost, but other devices on your network don't. In NAT mode you need a netsh interface portproxy rule, and the WSL IP changes on restart.
On Windows 11 22H2 and later, set networkingMode=mirrored under [wsl2]. Mirrored mode adds IPv6, direct LAN access, multicast and better VPN compatibility. With WSL 2.0.9 or later on Windows 11 22H2, the Hyper-V firewall is on by default, so inbound traffic may still need a firewall rule.
My rule of thumb: if WSL has no network on a corporate VPN, try mirrored mode before you open a ticket. On managed devices that block custom networking, admins have to set it centrally.
Managing WSL in the enterprise
In Intune, go to Devices > Configuration Profiles > Create > New Policy > Windows 10 and later > Settings catalog and search for "Windows Subsystem for Linux". You can also control WSL and its key security settings with Group Policy. Microsoft recommends disabling the inbox WSL version, WSL 1, the debug shell, and custom kernel, networking and firewall configuration, among other settings. Defender for Endpoint has a WSL plug-in that monitors running distributions. Microsoft lists as unsupported: controlling which distributions users can use, controlling root access, and patching distributions with Windows tools.
My recommendation: allow WSL, block WSL 1, lock the security settings, and own Linux package patching as a developer responsibility.
Related
Sources
- Comparing WSL versions (Microsoft Learn)
- How to install Linux on Windows with WSL (Microsoft Learn)
- Working across Windows and Linux file systems (Microsoft Learn)
- Advanced settings configuration in WSL (Microsoft Learn)
- Accessing network applications with WSL (Microsoft Learn)
- Frequently asked questions about WSL (Microsoft Learn)
- Set up WSL for your company (Microsoft Learn)
- Intune settings for WSL (Microsoft Learn)
- What is Microsoft Dev Box? (Microsoft Learn)
FAQ
What is WSL?
WSL, the Windows Subsystem for Linux, lets you run a Linux distribution such as Ubuntu directly on Windows 10 or 11, with Linux command-line tools and apps, without a traditional virtual machine or dual boot.
Should I use WSL 1 or WSL 2?
Microsoft recommends WSL 2 for its performance and full system call compatibility. WSL 1 still fits when project files must stay on the Windows file system and you access them from Linux, because WSL 1 is faster across file systems.
Does WSL work on Windows Home?
Yes. WSL 2 is available on all desktop editions where WSL is available, including Windows 10 Home and Windows 11 Home. It needs the Virtual Machine Platform and Windows Subsystem for Linux features, which wsl --install enables.
Why does WSL use so much memory?
WSL 2 may use up to 50% of Windows memory by default and older builds kept cached pages until the instance shut down. Set memory and swap limits in .wslconfig and check the autoMemoryReclaim setting.
Can companies block or control WSL?
Yes. Intune has a Windows Subsystem for Linux category in the settings catalog, and Microsoft also supports Group Policy for this. You can block WSL entirely, block WSL 1 or lock settings like custom kernels and networking.