Skip to content

Open in agents fails to recognize WSL2 #316537

Open

Description

@ajwtech

Type: Bug

On a Windows host launch code
Connect to remote select "connect to WSL"
Open any project folder (Files in Linux file system not Windows)
Click "Open in Agent"
In the agent window there isn't a way to connect to WSL and it drops you in the windows users home directory.

VS Code version: Code 1.120.0 (0958016, 2026-05-12T20:17:22Z)
OS version: Windows_NT x64 10.0.26200
Modes:
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2

System Info
Item Value
CPUs Intel(R) Core(TM) i9-14900HX (32 x 2419)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2757 [NVIDIA GeForce RTX 4090 Laptop GPU], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.9579 ACTIVE
GPU1: VENDOR= 0x8086, DEVICE=0xa788 [Intel(R) UHD Graphics], DRIVER_VERSION=32.0.101.7084
GPU2: VENDOR= 0x8086, DEVICE=0xa788 [Intel(R) UHD Graphics], DRIVER_VERSION=32.0.101.7084
GPU3: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8328
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 63.70GB (28.79GB free)
Process Argv --crash-reporter-id 75cea53d-c0e2-46b3-a3b5-24b6ea95b5e6
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 6.6.87.2-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i9-14900HX (32 x 0)
Memory (System) 31.19GB (27.34GB free)
VM 0%
Extensions (77)
Extension Author (truncated) Version
rust-syntax dus 0.6.1
remotehub Git 0.64.0
output-colorizer IBM 0.1.2
vscode-azurevirtualmachines ms- 0.6.10
vscode-edge-devtools ms- 2.1.10
jupyter-keymap ms- 1.1.2
vscode-ai-remote ms- 1.4.7
remote-containers ms- 0.459.0
remote-ssh ms- 0.122.0
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.104.3
vscode-remote-extensionpack ms- 0.26.0
azure-repos ms- 0.40.0
notepadplusplus-keybindings ms- 1.0.7
remote-explorer ms- 0.5.0
remote-repositories ms- 0.42.0
remote-server ms- 1.5.3
vscode-speech ms- 0.16.0
vscode-icons vsc 12.18.0
rust-bundle 1Yi 1.0.0
aws-toolkit-vscode ama 4.5.0
vscode-zipfs arc 3.0.0
atlascode atl 4.0.28
azurite Azu 3.35.0
markdown-mermaid bie 1.32.0
cucumber-official Cuc 1.11.0
vscode-eslint dba 3.0.24
colorful-monorepo des 0.0.9
docker doc 0.18.0
githistory don 0.6.20
rust-syntax dus 0.6.1
prettier-vscode esb 12.4.0
dependi fil 0.7.22
vscode-github-actions git 0.31.5
vscode-pull-request-github Git 0.145.2026051404
terraform has 2.39.2
vscode-package-json-inspector kri 0.2.0
mongodb-vscode mon 1.16.0
azure-dev ms- 0.10.0
vscode-azure-github-copilot ms- 1.0.201
vscode-azure-mcp-server ms- 2.0.43
vscode-azureappservice ms- 0.26.5
vscode-azurecontainerapps ms- 0.11.0
vscode-azurefunctions ms- 1.21.0
vscode-azureresourcegroups ms- 0.12.4
vscode-azurestaticwebapps ms- 0.13.2
vscode-azurestorage ms- 0.17.1
vscode-azurevirtualmachines ms- 0.6.10
vscode-bicep ms- 0.43.8
vscode-containers ms- 2.4.4
vscode-cosmosdb ms- 0.32.1
vscode-dotnet-runtime ms- 3.0.2
vscode-aks-tools ms- 1.7.8
vscode-kubernetes-tools ms- 1.3.29
vscode-pgsql ms- 1.22.0
playwright ms- 1.1.19
debugpy ms- 2026.6.0
python ms- 2026.4.0
vscode-pylance ms- 2026.2.1
vscode-python-envs ms- 1.30.0
vscode-ai ms- 1.4.1
vscode-ai-remote ms- 1.4.7
azurecli ms- 0.6.0
live-server ms- 0.5.2026051301
makefile-tools ms- 0.12.17
powershell ms- 2025.4.0
vscode-chat-customizations-evaluations ms- 1.0.2
vscode-node-azure-pack ms- 1.8.2
windows-ai-studio ms- 1.2.0
chatgpt ope 26.513.21555
pulumi-lsp-client pul 0.2.3
pulumi-vscode-tools pul 0.4.0
vscode-yaml red 1.23.0
rust-analyzer rus 0.3.2896
tailwind-search Sou 2.0.0
sourcery sou 1.43.0
vscode-ai-foundry Tea 1.2.3
A/B Experiments
vsliv368cf:30146710
pythonvspyt551cf:31249601
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
82j33506:31327384
6abeh943:31336334
envsactivate1:31505457
cloudbuttont:31379625
3efgi100_wstrepl:31403338
55ia6109:31457054
ec5jj548:31422691
cp_cls_t_966_ss:31454198
inlinechat_v2_hd992725:31505030
4je02754:31466945
c3h7c220:31478652
ge8j1254_inline_auto_hint_haiku:31490510
38bie571_auto:31478677
cp_cls_t_1081:31454832
conptydll_true:31498968
ia-use-proxy-models-svc:31452481
e9c30283:31461165
test_treatment2:31471001
c9b86496:31447327
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
nes-extended-on:31455476
chat:31457767
8hig5102:31480529
7e187181:31503455
i2gc6536:31499202
17hge832:31513033
ghj88844:31499326
h08i8180:31475369
ddid_t:31478206
1b2f8594:31509479
getcmakediagnosticsoff:31489825
ja75b849:31512419
7df3h592:31512476
pro_large_t:31499376
cp_cls_c_1082:31504161
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_c_632:31510883
56dj4588:31512888
cg448276_tst_on:31514358
32d76977:31512328
ha629193:31508444
539gd155_c:31506875
api_cot_off:31513532
prpt_ctrl:31513641

