Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode Devcontainers Unable to Open X11 Displays #10732

Open
matthewperry97 opened this issue Feb 26, 2025 · 0 comments
Open

VSCode Devcontainers Unable to Open X11 Displays #10732

matthewperry97 opened this issue Feb 26, 2025 · 0 comments
Assignees
Labels
containers Issue in vscode-remote containers

Comments

@matthewperry97
Copy link

  • VSCode Version: 1.97.2
  • Local OS Version: Microsoft Windows NT 10.0.22631.0
  • Remote OS Version:Ubuntu 24.04.1 LTS
  • Remote Extension/Connection Type: Dev Containers/WSL/Remote - Tunnels/VS Code Server
  • Logs: remoteContainers.log

Steps to Reproduce:

  1. Create an empty VS Code workspace
{
	"folders": [
		{
			"path": "."
		}
    ],
    "settings": {}
}
  1. Create a devcontainer with the following devcontainer.json file:
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
	"name": "Ubuntu",
	// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
	"image": "mcr.microsoft.com/devcontainers/base:jammy",
	// Features to add to the dev container. More info: https://containers.dev/features.
	// "features": {},

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],

	// Use 'postCreateCommand' to run commands after the container is created.
	// "postCreateCommand": "uname -a",

	// Configure tool-specific properties.
	// "customizations": {},

	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
	// "remoteUser": "root"
}
  1. Open the workspace in the devcontainer.
  2. In the devcontainers terminal run the following to install X-11 apps
sudo apt update && sudo apt install -y x11-apps
  1. Try running xcalc
  2. Get the following error
Error: Can't open display:
  • I'm able to run the same steps within WSL and the xcalc GUI opens and functions as expected.
  • Within WSL using the docker run command to open the same docker container I can install the X11 apps and run xcalc as expected
  • The issue started happening a couple months ago though frequency at which error showed up has increased (went from occuring once a week where a computer restart resolved the issue to anytime I try to open a GUI). I am now unable to open any GUIs from VSCode devcontainers.
@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

2 participants