【发布时间】:2021-05-31 23:44:40
【问题描述】:
我正在试用 WSL2 进行工作,并且我支持公司代理。我已经在 WSL 中配置了代理,因此互联网连接正常,并且我已将 no_proxy 设置如下
localhost,127.0.0.1,::1
当我使用命令 code . 从 wsl 打开 VSCode 时,大约需要一分钟才能打开。当我检查 VSCode 启动的日志时,它似乎正在尝试通过此地址连接到 WSL 上的服务器 172.17.164.22:36869
我的直觉是它与代理有关,但即使我将该 IP 地址添加到 no_proxy,它的行为也是一样的。从 WSL1 打开 VSCode 时没有延迟。一分钟后VSCode确实加载成功,我可以安装扩展没有问题,只是初始打开很慢。
我已尝试从 windows 和 WSL ping 该地址但均未识别,我按照日志中的建议在浏览器中尝试了它,它确实立即返回了一个 guid 外观的字符串
有什么想法吗?
[2021-03-02 11:39:09.199] Using shell environment from invoking shell: /tmp/vscode-distro-env.D9Yczp
[2021-03-02 11:39:09.392] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu-20.04 -e sh -c "[ -d ~/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2021-03-02 11:39:09.573] Probing result: found
[2021-03-02 11:39:09.574] Server install found in WSL
[2021-03-02 11:39:09.575] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu-20.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 622cb03f7e070a9670c94bae1a45d78d7181fbd4 stable .vscode-server 0 '}
[2021-03-02 11:39:09.691] Setting up server environment: Looking for /home/barista/.vscode-server/server-env-setup. Not found.
[2021-03-02 11:39:09.691] WSL version: 4.19.128-microsoft-standard Ubuntu-20.04
[2021-03-02 11:39:09.691] WSL2-shell-PID: 627
[2021-03-02 11:39:09.691] Starting server: /home/barista/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4/server.sh --port=0 --use-host-proxy --without-browser-env-var --enable-remote-auto-shutdown
[2021-03-02 11:39:09.992]
[2021-03-02 11:39:09.992]
[2021-03-02 11:39:09.992] *
[2021-03-02 11:39:09.992] * Visual Studio Code Server
[2021-03-02 11:39:09.992] *
[2021-03-02 11:39:09.992] * Reminder: You may only use this software with Visual Studio family products,
[2021-03-02 11:39:09.992] * as described in the license https://aka.ms/vscode-remote/license
[2021-03-02 11:39:09.992] *
[2021-03-02 11:39:09.992]
[2021-03-02 11:39:09.992] IP Address: 172.17.164.22
[2021-03-02 11:39:09.992] Extension host agent listening on 36869
[2021-03-02 11:39:09.992]
[2021-03-02 11:39:09.992] [11:39:09] Extension host agent started.
[2021-03-02 11:39:10.011] Pinging 172.17.164.22:36869...
[2021-03-02 11:40:25.179] 172.17.164.22:36869 no response
[2021-03-02 11:40:25.179] WSL resolver response: ::1:36869
[2021-03-02 11:40:25.179] To debug connection issues, open a local browser on http://[::1]:36869/version
【问题讨论】:
-
您是否启用了代理? This post 有类似的问题,但这是由于代理配置造成的。
标签: visual-studio-code proxy wsl-2