vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Cannot start a dev container when connected to WSL2 through VSCode Tunnels

Open a-gn opened this issue 1 year ago • 10 comments

  • VSCode Version: 1.85.0
  • Local OS Version: macOS Sonoma 14.1.2 (23B92)
  • Remote OS Version: Windows 11
  • Remote Extension/Connection Type: Tunnel -> WSL2 -> (not working) Dev Containers
  • Logs:

In the Dev Containers log:

[2680055 ms] Start: Run: wsl -d Ubuntu@tunnel+pc -e /bin/sh -c cd '/home/me/project/src' && /bin/sh
[2680057 ms] Start: Run in host: id -un

In the dev console:

  ERR Shell server failed: Error: spawn wsl ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:283:19)
	at onErrorNT (node:internal/child_process:476:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21): Error: Shell server failed: Error: spawn wsl ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:283:19)
	at onErrorNT (node:internal/child_process:476:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
	at d.h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:141:140441)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to Reproduce:

  1. Connect to a Windows computer through Tunnels.
  2. Connect to WSL2 on that machine with the Remote - WSL extension.
  3. Open a WSL2 folder that contains a .devcontainers configuration.
  4. Run the "Reopen in Container" command.

I expect that VSCode start building a dev container using my configuration and open the same folder in the container. Instead, nothing happens, I get no feedback besides the logs I posted above.

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

a-gn avatar Dec 12 '23 13:12 a-gn

just had the same issue. can confirm that it doesn't work here either.

OneCyrus avatar Dec 22 '23 06:12 OneCyrus

I have the same issue too

nag92 avatar Dec 26 '23 13:12 nag92

same, W10, WSL(Ubuntu 20.04)

thisismygitrepo avatar Jan 01 '24 22:01 thisismygitrepo

I was able to solve the problem by deleting all the config files in the .vscode directory. factorying resetting Docker, reinstalling Ubuntu and not having the "Execute in WSL": selected

nag92 avatar Jan 06 '24 15:01 nag92

Same issue in the same situation, but now I get this popup:

Command 'Dev Containers: Rebuild and Reopen in Container' resulted in an error

Shell server failed: Error: spawn wsl ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

ArnoGW1 avatar Jun 18 '24 07:06 ArnoGW1

same here

jgsqware avatar Jul 12 '24 10:07 jgsqware

Same issue in the same situation, but now I get this popup:

Command 'Dev Containers: Rebuild and Reopen in Container' resulted in an error

Shell server failed: Error: spawn wsl ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I got the exact same error. I am using local a Linux machine and tried to remote-tunnel to a remote WSL2 win11 desktop.

lnguyen4 avatar Aug 14 '24 00:08 lnguyen4

Is there any progress on this feature?

tungts1101 avatar Jan 14 '25 10:01 tungts1101

I had the same problem with following action: ssh into windows from my local ubuntu, connect to wsl, try to attach docker container. Somehow it seems that vs code tries to run wsl on my local PC, which obviously doesn't work as my PC is ubuntu. I just ssh into windows and then attach to docker container right away without connecting to wsl. And then it worked. I guess using windows version docker could be a solution.

cjsj166 avatar Apr 30 '25 14:04 cjsj166

Throwing another "me too" on the pile here, but I'm very confused about the classification of this problem.

@chrmarti This is not a feature request. This is a bug. Feature requests don't have error messages with stack traces. WSL and Dev containers working correctly is expressly advertised on the web page documenting the feature: https://code.visualstudio.com/docs/remote/tunnels#_can-i-use-other-remote-development-extensions-or-a-dev-container-while-im-tunneling

CECapps avatar May 17 '25 16:05 CECapps