Switch Container option not working after reinstall (WSL + Dev Containers)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

After reinstalling everything, the Switch Container option no longer works correctly in a WSL + Docker Dev Container setup.

When the project is opened in WSL, Cursor correctly detects multiple devcontainer.json files inside the .devcontainer directory.

However, once a container is opened and I try to use Switch Container, Cursor reports:

Found 0 devcontainer.json files
Failed to reopen folder in container
No devcontainer.json files found.

So:

In WSL → devcontainers are detected (2 found)

Inside running container → 0 devcontainers found

This issue started after reinstalling WSL + Cursor.

Environment:

Windows + WSL2 (Ubuntu 24.04.4 LTS)

Docker Engine 29.2.1

Kernel: 6.6.87.2-microsoft-standard-WSL2

Cgroup v2

Storage driver: overlayfs

Project structure:

.devcontainer/
├── container_1/devcontainer.json
└── container_2/devcontainer.json

Steps to Reproduce

Open project in WSL (Ubuntu 24.04).

Ensure multiple devcontainer.json files exist inside .devcontainer/**.

Use “Open in Container” and select one of the devcontainers.

Once inside the running container, use “Switch Container”.

Cursor searches for devcontainer.json files.

Cursor reports: “Found 0 devcontainer.json files”.

Expected Behavior

When using Switch Container from inside a running dev container, Cursor should:

Detect all valid devcontainer.json files in the workspace.

Allow switching between container_1 and container_2.

Reopen the workspace in the selected container.

Instead, it reports that no devcontainer.json files exist, even though they are present and were previously detected in WSL.

Operating System

Windows 10/11

Version Information

Version: 2.5.22 (user setup)
VSCode Version: 1.105.1
Commit: 0eda506a36f70f8dc866c1ea642fcaf620090080
Date: 2026-02-23T00:15:21.265Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Does this stop you from using Cursor

No - Cursor works, but with this issue

Additional Information

WSL Log

2026-02-23 22:27:23.064 [info] Getting remote exec server for authority: wsl+Ubuntu-24.04
2026-02-23 22:27:23.065 [info] [docker info]: Running command: docker
2026-02-23 22:27:23.524 [info] [docker info]: Command completed with exit code 0
2026-02-23 22:27:23.524 [info] docker version: Client: Docker Engine - Community
 Version:    29.2.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.31.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.0.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  model: Docker Model Runner (Docker Inc.)
    Version:  v1.1.4
    Path:     /usr/libexec/docker/cli-plugins/docker-model

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 2
 Server Version: 29.2.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: dea7da592f5d1d2b7755e3a161be07f43fad8f75
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.6.87.2-microsoft-standard-WSL2
 Operating System: Ubuntu 24.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 15.47GiB
 Name: 1047-len-lig
 ID: c49abf9e-1667-42ac-9ace-33ccbe19dee1
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables
2026-02-23 22:27:23.525 [info] Searching for devcontainer.json files
2026-02-23 22:27:23.551 [info] Found 2 devcontainer.json files: \home\user\my-application\.devcontainer\container_1\devcontainer.json, \home\user\my-application\.devcontainer\container_2\devcontainer.json

Container Log

2026-02-23 22:19:16.771 [info] [docker info]: Running command: docker
2026-02-23 22:19:17.064 [info] [docker info]: Command completed with exit code 0
2026-02-23 22:19:17.065 [info] docker version: Client: Docker Engine - Community
 Version:    29.2.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.31.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.0.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  model: Docker Model Runner (Docker Inc.)
    Version:  v1.1.4
    Path:     /usr/libexec/docker/cli-plugins/docker-model

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 2
 Server Version: 29.2.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: dea7da592f5d1d2b7755e3a161be07f43fad8f75
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.6.87.2-microsoft-standard-WSL2
 Operating System: Ubuntu 24.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 15.47GiB
 Name: 1047-len-lig
 ID: c49abf9e-1667-42ac-9ace-33ccbe19dee1
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables
2026-02-23 22:19:17.065 [info] Searching for devcontainer.json files
2026-02-23 22:19:17.072 [info] Found 0 devcontainer.json files: 
2026-02-23 22:19:17.073 [error] Failed to reopen folder in container No devcontainer.json files found. Please define the devcontainer in '.devcontainer/devcontainer.json', '.devcontainer.json', or '.devcontainer/**/devcontainer.json'

Hey, thanks for the detailed report and the logs.

From the logs, the key difference is clear: in WSL the search finds both files, but inside the running container it finds 0. Most likely the .devcontainer folder isn’t mounted inside your container.

The Anysphere Dev Containers extension needs the .devcontainer directory to be accessible from the running container for the “Switch Container” feature to work. Could you please check:

  1. What does workspaceFolder look like in your devcontainer.json files? Does it point to the project root (where .devcontainer/ lives) or to a subfolder?
  2. Inside the running container, can you confirm that .devcontainer/ is actually present? Run ls -la at the workspace root from the container terminal.

If workspaceFolder points to a location that doesn’t include .devcontainer/, you may need to adjust the mount so that directory is available inside the container. Related discussion with the same root cause: Anyspheres Dev Container Extension: Switch Containers - Anyspheres Dev Container Extension: Use the Name Property of DevContainers + Allow to Switch Containers - #7 by ravirahman.

Let me know what you find.

Thanks for the quick response :folded_hands:

I checked the points you mentioned:

  • The entire workspace folder includes .devcontainer/.

  • workspaceFolder in both devcontainer.json files points to the project root (the same root where .devcontainer/ lives), not to a subfolder.

  • Inside the running container, if I ls -la at the workspace root, .devcontainer/ is present and both container_1 and container_2 directories are visible.

So effectively:

  • WSL → sees .devcontainer/ :white_check_mark:

  • Inside container → also sees .devcontainer/ and both devcontainer.json files :white_check_mark:

The only difference is that inside the container, Cursor reports:

Found 0 devcontainer.json files

even though the files are clearly there and accessible.

Both WSL and the container open the exact same project directory (same structure, only absolute path differs).

This exact setup was working before I:

  • Updated WSL (moved from Ubuntu 22.04 to 24.04)

  • Reinstalled Cursor

The issue started only after that.

I also tested the same project with VS Code (Dev Containers extension), and switching containers works there without any issue.

1 Like

@deanrie Please let me know if you need any more details or logs. It will be really helpful if this can be fixed soon as this really affects our development workflow with cursor.

1 Like