Skip to content

Instantly share code, notes, and snippets.

@kaishuu0123
kaishuu0123 / x11_docker_mac.md
Created January 26, 2022 07:18 — forked from cschiewek/x11_docker_mac.md
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment: