From 1a95ab9c24a212333aec6b4a9c32c2c0014b0787 Mon Sep 17 00:00:00 2001 From: Alexis Guijarro Date: Wed, 20 May 2026 13:57:18 -0500 Subject: [PATCH 1/2] Adding support to Wayland in Linux --- docker/docker_run.sh | 13 ++++++++++++- docs/setup.md | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docker/docker_run.sh b/docker/docker_run.sh index 06a4975..d11500a 100755 --- a/docker/docker_run.sh +++ b/docker/docker_run.sh @@ -5,6 +5,7 @@ SCRIPTPATH=$(dirname "$SCRIPT") NO_GUI=false NVIDIA=false TMUX_LAYOUT=false +WAYLAND=false while [[ $# -gt 0 ]]; do case $1 in @@ -20,9 +21,13 @@ while [[ $# -gt 0 ]]; do TMUX_LAYOUT=true shift ;; + --wayland) + WAYLAND=true + shift + ;; *) echo "Unknown argument: $1" - echo "Usage: $0 [--no-gui] [--nvidia] [--tmux]" + echo "Usage: $0 [--no-gui] [--nvidia] [--tmux] [--wayland]" exit 1 ;; esac @@ -49,6 +54,12 @@ if [ "$NO_GUI" = false ]; then DOCKER_CMD="$DOCKER_CMD -v /tmp/.X11-unix:/tmp/.X11-unix:ro" DOCKER_CMD="$DOCKER_CMD -e DISPLAY=$DISPLAY" + # WAYLAND support through X11 Compatibility Layer + # We need it so QT can talk to the display for Gazebo + if [ $WAYLAND = true ]; then + DOCKER_CMD = "$DOCKER_CMD -e QT_QPA_PLATFORM=xcb" + fi + # Always forward /dev/dri so Mesa has a working DRM path. The nvidia # runtime by itself only provides NVIDIA's GL stack; it does not expose # the integrated GPU. Without /dev/dri the iris/i915 Mesa driver fails diff --git a/docs/setup.md b/docs/setup.md index 0cbd066..b825ae8 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -95,6 +95,7 @@ You can use also use these options: This option also forwards port `18570` to allow external (Host) QGC connection. - `--nvidia` to run the container with the `nvidia` runtime (it requires the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed and registered with Docker on the host; see `nvidia-ctk runtime configure --runtime=docker` followed by `sudo systemctl restart docker`). - `--tmux` to drop straight into the preconfigured workshop `tmux` layout (see [Option C](simulation.md#option-c--the-preconfigured-workshop-layout-workshop-tmux)) instead of a plain shell. Detaching the session (`Ctrl+b d`) leaves you in a normal shell with the simulation still running; reattach with `workshop-tmux`. +- `--wayland` to use Wayland's X11 Compatibility layer so Gazebo can run on machines using Wayland as Window Manager, make sure to run `xhost +local:docker` on your host terminal first. When using this method you can attach new shell to your container by running From 6dfc555a77c894e93df51024728d6dd823b2b839 Mon Sep 17 00:00:00 2001 From: Alexis Guijarro Date: Wed, 20 May 2026 14:11:44 -0500 Subject: [PATCH 2/2] Update docker_run.sh --- docker/docker_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker_run.sh b/docker/docker_run.sh index d11500a..974cecb 100755 --- a/docker/docker_run.sh +++ b/docker/docker_run.sh @@ -57,7 +57,7 @@ if [ "$NO_GUI" = false ]; then # WAYLAND support through X11 Compatibility Layer # We need it so QT can talk to the display for Gazebo if [ $WAYLAND = true ]; then - DOCKER_CMD = "$DOCKER_CMD -e QT_QPA_PLATFORM=xcb" + DOCKER_CMD="$DOCKER_CMD -e QT_QPA_PLATFORM=xcb" fi # Always forward /dev/dri so Mesa has a working DRM path. The nvidia