XQuartz
XQuartz enables macOS to run X11-based applications over ssh -X — the SSH dash X option to forward GUI apps , allowing remote Unix GUI programs to display locally. It’s commonly used for tools like MATLAB, RStudio, and VMD—essential for rendering scientific graphs, simulations, and 3D molecular structures.
You can use
ssh -X
— in the macOS Terminal with XQuartz open
in the standard macOS Terminal to forward GUI apps,
as long as XQuartz is installed and
running in the background
— required for remote GUI apps to show
.
Install XQuartz on macOS via Homebrew:
brew install --cask xquartz
X11 forwarding using XQuartz to run remote Linux/Unix GUI apps on macOS.
Launch XQuartz from Applications or with:
open -a XQuartz
In XQuartz, open Preferences → Security and enable:
☑ Allow connections from network clients
Allow local access to the X11 display:
xhost +localhost
Connect to the remote machine with X11 forwarding:
ssh -X user@remote-host
Confirm your display variable is set by XQuartz:
echo $DISPLAY
Expected output format (will vary):
/private/tmp/com.apple.launchd.XYZ/org.macosforge.xquartz:0