1

I have:

  • Remote server that runs Docker container and a SSH daemon
  • My own computer that can run Docker container and connect to the remote server through SSH with X11 forward

From my computer, I would like to open a GUI application located in the Docker container located in the Remote server.

  • If I run the Docker container in my own computer, I can open GUI app without any problem.

    • docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --env="QT_X11_NO_MITSHM=1" ...
  • If I run the container in the Remote server through SSH. I get: myapp: cannot connect to X server localhost:10.0

I guess there is another configuration to be able to share the virtual display created by the SSH connection to the container.

I am not running any SSH server in the Docker container and I don't want to.

How can I share the SSH X11 forward display with a Docker container?

  • If possible with a transparent way, no matter I run the container in local or remotely through SSH.
Alexis
  • 2,136
  • 2
  • 19
  • 47

1 Answers1

0

Try running the following on the host:

sudo xhost +local:root
Pavel Smirnov
  • 4,611
  • 3
  • 18
  • 28
  • Actually I found the solution here: https://stackoverflow.com/questions/48235040/run-x-application-in-a-docker-container-reliably-on-a-server-connected-via-ssh-w/48235281#48235281 – Alexis May 21 '19 at 21:44