Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 .

like image 813
pgh Avatar asked Apr 24 '15 09:04

pgh


2 Answers

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:

  • an X11 server like Xming
  • to check if socat is available for Windows )

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.)

like image 160
VonC Avatar answered Sep 29 '22 08:09

VonC


I started vncserver and then can see my application with vncviewer .

like image 44
pgh Avatar answered Sep 29 '22 06:09

pgh