Skip to main content
Installing Windows Subsystem for Linux 2 on Windows 11 - Virtarix Blog

Installing Windows Subsystem for Linux 2 on Windows 11

October 14, 2025 · Blog / Technical Guides

If you’re using Windows 11, Windows Subsystem for Linux 2 (WSL 2) can bring a Linux environment into your workflow. Microsoft documents support for systemd, GPU-accelerated compute, Docker and Dev Container workflows, and Linux GUI applications; check the official WSL documentation for the requirements that apply to your Windows build.

With these improvements, you can now run full Linux distributions such as Ubuntu, Debian, or Fedora on your Windows machine without relying on virtual machines or dual-boot setups. The experience feels almost identical to working on a native Linux system, letting developers, researchers, and students code, test, and deploy Linux applications right inside Windows – no restarts or complicated setup needed.

In this updated guide, you’ll learn how to install WSL 2 on Windows 11 using both the quick one-command method and the manual setup method. You’ll also see how to configure and update your Linux distribution for better performance, enable systemd, optimize your setup using the .wslconfig file, and connect your Windows and Linux environments for a smooth workflow. The quick installation usually takes about 10–15 minutes, while the manual setup with full configuration may take around 20–30 minutes.

Prerequisites

Before beginning the installation, verify your system meets these requirements:

  • Windows 11 with the latest updates installed through Windows Update
  • Hardware virtualization enabled (Intel VT-x or AMD-V) in your BIOS/UEFI settings
  • Administrator access to run PowerShell or Command Prompt with elevated privileges
  • Stable internet connection for downloading kernel updates and Linux distributions
  • At least 8GB of available disk space (20GB+ recommended for comfortable usage)

Quick verification

To verify your system is ready:

  1. Press Win + I to open Settings
  2. Navigate to System > About
  3. Confirm Windows 11 version is 22000 or higher
  4. Check that your processor supports virtualization

Verify virtualization is enabled

  • Open Task Manager (Ctrl + Shift + Esc)
  • Click the Performance tab
  • Select CPU

Check if "Virtualization" shows "Enabled"

If virtualization is disabled, restart your computer and enter BIOS/UEFI settings (usually by pressing F2, F12, Del, or Esc during boot) to enable Intel VT-x or AMD-V.

Quick installation method (recommended)

Microsoft introduced a simplified installation command that automates the entire WSL 2 setup process. This is the recommended method for most users running modern Windows 11 builds.

Single command installation

1. Open PowerShell as administrator

  • Right-click the Start button
  • Select "Windows Terminal (Admin)" or "PowerShell (Admin)"

2. Run the installation command

Install WSL with the default distribution
    wsl --install

3. Review what the command does automatically

  • Enables the Windows Subsystem for Linux feature
  • Enables the Virtual Machine Platform feature
  • Downloads and installs the latest Linux kernel
  • Sets WSL 2 as the default version
  • Installs Ubuntu (the default distribution)

