nvidia-docker2 tutorial fails even when following exact steps
I am following this tutorial. After running runmyimage.sh from the tutorials, this is the output:
xauth: /tmp/.docker.xauth not writable, changes will be ignored
xauth: (argv):1: unable to read any entries from file "(stdin)"
chmod: changing permissions of '/tmp/.docker.xauth': Operation not permitted
then inside the docker interactive terminal, after running rosrun rviz rviz
here is the output:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
my $DISPLAY = :1
after looking at this post, I did try to add xhost +si:localuser:root
at the beginning of my runmyimage.sh file, yet the error still showed up. I also tried xhost +"local:docker@"; but still same resoponse.
I am running docker without sudo, but docker has been added to the sudo user group.
I also tried sudo ./runmyimage.sh and this is the output from the host terminal:
xauth: (argv):1: unable to read any entries from file "(stdin)" non-network local connections being added to access control list
yet the display error inside docker terminal does not change. Its the same as above.
my docker version is 18.06.1-ce but I did try 18.09, yet uninstalled it and reverted back when I realized that the update didn't change anything.
My system is ubuntu 18.04 Bionic.
Asked by tristochief117 on 2018-11-14 19:24:48 UTC
Answers
found the answer,
The tutorial has a typo.
inside the run_my_image.bash file, change the docker run option --env to --env="DISPLAY=$DISPLAY" instead of --env="DISPLAY"
I don't know how I didn't see this typo, but of course if the docker container didn't have a DISPLAY variable set, then of course it would display the error above.
a side note, the docker tutorial has another error in it: the docker run option (again inside the bash script) *-env="XAUTHORITY=$XAUTH" * is missing a - change it from *-env="XAUTHORITY=$XAUTH" * to *--env="XAUTHORITY=$XAUTH" * notice the extra - (dash ) symbol
Asked by tristochief117 on 2018-11-14 22:02:28 UTC
Comments
If you feel the tutorial is incorrect, then please register for a wiki account and correct the text. That's why it is a wiki.
Asked by gvdhoorn on 2018-11-15 13:38:27 UTC
Comments
+1 for adding the line
xhost +si:localuser:root
to the script,chown 1000:1000 /tmp/.docker.xauth
is also worth trying.Asked by fvd on 2019-05-01 05:25:54 UTC