- Install XQuartz
$> brew install xquartz
Updating Homebrew...
==> Downloading https://github.com/XQuartz/XQuartz/releases/download/XQuartz-2.8.1/XQuartz-2.8.1.dmg
==> Downloading from https://github-releases.githubusercontent.com/201858552/97a77400-a5f0-11eb-90ad-2973b8c2dc53?X-Amz-Algorithm=AWS4-
######################################################################## 100.0%
==> Installing Cask xquartz
==> Running installer for xquartz; your password may be necessary.
...
- Verify your installed app
$> brew info xquartz
brew info xquartz
xquartz: 2.8.1 (auto_updates)
https://www.xquartz.org/
/usr/local/Caskroom/xquartz/2.8.1 (103.5MB)
...
- Validate your SSH configuration (as client)
$> cat ~/.ssh/config
Host *
ForwardX11 yes
ForwardX11Trusted yes
ForwardAgent yes
...
- Start your X11 Service
$> launchctl start org.xquartz.startx
$> launchctl list org.xquartz.startx
{
"EnableTransactions" = true;
"Sockets" = {
"org.xquartz:0" = (
file-descriptor-object;
);
};
"LimitLoadToSessionType" = "Aqua";
"Label" = "org.xquartz.startx";
"OnDemand" = true;
"LastExitStatus" = 9;
"PID" = 99518;
"Program" = "/opt/X11/libexec/launchd_startx";
"ProgramArguments" = (
"/opt/X11/libexec/launchd_startx";
"/opt/X11/bin/startx";
"--";
"/opt/X11/bin/Xquartz";
);
};
- Export your X11 Server
$> export DISPLAY=:0
- Start your remote application
$> ssh -Y 10.2.1.20 xclock
References