To install WSL2 on Windows 11, right-click Start, select Terminal (Admin), run wsl --install, and restart your PC. The command turns on the Windows Subsystem for Linux, installs WSL2, and adds Ubuntu. After the restart, Ubuntu opens and asks you to create a Linux user name and password.
WSL lets you run Linux tools, the Bash shell, and even Linux apps with windows directly on Windows 11, without a separate virtual machine or dual boot. For a separate Ubuntu desktop at startup, use the dual-boot steps below. For a full desktop in a virtual machine, see how to run a virtual machine on Windows 11.
How to Install WSL2
- Right-click Start and select Terminal (Admin). Select Yes in the User Account Control prompt.
- Type this command and press Enter:
wsl --install
- Wait for the download and setup to finish, then restart the PC.
- After the restart, Ubuntu opens in a terminal window. If it doesn’t, select Start and open Ubuntu.
- Wait a minute while it unpacks the first time.
- Enter a new Linux user name and password. These are separate from your Windows account, and the password doesn’t show as you type.

New installs use WSL 2 by default, so you don’t need to set it separately. Microsoft’s WSL install documentation covers the same steps.
Update Ubuntu after installing
Run this inside Ubuntu to get the latest packages. It asks for the Linux password you just created.
sudo apt update && sudo apt upgrade
Install WSL in Windows 10
For Windows 10, check winver first: the simple installation command requires version 2004, build 19041 or later. Open PowerShell as administrator, run wsl --install, and restart when requested. Launch the installed distribution and create its Linux user as described above, then check wsl -l -v for version 2. Microsoft’s installation guide covers both Windows versions and links to a separate manual process for older builds. Enabling only the Windows Subsystem for Linux checkbox does not by itself install a usable Linux distribution.
Install a Different Linux Distribution
- Run
wsl --list --onlineto see the available distributions. - Run
wsl --install -dfollowed by the name, for example:
wsl --install -d Debian
To make that distribution the one that opens when you type wsl, run wsl --set-default Debian.
Want Kali instead of Ubuntu or Debian? Our Kali Linux on Windows 11 guide explains its specific installation command, first-launch setup, verification and optional Win-KeX desktop.
How to Use WSL After Installing
Once the first-run account setup finishes, you can open Ubuntu from Start whenever you need Linux. You do not need to repeat the installation or enable Windows features each time.
- Open a regular PowerShell tab in Terminal and run
wsl -l -v. Check that your distribution is listed and its VERSION column says 2. - Run
wsl ~to open the default distribution in your Linux home folder. To choose another installed distribution, usewsl -d Debian, replacing Debian with its listed name. - Inside Linux, run
pwdto show your current folder andlsto list its files. Runcd ~to return to your Linux home folder. - To browse that folder in Windows, run
explorer.exe .inside Linux. Include the space and final period. Your Windows C drive is also available at/mnt/c. - Type
exitto leave the Linux shell and return to PowerShell. This does not uninstall Ubuntu or delete your saved files.
Keep Linux development projects in the Linux home folder for better file performance. Use /mnt/c when you need Windows files, and put quotes around paths containing spaces. Linux filenames distinguish uppercase and lowercase letters. Microsoft explains these differences in its Windows and Linux file systems guide.
Installing WSL does not automatically install Docker. If you need containers, follow Docker’s WSL 2 instructions and check its prerequisites. Distribution access is configured in Docker Desktop under Settings > Resources > WSL Integration.
Install Docker Desktop With WSL 2
WSL is the prerequisite, not Docker itself. Check Docker’s Windows installation requirements for your edition, architecture and support status. Its x64 list includes Windows 10 version 22H2 and Windows 11 version 23H2 or later, 8 GB RAM and hardware virtualization. Docker supports Windows releases within Microsoft’s servicing timeline; do not assume any old Windows 10 installation qualifies. Run wsl --version and wsl --update; Docker requires WSL 2.1.5 or later. Restart if requested.
Download Docker Desktop from that official page, run the installer, choose the WSL 2 backend when offered, and finish setup. Open Docker Desktop from Start. Review its subscription agreement and licensing eligibility before agreeing; some commercial and government use requires payment. Installation does not start Docker automatically.
In Docker Desktop, check Settings > General > Use WSL 2 based engine; on WSL-capable systems this may already be enabled without a visible switch. In Settings > Resources > WSL Integration, enable your intended distribution and apply the change. Run wsl -l -v in PowerShell to confirm that distribution uses version 2. Docker’s WSL backend instructions explain these controls and warn that a separate Docker Engine or CLI installed inside the distribution can conflict. Preserve existing container data before changing such an installation.
With Docker Desktop running, open the integrated distribution’s terminal and run docker version. Client and Server details confirm that the command can reach the engine; a connection error means setup is incomplete. For a first container, Docker’s container introduction shows a welcome-page container. To bind it only to this PC, use docker run -d -p 127.0.0.1:8080:80 docker/welcome-to-docker. Open http://localhost:8080 to check its welcome page, then stop the test container in Docker Desktop when finished.
Useful WSL Commands
wsl -l -v: list installed distributions and whether each uses WSL 1 or 2.wsl --set-version Ubuntu 2: convert an existing distribution to WSL 2. Back up important Linux files before converting; the conversion can take time and fail.wsl --update: update WSL to the latest version.wsl --shutdown: stop all running distributions immediately. Save your work first; this ends running Linux processes.
Microsoft lists more in its basic WSL commands.
What You Can Do With WSL2
- Run Linux apps with windows: WSL supports Linux GUI apps on Windows 11. Install one in Ubuntu, such as sudo apt install gedit, and it appears in the Start menu. Microsoft explains this in its Linux GUI apps guide.
- Code in VS Code: install the WSL extension in Visual Studio Code to edit and run projects stored in Linux. See Microsoft’s VS Code with WSL tutorial.
- Open Windows files: your C drive is available in Linux at /mnt/c.
If the Install Fails

