I have followed these two links to set up apt-get proxy. https://github.com/microsoft/WSL/issues/6143 and https://askubuntu.com/questions/7470/how-to-run-sudo-apt-get-update-through-proxy-in-commandline meaning;

I edited /etc/sudoers to:

Defaults env_keep = "http_proxy https_proxy ftp_proxy DISPLAY XAUTHORITY"

and set proxy like this:

export HTTPS_PROXY="http://${hostip}:1080" export HTTPS_PROXY="http://${hostip}:1080" export https_proxy="http://${hostip}:1080" export http_proxy="http://${hostip}:1080"

but I still can't connect to my shadowsocks server. any thoughts?

  • How are you setting the hostip variable? I don't see any reference to that in either of the two links you posted. Feb 19, 2021 at 21:26
  • 'hostip' is set by windows
    – Moe
    Feb 20, 2021 at 5:44
  • Not in my experience, no. I might be missing something obvious, but a Google search for wsl hostip doesn't seem to indicate this either. Instead, you'll see a number of suggestions on how to retrieve the host ip. Try hostip=$(powershell.exe "(Test-Connection -ComputerName (hostname) -Count 1).IPV4Address.IPAddressToString"). There are some other, simpler methods (e.g. yourwindowscomputername.local or yourwindowscomputername.mshome.net), but they return the IP of the virtual NIC, and your proxy may not be bound to that address. Feb 20, 2021 at 14:22

1 Answer 1


If you want a VPN on your WSL just install protonvpn:

pip install protonvpn-cli
  • Congratulations on finding the solution yourself. However, considering that your answer revolves around a VPN, and your original question around the shadowsocks encryption protocol, you may want to edit the answer to add more information on why you (seemingly) abandoned your original approach.
    – AdminBee
    May 17, 2022 at 9:38
  • My initial question remains although I found a workaround that might be a remedy
    – Moe
    May 19, 2022 at 14:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .