What WSL is
WSL (Windows Subsystem for Linux) lets you run Linux tools and the Bash shell on Windows, without a separate virtual machine or a dual boot. It is great for developers who use Linux commands, scripts and tools.
Bash is the default command shell of most Linux systems. You can use it for scripts, file work and server administration.
Requirements
- Windows 10 version 1903 or higher (build 18362 or newer), or Windows 11.
- Hardware virtualization turned on in the BIOS/UEFI.
- A 64-bit system.
The quick way (recent Windows)
Open PowerShell as administrator and run:
wsl --install
This turns on the needed features and installs Ubuntu by default. Restart the computer when asked. Then open Ubuntu from the Start menu and create a user name and password. To see other distributions:
wsl --list --online
wsl --install -d Debian
The step-by-step way
Step 1: Turn on WSL
- Open the Start menu and go to Settings, then Apps.
- Click Optional features, then More Windows features.
- Tick Windows Subsystem for Linux and Virtual Machine Platform. Click OK and restart.
Or run these commands in an elevated PowerShell:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Step 2: Pick a Linux distribution
Open the Microsoft Store and search for the distribution you like, such as Ubuntu or Debian.
Step 3: Install it
Click Get or Install. Then start it from the Start menu. The first start takes a few minutes. Create a user name and a password.
Step 4: Update the packages
In the Linux terminal, run:
sudo apt update
sudo apt upgrade
If your distribution uses another package manager, change apt to match it.
Step 5: Use WSL 2 (recommended)
WSL 2 is faster and more compatible. Set it as the default:
wsl --set-default-version 2
Check the version of your distributions:
wsl -l -v
Use it
- Start Bash by opening the distribution from the Start menu, or by typing
wslin PowerShell or Command Prompt. - Your Windows drives are in
/mnt/c,/mnt/d, and so on. - Use Windows Terminal for a good experience.
Quick recap
wsl --installis the fastest way.- Create a Linux user and run
sudo apt update. - Use WSL 2.