Skip to content

Instantly share code, notes, and snippets.

@rlan
Last active February 13, 2019 23:53
Show Gist options
  • Select an option

  • Save rlan/6215eaca876c2fd7bb0739fe6dc7ceb0 to your computer and use it in GitHub Desktop.

Select an option

Save rlan/6215eaca876c2fd7bb0739fe6dc7ceb0 to your computer and use it in GitHub Desktop.
Run GUI applications from Docker
#!/bin/bash
#
# Usage ./gui_docker osrf/ros:kinetic-desktop-full
#
# Host-side pre-requisite:
# Linux: a desktop environment, e.g., GNOME
# MacOS: XQuartz (https://www.xqartz.org/)
# Windows: Xming (http://www.straightrunning.com/XmingNotes/)
#
xhost +local:root
docker run -it --rm \
--env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
$1 \
bash
xhost -local:root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment