WSL
常用命令
wsl --list
wsl --unregister <Dist>
wsl --help
wsl --version
修改默认用户为 root
- 找到对应的发行版exe文件:C:\Users\用户名\AppData\Local\Microsoft\WindowsApps\ubuntu1804.exe
- 执行命令:ubuntu1804.exe config –default-user root
需要在cmd中执行,cd到指定目录
- 如果遇到
NAT 模式下的 WSL 不支持 localhost 代理
- 修改
C:/User/用户名/.wslconfig
1
2
3
4
5
6[experimental]
autoMemoryReclaim=gradual
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true - 重启wsl:
wsl --shutdown
- 修改
令wsl使用systemd
- 更新wsl:
wsl --update
- 修改文件
/etc/wsl.conf
- 添加配置
1
2[boot]
systemd=true
WSL
https://gjorn4389.github.io/2023/12/17/os_ops/wsl/