BIRCH
Return to VNC

Setting up your Unix account to run vncserver


1. Login to your Unix account at the command line using an ssh client program such as Putty or SSH.

If you are setting up vncserver on a Unix desktop you are already logged in, so you can skip this step.

2. Run vncserver once to create a .vnc directory and password

The first time you run vncserver, it will create a directory called $HOME/.vnc. This directory contains a password for use with VNC, and will be used to store temporary files during each VNC session. vncserver will also prompt you for a password. This could be the same as your Unix password, but for extra security, you could create another password.
Run vncserver at the command prompt:

{merak:/home/plants/frist}vncserver
Password: 
Verify:   
{merak:/home/plants/frist}

3. Edit .vnc/xstartup to choose your preferred desktop

Users of the Univeristy of Manitoba BIRCH system can skip this step.

By default, vncserver logs you into a very minimal X11 screen that is essentially useless. The first time you run vncserver, it creates $HOME/.vnc/xstartup, that lists windows to put in your X-windows desktop. To get vncserver to run the same desktop that you normally see at an X-terminal, you need to edit  $HOME/.vnc/xstartup.  The following examples show what your xstartup file should look like.

If you are using the either the  GNOME or Sun Java Desktop
#!/bin/sh
gnome-session &
If you are using the CDE desktop
#!/bin/sh
Xsession &
All other lines in this file should either be deleted or commented out by inserting a '#' character at the first position on each line. (On other systems running CDE, you may need to replace the above line with the fully qualified path:

/usr/dt/bin/Xsession &

Finally, make sure that xstartup is executable:

chmod 700 xstartup
Verify this by typing ls  -l
-rwx------   1 psgendb  psgendb       21 Jul  1  1999 xstartup*

4. Test VNC by starting vncserver

{merak:/home/plants/frist}vncserver &
New 'X' desktop is merak:2
Starting applications specified in /home/plants/frist/.vnc/xstartup
Log file is /home/plants/frist/.vnc/merak:2.log
{merak:/home/plants/frist}
These messages show that VNC has created a new vnc session running on merak,  called merak:2. If VNC is running normally, you should see a job called 'Xvnc' running under your userid, using either the ps or top commands.
Note that the ampersand (&) was added to run the vncserver job in the background. That way, you could logout and the vncserver session would still be running.

To connect to this session at the Unix command line type vncviewer session_name  eg.

vncviewer merak:2
 
More information on connecting to your VNC session from PCs can be found at

Trouble-shooting tip
In some cases, Xvnc runs, and you get a vnc session, but for certain applications fonts are missing, or the application may not start at all. If you are getting error messages saying that fonts can't be found, it may necessary to edit the /usr/bin/vncserver script. On Linux, one fix may be to find the "# Font path and color" section, and add the following line:

$cmd .=  " -fp unix/:7100";


Return to BIRCH home page