Anysphere: Switching between containers doesn't work

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Switching between containers doesn’t work in a multi-devcontainers setup.

I tried with GitHub - madebygps/multiple-dev-container-vscode: An example repo on how to use multiple devcontainer.json files with VS Code..

This setup doesn’t work in cursor 2.5.25 with anysphere.remote-containers extension version 1.0.32:

2026-02-26 13:25:07.955 [info] Searching for devcontainer.json files
2026-02-26 13:25:07.972 [info] Found 2 devcontainer.json files: /home/user/Projects/multiple-dev-container-vscode/.devcontainer/python-container/devcontainer.json, /home/userProjects/multiple-dev-container-vscode/.devcontainer/node-container/devcontainer.json
2026-02-26 13:25:09.097 [info] Using host workspace folder: /home/user/Projects/multiple-dev-container-vscode
2026-02-26 13:25:09.098 [error] Failed to reopen folder in container The selected devcontainer.json must be within a workspace folder

It works in VS Code 1.109.5 with ms-vscode-remote.remote-containers extension version 0.442.0

Steps to Reproduce

  • Clone madebygps/multiple-dev-container-vscode repo
  • Open local Cursor window on cloned repo.
  • From the command palette Dev Containers: Reopen in Container, pick Python Container.
  • From the command palette Dev Containers: Switch Container, pick Node Container

It failed with this error in the output console:

2026-02-26 13:25:07.955 [info] Searching for devcontainer.json files
2026-02-26 13:25:07.972 [info] Found 2 devcontainer.json files: /home/user/Projects/multiple-dev-container-vscode/.devcontainer/python-container/devcontainer.json, /home/userProjects/multiple-dev-container-vscode/.devcontainer/node-container/devcontainer.json
2026-02-26 13:25:09.097 [info] Using host workspace folder: /home/user/Projects/multiple-dev-container-vscode
2026-02-26 13:25:09.098 [error] Failed to reopen folder in container The selected devcontainer.json must be within a workspace folder

Expected Behavior

Switching between containers works.

Operating System

Linux

Version Information

Version: 2.5.25
VSCode Version: 1.105.1
Commit: 7150844152b426ed50d2b68dd6b33b5c5beb73c0
Date: 2026-02-24T07:17:49.417Z
Build Type: Stable
Release Track: Early Access
Electron: 39.5.2
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Linux x64 6.18.9-arch1-2

Additional Information

I saw this answer Anyspheres Dev Container Extension: Use the Name Property of DevContainers + Allow to Switch Containers - #7 by ravirahman, but this topic is polluted with other non-related issues, and anyway the answer is not solving the problem.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report, and especially for the link to the public repo. It makes it easy to reproduce the issue.

This is a known bug in the anysphere.remote-containers extension. It resolves paths in devcontainer.json incorrectly when you switch containers from inside an already running container. Another user reported the same thing here: Switch Container option not working after reinstall (WSL + Dev Containers).

I also noticed something in your logs. The second path is missing a slash: /home/userProjects/... instead of /home/user/Projects/..., which might point to a path resolution issue.

The team is aware. There is no ETA yet, but your report, with a clean repo to reproduce, will help with prioritization.

Thanks, the path mistake is my fault, i changed it manually to not show my username…

Maybe a good hint to solve this issue, in vscode, the path to devcontainer.json file is relative:

In cursor, it’s absolute:

Great catch on the relative vs absolute paths. I’ll pass this detail to the team, it should help with debugging and the fix. Let me know if you notice anything else.