Stopping your VNC server

Unix VNC users may stop their session anytime. Stopping a VNC session is required to restart with a different desktop manager or to change your password. The following instructions tell you how to end a VNC session.

  1. Unless you know exactly where your VNC session is hosted from, you'll have to list off the files in your .vnc directory to find where your active session was launched.

    hostname% ls .vnc
    vnchost:XX.log vnchost:XX.pid passwd xstartup

    VNC hosts are denoted by a pair of .log and .pid files. For example if you have a pair of antares:16.log and antares:16.pid files, then your VNC host is antares (the 16 isn't important). If there are no .log and .pid files then you don't have any sessions to close down and don't need to bother with the rest of this document.

  2. You need to login to your VNC host and verify the active VNC session with the following steps:

    1. Use the rlogin vnchost command to connect to your VNC host. (If you're already logged onto your VNC host then you don't need to do this.)

    2. The ps -fu userid | grep vnc command will allow you to find your active session. Replace userid with your own userid. Look for the line that has Xvnc in it. On that line the first number after your userid represents the process id of the VNC session.

    3. Use the kill XXXXX command to shut down the session (where XXXXX is the process id number for your Xvnc process).

    4. Once completed, use the logout command to return to your regular login host (if required).

    hostname% rlogin vnchost

    Sun Microsystems Inc. SunOS 5.6 Generic August 1997
    vnchost [vee enceus hostus] one of billions and billions of stars

    vnchost% ps -fu userid | grep vnc

    userid YYYYY  8028  0 15:37:54 pts/176  0:00 grep vnc
    userid XXXXX     1  0 14:56:36 pts/176  0:01 Xvnc :16 -desktop X -httpd /usr/local/vnc/classes ...

    vnchost% kill XXXXX
    vnchost% logout

    Connection closed.

    hostname%

  3. To finish removing your old sessions, delete the .log and .pid files from your .vnc directory.

    hostname% rm .vnc/*.pid
    remove vnchost:XX.pid? y
    hostname% rm .vnc/*.log
    remove vnchost:XX.log? y

    You're now free to make any changes you need and restart VNC to create a new session.


Related Links

Establishing your Unix VNC Server 

Changing your VNC password

Connecting to your VNC session via a web browser