I have been trying to run graphical applications (rviz, rqt_graph, etc) from inside a docker container. To do this I have found this excelent article:Rviz on docker
To summarize, the author says that we need to
when we run the container.
However if you see at the attached github page and you check the run_ssh_rviz_c.bash
script you find
#!/bin/bash
docker run -it --rm --privileged
--net=host
--env=NVIDIA_VISIBLE_DEVICES=all
--env=NVIDIA_DRIVER_CAPABILITIES=all
--env=DISPLAY
--env=QT_X11_NO_MITSHM=1
-v /tmp/.X11-unix:/tmp/.X11-unix
--runtime=nvidia
-e NVIDIA_VISIBLE_DEVICES=0
rviz_c
/bin/bash
# For the latest docker version:
#docker run -it?--rm?--privileged?
# --net=host?
# --env=NVIDIA_VISIBLE_DEVICES=all?
# --env=NVIDIA_DRIVER_CAPABILITIES=all?
# --env=DISPLAY?
# --env=QT_X11_NO_MITSHM=1
# -v /tmp/.X11-unix:/tmp/.X11-unix?
# --gpus 2
# rviz_c
# /bin/bash
I checked and it runs without problems ( I could see rviz and rqt_graph)
So my questions are:
- Where is
xhost +local:docker
? Isnn't that needed?
- If not, which of the docker run selections is making it possible to run GUI aplications?
- An unrelated question, but we are starting one container and running roscore in it, and starting another container and running rviz on it. How come this works if theye are two different containers? I thought until this time that it would have to be in the same container. I think I need some networking explanation.
question from:
https://stackoverflow.com/questions/65867746/running-graphical-applications-on-docker 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…