Sharing the Xserver with docker container

Ryan Schmidt ryandesign at macports.org
Mon Jan 25 03:45:36 UTC 2021



On Jan 24, 2021, at 21:42, Tong Sun wrote:

> On Sun, Jan 24, 2021 at 10:31 PM Ryan Schmidt wrote:
> 
>> I found this article about how to do this. Maybe it will help?
>> 
>> https://medium.com/@mreichelt/how-to-show-x11-windows-within-docker-on-mac-50759f4b65cb
>> 
>> Where it says "install XQuartz", don't, since you already have the MacPorts X11.app which is equivalent to but newer than XQuartz.
>> 
>> It sounds like the key may be to set "Allow connections from network clients" in X11.app's Preferences window, close and reopen X11.app, and run "xhost + 127.0.0.1" and "export DISPLAY=host.docker.internal:0" in the Docker image.
> 
> Hmm... I've looked everywhere but cannot find this "Allow connections
> from network clients" in X11.app's Preferences window. Where can I
> find it?
> 
> Without such step, I'm getting
> 
> $ xhost + 127.0.0.1
> xhost:  unable to open display "127.0.0.1:0"

Open X11.app. Choose Preferences from the X11 menu. Select the Security tab.


More information about the macports-users mailing list