Problem
I need to provide a graphical desktop environment to thin clients that are able to connect to a VNC server with different resolutions for each user.
Solution
What is TightVNC?
----------------
The TightVNC package provides a VNC server solution allowing a
graphical desktop environment such as KDE to be displayed on a VNC
client.VNC clients can either be a workstation running VNC client software or thin client hardware running an embedded VNC client.
Where can I get TightVNC for SCO OpenServer 6?
---------------------------------------------
Download the TightVNC 1.3.9 application from:-ftp2.sco.com/pub/skunkware/osr6/vols/tightvnc-1.3.9Se-VOLS.cpioDownload the TightVNC 1.3.9 README from:-ftp2.sco.com/pub/skunkware/osr6/vols/tightvnc-1.3.9Se-READMEHow do I install TightVNC?:
--------------------------
Download and extract the cpio archive of media images for
tightvnc (tightvnc-1.3.9Se-VOLS.cpio) into an empty directory.For example:
# cd /tmp/tightvnc
# /bin/cpio -icdvu -I./tightvnc-1.3.9Se-VOLS.cpioUsing the SCO Software Manager (/etc/custom), select Software -> Install New -> From <your system> Select "Media Images" for the Media Device and "Continue" Enter the directory where the tightvnc media images were extracted (in above example, /tmp/tightvnc) for the Image Directory and press "OK".
How do I config TightVNC?:
------------------------
Using the SCO Account Manager (scoadmin acc) create user
accounts for each user that you wish to give a graphical
desktop via TightVNC.For each user set a VNC passwd that they will be prompted for when they connect via a VNC client using the command below. In this example we're setting the TightVNC passwd for user jdoe:-
Login as user root and run the command:-# su - jdoe -c vncpasswdYou will be prompted to enter a new passwd and also asked if you would like to set a 'view only' passwd. The 'view only' option could be used to allow an administrator to view the users desktop to provide support. It could also be used to present a presentation to a number of other users.
Set the VNC passwd for each user, replacing jdoe in the example above with each users username.
To change the default SCO OpenServer 6 graphical environment to the KDE desktop edit the file:
/etc/default/X11and change the following line:from:XDESKTOP=xdt3to:XDESKTOP=kde3save the file and exit.To make TightVNC launch the KDE desktop for each user as standard, edit the file /usr/bin/vncserver
Comment out the lines (usually lines 68 & 69)
from:"xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n"
"twm &\n");to:# "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n"
# "twm &\n");and below them add the line"/opt/kde/bin/startkde");save the file and exit.A VNC server process must be started for each user, in the example below a KDE desktop environment will be delivered for user jdoe with a resolution of 1280x1024 and a colour depth of 16bit.
If no -geometry option is set then the default resolution of 1024x768 is used.
If no -depth option is set then the default 24 bit colour depth is used. The defaults can be changed in the file /usr/bin/vncserver (usually lines 36 & 37).
Login as user root and run the command:-# su - jdoe -c vncserver -geometry 1280x1024 -depth 16New 'X' desktop is myserver:1Starting applications specified in /u/jdoe/.vnc/xstartupLog file is /u/jdoe/.vnc/myserver:1.logYou should see an Xvnc process and an xstartup process for each VNC server you start for each user. Each VNC server that is started will get a different display number. In this example the display number is :1
bash-3.2# ps -ef | grep vnc
jdoe 6322 1 0 09:22:18 ttyp1 00:00:00
/u/jdoe/.vnc/xstartup
jdoe 6317 1 0 09:22:17 ttyp1 00:00:01 Xvnc
:1 -desktop X -httpd
/usr/share/vnc/classes -auth /u/jdoe/.Xauthority -gTo connect to the jdoe VNC desktop using a VNC client, point the VNC client to the servers IPaddress followed by the VNC display number. On making a connection a password box will appear prompting for jdoe's VNC passwd. In case you are seeking a VNC client, one can be downloaded for Windows PCs from (http://www.tightvnc.com/download.html)
192.168.0.100:1Repeat the above steps for each user remembering to change the display number to the number that corresponds to that user.
Each VNC server for each user will run until its process is killed off or the server is rebooted. This allows the user to simply turn off their VNC client when they are finished and then reconnect at a later time carrying on exactly where they left off.
In some cases a VNC server might need to be stopped manually. The example below would stop the jdoe VNC server on display :1. If this correct approach is not used to kill off a VNC server, lock files in /tmp/.X11-unix & /tmp/X1-lock can stop it from being restarted on the same number VNC display. Simply delete them if this is the case before restarting the VNC server on that VNC display number.
# su - jdoe -c "vncserver -kill :1"This can then be restarted with the command:
# su - jdoe -c vncserver :1 -geometry 1280x1024 -depth 16If a user attempts to close KDE using the Logout option within the KDE desktop, KDE will close but their VNC server process will not. The result will be an empty desktop screen until the VNC server process is restarted. To avoid this, KDE allows restrictions. A useful restriction to overcome this is to remove the logout button for the user.
In each users kdeglobals file the following lines should be entered. The example below is for the user jdoe.
Edit the file:/u/jdoe/.kde/share/config/kdeglobalsAdd the lines:[KDE Action Restrictions]
logout=falsesave the file and exit.Many more restrictions can be added, a few more useful ones are listed below, though a full list can be found at:
http://techbase.kde.org/KDE_System_Administration/Kiosk/Keys[KDE Action Restrictions] logout=false run_command=false lock_screen=false shell_access=false start_new_session=false switch_user=false
To start a series of VNC processes at boot time depends if you wish to give each user the same default resolution and colour depth. If you do then follow step 1 below, however if you want to give each user a different resolution and colour depth to suit their VNC client and monitor use step 2 below.
1. Edit /etc/sysconfig/vncserver setting the VNCSERVERS to the display and user.
For instance,VNCSERVERS="1:root"to run the TightVNC server on display 1 as user 'root'.
In order to run multiple VNC servers set VNCSERVERS as follows:
VNCSERVERS="1:user1 2:user2"where "user1" and "user2" are valid system users.
/etc/init.d/vncserver enable2. Create a file called /etc/vncserversAdd an entry for each user in the format:-
display_number username resolution colour_depthFor example to start a TightVNC server at boot time on VNC display 1 for user jdoe with resolution 1280x1024 with a colour depth of 24 use the following syntax.
1 jdoe 1280x1024 24For multiple users the file may look something like this, not the display number in the first column must be different on each line.
1 jdoe 1280x1024 24 2 sueb 800x600 16 3 tomg 1600x1200 24
Create the file /etc/rc2.d/S99vncserversAdd the lines below, give it 744 permissions (chmod 744 /etc/rc2.d/S99vncservers) and make sure its owner is root and its group sys (chown root:sys /etc/rc2.d/S99vncservers)
#!/bin/shPATH=$PATH:/usr/gnu/bin:/usr/X11R6/bin
export PATHstart() {
echo -n "Starting VNC server:"
ulimit -S -c 0 >/dev/null 2>&1
# Make sure the font server is running
xfs >/dev/null 2>&1 & cat /etc/vncservers | while read displaynum user resolution coldepth
do
echo Starting VNC server for
$user:$displaynum $resolution $coldepth
su - $user -c vncserver $displaynum
-geometry $resolution -depth $coldepth
done
}stop() {
# This will only stop VNC servers that are started
from /etc/vncservers, not manually started ones
echo -n "Stopping VNC servers"
cat /etc/vncservers | while read displaynum user resolution coldepth
do
echo Stopping VNC server for
$user:$displaynum
su - $user -c "vncserver -kill :$displaynum"
done}case "$1" in'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
*)
echo "Usage: /etc/rc2.d/S99vncservers { start | stop | restart
}"
;;
esacTo give users a productive set of applications on their desktop, be sure to add OpenOffice, the Firefox browser and Thunderbird email client to your OpenServer 6 system. These can be downloaded from the following locations.
Download OpenOffice from:-ftp://ftp2.sco.com/pub/skunkware/osr6/vols/Download the latest Firefox browser and Thunderbird email client from:-
http://www.sco.com/support/download.html