How to Use WSL in Windows 11

The Windows Subsystem for Linux (WSL) allows you to run a Linux environment directly on Windows 11 without creating a virtual machine or setting up a dual-boot system. It enables developers, system administrators, students, and Linux enthusiasts to use Linux command-line tools, programming languages, package managers, and applications alongside Windows.

With WSL, you can install popular Linux distributions such as Ubuntu, Debian, Fedora, Kali Linux, and openSUSE, then run Linux commands, develop applications, manage files, and even run graphical Linux applications. This guide explains how to install WSL, configure a Linux distribution, use essential commands, and troubleshoot common issues on Windows 11.

What Is WSL?

Update Windows Drivers

Windows Subsystem for Linux is a Windows feature that provides a Linux-compatible environment without requiring a separate operating system installation.

PC running slow or unstable? Do you want to update drivers?

WSL lets you:

  • Run Linux commands
  • Install Linux distributions
  • Develop software
  • Use Bash shell
  • Manage Linux packages
  • Access Windows files
  • Run scripting languages
  • Use Git and SSH
  • Run Linux graphical applications
  • Test Linux software

WSL integrates Linux and Windows so you can use both operating systems together.

Benefits of Using WSL

WSL offers several advantages over traditional virtual machines.

Some benefits include:

  • Fast startup
  • Low resource usage
  • Easy installation
  • Native Windows integration
  • Access to Linux package managers
  • Supports multiple Linux distributions
  • File sharing between Windows and Linux
  • Command-line development
  • GPU support for compatible workloads
  • Support for graphical Linux applications

It is especially useful for developers working across multiple platforms.

System Requirements

Before installing WSL, ensure your PC meets these requirements:

  • Windows 11
  • Administrator privileges
  • Virtualization enabled in BIOS or UEFI
  • Internet connection
  • At least 4 GB RAM (8 GB recommended)
  • Around 10 GB of free storage
Repair PC

Most modern Windows 11 computers support WSL.

Method 1: Install WSL Using a Single Command

The easiest way to install WSL is through Command Prompt or Windows PowerShell.

PC running slow or unstable? Do you want to update drivers?

Steps:

  1. Open Command Prompt or Windows PowerShell as Administrator.
  2. Run the following command:
wsl --install
  1. Wait for Windows to install the required components.
  2. Restart your computer when prompted.

After restarting, Windows automatically installs the default Linux distribution, usually Ubuntu.

Method 2: Install a Specific Linux Distribution

To see available Linux distributions:

wsl --list --online

The command displays supported distributions.

To install a specific distribution:

wsl --install -d Ubuntu

Replace Ubuntu with another supported distribution if desired.

Complete the Linux Setup

PC running slow or unstable? Do you want to update drivers?

When launching Linux for the first time:

  1. Wait for installation to finish.
  2. Create a Linux username.
  3. Create a password.
  4. Complete the initial setup.

Your Linux environment is now ready to use.

Check the Installed WSL Version

To verify your installation:

wsl --version

This displays:

  • WSL version
  • Kernel version
  • Windows version
  • Installed components

Keeping WSL updated ensures better compatibility and performance.

Update WSL

To install the latest updates:

wsl --update

Restart WSL after updating if necessary.

Launch Linux

To open your installed Linux distribution:

  • Open it from the Start menu, or
  • Run:
wsl

The Bash shell opens, allowing you to enter Linux commands.

Basic Linux Commands

Once inside WSL, you can use familiar Linux commands.

Some commonly used commands include:

pwd

Displays the current directory.

ls

Lists files and folders.

cd

Changes directories.

mkdir Projects

Creates a new folder.

rm filename

Deletes a file.

cp source destination

Copies files.

mv source destination

Moves or renames files.

These commands work the same as they do on a standard Linux system.

Update Linux Packages

After installing a Linux distribution, update the package list.

For Ubuntu:

sudo apt update
sudo apt upgrade