4. Restart and complete the Ubuntu setup

  • Create a Linux username (lowercase recommended, no spaces)
  • Set a secure password (characters won't display as you type – this is normal)

Installation is complete! You now have a fully functional Ubuntu environment running on WSL 2.

Installing a different distribution

If you prefer a Linux distribution other than Ubuntu:

View available distributions

List Linux distributions available for WSL
wsl --list --online

This displays all available Linux distributions, including Ubuntu variants, Debian, Kali Linux, openSUSE, and more.

Install your preferred distribution

Install Debian on WSL
wsl --install -d Debian

Replace Debian with any distribution from the list (e.g., Ubuntu-24.04, kali-linux, openSUSE-Leap-15.5).

Verification

After installation, verify everything is working:

Show the WSL status
wsl --status

You should see output indicating Default Version: 2 and your installed distribution.

List installed WSL distributions and versions
wsl --list --verbose

This displays all installed distributions and confirms they're running WSL version 2.

Manual installation method (alternative)

Use this method if the quick installation fails, when troubleshooting issues, or if you require more granular control over the installation process.

Step 1: enable required Windows features

Open PowerShell as Administrator and execute the following commands without rebooting between them:

Enable the Windows Subsystem for Linux feature
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

This command enables the Windows Subsystem for Linux feature, which provides the foundation for running Linux distributions.

Enable the Virtual Machine Platform feature
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

This command enables the Virtual Machine Platform, which WSL 2 requires to create its lightweight virtual machine environment.

Now, restart your computer to apply these system-level changes.

Step 2: install the WSL 2 Linux kernel update

After your system restarts, download the latest WSL 2 Linux kernel update package from Microsoft’s WSL 2 Linux kernel update package. Once the download is complete, run the installer file named wslupdatex64.msi. Follow the installation wizard using the default settings, and then click “Finish” when the installation completes.

In recent Windows 11 builds, the WSL 2 kernel may already be included. If the installer notifies you that it is already present, you can safely skip this step.

Step 3: set WSL 2 as default version

In an Administrator PowerShell window, execute:

Set WSL 2 as the default version
wsl --set-default-version 2

This ensures any Linux distribution you install will automatically use WSL 2 rather than the older WSL 1 architecture.

Verify the change:

Verify the WSL default settings
wsl --status

The output should display "Default Version: 2."

Step 4: install a Linux distribution

You have two options for installing distributions:

Microsoft Store (recommended)

  1. Open the Microsoft Store application
  2. Search for your preferred Linux distribution (e.g., "Ubuntu 24.04 LTS")
  3. Click "Get" or "Install"
  4. Wait for the download to complete

Command line

Install Ubuntu 24.04 on WSL
wsl --install -d Ubuntu-24.04

Replace Ubuntu-24.04 with any distribution name from wsl –list –online.

Step 5: launch and configure your distribution

Launch your Linux distribution either from the Start menu or by running the command wsl -d Ubuntu-24.04 in PowerShell or Command Prompt. Then wait for the initialization process to complete – the first launch may take 1–2 minutes.

Once initialized, you’ll be prompted to create your Linux user account. Enter a username (use lowercase letters and avoid spaces) and then set a password. The password field will not display any characters as you type; this is completely normal.

Your Linux password is independent of your Windows password, so make sure to store it securely, as it will be required whenever you use sudo commands. After setup completes, you’ll be greeted with a Linux command prompt, indicating your distribution is ready to use.

Need a real Linux VPS after local WSL testing?

Use WSL for local tooling, then run production-like Linux workloads on a Virtarix VPS with root access, NVMe storage, snapshots, backups, and remote server control.

Updating and configuring your Linux distribution

Update Linux packages

Inside your Linux terminal, run the following commands to update your system:

Update and upgrade packages in WSL
sudo apt update && sudo apt upgrade -y

This updates the package lists and upgrades all installed packages to their latest versions. The initial update may take several minutes to complete.

For a more thorough update:

Fully upgrade and remove unused packages
sudo apt full-upgrade -y
sudo apt autoremove -y

These commands upgrade all packages (including kernel updates) and remove unnecessary packages.

Update WSL kernel

Return to PowerShell (Administrator) and update the WSL kernel to the latest version:

Update the WSL kernel and components
wsl --update

This fetches the latest WSL kernel releases and components from Microsoft.

Then, cleanly shut down all running WSL instances to apply updates:

Shut down all WSL instances
wsl --shutdown

Restart your distribution normally after the shutdown completes.

Verify installation

Confirm WSL 2 is properly installed and configured:

Confirm the WSL installation status
wsl --status

Check your installed distributions and their versions:

Check each installed distribution's WSL version
wsl --list --verbose

The output should show your distribution running on version 2.

If a distribution shows version 1, convert it to WSL 2:

Convert Ubuntu 24.04 to WSL 2
wsl --set-version Ubuntu-24.04 2

Replace Ubuntu-24.04 with your actual distribution name.

Essential post-installation configuration

About systemd in WSL

Systemd is the modern Linux initialization system that many services and applications depend on, including Docker, snapd, and various system services. WSL 2 supports systemd natively, but it requires manual enablement.

Enable systemd in WSL

Open your WSL distribution and edit the WSL configuration file:

Open the WSL distribution configuration
sudo nano /etc/wsl.conf

Add the following lines:

Enable systemd in WSL
[boot]
systemd=true

Save the file (Ctrl + O, Enter, then Ctrl + X to exit).

Shut down WSL from PowerShell:

Restart WSL after enabling systemd
wsl --shutdown

Restart your distribution – systemd is now active.

Verify systemd is running:

List active systemd services
systemctl list-units --type=service

You should see a list of active services managed by systemd.

If you get an error like:

"System has not been booted with systemd as init system (PID 1). Can't operate."

Double-check that:

  • /etc/wsl.conf includes systemd=true under [boot]
  • You shut down WSL completely using wsl –shutdown
  • You restarted your distribution from scratch (not a reopened terminal session)

Optimizing performance and resources

Using .wslconfig for resource limits

By default, WSL 2 can consume up to 50% of your total RAM or 8GB (whichever is smaller), and use all available CPU cores. For better control over system resources, create a configuration file.

Create the configuration file

Open PowerShell and create .wslconfig in your Windows user directory:

Attempt to open .wslconfig in Notepad
notepad $env:USERPROFILE.wslconfig

Add configuration settings (adjust values based on your system):

Set WSL 2 resource limits
[wsl2]
## Limits VM memory (adjust based on your RAM)
memory=4GB
## Sets the VM to use a specific number of processors
processors=2
## Sets swap file size (used when RAM is exhausted)
## Recommended: 25–50% of your memory limit
## Note: Swap is slower than RAM — if used often, increase memory instead
swap=2GB
## Enables nested virtualization (needed for Docker)
nestedVirtualization=true

Save and close the file.

Restart WSL to apply changes:

Restart WSL to apply resource limits
wsl --shutdown

Recommended settings by system RAM

  • 8GB RAM: memory=3GB, processors=2
  • 16GB RAM: memory=6GB, processors=4
  • 32GB+ RAM: memory=8GB or more, processors=4–8

Post-installation tips

Accessing files between Windows and Linux

Access Windows files from Linux

Your Windows drives are automatically mounted under /mnt/:

Navigate to Windows documents from WSL
cd /mnt/c/Users/YourUsername/Documents
ls

Access Linux files from Windows

From Windows File Explorer, navigate to:

Attempt to access Ubuntu files from Windows Explorer
\wsl$Ubuntu-24.04homeyourusername

Or simply type \wsl$ in the address bar to see all distributions.

For best performance, store project files that Linux tools will access frequently (like code repositories) in the Linux filesystem (~/projects) rather than in Windows directories (/mnt/c/). Operations on files in the Linux filesystem are 5-10x faster.

Slow path

Show a project path on the Windows filesystem
/mnt/c/Users/yourusername/projects/

Fast path

Show a project path in the Linux filesystem
~/projects/

Example

Clone a project into the WSL Linux filesystem
## Create projects directory in Linux filesystem
mkdir ~/projects
cd ~/projects
## Clone repositories here, not in /mnt/c/
git clone https://github.com/yourrepo.git

This especially matters for:

  • Node.js or Python projects
  • Git operations
  • Compilation tasks
  • Docker volumes

Conclusion

You’ve now set up WSL 2 on your Windows 11 system and turned it into a complete Linux workspace. With support for systemd, GPU acceleration, and smooth file sharing between Windows and Linux, you can now work, test, and develop in a Linux environment without leaving Windows.

From here, you can install your favorite tools, set up your projects, or start experimenting with coding, Docker, or other Linux-based workflows. WSL 2 makes it easy to get the best of both systems – simple, fast, and ready for whatever you want to build next.

Ready to move from local WSL experiments to a real VPS?

Compare Virtarix VPS sizes for Linux development, testing, and remote services with root access, NVMe storage, IPv4 + IPv6, snapshots, and backups.

VPS S

For small sites, dev servers and Docker

$ 5 .50 /month
  • 3 cores
  • 6 GB
  • 50 GB NVMe
  • Unlimited
Get It Now
BEST SELLER

VPS M

For growing apps, websites and staging

$ 11 .40 /month
  • 6 cores
  • 16 GB
  • 100 GB NVMe
  • Unlimited
Get It Now
Peter French
About the Author Peter Frenchis the Managing Director at Virtarix, with over 17 years in the tech industry. He has co-founded a cloud storage business, led strategy at a global cloud computing leader, and driven market growth in cybersecurity and data protection.