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\"
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.)
From: moby/moby#8710
@ikabar-tracxpoint I had the same problem as you and i made it work as follow:
Close xQuartz.
IN a normal terminal, run as follow:
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:"$DISPLAY"
You can put it in a screen session Still in a normal terminal, enter:
docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=:0 jess/firefox It take time to boot xquartx, and voila, it should work fine
Good luck