Skip to content

Docker: enable GUI forwarding from container (Qt/xcb + Open3D)#36

Open
kvnptl wants to merge 1 commit intoNVlabs:masterfrom
kvnptl:chore/docker-x11-gui
Open

Docker: enable GUI forwarding from container (Qt/xcb + Open3D)#36
kvnptl wants to merge 1 commit intoNVlabs:masterfrom
kvnptl:chore/docker-x11-gui

Conversation

@kvnptl
Copy link

@kvnptl kvnptl commented Mar 23, 2026

What

  • Dockerfile: Install X11/xcb and related libs so OpenCV’s Qt backend can show windows when using host X11 forwarding (cv2.imshow). Adds libsm6 (fixes missing libSM.so.6), plus libx11-xcb1, libxcb-*, libxext6, etc. Uses libxcb-sync1 for Ubuntu 22.04 (not libxcb-sync0).
  • Dockerfile: ENV PATH=$PATH:/opt/conda/envs/my/bin, modern ENV form (silences Docker LegacyKeyValueFormat warning).
  • run_container.sh: set XDG_RUNTIME_DIR + create /tmp/runtime for Open3D; QT_X11_NO_MITSHM=1; optional QT_DEBUG_PLUGINS=0.

Why

Without these system libraries, Qt fails to load the xcb platform plugin inside the container even with DISPLAY and /tmp/.X11-unix mounted. Open3D may error if XDG_RUNTIME_DIR is unset.

How to verify

  1. On host: xhost +local:root
  2. Build image, run bash docker/run_container.sh
  3. Run a script that uses cv2.imshow and/or Open3D visualization -> windows should appear on the host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant