CPS 196/296: Robotics
Spring 2007
VNC Tips
VNC is a virtual desktop service that allows you to have a desktop running
on one machine but have the display and control for this desktop on another
machine anywhere in the network. To use VNC, need to have two programs
running, a server on the host machine and a client on the
remote machine. vncserver comes installed on many linux distributions,
such as Fedora Core.
- To start things on a linux client, you will need to do a "vncserver
-depth XX -geometry LxH", where XX is the bit depth (typically 16 or 24), L
is the screen length in pixels, and H is the screen height in pixels. For
example, a typical way to start the vnc server would "vncserver -depth 24
-geometry 1024x768"
- When you start the server, pay attention to the diagnostic output that
tells you the name of the desktop. This will typically by your server's IP
address followed by a colon and number, e.g., 192.168.1.100:1 or
mymachine.edu:1
- When you connect from a vnc client, you will need to enter the name as
it appears in the diagnostic output. The number after the colon is
important since there can be multiple virtual desktops running on your
machine and the number is needed to indicate which one you want.
- To kill a vncserver, from any window on the server machine (even one
inside your virtual desktop) do "vncserver -kill :n", where n is the number
of the server you wish to kill.
- The first time you start a vnc server, you will be asked for a
password. You can change this later with vncpasswd
- The first time you create a vnc server, it creates several files in a
hidden directory at the root level of your account. One file,
.vnc/xstartup, contains information on the window manager that vnc will
use. This defaults to something rather ugly, but you can use your default
window manager by commenting out two lines in the xstartup file. (This is
explained in the comments in the xstartup file.) I suggest you kill your
first vnc session immediately, edit the xstartup file, then start another
session to avoid the horror of the default window manager for vnc.
- vnc uses ports that may be blocked on many systems. On the virtual
machines I have provided you, I have unblocked the ports corresponding to
the first two virtual desktops (ports 5901 and 5902). If you use more
desktops than this, you will need to unblock additional ports.
- If you want to be able to cut and paste between your remote machine
and your desktop, you need to run vncconfig on the desktop.