Comp11

Working from Home

Overview

The easiest way to work on programming assignments is to use the lab computers in Halligan Room 118 (available to you all hours of the day and night). I understand, though, that it's often more convenient and comfortable to work from home. There are two main ways to do this:

In either case, you must have a secure shell (ssh) program installed on your home computer. Ssh allows you to open a terminal window on your computer with a shell program running on the remote computer. Commands you type in ssh are sent across the Internet to the computer in Halligan, and the results come back over the internet to your screen. In addition, these programs include the ability to copy files back and forth from your computer to your home directory in Halligan.

Most of you have a computer using either Microsoft Windows or Apple MacOS operating systems. These two systems are quite different, so the instructions below are divided along those lines.

Method 1: Log in to Halligan

In this method, everything happens on the Halligan computers -- all files stay there, all commands are run there. The role of your home computer is just to send commands across the Internet, and then display the results. In addition, you will be able to run JEdit remotely: JEdit will run on the Halligan computers and have access to files in your home directory, but the JEdit window will appear on your home computer. This method is the most straightforward, and requires relatively little setup, particularly on Apple computers.

In order to run JEdit over the Internet, you will need to install a program called an X server. It allows mouse/window-based programs to work correctly across the net. When you run JEdit, instead of popping up a window on the computer in Halligan, the window is sent to your home computer. All files, however, stay on the Halligan computers. When you choose "Open" or "Save" you'll notice that you are looking at your home directory in Halligan.

Set up on Apple MacOS

MacOS has both secure shell and X server built-in. You will find both programs in the "Utilities" folder under "Applications" in the Finder.

Start by double-clicking the "X11" program -- this starts the X server. By itself, it doesn't do anything, but it waits for windows to display from remote computers. Double-click the program called "Terminal" to open a terminal window. You can open as many terminal windows as you like using this icon or choosing "New terminal window" from the menu.

Skip down to the section below "Working remotely"

Set up on Microsoft Windows

Microsoft Windows does not include a secure shell or X server, so the first step is to install these programs. Follow the instructions here to install a free version called Cygwin.

Once installed, start the Cygwin X server by clicking on the start menu, finding the program group called "Cygwin-X" and choosing "XWin Server". Once running, the X server program will open a terminal window called an "xterm". You can start more terminal windows by typing xterm & from the command line (note the ampersand at the end of the line.) You can also start a new terminal by right-clicking on the "X" icon in the status bar (lower right corner) and choosing "Applications" --> "xterm".

If you can't find the "Cygwin-X" group under the start menu, open the Cygwin terminal and type "startxwin". This command will not print anything on the screen, but when the prompt comes back you should see the big "X" icon in the status bar.

NOTE: in the Cygwin terminal window (with the black background) you will need to type one additional command before you log in to Halligan remotely:

export DISPLAY=":0.0"

Working remotely

With a terminal window open, type the following command to use the secure shell to log in to Halligan remotely (Note the -X argument, which is a capital X):

ssh -X yourutln@linux.cs.tufts.edu

You will see a new command prompt that indicates you are now logged in to a machine named "sunfire32". This computer is a large server that often has many users logged in. You can type finger to see who else is online.

All commands you type are being sent across the Internet to Halligan, run on sunfire32, and the response sent back to your home computer. All the commands you use at the lab (jedit, use comp11, compile, provide, etc) are available to you. All files you view and edit reside on the Halligan machines, not on your home computer.

Here is an example session using Cygwin on Windows (the name of my computer is "davis" and the remote computer is "sunfire32".)

When you're done

Type exit to close the secure shell and return to your own machine.

Method 2: Work remotely, copy files

This method has the advantage that you don't need an Internet connection while you're working. The idea is that you install all the necessary software on your machine, edit, compile and test your code on your machine, then copy the finished files back to the computers at Halligan. The disadvantage is that installing all the necessary software and getting it properly configured is a lot more involved. In addition, sometimes programs that work on your machine don't compile and run cleanly on the Halligan machines, making it hard to grade your work.

TBD: the rest of this description is coming soon. The overall process looks like this:


Back to Comp11.