Reputation: 10891
I have been trying to follow the instructions on https://learning-continuous-deployment.github.io/docker/images/dockerfile/2015/04/22/docker-gui-osx/ about running GUI apps in a docker container inside a MacBookPro host (using Docker tools).
I created a simple docker container using Fedora 23 and with firefox installed.
I try to run firefox and after about a minute I get the following error:
Unable to init server: Broadway display type not supported: 192.168.57.3:0
Error: cannot open display: 192.168.57.3:0
Does anyone have a clue what the error means and/or how to fix it?
Upvotes: 20
Views: 11568
Reputation: 472
I was seeing the same error and unfortunately rebooting did not solve the problem for me. However, I was able to get it working by mounting and pointing to my local .Xauthority file:
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
docker run --rm --name firefox -e DISPLAY=$IP:0 -e XAUTHORITY=/.Xauthority --net host -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/.Xauthority jess/firefox
Of course, this assumes your XQuarts/xhost stuff is properly configured according to this answer
Upvotes: 2
Reputation: 1622
On a Mac you may find the following steps useful:
open -a XQuartz
)xhost + $IP
(see note 1)Note 1: Here's a neat trick toget your ip address:
export IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
Note 2: And an example docker run command to start firefox
docker run -it -e DISPLAY=$IP:0 -v /tmp/.X11-unix:/tmp/.X11-unix <image> firefox
Upvotes: 25