You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working for the past month on the support of proxies for the Windows version of rancher-desktop. It has been a known issue for a long time that you can't use rancher-desktop with a corporate proxy in Windows because WSL does not takes the proxy settings of the host into account. Here is a list of some issues related to proxy in Windows:
None of the solution proposed really worked. Using WSLENV introduce the error with kubernetes and will share the proxy variable with every WSL VM. Based on discussion I had in the rancher-desktop slack I opted for a solution based on the usage of a proxy running inside WSL that could be programmatically enabled/disabled to catch the network traffic and forward it to an http proxy.
My changes to the rancher-desktop-wsl-vm and rancher-desktop code are available here:
My solution is based on a software named moproxy, a software installed on WSL as a service that handles the connections and transmissions of packets to an http proxy. The traffic from the network interface is redirected to moproxy using iptables, so any type of filtering on ports/address is supported.
flowchart LR;
subgraph VM["WSL VM"]
direction LR
apps{{"Apps"}}
subgraph vmIptables["iptables"]
direction LR
rules{"Rules"}
end
moproxy["moproxy"]
apps -- TCP --> rules
rules --> moproxy
end
proxy((("Proxy")))
moproxy --> proxy
Loading
I also made changes to the rancher-desktop graphical interface to make the proxy configurable from the rancher-desktop settings page or during the first run. For now my changes are only available in the WSL setting page but in the future it could probably be ported to other platforms.
Changes on the proxy configuration take effect immediately after clicking on Apply without having to restart the backend like the other change in settings.
Additional Information
Recently there has been some activity on the Github issues to port the network stack to work with gvisor-tap-vsock (see Epic: Incorporate gvisor into Rancher Desktop's networking stack). I'm waiting for the release of this experimental feature in rancher-desktop 1.8 to see how gvisor-tap-vsock can work with proxy and if my changes are still required.
flowchart LR;
subgraph VM["VM"]
direction LR
apps{{"Apps"}}
subgraph vmIptables["iptables"]
direction LR
rules{"Rules"}
end
moproxy["moproxy"]
vmSwitch["VM Daemon Switch"]
apps -- TCP --> rules
rules --> moproxy
moproxy -- TAP --> vmSwitch
end
subgraph host["Host"]
hostSwitch["Host Switch"]
end
vmSwitch -- VSOCK --> hostSwitch
proxy((("Proxy")))
hostSwitch -- CONNECT --> proxy
Loading
The text was updated successfully, but these errors were encountered:
Problem Description
I've been working for the past month on the support of proxies for the Windows version of rancher-desktop. It has been a known issue for a long time that you can't use rancher-desktop with a corporate proxy in Windows because WSL does not takes the proxy settings of the host into account. Here is a list of some issues related to proxy in Windows:
http_proxy
variable setwslenv
.nerdctl compose up
behind a proxywslenv
.If you use rancher-desktop behind a proxy you can't:
There has been different proposal in Github issue discussions about how to use a proxy with rancher-desktop:
http_proxy
,https_proxy
inWSLENV
. This will create an error from kubernetes.wsl-vpnkit
rc.conf
Proposed Solution
None of the solution proposed really worked. Using
WSLENV
introduce the error with kubernetes and will share the proxy variable with every WSL VM. Based on discussion I had in the rancher-desktop slack I opted for a solution based on the usage of a proxy running inside WSL that could be programmatically enabled/disabled to catch the network traffic and forward it to an http proxy.My changes to the rancher-desktop-wsl-vm and rancher-desktop code are available here:
My solution is based on a software named
moproxy
, a software installed on WSL as a service that handles the connections and transmissions of packets to an http proxy. The traffic from the network interface is redirected tomoproxy
usingiptables
, so any type of filtering on ports/address is supported.I also made changes to the rancher-desktop graphical interface to make the proxy configurable from the rancher-desktop settings page or during the first run. For now my changes are only available in the
WSL
setting page but in the future it could probably be ported to other platforms.Changes on the proxy configuration take effect immediately after clicking on
Apply
without having to restart the backend like the other change in settings.Additional Information
Recently there has been some activity on the Github issues to port the network stack to work with
gvisor-tap-vsock
(see Epic: Incorporate gvisor into Rancher Desktop's networking stack). I'm waiting for the release of this experimental feature in rancher-desktop 1.8 to see howgvisor-tap-vsock
can work with proxy and if my changes are still required.The text was updated successfully, but these errors were encountered: