How to use VNC
What is VNC?
VNC is often described
as "remote desktop" software. Essentially, a familiar Linux desktop runs
in a virtual screen sitting in memory on some server, and you can
"connect to" or "view" or "remotely control" (all the same thing)
that virtual desktop from anywhere in the world. In particular, you
can do so from machines running Windows or Mac OS X.
(For the curious: you can read more about this project at
www.realvnc.com
and at www.tightvnc.com.
The TightVNC folks have the faster implementation.)
One-time setup: starting a VNC server
To get started, you must once and for all create your virtual X desktop.
-
Pick a computer to hold the desktop. We have two computers set aside
specifically for this purpose:
- For faculty/visitors/staff, the dedicated VNC server is bobcat.math.arizona.edu.
- For grad students, the VNC server is iguana.math.arizona.edu. (In the instructions below, wherever we write "bobcat", grad students should substitute "iguana".)
-
Use SSH to connect to the VNC server: ssh myusername@bobcat.math.arizona.edu.
(In Windows, use the program SSH/Term or PuTTY to make the connection.)
-
(Optional step: If you've run VNC in the past and got an unfamiliar X environment, try removing the file "xstartup" from your ".vnc" subdirectory. This file will get recreated by the next step.)
-
On bobcat, issue the following command to create your VNC server:
vncserver.
It will tell you the number of your new desktop. It might be ":7", or ":13".
You must remember that number! All examples below will use ":7".
(Note that you could also have specified different sizes for your virtual X desktop and different color depths. Try "man vncserver" for a list of options.)
How to permanently kill your virtual X desktop
There is seldom a need to do this,
If ever you need to kill your virtual X desktop, this is how you would do it,
substituting your own desktop number for the sample number shown below.
ssh myusername@bobcat.math.arizona.edu
vncserver -kill :7
Remotely viewing/controlling your virtual X desktop
To connect to (that is: view) your virtual desktop, you use your web
browser, or for better performance, you run a special
viewer program called vncviewer.
Using a web browser
Simply point the browser to
http://bobcat.math.arizona.edu:58xx, where
58xx will be 5807 if you are running on desktop ":7",
or 5813 if you are running on desktop ":13", and so on.
Using vncviewer
The software referred to below may be downloaded from
tightvnc.com. You only need
the viewer. (It is already installed
on department computers.) You do not need the server or the source.
From Linux systems
Use the
command vncviewer bobcat.math.arizona.edu:7, substituting
your desktop number for ":7".
From Windows systems
Double-click the viewer, or find it in your Start menu under Program Files.
When it asks where to connect, type in
bobcat.math.arizona.edu:7,
substituting your desktop number for ":7".
From Macintosh OS X
The vncviewer client program we recommend for Macintosh OS X is Chicken of
the VNC. This is available for download from
sourceforge.net.
This is a fully graphical client and has extensive help files built-in to the
program.
Disconnecting
-
To disconnect (stop viewing) your virtual X desktop, simply close the viewer (the outermost window).
-
There is no need to close individual windows inside
your virtual desktop, nor is there a need
to log out the Gnome session inside your
virtual desktop. (In fact, if you accidentally do this, then you must
follow the steps from earlier to kill that VNC server and then follow
the other steps to create a new one.)
Important cautions (to prevent people yelling at you):
-
The first time you connect to your virtual desktop, be sure to disable
your X screensaver (go to Start/Programs/Settings/Desktop/Screensaver).
Otherwise your virtual desktop will eat up lots of CPU cycles "saving"
a non-existent screen, which may annoy other users.
-
The machine bobcat.math.arizona.edu will have lots of people
running virtual desktops on it.
You should not run heavy-duty computations on this
machine. From within your virtual desktop you can easily create a
terminal window and connect to a different machine,
such as your office machine or some machine dedicated to computations,
and perform your heavy-duty computations over there!
Hints for getting the most out of VNC:
-
The simpler the graphics on your desktop, the less information needs to be
transferred, and thus the faster your VNC connection will be.
- Change your desktop background color to a solid color. Even better,
use solid white or solid black.
- Turn off any cutesy things, like charts that monitor CPU usage,
or eyeballs that follow the mouse cursor...
-
When you created your VNC server on bobcat with the command
vncserver, you could have specified a different resolution and/or
color depth. You might want to have this information precisely match the
screen from which you most often use VNC, and then run VNC in fullscreen mode.
- For example, say your Windows box at home has a display resolution
of 1280x1024 at 24 bits/pixel. (To see this information,
right-click on the background of the desktop
and bring up Properties.)
- When you create your VNC server, you could use the command
vncserver -depth 24 -geometry 1280x1024. (The manpage has
complete documentation: man vncserver.)
- When you connect from your Windows box, right-click on the titlebar
of the outermost VNC window and select "Full Screen". It will tell you the
keystrokes to escape from full-screen mode.
- At this point, instead of seeing Linux inside a VNC window inside
MS Windows, all you see in front of you is your remote Linux desktop!
-
If you are connecting over a modem connection,
then you want to streamline your VNC to make it as fast as possible. Use
a smaller desktop, and use fewer bits per pixel. For example:
vncserver -depth 8 -geometry 800x600. Also follow the
earlier hints on simplifying the desktop background and eliminating
cutesy stuff.
Concerning security
-
When you connect to your virtual desktop from a remote connection,
your password is not sent in the clear. Thus you do not need to worry
about your password.
-
However, the actual VNC session itself is not encrypted.
This means an internet snoop might be able to observe your VNC
session. In particular, anything you type (including passwords) while
inside your VNC session could be intercepted. The solution is to
tunnel the entire VNC session over SSH. [Instructions coming soon.]