Having a issue with attaching devcontainer

Describe the Bug

I have the following extensions installed in Cursor:

  • anysphere.remote-containers

  • ms-vscode.remote-server

I’m starting a devcontainer using the Devcontainer CLI, and I’m trying to open Cursor attached to this running devcontainer using the following script:

CONF=$(printf '{"settingType":"container", "containerId":"%s"}' "$devcontainer_id")
hex_config=$(printf "$CONF" | od -A n -t x1 | tr -d '[\n\t ]')
cursor --folder-uri "vscode-remote://attached-container+${hex_config}${folder}"

Cursor launches, but it doesn’t open the devcontainer. In the Extension Host Output, I see this error:

2025-07-07 20:23:46.988 [info] [resolveAuthority(attached-container,1)][0ms] activating resolver for attached-container+7b2273657474696e67547...
2025-07-07 20:23:46.988 [error] [resolveAuthority(attached-container,1)][0ms] no resolver for attached-container undefined

Any idea how to make this work with Cursor?
Works fine for vscode tho.

Steps to Reproduce

  1. Start any devcontainer useing devcontainer CLI
  2. Open cursor with setting provided above using containerId

Expected Behavior

While the attached-container authority works as expected in VS Code, it throws an error and fails to resolve in Cursor.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.1
VSCode Version: 1.99.3
Commit: 031e7e0ff1e2eda9c1a0f5df67d44053b059c5d0
Date: 2025-07-03T06:06:37.704Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

For cursor i had it working using dev-container instead of attached-container, as cursor does not support attached-container resolver.

CONF=$(printf '{"settingType":"container", "containerId":"%s"}' "$devcontainer_id")
hex_config=$(printf "$CONF" | od -A n -t x1 | tr -d '[\n\t ]')
cursor --folder-uri "vscode-remote://dev-container+${hex_config}${folder}"

Is there any plan on when cursor will support attached-container resolver?

Hi @Shashwat_Triparthi, could you upgrade to version 1.0.10 of the extension? This version supports the attached-container scheme.

1 Like

Hi @ravirahman attached-container scheme works now :slight_smile: But seeing a problem.

After attaching to devcontainer using attached-container it is not using remoterUser config provided in devcontainer.json.

Hi @Shashwat_Triparthi – we do not yet support the Attached Container Configuration Files where these settings would be stored. We are working on adding this functionality in to the extension. We currently use the same user that was used to start the container.

Hi @ravirahman I saw that the changelog for the latest release includes:

Support remoteUser and customizations defined as part of the container image or devcontainer features. (Only applies to newly opened containers)

However, it looks like the remoteUser property in the devcontainer.json (e.g., "remoteUser": "vscode") is still not being applied when attaching to an existing container using the attached-container scheme.

Is this the expected behavior with the current release, or should it now be supported?
Also, is there a timeline for when support for remoteUser in the attached-container scenario might be available?

Thanks for your help! :folded_hands:

Note:
I am starting devcontainer using devcontainer cli

devcontainer up --workspace-folder $repo_path --config $devcontainer_file --mount type=bind,source=$HOST_CACHE,target=$CONTAINER_CACHE

And the I am attaching container started above with cursor like this

CONF=$(printf '{"settingType":"container", "containerId":"%s"}' "$devcontainer_id")
hex_config=$(printf "$CONF" | od -A n -t x1 | tr -d '[\n\t ]')
cursor --folder-uri "vscode-remote://attached-container+${hex_config}${folder}"

Hi @ravirahman did you got chance to look into this?

Hi @Shashwat_Triparthi, thank you for your patience as we worked through this issue. We released version 1.0.19 of the Remote Containers extension, which supports Attached Container Configuration files. Could you try upgrading to the latest version?

Hi @ravirahman it’s still not picking up the remoteUser setting from the devcontainer.json file. :smiling_face_with_tear:

Is there anything else I need to specify when attaching to the dev container? Currently, I’m attaching like this:

CONF=$(printf '{"settingType":"container", "containerId":"%s"}' "$devcontainer_id")
hex_config=$(printf "$CONF" | od -A n -t x1 | tr -d '[\n\t ]')
cursor --folder-uri "vscode-remote://attached-container+${hex_config}${folder}"

Hi @Shashwat_Triparthi, could you use the dev-container+ scheme instead of attached-container+?

The schema for the JSON blob is:

{
	settingType: 'config';  // should be the literal string 'config'
	workspacePath: string;  // path to workspace
	devcontainerPath: string; // path to the devcontainer.json file
}

Similar to before, you’ll want to hex-encode this, and then put it in the uri. We do not read the remoteUser when using the attached-container scheme.

Hey @ravirahman I am starting devcontainer using the DevContainer CLI. From what I understand, when using the dev-container+ scheme, Cursor starts the container itself.

In VS Code, using the attach-container+ scheme respects the remoteUser field from devcontainer.json.

Is there a workaround that lets me keep using the DevContainer CLI to start the container, but attach it in Cursor in a way that respects the remoteUser defined in devcontainer.json?

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.