At times, you will want to access MathLAN programs from your own computer. For example, students in CSC 151 might want to use GIMP and DrRacket and students in CSC 207 might want to use the MathLAN version of Eclipse. One way to access the MathLAN is to use VNC, or Virtual Network Computing. Unfortunately, VNC isn't quite as straightforward as we'd hope, but with some practice, you can get it working. To use VNC, you need to set up a server on a MathLAN machine and a client on your own machine.
These are very rough instructions for using VNC. Expect to see updates as time progresses.
Warning! If you're not careful with VNC, you'll leave things running on various MathLAN machines and make life more difficult for everyone, including yourself. Make sure to clean up after yourself.
In order to use VNC you'll need a VNC client program.
There are a variety of free VNC clients for the Mac. Sam Rebelsky uses VNC Viewer from RealVNC. Jerod Weinman uses Chicken of the VNC (he hasn't tried its successor, Chicken). There's even a built-in one on the Mac, but none of us have used it much.
The members of the department don't tend to use Microsoft Windows. VNC Viewer from RealVNC, which Sam Rebelsky uses on the Mac, is also available on Windows. Some students have reported success in using it.
To start and stop the VNC server, you'll need a way to connect to the MathLAN. Ssh, the secure shell, is the recommended program. If you have a Mac or Linux workstation, ssh is installed by default. If you use Windows, you will probably need to obtain puTTY or some equivalent.
Pick an unused machine in the MathLAN. Open a terminal window and connect with ssh
. For example, on both Mac and Linux, you would type the following. (We don't use Microsoft Windows very frequently, so we're not sure what you'd do. The last time one of us tried, puTTY worked pretty well.)
ssh username@machine.cs.grinnell.edu
We'd prefer that students use ssh.cs.grinnell.edu
for their work. But that may not work perfectly in all cases, so you can also try a machine in one of the classrooms. Make sure the machine is unused. You can type w
once you are logged in to make sure that the machine is unused. Eventually, the department hopes to have a script or Web page that lets you check which machines are free. For now, keep trying different machines until you find an unused one.
Once you've logged in to the MathLAN, type the following instruction to set your password for VNC connections.
vncpasswd
Choose something that will be hard for others to guess. Then type the following commentvncserver -geometry WIDTHxHEIGHT
to start the server, for example
vncserver -geometry 1200x900
When the server starts, you should get a short report, something like
New 'machine:2 (username)' desktop is machine:2 Starting applications specified in /home/username/.vnc/xstartup Log file is /home/username/.vnc/machine:2.log
That number after every colon is your desktop number. You'll need to know it in order to connect to VNC.
Yes, we know you haven't connected to the server yet. But we put these instructions here to reinforce that you have a responsibility to stop the server.
When you are done using the VNC server, go back to your ssh terminal and type
vncserver -kill :desktop
For example,
vncserver -kill :2
To connect to the server, you need to know (a) your password on the MathLAN; (b) the desktop number; (c) the vnc password you set above. You will need to translate the desktop number to a port number, which you do by adding "590" in front of single-digit numbers and "59" in front of two-digit numbers. For example, desktop 1 is port 5901, desktop 2 is port 5902, and desktop 10 is port 5910.
Open another terminal window on your Mac. Type the following (while you'll substitute the number of the port, you should type the localhost
verbatim):
ssh -L port:localhost:port -N -f username@machine.cs.grinnell.edu
For example,
ssh -L 5901:localhost:5901 -N -f username@machine.cs.grinnell.edu
For user rebelsky and machine ssh, this command would be
ssh -L 5901:localhost:5901 -N -f rebelsky@ssh.cs.grinnell.edu
You should be prompted for a password. Type your MathLAN password.
You can now start your VNC client. When it prompts for a server or host, use localhost:port
(e.g., localhost:5901
for desktop 1 and localhost:5902
for desktop 2). In VNC Viewer, you will connect and then be prompted for a password. In Chicken of the VNC, you should enter both localhost:port
and the password in the same dialog box.
You'll need to figure out your own way to set up an extra ssh connection for encryption. puTTY might work. SSVNC might work. These instructions for tunneling ssh with puTTY are probably the best strategy (but again we haven't tried it).
By default, VNC starts with only a terminal window. If you want the handy-dandy panel at the bottom of the screen, type
xfce4-panel &in the terminal widow. (And yes, you should type the ampersand.)
Our instructions give you an encrypted connection (even though RealVNC may not know that it's encrypted). There are ways to have unencrypted connections, but we wouldn't recommend it.