Installing WSL on Windows

Installing WSL on Windows

WSL Installation

System Requirements

Before installing WSL, ensure your system meets these requirements:

  • Windows 10 version 2004 (May 2020 Update) or later
  • Windows 11 (recommended)
  • At least 4GB RAM
  • 5GB free disk space for Ubuntu

Method 1: Quick Installation (Recommended)

The fastest way to install WSL is using a single command:

Step 1: Open PowerShell or Command Prompt

Press Win + X and select Windows Terminal (Admin) or PowerShell (Admin).

Step 2: Run the Installation Command

wsl --install

This command will:

  • Enable required Windows features
  • Download and install WSL2
  • Install Ubuntu as the default distribution

Step 3: Restart Your Computer

After installation completes, restart your computer to apply changes.

Step 4: Create Your Linux Account

When Ubuntu first launches, you'll be prompted to create a username and password. This is your Linux user account (separate from your Windows account).

Method 2: Manual Installation

If you prefer more control, follow these steps:

Step 1: Enable WSL Feature

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

Step 2: Enable Virtual Machine Platform

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 3: Set WSL2 as Default

wsl --set-default-version 2

Step 4: Install Ubuntu

Open Microsoft Store and search for Ubuntu, or run:

wsl --install -d Ubuntu

Verifying Your Installation

To check that WSL is installed correctly:

wsl --list --verbose

You should see Ubuntu listed with version 2.

Updating WSL

Keep WSL up to date:

wsl --update

Troubleshooting Common Issues

Issue: Installation Fails

  • Ensure Windows is up to date
  • Enable virtualization in BIOS/UEFI

Issue: Error Code 0x80070003

  • Enable Virtual Machine Platform feature
  • Check that WSL2 kernel is installed

Issue: Ubuntu Won't Start

  • Run Windows Update
  • Reinstall Ubuntu from Microsoft Store

Summary

Installing WSL is straightforward with the wsl --install command. After installation, you have a fully functional Ubuntu Linux running on your Windows computer.

Next Lesson

In the next lesson, you'll learn how to launch Ubuntu and get familiar with the basic commands.

Quiz - Quiz - Installing WSL on Windows

1. Which command installs WSL with one command?

2. What must you do after running the WSL installation command?

3. Which command sets WSL2 as the default version?

4. How can you verify WSL is installed correctly?

What is WSL and Why Use It?