Skip to content

Instantly share code, notes, and snippets.

@mluis
Created October 5, 2017 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mluis/b28e708645d251c72a19f30341bd55fa to your computer and use it in GitHub Desktop.
Save mluis/b28e708645d251c72a19f30341bd55fa to your computer and use it in GitHub Desktop.
share osx XQuartz
brew cask install xquartz
open -a XQuartz
# In the XQuartz preferences, go to the “Security” tab and make sure you’ve got “Allow connections from network clients”
iface="en1" #Wifi
ip=$(ifconfig $iface | grep inet | awk '$1=="inet" {print $2}')
xhost + $ip
docker run -d --name firefox -e DISPLAY=$ip:0 -v /tmp/.X11-unix:/tmp/.X11-unix jess/firefox
@mluis
Copy link
Author

mluis commented Dec 3, 2017

The important part is passing the environment variable: DISPLAY=$ip:0

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