Docker: running application with a remote X-server

I currently run my application in a container together with Xvfb and X11VNC. This all works nicely and I can see the GUI via any VNC client.
However, I would like to run Xvfb and X11VNC in container A, and my application in container B.

Container A is started as e.g.
docker run -it –rm –name x11 -p 6000-6100:6000-6100 myimagewithXvfb

  • How to connect to a Postgres server in a Docker (1.12.0) container on a Mac?
  • Jenkins Job Builder not creating publishers
  • Is there a way to download docker hub images whitout “docker pull” for a machine with out Internet access?
  • How to set PS1 in Docker Container
  • Problems with Dockerbeats dashboard containerName field
  • How can I make my Docker compose “wait-for-it” script invoke the original container ENTRYPOINT or CMD?
  • In B I set to DISPLAY=A, to point to the X server (XVfb) in container A.

    In B I start e.g. xeyes, but I get the error:
    root@a1ec4b67e98f:/# xeyes
    Error: Can’t open display:
    root@a1ec4b67e98f:/# echo $DISPLAY

    Also using does not matter.

    Anyway, the question is how to get this to work, if possible at all ?

  • coreos docker 1.7.1 -v file.txt:file.txt not updating
  • Deploy and debug a remote Linux Docker container using Visual Studio Tools for Docker
  • Limit number of open files in a Container
  • Docker Hub Private Repo Login. More secure way?
  • Access web server over https in a Docker container
  • When we execute docker run ubuntu:14.04 ps ax, where does ps ax command runs?
  • One Solution collect form web for “Docker: running application with a remote X-server”

    Without more information it’s hard to tell for sure, but my guess is that your problem is related to X authority. You can either allow clients to connect without access control by using the xhost command:

    A> xhost +
    B> export DISPLAY=
    B> xeyes

    A more secure way is on container A ssh to container B like this:

    A> ssh -Y B
    B> xeyes

    (Here you don’t need to manually set the DISPLAY env. variable as it’s set by SSH automatically.)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.