- Error 0x80370102 or a virtualization message: WSL2 needs hardware virtualization. Turn on Intel VT-x or AMD-V (sometimes called SVM) in the BIOS or UEFI settings. See how to turn on hardware virtualization in Windows 11.
wsl --install only shows help text:WSL is already partly installed. Runwsl --install -d Ubuntuinstead.- The install hangs at 0.0%: Microsoft suggests
wsl --install --web-download -d Ubuntu, which downloads the distribution first. - Old or broken WSL: run
wsl --update, then restart the PC.
Microsoft’s WSL troubleshooting guide lists other error codes and fixes.
Install Ubuntu Desktop Alongside Windows (Dual Boot)
Choose dual boot when you want to start a full Ubuntu desktop instead of Windows. WSL runs Linux within Windows; its checkbox does not set up dual boot. Back up the PC and USB contents first, keep Windows recovery information available, and check hardware compatibility in Ubuntu’s installation guide.
Download the appropriate Ubuntu Desktop ISO and use a USB drive of at least 8 GB. On Windows, download Rufus from its official site. In Rufus, verify Device, choose SELECT beside Boot selection, open the ISO, and choose START. Follow its additional-file prompts and use ISO Image mode when offered. Confirm erasure only after checking the USB name and capacity; wait for READY. Ubuntu’s USB-writing instructions explain these controls. Copying the ISO onto the drive is insufficient.
Restart with the USB connected and select it in the PC manufacturer’s boot menu. The key varies by model. Use Try Ubuntu first to check hardware, then open Install Ubuntu. Choose language, keyboard and network, then Interactive installation when offered. At Disk setup, choose Install Ubuntu alongside Windows Boot Manager, select the intended disk and allocate space for Ubuntu. Keep Windows and its recovery partitions; Erase disk removes the selected disk’s data.
If the installer reports BitLocker or cannot offer a suitable alongside option, stop before committing disk changes. Ubuntu’s BitLocker guidance explains that it cannot safely map an encrypted Windows installation for this setup. Decryption reduces protection, and some Windows versions may not allow encryption to be enabled again. Review that guidance and your recovery arrangements before deciding; a separate unencrypted disk or WSL may fit better. An Intel RST warning also requires its specific vendor guidance, rather than a random firmware change.
Create the Ubuntu username and password, choose the time zone, and inspect the final disk-change summary before Install. When finished, restart and remove the USB when prompted. Select Ubuntu or Windows from the boot menu offered by the installation or firmware. Verify that both systems start and your Windows files remain available; keep the backup. In Ubuntu, open Software Updater to check updates.
If Windows Is Not Installed Yet
On a blank PC, install and activate your licensed Windows edition before following the Ubuntu dual-boot steps. Check Windows 11 hardware compatibility and follow our Windows installation-media guide to create the Microsoft USB installer, boot it, select the intended disk, complete setup and check Windows updates and drivers. A Windows license does not come with Ubuntu. If Windows is already installed, keep it and its files rather than reinstalling it just to add Linux. Back up the working Windows installation, then use the Ubuntu dual-boot procedure above. That procedure uses Ubuntu as the specific Linux distribution; other distributions have different installers.
Uninstall WSL Without Losing Unbacked-Up Linux Files
First distinguish removing one Linux distribution from removing WSL itself. Save Linux work and review dependencies such as Docker Desktop before changing anything. In Windows Terminal or PowerShell, wsl --list --verbose lists the exact installed distribution names. For each distribution you intend to remove, make a backup outside its Linux filesystem: for example, replace ExactName and the destination in wsl --export "ExactName" "C:\Backups\ExactName.tar" with its actual listed name and an existing Windows backup folder. Wait for success, confirm the exported file exists and verify that your needed files are recoverable before proceeding. Microsoft documents listing, export and removal commands and explains distribution backups. An unverified export is not a reason to discard your only copy.
When you intentionally want to erase that distribution, wsl --unregister "ExactName" permanently removes its Linux files, settings and installed software. Use only the exact intended name after checking the backup; repeat only for other distributions you actually intend to remove. Run the list command again to confirm the name is gone. To remove its launcher app, open Settings > Apps > Installed apps, find the exact distribution app such as Ubuntu, use its three-dot menu > Uninstall and complete the prompts. Then, if no WSL workloads remain and you want the current WSL package removed, find Windows Subsystem for Linux in Installed apps and uninstall that package when present. Microsoft’s app-removal instructions cover this Windows 11 interface. A distribution app and the WSL package are separate entries.
For an older Windows-feature installation, or optional features left after package removal, search Start for Turn Windows features on or off. Record the existing selections, clear Windows Subsystem for Linux only if you no longer need that component, select OK and restart if Windows requests it. Clear Virtual Machine Platform only after checking that no other virtual-machine or application workload requires it. Microsoft’s manual installation guide identifies these separate WSL features. Afterward, check Installed apps and the feature selections again. Do not manually delete Windows system folders or Linux disk files to finish removal. Reinstalling WSL alone will not restore an unregistered distribution’s data; recovery requires your backup. These steps do not remove an Ubuntu dual-boot partition.
Use Windows 10 App Controls When Removing WSL
On Windows 10, follow the backup and exact-distribution removal procedure above first. For the launcher app, open Settings > Apps > Apps & features, select the intended distribution such as Ubuntu and choose Uninstall. If the separately installed Windows Subsystem for Linux package is listed and you no longer need WSL workloads, uninstall that package too. Microsoft’s app-removal guide distinguishes Windows versions. The older Windows-feature installation uses Turn Windows features on or off as described above, with a restart when requested. Verify the app list and feature selections afterward; manually deleting AppData package folders is not an appropriate cleanup step.
Frequently Asked Questions
Does WSL2 work on Windows 11 Home?
Yes. WSL2 works on Home, Pro, and other editions of Windows 11.
What version of Windows do I need for WSL?
Any version of Windows 11 works. On Windows 10, the wsl --install command needs version 2004 (build 19041) or later, according to Microsoft’s install guide.
How do I make WSL2 the default for new distributions?
It already is on new installs. If an older setup still uses WSL 1, run wsl --set-default-version 2.
Where are my Linux files?
In File Explorer, select Linux in the left pane to browse each distribution’s files.
How do I uninstall a Linux distribution from WSL?
Run wsl --unregister Ubuntu (use your distribution’s name from wsl --list). This permanently deletes that distribution’s files, settings, and installed software, so copy anything you need to Windows first. You can also uninstall the distribution app from Settings > Apps > Installed apps.
If a Windows command-line tool isn’t found, you may need to add its folder to your Path. See how to open environment variables in Windows 11.

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are tested on current devices or checked against official product documentation, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.