Working Remotely using X11 forwarding
(Setting up a remote connection for windowed Emacs on your
home machine with X11)
X11 Forwarding
PC users may need access to graphical interfaces on remote Unix or Linux computers. Frequently, this is complicated by the need for security for the connection. One approach, when the PC runs some version of Microsoft Windows, is the use of X server program and PuTTY/secureCRT (software that allows ssh protocol) to connect to the Unix/Linux host. This approach provides a secure, encrypted link and allows the graphical information to pass through firewalls using a feature called X11 forwarding.
If you have a Windows Machine:
- Download and Install secureCRT
(access secureCRT here)
- Authenticate with your PennKey and password
- Fill out a form (name, e-mail, number of new installations)
- Download and run the installer
- To connect to Eniac, open SecureCRT (added to the Start menu, and/or the SecureCRT executable in the SecureCRT directory).
- By default, the UPenn-provided copy lists available servers, and you can select
eniac.seas.upenn.edu and connect.
- Download and install
Xming
- Download and install Xming
Fonts
- Check all boxes during the installation process
- To setup windowed Emacs (i.e. have emacs open outside the terminal running as a background process)
do the following
- Start Xming and SecureCRT: Start Xming (the X Window server): Start -> All Programs -> Xming -> Xming. You will see an X appear in the toolbar. Then start SecureCRT (the secure terminal program): Start -> All Programs -> SecureCRT (followed by version number). Cancel out of 'Quick Connect'.
- New session continued: Click on the 'New Session' icon.
- New session continued: Protocol 'SSH2' (Secure Shell Version 2) should be used. Click 'Next'.
- New session continued: Enter under 'Hostname': eniac-l.seas.upenn.edu, and under 'Username': yourUsername. Click 'Next'.
- New session continued: Session name: yourUsername@eniac (you can give any name you like). Click 'Finish'.
- Change properties: Before you connect, two properties have to be changed. X11 forwarding has to be enabled, and some SSH 'Key exchange' protocols have to be disabled. Click on the 'Properties' icon.
- Change properties continued: Select the 'Remote/X11' category under 'Port Forwarding'. Check 'Forward X11 packets'. Do not click 'OK' yet.
- Change properties continued: Select the 'SSH2' category. Under 'Key exchange' uncheck 'Kerberos' and 'Kerberos w/ Group Exchange'. Then hit ok.
- Connect: Finally click on 'Connect' to connect to the server. You will be prompted for you password.
- If you get the Accept key - then click on the first time 'Accept & Save' the host key for eniac-l.seas.upenn.edu
- After you log in, type command
emacs &. This should start emacs as backdround process (opening emacs outside the terminal).
- If you get following Warning message: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1"to type FontStruct
- This happened because all fonts were not downloaded and installed. Then you have two options:
- Re-install Xming Fonts and this time make sure you select all check boxes (to install all kinds of fonts)
- From C:\WINDOWS\Fonts, copy all the .ttf files and paste them into C:\Program
Files\Xming\fonts\TTF.
- Then reconnect to the server and test again.
- In the future, use the Quick connect option and choose the session name saved in step 6.
Back to Top
If you have a Macintosh Machine:
- You can use the terminal application by using ssh to connect to eniac, and from there use
emacs and gcc.
- % ssh myusername@eniac.seas.upenn.edu -X
- % emacs
- The '-X' is for X11, the unix windowing system
- If the '-X' does not work, try '-Y' instead.
- If windowed emacs does not come up after you connect, you
might not have X11 forwarding turned on.
- If you have OS X 10.4, use the instructions found here to install X11. X11 comes installed for 10.5 (leopard).
- In order to turn on X11 forwarding on a mac, you have to
modify your sshd_config file. Details can be found here,
however modifying your config files is not recommended for novices. If you are uncomfortable doing this, please ask a TA or instructor.
- If you want to edit and compile your code on your local
machine without connecting, you need emacs and gcc installed:
- Emacs should come installed as a standard package on
Macintosh. If it isn't installed, you either need to find Emacs in the
package selector (by inserting your Mac OS X Install Disk 1 into your
CD Drive), or the program AquaEmacs
has the same functionality as the GNU Emacs we use in the lab.
- Gcc should also come installed, however if it is not
you need to install XCode. To install XCode, insert your Mac OS X
Install Disk into your CD Drive, double click on "XCode Tools", and
follow the on screen instructions.
- Note: Sometimes emacs doesn't run on the normal Mac
Terminal. If emacs doesn't run, try using Xterm rather than Terminal .
Back to Top