How to install WSL?
Step1. Upgrade Windows if needed.
Make sure you have upgraded to Windows 10 version 2004 or insider preview 19041 or higher. Older versions of Windows does not support WSL2.
Press Win+R, execute winver
to check your windows 10/11 version number.
Step2. Start installing.
In Cmd(administrator) or Powershell(administrator) , run
1 |
|
Then, open Microsoft Store, and search for Ubuntu 20.04
and download.
Launch it after the download is complete. You will see a command window with ‘installing…’.
Possible error code and solution:
0xc03a011a
:
- Find
C:\Users\YOUR_USER_NAME\AppData\Local\Packages
in file explorer, whereYOUR_USER_NAME
is your username. - Find the folder begin with
CanonicalGroupLimited.Ubuntu18.04onWindows
, right click on it, click ‘properties’, click ‘advanced’ - Deselect “压缩内容以节省磁盘空间”
- Click “Confirm” and try to install again
0x80370102
:
If you are installing wsl on a Mac using bootcamp windows, and got this error, you should enter macOS first, and reboot to windows from ‘startup disk’ in ‘system preferences’ (instead of entering windows directly after pressing the power on button). After you have entered windows, go to task manager -> performance -> CPU, and make sure ‘virtualization’ is ‘on’.
- Check if you have enabled VT virtualization: In “Task manager” -> “Performance” -> “CPU”, check if “virtualization” is on. If not, enter BIOS and enable this feature.
- Check if corresponding windows features are enabled: Press win+Q and search for “enable or disable windows features”
- Windows10:Make sure
Hyper-V
,Virtual Machine Platform
,Windows Subsystem for Linux
are enabled. - Windows11:Make sure
Windows subsystem for linux
is enabled.
- Windows10:Make sure
- 打开Powershell(管理员),执行以下命令:
1 |
|
Step 3: Enjoy
After the installation is complete, you can see the terminal of ubuntu.
You can access the terminal of WSL ubuntu by entering
1 |
|
in cmd or terminal.