Windows Subsystem for Linux (WSL) allows you to run a Linux environment directly on Windows without the overhead of a traditional virtual machine. This guide will walk you through installing WSL using the Windows Terminal or Command Prompt.
The easiest way to install WSL is using the new simplified command available in recent Windows versions.
Win + X
and select “Windows Terminal (Admin)” or “Command Prompt (Admin)”Run the following command to install WSL with the default Linux distribution (Ubuntu):
wsl --install
This command will: - Enable the required Windows features (WSL and Virtual Machine Platform) - Download and install the latest Linux kernel - Set WSL 2 as the default version - Download and install Ubuntu (default distribution)
After the installation completes, restart your computer when prompted.
After reboot, Ubuntu will automatically launch and ask you to: - Create a username (can be different from your Windows username) - Set a password for your Linux user account
If you prefer more control over the installation process or the simple method doesn’t work:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart Windows to complete the feature installation.
wsl --set-default-version 2
List available distributions:
wsl --list --online
Install your preferred distribution (e.g., Ubuntu):
wsl --install -d Ubuntu
You can choose from several Linux distributions:
To install a specific distribution:
wsl --install -d <DistributionName>
After installation, here are some helpful commands to manage your WSL environment:
wsl --status
wsl --list --verbose
wsl --set-default <DistributionName>
wsl -d <DistributionName>
wsl --shutdown
wsl --update
Download and install the WSL2 Linux kernel update package from Microsoft’s official website.
Run this command as administrator:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Enable virtualization in your BIOS/UEFI settings. Look for options like: - Intel VT-x - AMD-V - Virtualization Technology
Once WSL is installed, you can:
wsl
in any terminal or search for your Linux distribution in the Start menuapt
for Ubuntu)/mnt/c/
to access your C: driveWSL provides a powerful way to run Linux tools and applications on Windows. The installation process has been greatly simplified, making it easier than ever to get started with Linux development on Windows machines.
For more advanced configurations and troubleshooting, refer to the official Microsoft WSL documentation.