This installs the latest security updates and package improvements.

Install Software

You can install software directly from the Linux package manager.

Example:

sudo apt install git

Other commonly installed tools include:

  • Python
  • Node.js
  • GCC
  • Docker CLI
  • Curl
  • Vim
  • Nano

Installing software through the package manager is quick and secure.

Access Windows Files

WSL allows access to Windows drives.

For example:

cd /mnt/c

This opens the Windows C: drive.

Other drives are available under:

  • /mnt/d
  • /mnt/e
  • /mnt/f

This makes it easy to work with files stored in Windows.

Access Linux Files from Windows

Windows File Explorer can access Linux files.

In the address bar, type:

\\wsl$

You’ll see all installed Linux distributions and can browse their files.

Run Linux GUI Applications

Modern versions of WSL support graphical Linux applications.

Simply install a supported application and launch it.

Examples include:

  • Gedit
  • GIMP
  • Firefox (Linux version)
  • Visual Studio Code (Linux environment)

Windows automatically displays the application on your desktop.

Set the Default Linux Distribution

If multiple distributions are installed:

wsl --set-default Ubuntu

Replace Ubuntu with your preferred distribution.

List Installed Distributions

To see installed distributions:

wsl --list --verbose

The output includes:

  • Distribution names
  • Running state
  • WSL version

Shut Down WSL

To completely stop all Linux instances:

wsl --shutdown

This is useful when restarting services or applying updates.

Uninstall a Linux Distribution

If you no longer need a distribution:

  1. Open Settings.
  2. Go to Apps > Installed apps.
  3. Locate the Linux distribution.
  4. Select Uninstall.

Alternatively:

wsl --unregister Ubuntu

This removes the selected distribution and all of its data.

Common WSL Problems and Solutions

WSL Won’t Install

Ensure virtualization is enabled in your BIOS or UEFI firmware and that Windows 11 is fully updated.

Linux Won’t Launch

Restart your PC and run:

wsl --update

If necessary, reinstall the Linux distribution.

Command Not Found

Verify that the required package is installed and that the command is spelled correctly.

Slow Performance

Store Linux projects inside the Linux file system rather than on Windows drives for improved performance, especially when working with many small files.

Network Problems

Restart WSL using:

wsl --shutdown

Then reopen your Linux distribution.

Tips for Better Performance

For the best WSL experience:

  • Keep Windows 11 updated.
  • Update WSL regularly.
  • Update Linux packages frequently.
  • Use WSL 2 whenever possible.
  • Store development files within the Linux file system.
  • Install only the software you need.
  • Back up important Linux projects.
  • Restart WSL occasionally to clear temporary issues.

Conclusion

WSL brings the power of Linux to Windows 11 without the complexity of dual-boot configurations or virtual machines. It provides developers, students, and IT professionals with a fast, lightweight, and highly integrated Linux environment for programming, scripting, testing, and system administration.

Installing WSL takes only a few minutes, and once configured, you can run Linux commands, install packages, develop applications, and even launch graphical Linux programs directly from Windows. By keeping WSL and your Linux distribution updated, you’ll enjoy a reliable and productive cross-platform development environment.

Frequently Asked Questions

Is WSL available in Windows 11?

Yes. Windows 11 includes support for the Windows Subsystem for Linux and allows you to install it with a single command.

Which Linux distribution should I install?

Ubuntu is the most popular choice for beginners because of its extensive documentation and community support. However, Debian, Fedora, Kali Linux, and openSUSE are also available depending on your needs.

Can I run Linux GUI applications in WSL?

Yes. WSL supports many graphical Linux applications, allowing them to run directly on the Windows 11 desktop without additional configuration.

Is WSL faster than a virtual machine?

In most development scenarios, WSL starts faster and uses fewer system resources than a traditional virtual machine while providing excellent integration with Windows 11.

PC running slow or unstable? Do you want to update drivers?

GeeksDigit.Com
Logo