Get X11 forwarding in macOS

Begin with version 1.8, Core Shell supports X11 forwarding. For macOS, X11 is not the default graphical interface, XQuartz must be installed and started.

First, download and install XQuartz on your Mac and run it whenever you want to use X11 forwarding.

:warning: Note: Codinn Store or Setapp version of Core Shell / Tunnel is a mandatory before we move on.

Next, change advanced options of the host:

  1. ForwardX11 set to yes
  2. ForwardX11Trusted set to yes
  3. XAuthLocation set to command output of:
    which xauth
    
    generally, it is /opt/X11/bin/xauth .

Finally, run XQuartz and open a new shell window of the host, then start your remote X11 program and view the user display on your local machine:

xeyes &

Troubleshooting

If running an X11 program in an SSH terminal reports the error:

Error: Can't open display

Please check the following in order:

1. Make sure XQuartz allows network connections.

Open:

  • XQuartz → Settings (Preferences)
  • Security

Enable:

  • :white_check_mark: “Allow connections from network clients”

Then completely quit and relaunch XQuartz.

2. Enable X11 forwarding in the remote host’s sshd.

By default, sshd often does not have X11 forwarding enabled.

Edit sshd_config:

sudo nano /etc/ssh/sshd_config

Make sure it contains:

X11Forwarding yes