Installing and using X11 on macOS
To run X11 programs you need download and install XQuartz.
Since XQuartz 2.7.9 the indirect GLX mode is disabled by default. This prevents you from running FSLeyes over an SSH connection (although we strongly recommend you use VNC for this purpose).
To re-enable this, open a terminal and use the following commands:
defaults write org.xquartz.X11 enable_iglx -bool true
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
Now restart XQuartz (if it is running).
You may have to repeat this after Xquartz updates.
To launch a remote X11 application, use SSH with X11 tunnelling to connect to a remote Linux host and then run the graphical program.