a step-by-step guide to installing WSL2 on Windows 11 Home Edition
This tutorial describes how to set up WSL2 (Windows Subsystem for Linux) on Windows 11 Home Edition as in September 2024. The guide is adapted and consolidated from several online resources.
Check these blogs (in Chinese):
Windows 11 Professional users can skip this step.
win11-home-hyperv.bat pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL
Check available WSL commands:
wsl --help
wsl --update
wsl --set-default-version 2
wsl --list --online
wsl --install -d Ubuntu-22.04
By default, Linux will be installed on the system drive (C:).
If your C: drive has limited space, you can migrate the distribution. Here we move Ubuntu-22.04 to D: drive and rename it to Ubuntu-22.04-D.
2.5.1: Check and Stop Running Distributions
wsl -l -v
wsl --terminate Ubuntu-22.04
2.5.2: Export the Distribution
wsl --export Ubuntu-22.04 D:\ubuntu2204-export.tar
2.5.3: Unregister the Original Distribution
wsl --unregister Ubuntu-22.04
2.5.4: Import to a New Location
wsl --import Ubuntu-22.04-D D:\Ubuntu-22.04 D:\ubuntu2204-export.tar --version 2
After completion:
Ubuntu-22.04-D from the PowerShell terminal.If you need proxy access:
Install Clash and enable:
Create a file:
C:\Users\<your-username>\.wslconfig
Add:
[experimental]
autoMemoryReclaim=gradual
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
wsl --shutdown
Start a new WSL and test connection:
wget www.google.com
If successful, your proxy configuration is working correctly.
Here are some more articles you might like to read next: