Skip to content

Instantly share code, notes, and snippets.

@vinnnyr
Created August 5, 2020 23:19
Show Gist options
  • Save vinnnyr/0bdc91eef82eb5b51e8251bf89a87972 to your computer and use it in GitHub Desktop.
Save vinnnyr/0bdc91eef82eb5b51e8251bf89a87972 to your computer and use it in GitHub Desktop.
Run a Docker image with X11 automatically configured
#s is not the safest way however, as you then compromise the access control to X server on your host
xhost +local:root # for the lazy and reckless
# replace nav2/vinny with the name of your image obviously
docker run -it --env="DISPLAY" --network="host" --privileged -v /dev:/dev --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" nav2/vinny
export containerId=$(docker ps -l -q)
# Close security hole:
xhost -local:root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment