microsoft / microsoft/vscode-remote-release

VSCode fails to to connect to Codespaces if WSL2 is active

Open
#11,232 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

There seems to be some kind of race condition present when attempting to connect to Codespaces from VSCode on a machine with WSL2 active. Deleting .vscode-server from WSL2 seems to improve the odds of the connection succeeding, but could be superstition.

Could not fetch remote environment
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)

  • VSCode Version: 1.104.2
  • Local OS Version: Windows 11
  • Remote OS Version: Debian 12
  • Remote Extension/Connection Type: Dev Containers (GitHub Codespaces)

Steps to Reproduce:

  1. Start WSL2
  2. Open VSCode
  3. Open a Codespace

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with WSL2 active using VSCode 1.104.2 on Windows 11, connecting to a Debian 12 Codespace through Dev Containers. Compare connection attempts after removing .vscode-server and inspect the “Could not fetch remote environment” and WebSocket 1006 failures; done means the connection reliably succeeds with WSL2 running.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, docker, vscode
Domain
devtools, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.