microsoft / microsoft/vscode-remote-release

X applications can not start in devcontainer under Xwayland because of missing X authentication

Open
#10,791 2 comments 3 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Mar 16, 2025.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Issue description

Running X application in a devcontainer works well when vscode is started under Xorg. However when running under Wayland (GNOME Mutter in my case) with Xwayland X applications doesn't start with error:

Authorization required, but no authorization protocol specified

Error: Can't open display: :0

I think vscode should use data from $XAUTHORITY variable to configure devcontainer. It looks like vscode do some steps to pass X auth data in the devcontainer because it works out of the box.

Steps to reproduce

  1. git clone https://github.com/nE0sIghT/devcontainer-xauthority
  2. Open cloned folder in the vscode
  3. Reopen workspace in the devcontainer
  4. Open terminal in the vscode
  5. Run xclock

Actual results

xclock window appears when vscode started under Xorg.

Authorization required error when vscode started under Wayland.

Expected results

xclock window should appear.

Workarounds

  • Run xauth add in the devcontainer with the data from host's xauth list
  • Or run xhost +local:docker in the host which is less secure IMO

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.