Run Linux on Windows: WSL Setup in One Command
Type two words, restart once, and a full Ubuntu shell lives right next to your Windows apps.
A tutorial wants you to run grep, a coding course assumes a Bash shell, or a project's README only explains the Linux way. A few years ago that meant a virtual machine or a second boot partition. Today Windows has a full Linux environment built in, and you can install it by typing two words. The Windows Subsystem for Linux, WSL for short, runs real distributions such as Ubuntu or Debian right next to your Windows apps, without the overhead of a classic VM.
You need Windows 11, or Windows 10 version 2004 (build 19041) or newer, plus admin rights for the install. Plan around 15 minutes including a restart.
Step 1: Install WSL with wsl --install
- Search the Start menu for PowerShell, right-click it and choose Run as administrator.
- Type the following and press Enter:
wsl --install
- Restart your PC when the command finishes.
The whole install fits into one line. Screenshot from Microsoft's WSL documentation.
That single line does a lot behind the scenes. It enables the optional WSL and Virtual Machine Platform components, downloads the current Linux kernel, sets WSL 2 as the default and installs Ubuntu as your first distribution.
Prefer Debian, openSUSE or Kali? Run wsl --list --online to see what's available, then install your pick with wsl --install -d <DistroName>, for example wsl --install -d Debian.
If something goes wrong: if wsl --install only prints the help text, WSL is already partly installed. In that case use the -d variant above to add a distribution. If the download hangs at 0.0 %, run wsl --install --web-download -d Ubuntu, which fetches the distribution before installing it.
Step 2: Set up Ubuntu on first launch
After the restart, open Ubuntu from the Start menu. The first launch takes a moment, because the files are unpacked and stored on your PC. Every later start takes about a second.
Then Ubuntu asks for a UNIX username and a password.
First launch: pick a Linux username. It doesn't have to match your Windows name.
A few things to know here:
- The username and password belong to this Linux distribution only. They have nothing to do with your Windows account.
- While you type the password, nothing appears on screen. No dots, no stars. That's normal Linux behavior, so just type and press Enter.
- This account becomes the Linux administrator and can run commands with
sudo.
Forgot the password later? Open PowerShell, type wsl -u root to log into your default distribution as root, then set a new password with passwd <username> and leave with exit.
Step 3: Bring Ubuntu up to date
Windows Update does not touch the software inside your Linux distribution. You do that yourself, and it's the very first thing you should run:
sudo apt update && sudo apt upgrade
Enter your Linux password when prompted and confirm the upgrade. Repeat this every now and then, just as you would on any Linux PC.
Step 4: Move files between Windows and Linux
This is where WSL feels like magic. Both worlds can see each other's files.
From Linux to Windows files: your Windows drives are mounted under /mnt. Drive C: is /mnt/c, so your Windows user folder sits at /mnt/c/Users/<YourName>.
From Windows to Linux files: type \\wsl$ in the File Explorer address bar to see all installed distributions and their file systems. In recent Windows versions, File Explorer also shows a Linux entry in the navigation pane.
The Linux entry in File Explorer lists every installed distribution. Screenshot from Microsoft's documentation, older Explorer ribbon.
The quickest trick of all: inside Ubuntu, type
explorer.exe .
The dot at the end matters. It opens the current Linux folder in File Explorer.
Commands work across the border too. In PowerShell, wsl ls -la runs the Linux ls in your current Windows folder. In Ubuntu, notepad.exe launches Windows Notepad.
Performance tip: keep files on the side of the tools that work on them. If you use Linux tools in the Linux shell, store projects in your Linux home folder, such as /home/<user>/Project, not under /mnt/c. Accessing files across the two file systems works, but it's noticeably slower.
Step 5: Keep WSL updated and shut it down
A handful of commands from PowerShell keep WSL under control:
wsl --updateupdates WSL itself to the latest version.wsl --versionshows the WSL, kernel and component versions.wsl --statusshows your default distribution and settings.wsl --list --verbose(orwsl -l -v) lists installed distributions, whether they're running and whether they use WSL 1 or 2.wsl --shutdownstops all running distributions and the lightweight WSL 2 virtual machine at once. Use it after changing settings, or when WSL is hogging memory.wsl --terminate Ubuntustops just one distribution.
For daily work, the Windows Terminal is the most comfortable home for WSL. Each installed distribution automatically gets its own profile there, so Ubuntu is just a new tab away.
Step 6: Remove a distribution
Tried Kali for a weekend and done with it? Remove a distribution like this:
wsl --unregister <DistroName>
Be careful: this deletes all data, settings and software inside that distribution for good, with no recycle bin. Copy anything you want to keep to a Windows folder first. Alternatively, uninstall the distribution app like any other Store app. To start fresh, reinstall it with wsl --install -d <DistroName>.
Our verdict
WSL is the easiest way to get a real Linux shell on a Windows PC, and for students, web developers and anyone following Linux-first tutorials it beats a full VM on convenience. When you need a complete Linux desktop or other operating systems, a VM tool like VirtualBox is still the better fit. Do this today: run wsl --install, restart, and follow it with sudo apt update && sudo apt upgrade. Your Linux corner is ready in under 15 minutes.


