(Answer) (Category) VNC FAQ-o-Matic : (Category) Special setup tricks for VNC on Linux/Unix :
How to setup VNC to work with Inetd on *nix
Setting up VNC via Inetd
========================

Intro:
=====
The idea here is to setup a *nix server (this example uses
SuSE 8.1 Linux with the KDE windows manager, but the concepts 
hold for other flavors of *nix) so that a VNC Server is 
automatically started when a VNC Viewer connection attempt 
is detected. Once this works, you can use a VNC Viewer to open
a fully-functional window to the target system, starting with 
a normal login prompt.


Installing the software
=======================
VNC:
---
The version of VNC shipped with SuSE is a rather conservative version,
and although it works, better versions are available on the iternet.
So, get/use the RPM packages from one of those in the usual way... 

NOTE: You must uninstall the default SuSE VNC version before installing 
the newer one!

AutoCutSel:
----------
There is an additional program called "autocutsel" that allows cut 'n
paste to work between a windows vncviewer and a unix vncserver.  This
program needs to be copied to the directory /usr/local/bin.  To use the
program, you must start it by hand, with the following command:
"autocutsel &".  This starts the program, and sends it to the
background.


Configuring SuSE
================

/etc/services
-------------
Edit the file /etc/services
The file is ordered by port number.  So the following lines should 
be inserted at the appropiate place:

vnc640          5950/tcp       # tiny
vnc800          5951/tcp       # small
vnc1024         5952/tcp       # normal
vnc1280         5953/tcp       # large
vnc1600         5954/tcp       # X-Large

/etc/inetd.conf
---------------
Edit the file /etc/inetd.conf
Almost at the end of the file (before the "# End." line) add the
following lines:(Note: Each of the following line start with "vnc" 
and ends with a "geometry" parameter, but due to email 
restrictions the lines have been split in 2!  SO you must put 
the lines back together!)

vnc640 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query
127.0.0.1 -once -depth 16 -geometry 640x480
vnc800 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query
127.0.0.1 -once -depth 16 -geometry 800x600
vnc1024 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query
127.0.0.1 -once -depth 16 -geometry 1024x768
vnc1280 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query
127.0.0.1 -once -depth 16 -geometry 1280x1024
vnc1600 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query
127.0.0.1 -once -depth 16 -geometry 1600x1280

NOTE: The above presumes you've installed Xvnc into the /usr/bin
directory. If it's installed somewhere else (ie, type "which Xvnc"
to find out), then change the above lines accordingly...

Now you can restart the inetd deamon with the command:
"/etc/init.d/inetd restart" (without the "" marks, of course)

Note: I used to set the geometry to "screen size -- window frame size",
to allow you to have a window that takes up your entire screen, and does
not have a scrolling bar.  The newer versions of VNC now have a full
screen mode that allow you to use the entire screen, (without frames)
which works better than my method.  So the above geometry figures 
implement the newer method...


Yast2 parameter modifications
-----------------------------
In Yast2-.>System->Sysconfig Editor 
change DISPLAYMANAGER_REMOTE_ACCESS to yes
change DISPLAYMANAGER_STARTS_XSERVER to no  <--- no GUI on console
change KDM_SHUTDOWN to root
change KDM_GREETSTRING to "Westrick & Associates" <-- (your co. name)
then click "save"


Using the new configuration
===========================
In order to use the new configuration you need to first re-enter 
"init level 5". Do this by executing the following 2 commands as root:
init 3
init 5

Remote Root Login
=================
By default remote login as user root is not allowed.  In general 
this is a good security feature.  But in my case where the 
server is not protected from within, and only ssh is allowed from
without, this is both a needless precaution and a bothersome feature.
To allow remote root logins, save the following line in a file called
/etc/rc.config.
ROOT_LOGIN_REMOTE=yes


Testing your modifications:
==========================
1) Try connecting with vncviewer to server:50 to server:54 to see if all
is well, 
2) look at the console on server to see if it is nolonger graphical, 
3) and finally in the login screen try "shutdown" (It should require the
roots password!).  

4) Additionally, start autocutsel and test cut 'n paste across vnc!


Thanks to Jerry Westrick <jerry@westrick.com> for the post!
[Append to This Answer]
Previous: (Answer) How to setup a Linux VNC Server with KDE or Gnome
Next: (Answer) How can I get VNC to start automatically at boot time?
This document is: http://faq.gotomyvnc.com/cgi-bin/fom?file=57
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by sbest@best.com