1

On my OSX, I can show a gui interface from a docker container successfully with Xqautz as the following command:

docker run -v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY --privileged -ti MY_OWN_DOCKER_IMAGE bash

However, I would like to put MY_OWN_DOCKER_IMAGE inside a docker-machine(called default) and show the gui interface on my OSX.

My scenario like below:

  1. Execute a gui application inside a container running inside default VM.
  2. pass GUI view from container to default VM.
  3. pass GUI view from default VM to OSX.
  4. GUI interface show on my macbook !

I got a question here: how do I set the "-v" and "-e" parameters when I am trying to do "docker run MY_OWN_DOCKER_IMAGE" inside default VM? or is there any other solution?

Tony
  • 11
  • 3

1 Answers1

0

I found solution here: X11 forwarding doesn’t work when image runs in docker machine but it works fine if the image is run w/o a docker machine

-v should be like : -v /var/run/docker.sock:/var/run/docker.sock

but -e DISPLAY should be given an ip(check it from XQuartz with command "xhost")

Now I can show gui interface from container running in a docker machine VM!

Tony
  • 11
  • 3