Intro
WSL: Windows Subsystem for Linux
WSL is a tiny Linux VM embedded in Windows, default is Ubuntu.
Homepage: https://github.com/microsoft/WSL
One-Click Install (Online Install)
wsl --install
Issue: wsl --install is very slow, mainly because Microsoft’s overseas servers have poor bandwidth in China. Fastest solution: Offline manual install (domestic mirror download), done in a few minutes.
Manual Install (Offline Install)
Prerequisites
Windows 11 Home fully supports WSL2, no Hyper-V required. Just enable two system features, install the MSI you downloaded, and import the wsl image - works fully offline.
Step 0: Download
wsl program
From https://github.com/microsoft/WSL/releases, download wsl.2.7.3.0.x64.msi file
Ubuntu wsl file
According to the https://github.com/microsoft/WSL/blob/master/distributions/DistributionInfo.json file, it contains URLs for all distros.
Find the WSL image download link from https://releases.ubuntu.com/26.04/, download ubuntu-26.04-wsl-amd64.wsl file
Place both files in an all-English path, e.g., D:\wsl
Additional Domestic High-Speed Links (unverified)
Use browser / Xunlei to download:
- WSL2 Kernel (msi)
- Ubuntu 22.04 (tar.gz) (Tsinghua Mirror)
Save to: D:\wsl\ (pure English path)
Step 1: Enable Required WSL System Features
- Right-click Start menu → select Windows Terminal (Admin) or PowerShell (Admin)
- Execute these two commands in sequence, no restart needed:
powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Restart computer to take effect
Step 2: Install WSL Core MSI Package
- Locate your downloaded
wsl.2.7.3.0.x64.msi - Double-click to install, just click Next through the defaults
- Close the window after installation, no extra configuration needed
Step 3: Import Ubuntu26.04 .wsl Image
Double-click the ubuntu-26.04-wsl-amd64.wsl file, it will import automatically.
During import, it will prompt you to enter username and password
You can also manually import with these steps:
- Create a new pure English path folder (preferably not on C drive), e.g.,
D:\WSL\Ubuntu2604 - Place the downloaded
ubuntu-26.04-wsl-amd64.wslin a path with no Chinese characters, no spaces, e.g.,D:\WSL\ - Open regular PowerShell (not admin), execute the import command:
wsl --import Ubuntu2604 D:\WSL\Ubuntu2604 D:\WSL\ubuntu-26.04-wsl-amd64.wsl --version 2
Parameter explanation:
Ubuntu2604: custom distro name (can change)D:\WSL\Ubuntu2604: directory to store WSL system files- Last is the full path to your
.wslfile --version 2: force WSL2
Step 4: Initialize and Use Ubuntu
- Start the imported system:
In powershell
wsl -d Ubuntu2604
// Command line will automatically enter the VM's shell
- First launch will prompt you to create Linux username and password, follow the prompts to set it
- Verify if it’s WSL2:
In powershell
wsl -l -v
// -l means list
// -v means verbose output, will output version
If version shows 2, you’re successful
Common Issues
- Import error due to Chinese / spaces in path: change all files and folders to English without spaces
- Stuck on initialization: run
wsl --shutdownthen restart - Want to set as default:
wsl --set-default Ubuntu2604 - Want to uninstall:
wsl --unregister Ubuntu2604
wsl Commands
Start VM
Run wsl -d <distro-name>, it will start the distro’s VM and enter its shell
Create and Change Default User
# Create user (replace with desired name)
useradd -m -G sudo -s /bin/bash yourname
passwd yourname
# Set as default user
echo -e "[user]\ndefault=yourname" >> /etc/wsl.conf
Shutdown / Reboot VM
wsl --terminate Ubuntu wsl -d Ubuntu
More Resources
press
Win+xand typewslin search box to get WSL tutorialOfficial web tutorial: https://learn.microsoft.com/en-us/windows/wsl/
Install documentation: https://learn.microsoft.com/en-us/windows/wsl/install#offline-install
💬 Welcome to leave your comments (GitHub account required)