What is X11 Forwarding?
X11 forwarding allows GUI applications running on SeaWulf to display on your local machine. X11 is a window management protocol that enables remote graphical applications to appear on your desktop as if they were running locally. This is essential for plotting tools, interactive software, and applications with graphical interfaces.
Installing an X Window Server
Before using X11 forwarding, you need an X server installed on your local machine. The X server receives and displays the graphical output from remote applications.
Windows
- MobaXterm (Recommended): Includes built-in X server with easy SSH integration
macOS
- XQuartz: The standard X11 implementation for macOS
Important for XQuartz 2.7.9+:
After installing XQuartz version 2.7.9 or later, you must manually enable indirect GLX (disabled by default). Run this command in Terminal:
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
Then restart XQuartz for the changes to take effect.
Linux
- No additional software required: Most Linux distributions include X11 by default
Basic X11 Forwarding Setup
Understanding the SSH Flags
-X
: Enables X11 forwarding with security restrictions (recommended)-Y
: Enables trusted X11 forwarding with relaxed security (use only if-X
doesn't work)
Security Note:
Use -Y
only when necessary. Trusted X11 forwarding (-Y
) disables X11 security extensions, making it easier for other applications to spy on your session. Always try -X
first.
MacOS and Linux
- Ensure your X11 server is running (XQuartz for Mac, automatic for Linux)
- Connect to SeaWulf with X11 forwarding enabled:
ssh -X <your_netid>@login.seawulf.stonybrook.edu
Test Your Connection:
After logging in, test X11 forwarding by running:
glxgears
You should see a small window with rotating gears, typically in the upper-left corner of your screen. The appearance varies based on your operating system and X11 implementation.
Windows: MobaXterm
- Download and install MobaXterm Home Edition
- Verify "X11 server" is enabled in Settings (enabled by default)
- Create a new SSH session:
- Remote host:
login.seawulf.stonybrook.edu
- Check "Specify username" and enter your NetID
- Under "Advanced SSH Settings," check "X11-Forwarding"
- Remote host:
- Connect to the cluster
- Test with
glxgears
- GUI applications will appear on your Windows desktop
Using X11 with SLURM Jobs
To run GUI applications on compute nodes, you need to request a job allocation and then SSH into the allocated node with X11 forwarding.
Interactive Jobs with X11
module load slurm salloc -N 1 -p short-40core
ssh -X $SLURM_NODELIST
Queue Availability:
The example above works on milan1 and milan2 login nodes. For login1 or login2, use short-28core
instead of short-40core
. Check the SeaWulf FAQ for complete queue availability information.
Switching Between Nodes
X11 forwarding is established per SSH connection. When moving between different nodes, you must establish new SSH connections with X11 forwarding enabled.
Moving to Different Login Nodes
ssh -X <your_netid>@milan1.seawulf.stonybrook.edu # or ssh -X <your_netid>@milan2.seawulf.stonybrook.edu
Moving to Compute Nodes
ssh -X <your_netid>@compute-node-name
Tips and Troubleshooting
- Performance: GUI performance depends on network latency. Heavy graphics applications may be slower over remote connections
- Application Failures: Some applications will fail if SSH or SLURM jobs don't have X11 forwarding enabled
- Fresh Connections: Each new node requires a fresh
ssh -X
orsrun -X
command - Display Issues: If applications don't appear, verify your local X server is running and the
DISPLAY
environment variable is set
Common GUI Applications to Test:
glxgears
- 3D graphics test- Python matplotlib plots
- MATLAB GUI components