https://docs.microsoft.com/en-us/windows/wsl/about
https://docs.microsoft.com/en-us/windows/wsl/install-win10
Install the Windows Subsystem for Linux
Before installing any Linux distros for WSL, you must ensure that the "Windows Subsystem for Linux" optional feature is enabled:
-
Open PowerShell as Administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -
Restart your computer when prompted.
Install your Linux Distribution of Choice
To download and install your preferred distro(s), you have three choices:
- Download and install from the Windows Store (see below)
- Download and install from the Command-Line/Script (read the manual installation instructions)
- Download and manually unpack and install (for Windows Server - instructions here)
在windows store里面搜索wsl,然后找到Ubuntu版本
安装完启动,需要创建Ubuntu的账号https://docs.microsoft.com/en-us/windows/wsl/user-support
创建用户成功后,提示
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.