Download image
A complete guide https://wiki.ubuntu.com/WSL
I chose to install Ubuntu1804 on WSL via rootfs https://cloud-images.ubuntu.com/bionic/current/
Speed limited ,you can install the image in the Tsinghua open source image station.
Also, you can chose other editions by clicking the links in the wiki.
Install
Open powershell and using command line.
wsl --import DistributionName InstallLocation FileName
DistributionName:The name of your subsystem.
InstallLocation:Install location
FileName:The name of the file you installed.
To use your wsl,key in command.
wsl -d DistributionName
Also , you can use it by Windows terminal.
uninstall
wslconfig command
/l, /list [/all]
列出已注册的分发版。
/all - 有选择地列出所有分发版,包括当前正在安装或卸载的分发版。
/s, /setdefault <DistributionName>
将该分发版设为默认。
/t, /terminate <DistributionName>
终止分发。
/u, /unregister <DistributionName>
取消分发版注册。
/upgrade <DistributionName>