Features and apps
Windows 11 WSL2: Install Linux in One Command, Step by Step
Written by Windows 11 Field Guide Editorial Team · Updated

Windows Subsystem for Linux lets you run a real Linux distribution, such as Ubuntu, Debian or openSUSE, directly on Windows: Bash, apt, compilers, Linux command-line tools and even Linux desktop apps, side by side with your Windows apps. On Windows 11, WSL2 is the version you want, and setting up Windows 11 WSL2 takes a single command. This guide covers installation, choosing and managing distributions, the commands you will use most, working with files across Windows and Linux, and how to fix or remove things.
Microsoft’s install instructions apply to every version of Windows 11, including 24H2, 25H2 and 26H2.
WSL 1 vs WSL 2 in one paragraph
WSL 2 runs a real Linux kernel in a lightweight utility virtual machine that Windows manages for you. WSL 1 translated Linux calls instead. Microsoft’s install guide says new installations made with wsl —install use WSL 2 by default, and Linux GUI apps only work on WSL 2. Unless you have a specific reason, such as working mostly on files on the Windows drive, stay on WSL 2.
Before you start
- Check virtualization. WSL 2 needs hardware virtualization (Intel VT-x or AMD-V/SVM). It is on by default on most PCs; if not, switch it on in the firmware as shown in our Windows 11 BIOS UEFI settings guide.
- Install Windows updates first, so the WSL components install cleanly.
- Use an administrator terminal. Right-click Start and select Terminal (Admin). Our Windows 11 Terminal guide explains profiles and tabs.
Install WSL with one command
-
In an administrator PowerShell window, run:
wsl --install -
Restart the PC when asked.
-
After the restart, the Ubuntu window opens. Microsoft notes that the first launch takes a moment while files decompress; later launches should take under a second.
-
Create a Linux user name and password. These are separate from your Windows account and are what Linux sudo asks for.
Microsoft adds that wsl —install only works if WSL is not installed at all. If you see the WSL help text instead, WSL is already there: use the distribution commands below. If an install hangs at 0.0%, Microsoft suggests wsl —install —web-download -d followed by the distribution name.
Choose a different distribution
Ubuntu is the default, but you can pick another:
wsl --list --online
wsl --install -d Debian
The first command lists distributions available to install; the second installs one by name. You can install several and switch between them. To set which one plain wsl opens, use wsl —set-default followed by its name.
Commands you will actually use
| Command | What it does |
|---|---|
| wsl | Opens your default distribution in the current window |
| wsl -l -v | Lists installed distributions, whether they are running, and WSL version 1 or 2 |
| wsl —set-version Ubuntu 2 | Converts a distribution to WSL 2 (back up first; Microsoft warns it can take time and fail on large projects) |
| wsl —update | Updates WSL itself |
| wsl —status | Shows default distribution, version and kernel information |
| wsl —shutdown | Stops all distributions and the WSL 2 virtual machine, for example after changing settings |
| wsl —export / —import | Backs up a distribution to a file or restores it, for example to move it to another drive |
Inside Linux, update software with the distribution’s own tools, for example sudo apt update and sudo apt upgrade on Ubuntu or Debian. That is separate from wsl —update, which updates the WSL platform. Linux sudo inside WSL is different from Sudo for Windows, which elevates Windows commands.
Working with files across Windows and Linux
Microsoft’s advice is clear: for speed, keep files in the file system of the tools you use. If you work in a Linux command line, store projects in your Linux home folder, for example /home/yourname/project, not on the Windows drive.
- Windows drives inside Linux: your C: drive appears at /mnt/c.
- Linux files from Windows: type \wsl$ in the File Explorer address bar to see each distribution’s files, or run explorer.exe . inside Linux to open the current folder.
- Mixing commands: you can run Linux tools from PowerShell with wsl followed by the command, and Windows programs from Linux by adding .exe, for example notepad.exe.
Microsoft also notes that Linux is case-sensitive and Windows is not, so file names that differ only by capital letters can cause surprises when you move files between them.
Linux GUI apps (WSLg)
WSL 2 can run Linux apps with a graphical interface, and they appear in the Start menu under the distribution’s name, can be pinned to the taskbar and work with Alt+Tab and copy and paste. Microsoft recommends installing the current graphics driver from your GPU maker for hardware acceleration; our guide to Windows 11 graphics drivers covers that. If you installed WSL a while ago, run wsl —update and then wsl —shutdown to get GUI support. Microsoft notes it is not a full Linux desktop.
When things go wrong
- Virtualization or “please enable the Virtual Machine Platform” errors: check virtualization in the firmware and install Windows updates, then try again.
- Install stuck or fails to download: try the —web-download option shown above, and check your internet connection.
- Network or DNS problems inside Linux: restart WSL with wsl —shutdown; if a VPN or firewall is involved, see Microsoft’s troubleshooting page.
- A distribution is broken beyond repair: export what you need, then reinstall it.
Microsoft’s WSL troubleshooting page lists specific error codes and fixes, and is worth checking before you reinstall anything.
Remove a distribution or WSL
To remove one distribution:
wsl --unregister Ubuntu
Microsoft warns that once unregistered, all data, settings and software in that distribution are permanently lost; reinstalling gives you a clean copy. Export it first if you might need anything. You can also uninstall a distribution like any other app from Settings > Apps > Installed apps.
Running Linux on its own drive or in a dual-boot setup is also possible, but for most development work WSL is simpler and safer, and it leaves your Windows setup untouched. For other built-in tools, see the Windows 11 features guide.
Developers who build on the Windows side can also speed up repositories and package caches with a Dev Drive in Windows 11.
Frequently asked questions
How do I install WSL2 on Windows 11?
Open PowerShell as administrator, run wsl --install and restart. Microsoft says this enables the features WSL needs and installs Ubuntu, and new installs use WSL 2 by default.
How do I check if I am using WSL 1 or WSL 2?
Run wsl -l -v in PowerShell. The VERSION column shows 1 or 2 for each installed distribution.
Can I install a distribution other than Ubuntu?
Yes. Run wsl --list --online to see what is available, then wsl --install -d followed by the distribution name.
Does WSL need virtualization enabled?
WSL 2 runs in a lightweight utility virtual machine, so hardware virtualization must be available. If installation fails with a virtualization error, check that it is enabled in your UEFI/BIOS settings.
How do I remove a Linux distribution?
Run wsl --unregister followed by the distribution name. Microsoft warns that all data, settings and software in that distribution are permanently lost, so back up first.
Sources
Windows 11 Field Guide Editorial Team
Editorial team
The Windows 11 Field Guide team writes and updates independent Windows 11 guides and checks each step against Microsoft's documentation and the current Settings app.




