
Overview
- WSL 2 (Windows Subsystem for Linux 2) allows running a full Linux environment on Windows.
- Unlike WSL 1, WSL 2 uses a real Linux kernel, provided by Microsoft.
- WSL 2 utilizes Hyper-V technology and runs on a lightweight virtual machine, leveraging the Windows Hypervisor Platform.
- WSL 2 is automatically installed when installing a Linux distribution from the Microsoft Store.
WSL Command
# Check WSL Version
wsl -l -v # List all WSL distributions with their versions
wsl -l # List installed WSL distributions
wsl -v # Show WSL version (available in WSL 2+)
wsl --status # Show general WSL configuration and default version
# Update WSL to the latest version
wsl --update # Update the WSL kernel and related components
wsl --version # Show WSL version details (Windows 11+)
# List available Linux distributions
wsl --list --online # Show available Linux distributions for installation
# Reset & Reinstall Ubuntu (Run in Windows Terminal)
wsl --unregister Ubuntu # Remove Ubuntu (all data will be erased)
wsl --install Ubuntu # Reinstall a fresh Ubuntu
Installation
Install Ubuntu for WSL from the Microsoft Store:
- WSL 2 and all necessary components are installed automatically.
- Provides a full Ubuntu user-space environment.
- No GUI by default, but you can install a graphical interface (e.g., XFCE4) if needed.
Required Windows Features
- Do not enable "Windows Subsystem for Linux", which is for WSL 1
- Microsoft Store installation will automatically enable:
- Virtual Machine Platform
- Windows Hypervisor Platform
Additional
- Ensure CPU virtualization is enabled in Task Manager > Performance > CPU.
- WSL 2 uses a real Linux kernel but shares networking and filesystems with Windows.