Getting Started with VNC
VNC consists of two types of component. A server, which generates a display, and a viewer, which actually draws the display on your screen. There are two important features of VNC:
- The server and the viewer may be on different machines and on different architectures. We expect the most common use to be the display of a Unix X desktop on a PC, for example. The protocol which connects the server and viewer is simple, open, and platform- independent.
- No state is stored at the viewer. Breaking the viewer's connection to the server and then reconnecting will not result in any loss of data. Because the connection can be remade from somewhere else, you have easy mobility.
So, to get started with VNC you need to run a server, and then connect to it with a viewer.You'll need to know the name or IP address of the server machine.
Running a VNC server
A VNC server appears, to the Unix applications which appear on it, to be a standard X display just like the one you sit in front of; but it doesn't have a physical screen attached. The applications don't know this. They just carry on running whether or not a viewer is connected, in the same way as they would regardless of whether you were actually looking at your physical screen.
You can start a new VNC server by typing:
vncserver
on a Unix machine.
If you haven't run a VNC server before you will be prompted for a password, which you will need to use when connecting to this server.
Output
New 'X' desktop is your_hostname:1
Starting applications specified in /home/sammy/.vnc/xstartup
Log file is /home/sammy/.vnc/your_hostname:1.log
All your servers will use the same password, and you can change it using
vncpasswd
With a normal X system, the main display of a workstation your_hostname is usually your_hostname:0. You can run as many VNC servers on a machine as you like, and they will appear as your_hostname:1,your_hostname:2 etc. Normally vncserver will choose the first available display number and tell you what it is.
Nothing will appear immediately as a result of starting a server. To see anything you need to connect a viewer to the server.
The user can also manually edit the file $HOME/.vnc/xstartup to customize what commands should be run on startup of a new session.
We recommend using xfce as your VNC desktop environment:
xfce should be installed on all the astro machines. To use xfce, please edit your ~/.vnc/xstartup files follows:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#
xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
dbus-launch xfce4-session
Then just restart vncserver process and you will have xfce4 desktop in your vnc session.
Running a VNC viewer
If you have started a server as display 2 on machine snoopy, you can start a viewer for it by typing:
vncviewer snoopy:2
With the Windows viewer, if you don't specify the server on the command line, you will be prompted for the host name and display number:vncserver is used to start a VNC (Virtual Network Computing) desktop. vncserver is used to launch a VNC desktop session.
Killing a VNC server
You can kill a Unix VNC server using, for example:
vncserver -kill :2