I am trying to connect via ssh -X
to a remote machine and from them run a docker with the graphical interface enabled.
I have found and tried to follow this tutorial: https://blog.yadutaf.fr/2017/09/10/running-a-graphical-app-in-a-docker-container-on-a-remote-server/
but I am getting the following error even with the final script
xterm: Xt error: Can't open display: :10
if I add a sudo chmod -R 777 display
in the script I get this error instead:
X11 connection rejected because of wrong authentication. xterm: Xt error: Can't open display: :10
What I am missing? There is anything else I should configure either locally, on the remote machine or the container?
on local machine
$ xauth list
test/unix:1 MIT-MAGIC-COOKIE-1 f3e4afd36654c52965e3e529c8a3ce88
test/unix:0 MIT-MAGIC-COOKIE-1 a806b599d75e8b6df4f107a87faa952f
test/unix:10 MIT-MAGIC-COOKIE-1 85342ce3b19106adfea27f3333ba19d8
test/unix:11 MIT-MAGIC-COOKIE-1 224cda4faa7c6d128748c2c35387df68
test:10 MIT-MAGIC-COOKIE-1 5061d4d95dc44d11b60137ad215f1abe
test:11 MIT-MAGIC-COOKIE-1 1eddbb0db43952186265eca6e49e08a4
$ echo $DISPLAY
:0.0
on remote machine (ssh -X localhost
)
$ xauth list
test/unix:1 MIT-MAGIC-COOKIE-1 f3e4afd36654c52965e3e529c8a3ce88
test/unix:0 MIT-MAGIC-COOKIE-1 a806b599d75e8b6df4f107a87faa952f
test/unix:10 MIT-MAGIC-COOKIE-1 85342ce3b19106adfea27f3333ba19d8
test/unix:11 MIT-MAGIC-COOKIE-1 224cda4faa7c6d128748c2c35387df68
test:10 MIT-MAGIC-COOKIE-1 5061d4d95dc44d11b60137ad215f1abe
test:11 MIT-MAGIC-COOKIE-1 1eddbb0db43952186265eca6e49e08a4
$ echo $DISPLAY
test:10.0
$ sudo lsof -i4:6010
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 25693 me 10u IPv4 575887 0t0 TCP *:6010 (LISTEN)
sshd 25693 me 13u IPv4 583043 0t0 TCP localhost:6010->localhost:33366 (ESTABLISHED)
socat 25735 me 3u IPv4 585843 0t0 TCP localhost:33366->localhost:6010 (ESTABLISHED)
within container
$ xauth list
xterm/unix:10 MIT-MAGIC-COOKIE-1 85342ce3b19106adfea27f3333ba19d8
$ echo $DISPLAY
:10
p.s. I also have tried without success the following SO solutions [1], [2]