microsoft / microsoft/vscode-remote-release
X applications can not start in devcontainer under Xwayland because of missing X authentication
@chrmarti is already working on this.
Since Mar 16, 2025.
- 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
- git clone https://github.com/nE0sIghT/devcontainer-xauthority
- Open cloned folder in the vscode
- Reopen workspace in the devcontainer
- Open terminal in the vscode
- 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 addin the devcontainer with the data from host'sxauth list - Or run
xhost +local:dockerin the host which is less secure IMO
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.