Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting X11 GUI applications to work on OS X with Docker

Getting X11 GUI applications to work on OS X with Docker

$ brew install socat
$ brew cask install xquartz <--- assuming you don't already have XQuartz installed some other way
$ open -a XQuartz <--- start an XQuartz session

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

In a new terminal:

$ inconfig

Look for the IP address assigned to your Docker VM; the interface will be something like vboxnet0 or vboxnet1

$ docker run --rm -e DISPLAY=[IP address of vboxnet0]:0 [image] [command]

For example, to run the Arduino IDE, I've used

$ docker run --rm -e DISPLAY=192.168.99.1:0 davechick/arduino-dev arduino

See https://github.com/docker/docker/issues/8710 for more info

@hildjj

This comment has been minimized.

Copy link

@hildjj hildjj commented Sep 27, 2016

s/XQuarts/XQuartz/

@kiki67100

This comment has been minimized.

Copy link

@kiki67100 kiki67100 commented Dec 14, 2017

Hello
I make a little script to do that :

https://gist.github.com/kiki67100/5e1568ac783e8e4942b672f1090db2cd

Thanks for your script

@stonehippo

This comment has been minimized.

Copy link
Owner Author

@stonehippo stonehippo commented Oct 22, 2019

s/XQuarts/XQuartz/

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment