Skip to content

X-Forwarding on Mac OS

X11 forwarding allows a user to launch applications and see a graphical representation of the application running on a remote machine using functionality embedded in the X-Server protocols common across many Linux (and other) platforms.

The Mac operating system fully supports X-Forwarding for accessing graphical content over an SSH Connection. The SSH connection will commonly be to a Linux environment, but there are also other operating systems that support X-Windows and X-Forwarding connections.

Important

The installer for the software that is required to complete the following steps requires logging off of the current Mac user session at the end of installation. Save all work before performing the steps in this document.

Installation of XQuartz

Mac OS requires installation of the XQuartz software prior to being able to launch graphical X applications. To install this software, navigate to The XQuartz Project at https://xquartz.org and click on the link to download the latest XQuartz-x.x.x.dmg file.

Screenshot

Find the downloaded DMG file in Mac's Finder, under the Downloads folder and double-click on it to launch:

Screenshot

Upon double-clicking, a new winodw will display with the installation package:

Screenshot

Click allow on the following prompt:

Screenshot

Click Continue through each of the installation screens:

Screenshot

Prior to installation, enter the Mac user password to allow the installation to continue, then click 'Install Software':

Screenshot

The installer will now prompt to Log Out of the machine, ensure all work is saved and click 'Log Out':

Screenshot

Click 'Move to Trash' when prompted by the installer to eject and delete the installation disk image:

Screenshot

Log back into Mac OS.

Testing X-Windows Functionality via XQuartz

Open a Terminal window and attempt use of X-Forwarding by connecting to SunLab using the -X SSH command line option:

ssh -X sun123@sunlab.cse.lehigh.edu

Where sun123 is the SunLab username.

Note

The SSH command line option -Y is also a method to enable X-Forwarding, but should only be used on fully trusted platforms as it can open security vulnerabilities. -X is the preferred method to use.

Run an X-Windows compatible program like 'xeyes'. XQuartz should launch automatically (its icon will appear in the Mac Dock) and the X-Windows program will display:

Screenshot