Sherioc's Blog
文章
未分类

WSL2配置代理

2025年1月17日(更新于 2026年3月16日) 1 分钟阅读 浏览 17 喜欢 0 评论 0

1、关闭梯子

2、设置为mirrored模式

image.png

该设置会生成 C:/Users/<username>/.wslconfig

【可选】修改.wslconfig文件内容如下

shell
[experimental]
autoMemoryReclaim=gradual  
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

3、打开cmd并执行wsl --shutdown 4、重新启动梯子、wsl

参考 :

使用WSL2时控制台输出“wsl: 检测到 localhost 代理配置,但未镜像到 WSL。NAT 模式下的 WSL 不支持 localhost 代理“_wsl: 使用镜像网络模式时,wsl2.localhostforwarding 设置无效-CSDN博客 https://blog.csdn.net/heromps/article/details/137889499

喜欢 0
评论区在赶来的路上...