Activity

  1. removed their assignment
    on Sep 3, 2026
  2. kumarshaz commented on Sep 21, 2026

    @kumarshaz

    I am encountering a potentially related failure in the Agents window on Windows with a WSL2 Ubuntu workspace.

    Environment:

    • VS Code: 1.138.0 Stable, based on the connected server metadata
    • Commit: 7debcd0
    • Windows desktop VS Code connected to WSL2
    • Ubuntu 24.04.4 LTS
    • Kernel: 6.6.87.2-microsoft-standard-WSL2
    • Code Spell Checker: 4.9.3

    After opening the Agents window, both the built-in JSON Language Server and Code Spell Checker fail to start.

    JSON Language Server output:

    2026-09-20 19:59:02.073 [error]
    JSON Language Server client: couldn't create connection to server.
    Error: UNC host 'wsl$' access is not allowed
    at lstat (node:fs:1620:10)
    at Object.<anonymous> (node:electron/js2c/node_init:2:5035)
    at ...\jsonClientMain.js:28:36989
    at new Promise (<anonymous>)
    at TT._getServerWorkingDir (...\jsonClientMain.js:28:36970)
    at TT.createMessageTransports (...\jsonClientMain.js:28:31721)
    

    Code Spell Checker reports the same UNC-host rejection in
    LanguageClient._getServerWorkingDir.

    Code Spell Checker Server client: couldn't create connection to server.
    Error: UNC host 'wsl$' access is not allowed
    at lstat (node:fs:1620:10)
    ...streetsidesoftware.code-spell-checker-4.9.3\packages\client\dist\extension.cjs:157:36136
    at e.LanguageClient._getServerWorkingDir (...extension.cjs:157:36118)
    at e.LanguageClient.createMessageTransports (...extension.cjs:157:30960)
    at e.LanguageClient.createConnection (...extension.cjs:148:11607)
    at e.LanguageClient.start (...extension.cjs...)
    

    Both stack traces point to Windows-side extension installations.
    This suggests a Windows/WSL working-directory handling problem,
    but I have not confirmed the root cause.

    The JSON-server failure closely matches #316265, which is closed
    and locked, except that my error names wsl$ rather than wsl.localhost.

    Expected: language services initialize successfully for the selected
    WSL workspace, or the Agents window provides actionable guidance.

    Does this belong to this issue, or should I file a separate issue
    for language-server initialization on WSL UNC paths?
    Related issue: #317380 (AgentHost: Dev Containers/WSL support) — closed as completed in milestone 1.138.0. I previously reported this same error there (comment #317380 (comment), as kumarshaz). Filing separately per maintainer request (#317380 (comment)) since this reproduces again on the version where WSL support was supposedly completed.

    Steps to Reproduce:

    1. Open VS Code connected to a WSL2 Ubuntu distro (Remote - WSL).
    2. Open a project folder inside the WSL filesystem.
    3. Click "Open in Agents" (or Command Palette: Chat: Open Agents Window Click on the agent window icon from the top right of search box and more actions buttons. The agent window launches and throws all these errors).
    4. Observe the Output panel for "JSON Language Server" and "Code Spell Checker Server".
    5. VS Code connected to a WS on WSL remote on Ubuntu. I can still search the workspace (remote), close out the errors and use the chat features with workspace or without a workspace.

    Expected behavior:
    Built-in and third-party language servers running against a WSL-hosted workspace in the Agents Window should resolve paths through the same remote/agent-host connection used for file access, without attempting direct Windows-host \\wsl$\... UNC access.

    Actual behavior:
    Both language server clients crash on startup with errors reported above.

    Additional context:

    Not yet tested: latest Insiders and a minimal-extension configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions