为何我的 wsl2 目录在 vscode 的 remote-wsl 扩展中打开如此之慢?
資深大佬 : syficy 1
之前习惯了在 wsl2 中开发,重装了 windows10 之后安装 wsl 和 vscode 的 remote-wsl 扩展,升级了 wsl2,发现打开 wsl2 目录的时间大约有两分钟,然而打开 wsl1 的速度在 5s 之内,之前系统打开 wsl2 速度也在 5s 之内。
2 分钟是用 vscode 扩展打开 wsl2 内目录的时间,wsl2 是在运行中的,用命令行可以秒进。
对于经常需要切换目录的开发者来说,2 分钟简直是人间地狱。
Debug 信息如下,主要是 pinging 的时间过长,不知道该如何解决。
[2021-02-21 04:21:44.845] Resolving wsl+Ubuntu20, resolveAttempt: 1 [2021-02-21 04:21:44.924] Starting VS Code Server inside WSL (Ubuntu20) [2021-02-21 04:21:44.924] Extension version: 0.53.4, Windows build: 19041. Multi distro support: available. WSL path support: enabled [2021-02-21 04:21:45.043] Using shell environment from invoking shell: /tmp/vscode-distro-env.HE2IGZ [2021-02-21 04:21:45.196] Connecting to daemon started by other Remote-WSL window... 5.4.72-microsoft-standard-WSL2 Ubuntu20 [2021-02-21 04:21:45.203] Pinging 172.26.252.122:35521... [2021-02-21 04:23:58.617] 172.26.252.122:35521 no response [2021-02-21 04:23:58.618] WSL resolver response: ::1:35521 [2021-02-21 04:23:58.618] To debug connection issues, open a local browser on http://[::1]:35521/version
大佬有話說 (4)