vncserver no longer active after unix session logout

Tim Wood timwood0 "at" pacbell.net
Sun Jan 11 19:38:00 2004


At 05:34 AM 01/11/04, Joel Lieberman wrote:

Whew, at first look, I thought you were the guy running for president! =)

>Problem:  when I logout of the Unix
>session (as Unix account) either at the
>console or from the telnet session that
>started the vncserver, the vncserver is
>no longer accessible in a correct
>manner. 

I have worked up a method I like for starting Xvnc by using dtlogin (from the /usr/dt stuff in Solaris.)  Some nice things about this method are:
- Works as a drop-in to the Solaris CDE framework;
- Allows individual users on the box to have their own Xvnc process running under their own uid ready & waiting;
- Ideal for remote access, but still useable working locally: vncviewer becomes the sole local X application.

What I do is:

- Place a line like this in /etc/dt/config/Xservers (which starts out as a copy of /usr/dt/config/Xservers):

        :1 Local local_uid "at" none root /var/adm/scripts/dtstartXvnc :1 1280x1024 timwood

Each user gets assigned a line with a unique display number (:1, :2, ...) and their username.  The given geometry (1280x1024) is a default the user can override (below).

- Run these commands:
        chgrp root /usr/local/bin/Xvnc
        chmod g+s /usr/local/bin/Xvnc
These give Xvnc the privilege to write to the /tmp/.X11-unix directory without running as root and without making that directory world-writeable.  This is needed if you are running the Sun X server on the local display because of the way that server sets up the /tmp/.X11-unix permissions.

- Install the dtstartXvnc script (http://home.pacbell.net/timwood0/scripts/dtstartXvnc).  It does two major things:
  - Works around a bug observed in dtlogin where the given X server does not run under the uid given in /etc/dt/config/Xservers.
  - Allows users to set certain arguments to Xvnc, via a ~/.vnc/Xvncargs file, even though the system controls the Xvnc process.  The argument processing is best-effort, not represented as bullet-proof.

I have not used or ported the script anywhere but Solaris 7-8.

FWIW and HTH,
TW