Contents

Install WSL2 on a Non-Default Drive


Enable the Windows Subsystem for Linux

Open PowerShell as Administrator and run:

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

Enable Virtual Machine feature

Open PowerShell as Administrator and run:

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

Restart computer then move to next step.

Download the Linux kernel update package

Download and run Latest WSL2 Linux kernel update package for x64 machines

Set WSL 2 as your default version

Open powershell and run:

1
wsl --set-default-version 2

Create a folder in a non-system drive

Create a folder for wsl like this: D:\WSL

Download a linux distro

Open powershell in newly created folder and run:

1
Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx -UseBasicParsing

Alternatively, just download that linux distro using browser from distro list.

Unpack the downloaded distro

Run the following powershell commands:

1
2
3
move .\Ubuntu.appx .\Ubuntu.zip

Expand-Archive .\Ubuntu.zip

Initialize linux distro

Run the following commands to initialize:

1
2
cd .\Ubuntu\
.\ubuntu2004.exe

Then follow prompts to complete new user setup.

References

  1. Windows Subsystem for Linux Installation Guide for Windows 10
  2. Install Windows Subsystem for Linux on a Non-System Drive
  3. Manually download Windows Subsystem for Linux distro packages