Created
August 5, 2020 23:19
-
-
Save vinnnyr/0bdc91eef82eb5b51e8251bf89a87972 to your computer and use it in GitHub Desktop.
Run a Docker image with X11 automatically configured
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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