Skip to content

Vscode cannot connect with the WSL:Ubuntu-22.04 #11155

@KO-neverLate

Description

@KO-neverLate

I have tried the solution that i can search in those issues and in the internet, but they all cannot help me solve this problem.
I can make sure that .vscode-server exists, because when i input ls -a ~ | grep vscode in the Ubuntu terminal, it's printed below.So what puzzles me is that when I input "code ." in the Ubuntu terminal to connect WSL2 with my vscode, a pop-up window immediately appeares here, showing the error that

Vscode Server for WSL closed unexpectedly

. And at the same time, there is a string of red words appeared in the vscode terminal:

Unable to detect if server is already installed: Error: Failed to probe if server isN�S/ec�v�c6R�S��n0傁�O(udk�R��ed to probe if server is already installed: code: 4294967295, ,
��_{��y(u�e�v�c6R�S0

  • VSCode Version:1.103.1
  • Local OS Version:Windows 11
  • Remote OS Version:Ubuntu-22.04
  • Logs:

[2025-08-16 14:06:52.055] Extension version: 0.99.0
[2025-08-16 14:06:52.055] L10N bundle: file:///c%3A/Users/NING/.vscode/extensions/ms-vscode-remote.remote-wsl-0.99.0/l10n/bundle.l10n.zh-cn.json
[2025-08-16 14:06:52.064] authorityHierarchy: wsl+Ubuntu-22.04
[2025-08-16 14:06:52.064] WSL extension activating for a local WSL instance
[2025-08-16 14:06:52.108] Resolving wsl+Ubuntu-22.04, resolveAttempt: 1
[2025-08-16 14:06:52.109] NodeExecServer run: C:\Windows\System32\wsl.exe --status
[2025-08-16 14:06:52.115] Download in background is enabled
[2025-08-16 14:06:52.230] WSL feature installed: true (wsl --status)
[2025-08-16 14:06:52.231] NodeExecServer run: C:\Windows\System32\wsl.exe --list --verbose
[2025-08-16 14:06:52.328] 2 distros found
[2025-08-16 14:06:52.329] Starting VS Code Server inside WSL (wsl2)
[2025-08-16 14:06:52.329] Windows build: 22000. Multi distro support: available. WSL path support: enabled
[2025-08-16 14:06:52.329] Scriptless setup: false
[2025-08-16 14:06:52.343] NodeExecServer run: C:\Windows\System32\wsl.exe -d Ubuntu-22.04 -e sh -c [ -f '/tmp/vscode-distro-env.KZozMY' ] && cat '/tmp/vscode-distro-env.KZozMY' || echo ''
[2025-08-16 14:06:52.441] WSL daemon log file:
[2025-08-16 14:06:52.443] Probing if server is already installed: if [ -d ~/.vscode-server/bin/360a4e4fd251bfce169a4ddf857c7d25d1ad40da ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf 'alpine-'; fi; uname -m;
[2025-08-16 14:06:52.444] NodeExecServer run: C:\Windows\System32\wsl.exe -d Ubuntu-22.04 -e sh -c if [ -d ~/.vscode-server/bin/360a4e4fd251bfce169a4ddf857c7d25d1ad40da ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf 'alpine-'; fi; uname -m;
[2025-08-16 14:06:52.455] No shell environment set or found for current distro.
[2025-08-16 14:06:52.556] Unable to detect if server is already installed: Error: Failed to probe if server isN�S/ec�v�c6R�S��n0傁�O(udk�R��ed to probe if server is already installed: code: 4294967295, ,
��_{��y(u�e�v�c6R�S0
[2025-08-16 14:06:52.556]
[2025-08-16 14:06:52.556] ���Nx: Wsl/Service/WSL_E_CONSOLE
[2025-08-16 14:06:52.556]
[2025-08-16 14:06:52.557] NodeExecServer run: C:\Windows\System32\wsl.exe -d Ubuntu-22.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 360a4e4fd251bfce169a4ddf857c7d25d1ad40da stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=313500411-4235725275-182410184-2196723323 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
N�S/ec�v�c6R�S��n0傁�O(udk�R��
��_{��y(u�e�v�c6R�S0
[2025-08-16 14:06:52.679]
[2025-08-16 14:06:52.679] ���Nx: Wsl/Service/WSL_E_CONSOLE
[2025-08-16 14:06:52.679]
[2025-08-16 14:06:52.680] For help with startup issues, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

wslIssue in vscode-remote WSL

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions