Enabling Required Windows Features
Before installing a Linux distribution on Windows 10, you must enable the underlying virtualization framework. This involves activating the Windows Subsystem for Linux (WSL) and the Virtual Machine Platform (or Hyper-V).
- Navigate to Control Panel > Programs > Programs and Feautres and click on Turn Windows features on or off.
- Locate and check Windows Subsystem for Linux and Virtual Machine Platform (or Hyper-V if you are on Pro/Enterprise editions).
- Restart your computer to apply these changes.
After rebooting, you should see a "Linux" entry in your File Explorer's side pane, represented by a penguin icon. This confirms the subsystem is active.
Updating the WSL Kernel
To ensure compatibility and performance, update the WSL kernel to the latest version using an elevated PowerShell terminal:
wsl --update --web-download
Verifying System Architecture and Requirements
Ubuntu 20.04 requires Windows 10 build 16215.0 or later. You can verify your current OS build by going to Settings > System > About. Additionally, you need to identify your CPU architecture (typically x64 for most Intel/AMD systems) to download the correct image. Run the following in a command prompt:
wmic os get osarchitecture
If the output shows "64-bit", your architecture is AMD64/x64.
Manual Installation via WSL Import
While the Microsoft Store is the standard installation method, importing a manual image allows you to store the Linux root filesystem on a secondary drive (e.g., D: or G:), preventing your system drive from filling up.
1. Download the Rootfs Image
Navigate to the Ubuntu Cloud Images repository and download the WSL-specific .tar.gz file. For Ubuntu 20.04 (Focal Fossa) on an x64 system, look for a file named ubuntu-20.04-server-cloudimg-amd64-wsl.rootfs.tar.gz.
2. Perform the Import
Use the wsl --import command to regisetr the distribution. The syntax requires a name for the instance, a target installation directory, and the path to the downloaded image.
# Syntax: wsl --import [DistroName] [InstallLocation] [FileName]
wsl --import Ubuntu-20.04 D:\WSL\Ubuntu2004 C:\Downloads\ubuntu-20.04-wsl.rootfs.tar.gz
Environment Verification and Usage
Once the operation completes successfully, you can verify the installation by listing all registered distributions:
wsl --list --verbose
The installation directory will now contain an ext4.vhdx file, which acts as the virtual hard disk for your Linux environment. You can launch the instance by running:
wsl -d Ubuntu-20.04
Inside the Linux terminal, your Windows drives are automatically mounted under /mnt/. For example, your G: drive is accessible at /mnt/g/. Furthermore, if your host machine has an NVIDIA GPU with appropriate drivers, you can run nvidia-smi inside the WSL terminal to verify that GPU acceleration is passed through correctly.