What is X11 Forwarding?
X11 forwarding allows you to run GUI applications on SeaWulf while displaying them on your local computer. It works through the X11 windowing protocol, which sends graphical output from the cluster to your local desktop. This is commonly used for visualization tools, plotting software, or interactive applications that require a graphical interface.
Installing an X Window Server
Before using X11 forwarding, you must have an X server installed locally. The X server receives and displays graphics from remote applications. Follow the setup instructions below for your operating system.
Windows (MobaXterm)
MobaXterm (Recommended):
- Includes a built-in X server with SSH integration
- Minimal setup required
- Download and install MobaXterm Home Edition.
- Ensure "X11 server" is enabled (default setting).
- Create a new SSH session:
- Remote host:
login.seawulf.stonybrook.edu - Specify username: your NetID
- Enable "X11-Forwarding" under Advanced SSH Settings
- Remote host:
- Connect and test using
glxgears.
macOS (XQuartz)
XQuartz:
- Standard X11 implementation for macOS
- After installing version 2.7.9 or later, enable indirect GLX (required for 3D graphics):
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
Then restart XQuartz.
- Start XQuartz.
- Connect to SeaWulf with X11 forwarding:
ssh -X <your_netid>@login.seawulf.stonybrook.edu
- Test your setup:
glxgears
You should see a small window with rotating gears.
Linux
Most Linux distributions include X11 by default.
- Open a terminal and connect to SeaWulf with X11 forwarding:
ssh -X <your_netid>@login.seawulf.stonybrook.edu
- Test your setup:
glxgears
Using X11 with SLURM Jobs
Option 1: Interactive Jobs with X11
Step 1: Load SLURM and request a compute node:
module load slurm salloc -N 1 -p short-40core
Step 2: Once allocated, SSH into the node with X11 forwarding:
ssh -X $SLURM_NODELIST
Option 2: SeaWulf Desktop via Open OnDemand
Some GUI applications may perform better with the SeaWulf Desktop app in Open OnDemand.
- Log in to Open OnDemand
- Select SeaWulf Desktop
- Choose runtime, queue, and other options
- Once the job starts, launch the desktop session
- Use the terminal within the desktop to run GUI applications
Switching Between Nodes
X11 forwarding applies per SSH connection. When moving to a different node, reconnect using ssh -X.
To another login node:
ssh -X <your_netid>@milan1.seawulf.stonybrook.edu
To a compute node:
ssh -X <your_netid>@compute-node-name
Tips and Troubleshooting
- Each new SSH or SLURM session requires a fresh
-Xor-Yconnection - Verify your X server is running locally
- Ensure the
DISPLAYvariable is set correctly (echo $DISPLAY) - Test with
glxgearsor GUI tools like Matplotlib or MATLAB
If no window appears, your local X server may not be active or X11 forwarding may not be enabled in your SSH connection.
