WSL icon indicating copy to clipboard operation
WSL copied to clipboard

`wslc pull` behind a corporate proxy (HTTP_PROXY, HTTPS_PROXY, NO_PROXY)

Open bahrep opened this issue 5 months ago • 4 comments

Is your feature request related to a problem? Please describe. It appears that WSLC doesn't provide a way to configure HTTP proxy settings for the wslc commands. So running commands such as wslc pull fails with error message. Error message example:

PS C:\hello> wslc pull hello-world
Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on pi:53: read udp ip:11046->ip: i/o timeout
Error code: E_FAIL

Describe the solution you'd like

  1. A documentation that explains how HTTP proxy settings can be configured for WSLC.
  2. When possible/viable, automatically mirror HTTP proxy settings from Windows host OS.
  3. Provide an option to configure proxy settings via WSLC settings.yaml (similar to Docker's proxies section in daemon.json).

bahrep avatar Jul 02 '26 13:07 bahrep

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use .\collect-wsl-logs.ps1 -LogProfile networking instead, following the instructions in Collect WSL logs for networking issues

Once completed please upload the output files to this GitHub issue.

See Collect WSL logs (recommended method).

If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.

github-actions[bot] avatar Jul 02 '26 13:07 github-actions[bot]

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'.

/feature

bahrep avatar Jul 02 '26 13:07 bahrep

Diagnostic information
Found '/feature', adding tag 'feature'

github-actions[bot] avatar Jul 02 '26 13:07 github-actions[bot]

Non-persistent temporary solution:

Suppose you have an HTTP(S) proxy on localhost 1080. You can restart dockerd in wslc session VM.

# Set a longer auto-close time for wslc
"session:`n  idleTimeout: 300`n" | Set-Content -Path "$env:LOCALAPPDATA\wslc\settings.yaml" -Encoding ascii
# Kill dockerd and restart it with proxy options
wslc system session run /usr/bin/sh -c '/usr/bin/killall dockerd -9; /usr/bin/nohup /usr/bin/dockerd --http-proxy=http://127.0.0.1:1080 --https-proxy=http://127.0.0.1:1080 --no-proxy=localhost,127.0.0.1 --containerd=/run/containerd/containerd.sock >/dev/null 2>&1 &'

https://www.dddns.icu/posts/wslcproxy/

94Bo avatar Oct 12 '26 04:10 94Bo