Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL cannot use proxy with networkingMode=mirrored #10794

Closed
1 of 2 tasks
mingo99 opened this issue Nov 19, 2023 · 18 comments
Closed
1 of 2 tasks

WSL cannot use proxy with networkingMode=mirrored #10794

mingo99 opened this issue Nov 19, 2023 · 18 comments
Labels

Comments

@mingo99
Copy link

mingo99 commented Nov 19, 2023

Windows Version

Microsoft Windows [Version 10.0.22631.2715]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu20.04

Other Software

No response

Repro Steps

  • Set .wslconfig
[experimental]
autoMemoryReclaim=gradual
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
  • wsl --shutdown to stop WSL
  • Set proxy port to 7890 in clash for windows and open system proxy
    image
  • Restart WSL

Expected Behavior

Both WSL and Windows can successfully access google.com(banned in my place) by curl

Actual Behavior

  1. Execute curl in Wondows(Powershell)
    • curl google.com succeeded
      image
  2. Excute curl in WSl
  • curl google.com failed
    image

Diagnostic Logs

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@mingo99 mingo99 changed the title WSL cannot use proxy WSL cannot use proxy with networkingMode=mirrored Nov 19, 2023
@zhaoqiu-china
Copy link

try firewall=false?

@mingo99
Copy link
Author

mingo99 commented Nov 20, 2023

try firewall=false?
I've tried, but it still doesn't work

@zhaoqiu-china
Copy link

BTW, experimental feature has moved to wsl2.
image

@mingo99
Copy link
Author

mingo99 commented Nov 20, 2023

yeah,now my .wslconfig is below, but also come same problem

[wsl2]
kernel=C:\\WINDOWS\\System32\\lxss\\tools\\5.15.90.1-kernel-usb
networkingMode=mirrored
dnsTunneling=true
firewall=false
autoProxy=true

[experimental]
sparseVhd=true
autoMemoryReclaim=gradual

@mingo99
Copy link
Author

mingo99 commented Nov 21, 2023

Additionally, access the external network is normal, like ping github.com is ok

@PhyX-Meow
Copy link

It may not help but, I tried firewall=false then everything works fine. Did you restart wsl by wsl --shutdown?

@mingo99
Copy link
Author

mingo99 commented Nov 22, 2023

yeah,even reboot computer

@mingo99
Copy link
Author

mingo99 commented Nov 22, 2023

I upgraded from Ubuntu 20.04 to Ubuntu 22.04, and the issue got resolved, although I don't know how it was fixed. The reason I had this idea is that my other computer, which has Ubuntu 22.04 installed, could successfully use the proxy.

@zhaoqiu-china
Copy link

@mingo99

I upgraded from Ubuntu 20.04 to Ubuntu 22.04, and the issue got resolved, although I don't know how it was fixed. The reason I had this idea is that my other computer, which has Ubuntu 22.04 installed, could successfully use the proxy.

whether you set the HTTP_PROXY environment variable?

@mingo99
Copy link
Author

mingo99 commented Nov 23, 2023

No, it will set itself.

@KnineF
Copy link

KnineF commented Feb 6, 2024

我也遇到了这个问题。请问你解决了吗

@mingo99
Copy link
Author

mingo99 commented Feb 6, 2024

升级到 22.04 就没问题了🤣

@HawtinZeng
Copy link

HawtinZeng commented Feb 9, 2024

Additionally, access the external network is normal, like ping github.com is ok

Me too, but the tip about the local proxy is not mirrored into WSL still appears.And can't ping google.com

@SuAutumn
Copy link

SuAutumn commented Mar 9, 2024

I changed the inbound rules of the Clash for windows in firewall, that does work in Ubuntu 20.

@Minphie
Copy link

Minphie commented Mar 11, 2024

I changed the inbound rules of the Clash for windows in firewall, that does work in Ubuntu 20.
@SuAutumn
怎么改的?我的都勾选了还是不行。
image

@SuAutumn
Copy link

SuAutumn commented Mar 12, 2024

I changed the inbound rules of the Clash for windows in firewall, that does work in Ubuntu 20.
@SuAutumn
怎么改的?我的都勾选了还是不行。
image

You can curl http://<host_ip>:7890 -v in wsl terminal, get a 4xx status code means that you can successfully visit clash proxy in wsl. otherwise Just Shutdown firewall, and try again.
ps: Please confirm clash allow LAN setting enabled.

@amorZhu
Copy link

amorZhu commented Mar 19, 2024

Try deleting the Linux distribution and reinstalling it.
wsl --unregister <DistributionName>
wsl --install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants