WSL 3.0.3: Docker dev containers no longer open from WSL (spawn EPERM, WindowsApps folder added to PATH)

Aperta
#42,096 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, docker, vscode

Direzione di ricerca

Start by comparing how WSL 3.0.1 and 3.0.3 construct the PATH passed to Windows processes; the report identifies the WSL package folder as the unexpected entry. Reproduce with cmd.exe /c set from Ubuntu and compare it with PowerShell. Done when Windows programs launched from WSL receive the expected PATH and the Dev Containers repro no longer fails with spawn EPERM.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

wsl2
Windows Version

Microsoft Windows [Version 10.0.19045.6466]

WSL Version

WSL version: 3.0.3.0

Are you using WSL 1, WSL 2, or WSLC?
  • WSL 2
  • WSL 1
  • WSLC
Kernel Version

No response

Distro Version

Ubuntu 20.04.3 LTS

Other Software
  • WSL: 3.0.3.0 broken, 3.0.1.0 works
  • VS Code 1.108.0, Dev Containers extension 0.469.0, Docker Desktop
Repro Steps

STEPS TO REPRODUCE

  1. Install WSL 3.0.3 (in my case via a Microsoft Store auto-update).
  2. From an Ubuntu shell, run: cmd.exe /c set | grep -i windowsapps
  3. Compare with "cmd /c set" run from PowerShell.
Expected Behavior

The Path seen by Windows processes started from WSL is the same as the user's normal Windows Path, as on 3.0.1, with no WindowsApps WSL package folder added.

Actual Behavior

Since WSL updated itself from 3.0.1 to 3.0.3 through the Microsoft Store, no Docker dev container opens from WSL. VS Code connects to WSL but never attaches to the container, and the Dev Containers extension fails with "Error: spawn EPERM". Every container on the machine fails the same way. Opening the same folder from PowerShell still works, and rolling back to WSL 3.0.1 fixes it.

Cause: on 3.0.3, every Windows program started from WSL gets WSL's own package folder at the front of its PATH:

C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_3.0.3.0_x64__8wekyb3d8bbwe

"code ." passes that PATH to VS Code. The Dev Containers extension then finds wsl.exe in that WindowsApps folder first, and Windows refuses to start a program from WindowsApps directly, so it fails with EPERM. Programs started from PowerShell or Explorer do not get this PATH entry.

To reproduce on 3.0.3:

  1. In Ubuntu, run: cmd.exe /c set | grep -i windowsapps (shows the WSL package folder in Path)
  2. In PowerShell, run: cmd /c set | findstr /i windowsapps (does not show it)
  3. In Ubuntu, run "code ." in any folder with a dev container: it fails with spawn EPERM.
Diagnostic Logs

(I can take more diagnostic logs as needed)

Lingua principale
C++
Stelle
34.4k
Fork
1.9k
Merge medio
1g 23h
PR unite (30g)
166

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/WSL

Tutte le issue di microsoft/WSL

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.