Tips on using VNC

Use i5/OS™ control language (CL) commands to start and stop a Virtual Network Computing (VNC) server, and to display information about the currently running VNC servers.

Starting a VNC display server from a CL program

The following example is one way to set the DISPLAY environment variable and start VNC automatically by using control language (CL) commands:

     CALL QP2SHELL PARM('/QOpenSys/QIBM/ProdData/DeveloperTools/vnc/vncserver_java' ':n')
     ADDENVVAR ENVVAR(DISPLAY) VALUE('systemname:n')

where:

Note: The example assumes that you are not already running display :n and that you have successfully created the required VNC password file. For more information about creating a password file, see Creating a VNC password file.

Stopping a VNC display server from a CL program

The following code shows one way to stop a VNC server from a CL program:

     CALL QP2SHELL PARM('/QOpenSys/QIBM/ProdData/DeveloperTools/vnc/vncserver_java' '-kill' ':n')

where n is the numeric value that represents the display number that you want to terminate.

Checking for running VNC display servers

To determine what (if any) VNC servers are currently running on an iSeries system, complete the following steps:

  1. From an i5/OS command line, start a PASE shell:
         CALL QP2TERM
  2. From the PASE shell prompt, use the PASE ps command to list the VNC servers:
         ps gaxuw | grep Xvnc

The resulting output from this command will reveal running VNC servers in the following format:

     
  john  418  0.9  0.0  5020  0  - A  Jan 31 222:26 
    /QOpenSys/QIBM/ProdData/DeveloperTools/vnc/Xvnc :1 -desktop X -httpd 
  jane   96  0.2  0.0   384  0  - A  Jan 30 83:54  
    /QOpenSys/QIBM/ProdData/DeveloperTools/vnc/Xvnc :2 -desktop X -httpd

Where: