wsl -d ubuntu -u root
passwd root 修改
/etc/apt/source.list:
mirrors.aliyun.com
apt update
wsl –set-default-version 2
/etc/wsl.conf
[boot]
systemd=true
WSL ping 主机解决:
管理员运行:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL (Hyper-V firewall))" -Action Allow