Windows 11 · How-To
How to Set Up WSL2 (Linux on Windows 11)
Open PowerShell as Administrator, run wsl --install, and restart your PC. That one command turns on the features WSL needs, installs the latest Windows Subsystem for Linux, and sets up Ubuntu with WSL 2 as the default. When you reboot, launch Ubuntu from the Start menu, create a Linux username and password, and you have a full Linux environment running alongside Windows 11.
The rest of this guide covers the details worth knowing: choosing a different distribution, the difference between WSL 1 and WSL 2 and how to set the default, keeping WSL updated, moving files between Windows and Linux, and the notes that matter for GPU compute and systemd.
Windows 11 (any edition), or Windows 10 version 2004 / build 19041 and higher — the prerequisite stated on
Microsoft Learn's Install WSL page,
which also documents the -d, --web-download and --list --online options
below. WSL 2 additionally needs
virtualization to be available, which the installer enables for you. An administrator account is required
to run the install command.
1. Install WSL with one command
- Right-click the Start button and choose Terminal (Admin), or search for PowerShell, right-click it and pick Run as administrator.
- Run:
wsl --install - Wait for it to enable the required components and download WSL and Ubuntu, then restart your PC when prompted.
- After the reboot, open Ubuntu from the Start menu. The first launch unpacks the distribution, then asks you to create a Linux username and password. This account is separate from your Windows sign-in.
That is the entire happy path. On Windows 11, wsl --install installs the Microsoft Store
version of WSL, enables the Virtual Machine Platform, and sets WSL 2 as the default version for new
distributions.
If you only want the WSL platform now and will pick a distribution later, run
wsl --install --no-distribution. To install WSL but not launch the distro immediately,
add --no-launch.
wsl --install just prints help text
WSL is already present on your system. Instead of re-installing the platform, list what is available
with wsl --list --online and install a specific distribution with
wsl --install -d <DistroName>. If a download stalls at 0%, use
wsl --install --web-download -d <DistroName>.
2. Pick a Linux distribution
Ubuntu is the default, but WSL supports many distributions, and you can install several side by side. To see the current catalog available for download:
wsl --list --online
That command can also be written wsl -l -o. To install a specific distribution, pass its
name with the -d flag:
wsl --install -d Debian
Replace Debian with any name from the online list — for example
Ubuntu-24.04, Debian, kali-linux, or openSUSE-Tumbleweed.
Each distribution appears in the Start menu with its own launcher, and you can run them independently.
If you are unsure, stay on Ubuntu. It has the widest documentation and community support for WSL, and almost every tutorial you will find assumes it. You can always add another distribution later without removing the first.
3. WSL 1 vs WSL 2 — and setting the default
WSL comes in two architectures, set out in Microsoft Learn's comparison of WSL 1 and WSL 2, whose feature table gives WSL 2 the full Linux kernel, managed VM and full system-call compatibility, and gives WSL 1 the win on performance across OS file systems:
- WSL 2 (the default) runs a genuine Linux kernel inside a fast, lightweight managed virtual machine. It gives full system-call compatibility and much faster performance for work done inside the Linux file system. This is the right choice for almost everyone.
- WSL 1 translates Linux system calls to Windows on the fly. It has no virtual
machine, and it can be faster when your files live on the Windows drive and are reached through
/mnt/c. A few specific workloads keep it deliberately.
New distributions installed with wsl --install already default to WSL 2. To confirm which
version each installed distribution is using:
wsl --list --verbose
Short form: wsl -l -v. The VERSION column shows 1 or
2. To make WSL 2 the default for anything you install in future:
wsl --set-default-version 2
To convert an existing distribution between versions, name it and the target version:
wsl --set-version Ubuntu 2
Switching a distribution between WSL 1 and WSL 2 can take a while and, for large projects, can fail
because of the differences between the two architectures. Back up important files inside the
distribution before you run wsl --set-version.
4. Keep WSL updated
WSL now ships as a Microsoft Store package rather than an OS component, so it is serviced separately from
Windows — Microsoft's
note on WSL in the Microsoft Store
says to run wsl.exe --update to pull the latest features and servicing, and to append
--web-download if the Store is blocked on your network. From an elevated PowerShell:
wsl --update
To confirm the installed versions of WSL and its kernel components:
wsl --version
And for a summary of your configuration — default distribution, default version and kernel:
wsl --status
If you ever need WSL to reload its virtual machine — for example after changing a configuration file — shut everything down cleanly with:
wsl --shutdown
5. Access files across Windows and Linux
The two file systems are fully browsable from each other. Microsoft Learn's Working across file systems article documents all three routes below, and recommends keeping project files on whichever file system matches the tools you are running.
- From Linux, reach your Windows drives under
/mnt. YourC:drive is at/mnt/c, yourD:drive at/mnt/d, and so on. For example:cd /mnt/c/Users/. - From Windows, reach your Linux files by typing
\\wsl$\or\\wsl.localhost\into the File Explorer address bar to see each installed distribution as a network location. - Open the current Linux folder in File Explorer straight from a WSL shell with:
explorer.exe .
For the fastest builds and git operations under WSL 2, store your working files inside the Linux file
system (for example under ~/ or /home/), not on the Windows drive through
/mnt/c. Cross-file-system access carries a performance cost, so match the file location to
where the tools run.
6. Run Linux tools alongside Windows
WSL is designed to blend the two environments, and you can call across the boundary in both directions:
- Run a Windows program from inside Linux by appending
.exe, for examplenotepad.exeorexplorer.exe .. - Run a single Linux command from PowerShell without opening a shell, by prefixing it with
wsl. For examplewsl ls -laorwsl pwd. - Pipe between the two — Windows and Linux tools can be chained together on the same command line.
The most comfortable way to work with several shells at once is Windows Terminal, which is built into Windows 11. It opens each distribution — plus PowerShell and Command Prompt — in its own tab or pane, so you can switch between them instantly.
7. Notes on GPU compute and systemd
GPU compute. WSL 2 can pass your GPU through to Linux for accelerated compute workloads such as CUDA and DirectML. You do not install a Linux GPU driver inside the distribution. Instead, install the current WSL-enabled GPU driver in Windows from your GPU vendor, keep WSL updated, and the GPU is exposed to Linux automatically.
systemd. Modern WSL can run systemd, which many Linux services and
packages expect. It is enabled per distribution through the /etc/wsl.conf file. Edit (or
create) that file inside the distribution, for example with sudo nano /etc/wsl.conf, and add:
[boot]
systemd=true
Save the file, then from Windows run wsl --shutdown and reopen the distribution for the
change to take effect.
/etc/wsl.conf
This file controls how the distribution boots and mounts drives. A typo can stop it from starting
cleanly. Change only the settings you understand, and keep a note of what you edited so you can revert
it if a distribution behaves unexpectedly.
Frequently asked
Do I still need to enable Windows features manually to install WSL2?
No. On Windows 11 and current builds of Windows 10, the single command wsl --install enables everything WSL2 needs, including the Virtual Machine Platform, installs the latest WSL, and installs Ubuntu by default. The old manual route of turning features on and off in the Control Panel is only needed on older builds or in specific troubleshooting cases.
What is the difference between WSL1 and WSL2?
WSL1 translates Linux system calls to Windows in real time, while WSL2 runs a real Linux kernel inside a lightweight, managed virtual machine. WSL2 gives you full system-call compatibility and much faster performance on Linux-native files, and it is the default. WSL1 can still be faster when your project files live on the Windows drive and are accessed through /mnt/c, so a few workloads keep it deliberately.
How do I open my Linux files from Windows File Explorer?
Open File Explorer and type \\wsl$\ or \\wsl.localhost\ in the address bar to browse your installed distributions, or run explorer.exe . from inside a WSL shell to open the current Linux folder. From Linux, your Windows drives are mounted under /mnt, for example /mnt/c for the C: drive. For best performance keep Linux project files inside the Linux file system, not under /mnt/c.
Can WSL2 use my GPU for compute workloads?
Yes. WSL2 supports GPU-accelerated compute for frameworks such as CUDA and DirectML. You do not install a Linux GPU driver inside the distribution; instead you install the current WSL-enabled GPU driver in Windows from your GPU vendor, and WSL2 exposes the GPU to Linux automatically. Keep both Windows and WSL updated for the best results.
Browse all how-to guides for more current, step-by-step Windows 11 walk-throughs, or explore the windows-now.com archive of restored community posts from the original site.