-
Notifications
You must be signed in to change notification settings - Fork 822
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
Can't access Windows socks5 tunnel from WSL2 #4507
Comments
ref #4402 |
Thank you very much for the quick answer. I have tried the first method from here :
and copying the IP address following the term nameserver but it did not work. However the second method did work: Establish the tunnel from WSL Thanks again |
I am running into the same issue, can't establish a connection in the @oliviercwa can you elaborate more on how you managed to fix this problem? |
You need to create the tunnel not from a windows command prompt, but from a WSL command prompt. In windows, launch powershell, then type:
This will enter the wsl mode Then create your tunnel, for example:
Then curl will work properly Note that I am running WSL2 from Windows 10 version 19035.1 |
I have a service running in WSL (listening on My WSL # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 192.168.224.1 When I run ssh: connect to host 192.168.224.1 port 22: Connection timed out Also using WSL2 from Windows 10 version 19035.1 |
Are both these services running on the same machine? If so, you don't need a tunnel for this. You should be able to call the Windows service directly. |
Yes, they are both running on the same machine. I am not able to access the service directly, the service in WSL returns the error: PG::ConnectionBad - could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432? Also, in WSL: curl 127.0.0.1:5432
curl: (7) Failed to connect to 127.0.0.1 port 5432: Connection refused while on Windows it works fine: curl 127.0.0.1:5432
curl: (52) Empty reply from server According to ref #4402, this is expected because tunneling 127.0.0.1 does not currently work in the |
I must point out also that everything works perfectly fine in WSL 1. |
I have a proxy client running on windows which provides a socks5 proxy. This client has been set to listening 127.0.0.1:9050 .I want to use it in WSL2 Kali Linux terminal.How can I ?? Exactly what I am trying to do is ,to rotate IP's in kali Linux terminal WSL2 via windows client proxy application. The proxy application itself changes/rotate proxy So the only need is How can I connect it in WSL. The proxy client supports socksv5 so I have to set the WSL to socksv5 proxy. TIA! |
@danksuperuser did you get your query answered??? I am facing the same problem, want to access this socks5 client running on windows on my vs-code running on wsl |
Environment
Repro steps:
From Windows Powershell: Create a SOCKS 5 tunnel to an SSH Server:
Validate that the proxy is working. For my specific environment, I have a web server that i can query using:
This returns a response (a Spring Boot configuration JSON payload)
Next go to WSL2 mode
Result:
"curl: (7) Failed to connect to 127.0.0.1 port 20000: Connection refused"
Result:
"curl: (7) Failed to connect to localhost port 20000: Connection refused"
Expected:
The text was updated successfully, but these errors were encountered: