To run Linux commands inside Windows 10, install Windows Subsystem for Linux (WSL) and a Linux distribution such as Ubuntu. Windows remains the operating system that starts when you turn on the PC. For a full Linux desktop selected at startup, follow the Ubuntu dual-boot instructions instead.
Install WSL and a distribution
- Press Windows key + R, enter
winver, and check the build. Microsoft’s simple installation command requires Windows 10 version 2004, build 19041, or later. Earlier builds require different setup instructions. An eligible build for WSL may still be outside standard Windows 10 support. - On an eligible PC, open PowerShell as administrator. For a new installation with the default Ubuntu distribution, enter
wsl --install. Let it finish, then restart Windows if prompted. - If you want a different distribution, or WSL is already present and the command shows help, run
wsl --list --online. Use the name exactly as shown withwsl --install -d NAME, replacingNAMEwith the distribution name. For example, if the listing contains Ubuntu, the command iswsl --install -d Ubuntu.
Start Linux and check the installation
- Launch the distribution from Start, or enter
wsl -d Ubuntufrom PowerShell if Ubuntu is the installed name. On first launch, allow time for the distribution files to unpack. When prompted, create a Linux username and password. The password may show no characters while you type. These are Linux credentials for this distribution, separate from your Windows sign-in. - In the Linux shell, run
cat /etc/os-releaseto see the distribution information. Typeexitto return to PowerShell, then runwsl --list --verboseto see the installed distribution and its WSL version. A stopped distribution is still installed.
If the command or distribution is missing
If Windows does not recognize the install option, confirm the build and use Microsoft’s WSL installation instructions. If a distribution download stalls at 0.0%, Microsoft documents wsl --install --web-download -d NAME as an alternative. A virtualization error needs its specific error code and the PC’s hardware prerequisites checked before another installation attempt. See Microsoft’s WSL troubleshooting guide.
Use the WSL command reference to list and launch distributions. Avoid unregistering one as a troubleshooting shortcut because that deletes the distribution and its Linux files. If your next step is running containers, check Docker Desktop’s Windows and WSL requirements.
Tim Williams runs Everything Tech, where he writes and reviews plain-English guides for Windows, Office and web browsers, checking each one against the software maker’s own documentation. He has 12 years of experience in IT support and five years of experience writing online tutorials.