Home life · Updated
How to Install WSL on Windows: Step-by-Step Guide
Windows Subsystem for Linux (WSL) lets you run a Linux distribution, such as Ubuntu, alongside Windows without setting up a traditional virtual machine or dual-boot system. It is useful for Linux command-line tools, software development, and learning Linux. On supported Windows versions, installation is mostly one command; you will then choose a distribution and create a Linux user account. Save any open work first, because the process may require a restart.
What You’ll Need
- A PC running a supported, updated version of Windows 11 or Windows 10. The simplest
wsl --installmethod is available on Windows 11 and on Windows 10 version 2004 or later (build 19041 or later). - An account with administrator privileges, plus Windows Terminal or PowerShell. You can open either by searching the Start menu.
- An internet connection to download WSL components and a Linux distribution.
- For WSL 2, hardware virtualization must be available and enabled in your computer’s firmware. Most recent PCs support it; some managed or older devices may need an administrator to enable it.
- A little free disk space for the Linux distribution and any software you install inside it.
Step-by-Step
- Check your Windows version. Open Settings, select System, then About, and look under Windows specifications. You can also press
Windows+R, enterwinver, and press Enter. If your Windows 10 version is older than 2004 or its build is below 19041, run Windows Update and install available feature updates before continuing. Restart if Windows asks. - Open an elevated terminal. Search for Windows Terminal or PowerShell from Start, right-click the result, and choose Run as administrator. Approve the User Account Control prompt. The title bar may say Administrator. The install command changes Windows features, so a regular, non-administrator terminal can return an access or permission error.
- Run the WSL installation command. Enter
wsl --installand press Enter. Windows enables the required components, installs the WSL 2 platform, and normally downloads Ubuntu as the default Linux distribution. Wait for the command to finish; do not close the terminal while installation is in progress. If prompted to restart, save your work and restart Windows. - Choose a distribution if you do not want Ubuntu. Ubuntu is a practical default for most beginners, but other distributions may be available. In the administrator terminal, run
wsl --list --onlineto see the names Windows currently offers. Then install one by runningwsl --install -d Debian, replacingDebianwith the exact name shown in the list. Some distributions may be installed through the Microsoft Store, depending on your Windows setup. - Complete the first Linux launch. After the restart, Ubuntu or the distribution you selected may start automatically. If it does not, open Start, search for its name, and launch it. The first start can take a few minutes while files are unpacked. When asked, create a Linux username and password. These are for the Linux environment and do not have to match your Windows sign-in. Linux does not display characters as you type a password; type it carefully and press Enter.
- Confirm that WSL 2 is in use. Open PowerShell or Windows Terminal and run
wsl --list --verbose. Find your distribution in the output and check the VERSION column. A value of2means it is using WSL 2. If it shows1, runwsl --set-version Ubuntu 2, substituting your distribution’s exact name. You can set WSL 2 as the default for future installations withwsl --set-default-version 2. - Update WSL and Linux packages. In an administrator terminal, run
wsl --updateto check for WSL platform updates. Then open your Linux distribution and, for Ubuntu or Debian, runsudo apt updatefollowed bysudo apt upgrade. The first command refreshes package information; the second installs available updates. Other distributions use different package managers, so follow their documentation rather than copying these commands. - Try a basic command and exit cleanly. At the Linux prompt, run
pwdto see your current directory orlsto list its contents. Linux has its own filesystem, while Windows drives are commonly available under/mnt; for example, the Windows C: drive is usually/mnt/c. Typeexitto close the Linux shell. You can start it again from Start or by typingwslin a terminal.
Common Mistakes
Using a terminal without administrator rights: WSL setup may need to turn on Windows features. If the command fails with an access-denied or elevation message, close that window and reopen Terminal or PowerShell using Run as administrator.
Assuming the first launch is stuck: The initial distribution setup can take several minutes, especially on a slower PC or connection. Give it time before closing the window. If it remains unresponsive for a long period, use the troubleshooting steps below.
Confusing the Linux password with the Windows password: The Linux account is separate. Password characters are intentionally hidden while you type, so an empty-looking prompt is normal. If you lose this password, it can be reset from a root shell; it is not recovered by changing your Windows password.
Mixing Windows and Linux paths: A path such as C:\Users\Name is not written the same way in Linux. Windows drives are generally mounted under /mnt, while Linux files live in the distribution’s own filesystem. Use the right path format for the shell and tools you are running.
Expecting every distribution to use the same commands: Ubuntu and Debian use apt, but distributions such as Fedora use other package managers. Check which distribution you installed before following Linux-specific setup instructions.
Tips
Use WSL 2 for most new installations. It runs a real Linux kernel in a lightweight managed virtual machine and is the better fit for most modern development tasks. WSL 1 remains useful for particular workflows that need close access to Windows files or have compatibility requirements, but you usually do not need to select it deliberately.
Keep project files in the filesystem that matches the tools doing most of the work. For Linux command-line development, storing projects in your Linux home directory, such as /home/yourname, can provide better performance than working with many files under /mnt/c. Windows applications can still access Linux files through File Explorer by entering \\wsl$ in the address bar, or by using the distribution’s supported network path.
To see installed distributions and their versions, run wsl --list --verbose. To stop all running WSL distributions, use wsl --shutdown. This is handy after changing settings or when a Linux process seems to be using resources in the background. It does not uninstall your distributions or delete their files.
WSL is designed to integrate with Windows: you can launch Windows programs from Linux and Linux tools from Windows, though exact behavior depends on your setup. Keep Windows and your distribution updated, and back up important Linux files just as you would back up files on any other computer.
Troubleshooting
The command says WSL is not recognized or --install is unknown: Check the Windows version and build again. Install Windows updates, restart, and try from an administrator terminal. If your PC cannot be updated to a version that supports the single-command installation, use Microsoft’s manual WSL installation instructions for your specific Windows release; the required feature-enabling steps vary by version.
You see a virtualization or WSL 2 error: First install pending Windows updates and restart. If the message says virtualization is disabled, check Task Manager’s Performance tab for the virtualization status. If it is disabled, enable Intel VT-x or AMD-V/SVM in UEFI/BIOS settings, using your PC maker’s instructions. On a work or school computer, contact its administrator if firmware settings are locked. If WSL 2 is unavailable on that device, WSL 1 may be an option for your workload.
The distribution download fails or stalls: Check your internet connection and whether a firewall, proxy, or organizational policy blocks Microsoft Store downloads. Retry wsl --install -d Ubuntu from an elevated terminal, or install the distribution through the Microsoft Store if it is available there. A restart can clear a pending installation state.
The distribution opens but setup is incomplete: Close the shell and start the distribution again from Start. If you see a message asking you to create a UNIX username, complete that prompt. For broader WSL status information, run wsl --status. To restart WSL without rebooting Windows, run wsl --shutdown and launch the distribution again.
You need to convert an existing distribution: Check its exact name with wsl --list --verbose, then run wsl --set-version NAME 2, replacing NAME with that listed name. Conversion can take time, so keep the terminal open and ensure you have enough disk space. Do not uninstall the distribution as a workaround unless you have backed up files you want to keep.
Frequently Asked Questions
Is WSL free?
Yes. WSL is a Windows feature, and the Linux distributions offered through WSL are generally free to install. A particular distribution may have its own terms, so check those if you use it for business.
Does installing WSL remove Windows or change my boot setup?
No. WSL runs Linux alongside Windows; it does not replace Windows or require dual boot. You can open and close Linux like an application, and Windows remains your main operating system.
Which Linux distribution should a beginner install?
Ubuntu is a straightforward starting point and is the default for wsl --install on many systems. Choose another distribution if a course, workplace, or software project specifically requires it.
How do I open Linux after installation?
Search for your distribution, such as Ubuntu, in the Start menu and open it. Alternatively, run wsl in Windows Terminal to open your default distribution, or use wsl -d Ubuntu to specify one by name.
Can I uninstall WSL or a Linux distribution later?
You can remove a distribution from Windows Settings or with wsl --unregister NAME. Unregistering permanently deletes that distribution’s Linux files, so export or copy anything important first. Removing a distribution is different from disabling WSL itself.
Related
- How to Clean Gmail Inbox: Step-by-Step Guide
- Print Excel Sheets to Fit on Paper: Step-by-Step
- How to Change iPhone Region: Step-by-Step
Sources: general know-how. Menus and buttons can differ slightly by version. Spotted something out of date? Tell us.