microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.38k stars 28.61k forks source link

VSCode won't launch in WSL2 #204161

Open beachley opened 7 months ago

beachley commented 7 months ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. Open Ubuntu-22.04 Terminal
  2. Type code .
  3. Code opens with errors
[2024-02-02 16:15:29.594] Extension version: 0.86.0
[2024-02-02 16:15:29.594] L10N bundle: undefined
[2024-02-02 16:15:29.602] authorityHierarchy: wsl+Ubuntu-22.04
[2024-02-02 16:15:29.602] WSL extension activating for a local WSL instance
[2024-02-02 16:15:29.607] Resolving wsl+Ubuntu-22.04, resolveAttempt: 1
[2024-02-02 16:15:29.608] NodeExecServer run: C:\WINDOWS\System32\wsl.exe --status
[2024-02-02 16:15:29.698] WSL feature installed: true (wsl --status)
[2024-02-02 16:15:29.699] NodeExecServer run: C:\WINDOWS\System32\wsl.exe --list --verbose
[2024-02-02 16:15:29.791] 2 distros found
[2024-02-02 16:15:29.792] Starting VS Code Server inside WSL (wsl2)
[2024-02-02 16:15:29.792] Windows build: 22621. Multi distro support: available. WSL path support: enabled
[2024-02-02 16:15:29.792] Scriptless setup: false
[2024-02-02 16:15:29.806] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d Ubuntu-22.04 -e sh -c [ -f '/tmp/vscode-distro-env.dqjHkG' ] && cat '/tmp/vscode-distro-env.dqjHkG' || echo ''
[2024-02-02 16:15:29.947] Using shell environment from invoking shell: /tmp/vscode-distro-env.dqjHkG
[2024-02-02 16:15:29.979] WSL daemon log file: 
[2024-02-02 16:15:29.982] Probing if server is already installed: if [ -d ~/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2024-02-02 16:15:29.982] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d Ubuntu-22.04 -e sh -c if [ -d ~/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2024-02-02 16:15:30.111] Probing result: install-found x86_64
[2024-02-02 16:15:30.112] Server install found in WSL
[2024-02-02 16:15:30.112] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d Ubuntu-22.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 05047486b6df5eb8d44b2ecd70ea3bdf775fd937 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=1384870649-363185087-3615778268-1827744700 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2024-02-02 16:15:30.247] Setting up server environment: Looking for /home/myuser/.vscode-server/server-env-setup. Not found.
[2024-02-02 16:15:30.247] WSL version: 5.15.133.1-microsoft-standard-WSL2 Ubuntu-22.04
[2024-02-02 16:15:30.247] WSL-shell-PID: 1392
[2024-02-02 16:15:30.248] Node executable: /home/myuser/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/node
[2024-02-02 16:15:30.248] Starting server: /home/myuser/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/bin/code-server --host=127.0.0.1 --port=0 --connection-token=1384870649-363185087-3615778268-1827744700 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2024-02-02 16:15:30.248] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2024-02-02 16:15:30.248] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d Ubuntu-22.04 -e kill 1392
[2024-02-02 16:15:41.003] Download in background is enabled
[2024-02-02 16:16:11.009] Update check by another window detected, skipping

I've tried deleting the ~/.vscode folders and reinstalling the WSL extension, but I keep getting this

jm-gimenez-garcia commented 7 months ago

I'm experiencing the same problem, but only with a distribution that started with Ubuntu 18.04 and I have been updating to the latest version. I have another fresh 22.04 distribution, and that one works well with VSC (at least for now).

Hope that helps to identify the issue.