cline icon indicating copy to clipboard operation
cline copied to clipboard

Connection error with remote WSL

Open goodmaney opened this issue 1 year ago β€’ 5 comments

Which API Provider are you using?

Anthropic

Which Model are you using?

Claude 3.5 Sonnet

What happened?

cline cant connect to Claude 3.5 when I use it on vscode remote WSL , but it worked with host Windows. And WSL consle can connect to Claude 3.5 Independently with the same API key

Steps to reproduce

1.chose Remote Explorer 2. connect with my WSL Ubuntu 3.

Relevant API REQUEST output

No response

Additional context

image

goodmaney avatar Nov 28 '24 14:11 goodmaney

I also encountered the same issue. When using WSL2 with OpenAI compatible (x AI / Google Gemini) or Google Gemini, a connection error occurs, but it works normally in Windows image image

shiyi-jiaqiu avatar Dec 13 '24 06:12 shiyi-jiaqiu

Similar issue. Ollama running on the windows host, project is in WSL. Tried disabling windows firewall, no luck.

alexgorbatchev avatar Dec 27 '24 04:12 alexgorbatchev

change WSL networkMode to mirrored.

YunlongJ avatar Jan 03 '25 10:01 YunlongJ

change WSL networkMode to mirrored.

thanks πŸ™‡ but how it worked before πŸ€”

note: switched back to nat and it works 🀯

nandordudas avatar Jan 03 '25 10:01 nandordudas

change WSL networkMode to mirrored.

thanks πŸ™‡ but how it worked before πŸ€”

note: switched back to nat and it works 🀯

one case is: use a proxy in host windows(eg: clash), and it will effect cline request in WSL. (only effect cline, continue.dev works well......................)

YunlongJ avatar Jan 06 '25 10:01 YunlongJ

change WSL networkMode to mirrored.

According to your hint, I asked AI to tell me the detailed solution. Then I do that and it really works! What surprised me is this makes many similar extension available under WSL in VSCode, such as MarsCode, Copilot and Codeium. Now I can happily work and code just in VSCode under powerful AI assistance without switching to Cursor or Windsurf.

BioCrossCoder avatar Jan 22 '25 08:01 BioCrossCoder

I use proxy solve it . vim ~/.bashrc then add code to the end # get Host IP WINDOWS_IP=$(ip route | grep default | awk '{print $3}') PROXY_HTTP="http://${WINDOWS_IP}:7890"

# set env export http_proxy="${PROXY_HTTP}" export https_proxy="${PROXY_HTTP}"

goodmaney avatar Feb 11 '25 17:02 goodmaney