What is X11 Forwarding?
X11 Forwarding is what gives you the ability to run GUIs from a server on your own local machine (neat, huh?). For example, you can run Emacs from homework.eecs.tufts.edu from the comfort of your dorm.
How do I use X11?
Simple! All operating systems have a quick process to setup X11 Forwarding. Please see below for specific instructions based on operating system.
X11 Forwarding in Linux/Mac OS X
– For Macs, your best option is to download xQuartz from xQuartz.org. This is free software which will allow you to forward X11 on a Mac.
- Download the xQuartz DMG, open it, and follow the installation instructions.
- Run xQuartz from the Applications folder.
– For Linux, depending on your distribution, there may be no pre-requisites.
Connecting With X11 through SSH
- Connect to your favorite EECS server using ssh, but remember to tell it to forward X by adding the “-X” parameter.
- Example: ssh –X [username]@homework.eecs.tufts.edu
- To test to make sure X11 is working properly, run “xeyes” and a simple GUI should appear on the screen.
- That’s it! Any other application (Emacs, Matlab, etc) that you’d like to run the GUI for, simply start the program and a window will appear.
X11 Forwarding in Windows
- We recommend that you download Xming for all your Windows X11 needs.
- Launch Xming: A small program will appear in the taskbar; keep this running for the duration of the session.
- Launch PuTTy, an SSH (Secure SHell) client: Start->Programs->PuTTy->PuTTy.
- In the left-hand menu, expand “SSH”, open the “X11” menu, and check “Enable X11 Forwarding.” Do not forget this step!
- Go back to the “Session” menu, and under “Host Name” type firstname.lastname@example.org, then press Open.
- If a security alert pops up, press yes, then type your password into the open shell.
- You’re in Linux! Everything, such as “emacs myfile &”, will work just like a Linux lab machine.
If you want to ssh to another server during your session but want to keep X11 forwarding enabled, you must use the command “ssh -Y servername”.