To enable Windows Subsystem for Linux on Windows 11, open PowerShell as Administrator and execute the command
wsl --install. This single line automatically enables the necessary virtual machine platform features, installs the Linux kernel package, and sets Ubuntu as the default distribution. After the installation completes, you must restart your computer to finalize the configuration and allow the subsystem to initialize correctly.
Prerequisites and System Checks
Before running the installation command, it is crucial to verify that your system meets the minimum requirements. Windows 11 requires a 64-bit processor with Second Level Address Translation (SLAT), at least 4 GB of RAM, and virtualization capabilities enabled in the BIOS or UEFI firmware. Most modern computers have these features by default, but if you encounter errors related to virtualization, check your motherboard settings to ensure Hardware Virtualization Technology (Intel VT-x or AMD-V) is turned on.
Additionally, ensure your Windows version is up to date. Older builds of Windows 11 may lack the specific components required for WSL 2, which relies heavily on the Hyper-V architecture. Navigate to Settings > Windows Update and install any pending updates before proceeding. This step prevents compatibility issues during the feature installation phase.
Executing the Installation Command
The most efficient method to set up WSL is using the built-in command-line tool. Right-click the Start button and select "Terminal (Admin)" or search for PowerShell, then choose "Run as administrator." This elevation is mandatory because enabling system features requires administrative privileges. Once the terminal window is open, type the following command and press Enter:
wsl --install
This command performs several actions simultaneously. It enables the "Windows Subsystem for Linux" optional component, activates the "Virtual Machine Platform" which provides the lightweight utility VM used to run WSL 2, downloads and installs the Linux kernel update package, and sets Ubuntu as the default Linux distribution. If you prefer a different distribution, such as Debian or Kali Linux, you can specify it after the installation finishes using the
wsl --install -d <DistroName> command.
Wait for the process to complete. You will see progress indicators in the terminal. The download size varies depending on the selected distribution, but it typically takes only a few minutes on a standard broadband connection. Do not close the terminal window until the operation reports success.
Restarting Your Computer
After the installation script finishes, a prompt will appear asking you to restart your computer. This restart is non-negotiable. The changes made to the system features and the loading of new kernel drivers require a fresh boot cycle to take effect. If you skip this step, subsequent attempts to launch a Linux shell will fail with errors indicating that the subsystem is not properly initialized.
Click Restart now or schedule the restart for later. Once your computer boots back up, the WSL environment will be active. You can verify the installation by opening a new PowerShell window and typing
wsl. This should launch the Ubuntu terminal, prompting you to create a UNIX username and password. Note that this password is separate from your Windows login credentials and is used for administrative tasks within the Linux environment.
Troubleshooting Common Issues
If you encounter permission errors or access issues after installation, refer to our guide on resolving WSL permission problems with newly prepared drives. Sometimes, file system permissions between Windows and Linux paths can cause confusion when accessing shared directories. Understanding how WSL mounts Windows drives helps prevent data access conflicts.
Another common concern involves performance when moving large numbers of files between Windows and the Linux filesystem. Accessing files directly from
/mnt/c/ inside WSL can be significantly slower than native Linux operations. For better performance, store your project files within the Linux filesystem itself and only use the mounted Windows drive for storage that needs to be accessible from both operating systems. See our article on optimizing file transfer speeds for detailed strategies.
If you are dealing with disk space constraints, remember that WSL uses a dynamic VHDX file that grows as needed. However, shrinking the Windows partition to allocate more space to Linux can be tricky. Our tutorial on shrinking Windows partitions explains how to safely adjust your drive layout without losing data.
Verifying the Installation
To confirm everything is working correctly, open your Linux terminal and run
uname -r. This command displays the Linux kernel version. If it returns a version number starting with
5.x or higher, you are successfully running WSL 2. You can also check installed distributions by running
wsl -l -v, which lists all available Linux environments along with their versions and states.
Frequently Asked Questions
Can I install multiple Linux distributions?
Yes, you can install as many distributions as you like after the initial setup. Use the command
wsl --install -d <DistributionName> to add additional OS flavors like Debian, Fedora, or SUSE to your Windows 11 system.
Why does WSL ask for a UNIX password?
The UNIX password is created specifically for the root user within the Linux distribution you installed. It is independent of your Windows account and is required for executing administrative commands using
sudo inside the Linux terminal.
Is WSL 2 supported on Windows 10?
WSL 2 is supported on Windows 10, but only on versions 1903 or higher with build 18362 or above. Ensure your Windows 10 device is fully updated via Windows Update to access the latest WSL components and security patches.
How do I access Windows files from Linux?
Your Windows C: drive is automatically mounted at
/mnt/c/ inside the Linux filesystem. You can navigate to this directory using standard Linux commands like
cd /mnt/c/Users/YourName to access your Windows documents and projects.
What if the wsl command is not recognized?
If PowerShell says "wsl" is not recognized, your Windows build may be too old or the feature was never enabled. Check your Windows version using
winver and ensure you are on Windows 10 version 1903+ or Windows 11. Running
wsl --update can also help refresh the subsystem components if they are partially installed.