I am having trouble running a Java GUI app from within a docker container so that it appears on my desktop, as xeyes does.
Here are the steps I'm taking:
I am logged into my physical machine in a Unity session and open up a terminal, running the commands:
root@prod:~# echo $DISPLAY :0 root@prod:~# ls /tmp/.X11-unix/ X0 X1024
I then get onto a VPN and SSH into a host (named host-a).
I can run xeyes from within the host-a and the eyes appear on Unity, follow my mouse around, so X forwarding works.
a@host-a$ echo $DISPLAY localhost:10.0 a@host-a$ sudo netstat -anutp | grep 60 tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 21988/6 tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 22182/14 tcp6 0 0 ::1:6010 :::* LISTEN 21988/6 tcp6 0 0 ::1:6011 :::* LISTEN 22182/14
Within host-a, I then use docker to run image containing the Java app:
a@host-a$ sudo docker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -ti repo/image bash`
The output is:
root@7722f3167495:/# echo $DISPLAY localhost:11.0
Then trying to the run the Java app gives:
java.awt.AWTError: Can't connect to X11 window server using 'localhost:11.0' as the value of the DISPLAY variable.
I've tried setting
10.0 also but same.
I note that only local machine prod contains the sockets in
/tmp/.x11-unix. The container and host-a do not.
Any suggestions on why X session is not established would be greatly appreciated.