- Install VcXsrv or an equivalent X Server
- Launch the X Server and give it permission to access connections from all clients
- Launch the GUI app from the Docker container with appropriate X11 forwarding:
docker run --env="DISPLAY=host.docker.internal:0" ghcr.io/educelab/volume-cartographer VC
- Install XQuartz
brew install --cask xquartz
- Launch XQuartz. In the Preferences/Security tab, enable "Allow connections from network clients"
- Restart XQuartz
- Launch the GUI app from the Docker container with appropriate X11 forwarding:
# Give Docker permission to access the X server (will also launch XQuartz) # Needs to be run every time the XQuartz process is launched xhost +localhost # Launch the container docker run --env="DISPLAY=host.docker.internal:0" ghcr.io/educelab/volume-cartographer VC
# Give Docker permission to access the X server
# Needs to be run every time the X server is relaunched (e.g. after reboots)
xhost +local:docker
docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ghcr.io/educelab/volume-cartographer VC
Note: On some distributions, you may need to run Docker with superuser
privileges: sudo docker ...
If you get error could not connect to display <your display number>
, make
sure you run the following command to give Docker access to the X server:
# macOS: needs to be run every time the XQuartz process is launched
xhost +localhost
# Linux: needs to be run every time the X server is relaunched (e.g. after reboots)
xhost +local:docker
Are you using the Docker snap package? We've learned the hard way that the snap sandbox makes it extremely difficult to forward X11 windows to the host system. We recommend installing Docker Engine with apt (or the equivalent for your flavor of Linux). If you absolutely need to use the snap package, or still have issues connecting to the display, you may be interested in x11docker.