`wslc pull` behind a corporate proxy (HTTP_PROXY, HTTPS_PROXY, NO_PROXY)
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
- A documentation that explains how HTTP proxy settings can be configured for WSLC.
- When possible/viable, automatically mirror HTTP proxy settings from Windows host OS.
- Provide an option to configure proxy settings via WSLC settings.yaml (similar to Docker's
proxiessection in daemon.json).
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'.
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'.
/feature
Diagnostic information
Found '/feature', adding tag 'feature'
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/