windowdockerboot2dockerdocker-compose

How to run GUI application from linux container in Window using Docker?


I have a QT based GUI application which i compiled in docker (centos image). I am able to launch GUI application from inside Centos image in my Linux machine(OpenSUSE 13.2) Following instruction from this blog "http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker"

Same thing i want to do via window.I installed window docker . I loaded the desired centos images having my GUI application and and through terminal trying to launch GUI by using container . It gives Error saying" gui: cannot connect to X server"

Any idea or solution .


Solution

  • There was a similar discussion on docker issue 8710, but for MacOS:

    A somewhat crude way to do this:

    Start socat to expose local xquartz socket on a TCP port

    socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
    

    (Note: for Windows, you would need at least:

    Pass the display to container (assuming virtualbox host is available on 192.168.59.3):

     docker run -e DISPLAY=192.168.59.3:0 jess/geary
    

    (This is insecure on public networks, add bind, su and range options to socat to limit access.)