Step-by-Step Guide to Installing Ubuntu 24.04 on Windows 10/11 Using WSL2
WSL2 (Windows Subsystem for Linux version 2) allows you to run a real Ubuntu Linux distribution directly within Windows without dual-booting, rebooting, or wiping your Windows installation. It's integrated into Windows 10 (version 2004 or higher, Build 19041+) and Windows 11 Home/Pro editions. You'll need administrator access for some steps.
This guide uses the official Microsoft method. All commands should be run in PowerShell as an administrator (right-click Start > Windows PowerShell (Admin) or Terminal (Admin)). I'll use full executable names like wsl.exe where applicable for clarity, but wsl works if it's in your PATH (which it will be after installation).
Open PowerShell as administrator and run:
>wsl.exe --install
After restart, WSL2 is set as the default for new distributions.
In admin PowerShell, check installed distributions and versions:
>wsl.exe --list --verbose
If needed, set WSL2 as default (usually already done):
>wsl.exe --set-default-version 2
First, list available distributions:
>wsl.exe --list --online
Install it:
>wsl.exe --install -d Ubuntu-24.04
If it's not listed or you need a custom import (rare), download the .appx package from Microsoft's GitHub or Store, but the above should work.
Set it as default if installing multiple:
>wsl.exe --set-default Ubuntu-24.04
The first launch will:
Example prompts:
You're now in the Ubuntu shell! Your home directory is /home/yourusername/, and Windows drives are mounted under /mnt/ (e.g., C: is /mnt/c/).
In the Ubuntu terminal:
>sudo apt update && sudo apt upgrade -y
To access Windows files:
For better integration:
This setup runs Ubuntu as a lightweight VM under Windows Hyper-V. You can shut it down with wsl.exe --shutdown or uninstall with wsl.exe --unregister Ubuntu-24.04. For more, check wsl.exe --help.
WSL2 (Windows Subsystem for Linux version 2) allows you to run a real Ubuntu Linux distribution directly within Windows without dual-booting, rebooting, or wiping your Windows installation. It's integrated into Windows 10 (version 2004 or higher, Build 19041+) and Windows 11 Home/Pro editions. You'll need administrator access for some steps.
This guide uses the official Microsoft method. All commands should be run in PowerShell as an administrator (right-click Start > Windows PowerShell (Admin) or Terminal (Admin)). I'll use full executable names like wsl.exe where applicable for clarity, but wsl works if it's in your PATH (which it will be after installation).
Prerequisites
- Windows 10 version 2004+ (Build 19041+) or Windows 11.
- At least 4GB RAM recommended for smooth performance.
- Ensure virtualization is enabled in BIOS/UEFI (usually under CPU settings; restart and enter BIOS with Del/F2/F10 depending on your machine).
- If WSL is already partially installed, you may need to adjust steps—check with wsl.exe --list --verbose.
Step 1: Install WSL2 and Enable Required Features
Open PowerShell as administrator and run:
>wsl.exe --install
- This enables WSL, the Virtual Machine Platform (for WSL2), and installs the default Ubuntu distribution.
- If it hangs at 0%, try: wsl.exe --install --web-download -d Ubuntu.
- Restart your computer when prompted.
After restart, WSL2 is set as the default for new distributions.
Step 2: Verify WSL2 Installation and Set Default Version
In admin PowerShell, check installed distributions and versions:
>wsl.exe --list --verbose
- Look for "*" next to the default distro and "2" under VERSION.
If needed, set WSL2 as default (usually already done):
>wsl.exe --set-default-version 2
Step 3: Install Ubuntu 24.04 LTS Specifically
First, list available distributions:
>wsl.exe --list --online
- Look for "Ubuntu-24.04" or similar (it should be listed as Ubuntu 24.04 LTS is officially supported).
Install it:
>wsl.exe --install -d Ubuntu-24.04
- If the exact name differs (e.g., "Ubuntu2404"), use that instead.
- This downloads and installs from the Microsoft Store backend.
If it's not listed or you need a custom import (rare), download the .appx package from Microsoft's GitHub or Store, but the above should work.
Set it as default if installing multiple:
>wsl.exe --set-default Ubuntu-24.04
Step 4: Launch Ubuntu and Complete Initial Setup
- From Start Menu: Search for "Ubuntu 24.04" and launch it.
- Or in PowerShell: Run ubuntu2404.exe (or the exact name from wsl.exe --list).
- Or generally: wsl.exe -d Ubuntu-24.04.
The first launch will:
- Decompress files (takes a few minutes).
- Prompt for a UNIX username (e.g., your Windows username or something new).
- Set a password (not tied to Windows; remember it for sudo).
Example prompts:
- Enter new UNIX username: yourusername
- Enter new UNIX password: (type securely)
- Retype new password: (confirm)
You're now in the Ubuntu shell! Your home directory is /home/yourusername/, and Windows drives are mounted under /mnt/ (e.g., C: is /mnt/c/).
Step 5: Update Ubuntu and Basic Configuration
In the Ubuntu terminal:
>sudo apt update && sudo apt upgrade -y
- Enter your password when prompted.
To access Windows files:
- Navigate to /mnt/c/Users/YourWindowsUsername/ (replace with your actual Windows username).
For better integration:
- Install Windows Terminal from Microsoft Store for tabbed sessions.
- To run graphical apps (optional, requires additional setup): Install X server like VcXsrv, then in Ubuntu: sudo apt install ubuntu-desktop and set export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.
Troubleshooting
- If virtualization isn't enabled: Error will mention it—enable in BIOS.
- Command not found: Ensure you're in admin PowerShell.
- Older Windows: Manual steps involve enabling features via dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart and dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart, then restart and install kernel from https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi.
- Paths: WSL executables are typically in C:\Windows\System32\wsl.exe, but you don't need to specify full path unless PATH issues.
This setup runs Ubuntu as a lightweight VM under Windows Hyper-V. You can shut it down with wsl.exe --shutdown or uninstall with wsl.exe --unregister Ubuntu-24.04. For more, check wsl.exe --help.