VNC Contrib Support

Please read this entire page before running VNC. VNC is not CSE supported software. If you encounter any problems, first check the Troubleshooting section, then if you still have problems email me directly.

Please kill your vncserver process within 24 hours. We have had problems in the past with old VNC sessions using too many resources. If a session runs for more than 24 hours, it could be killed without notice.

What is VNC?

VNC stands for Virtual Network Computing. In short, it is a way to access the CSE login servers remotely in a manner similar to doing a remote X query with XWin-32 or eXceed, but unlike a remote X query, the session will be faster, easier to manage, and work through a NAT or IP Masquerade gateway easily. Much more information can be found on the VNC site, but I will outline the steps necessary to start using it here. I have used VNC in UNIX and Windows and have been quite surprised with the results. I hope that this will help you experience a faster and more enjoyable remote usage experience. I suggest reading everything here before trying to use VNC. There are important things to note throughout this page.

How Does it Work?

VNC consists of the following programs:

  • vncviewer - The VNC client program. This is run on the local machine (your PC at home) and connects to the vncserver.
  • vncserver - This is the VNC server program which starts a special X server on the remote machine (stdsun). Running this program for the first time creates your session password.
  • vncpasswd - This sets your password for VNC access.

You can think of VNC as wrapping your remote X session inside of a new X11 protocol, at least in a sense. This would be a good time to tell you that it is even possible to run a VNC session in a web browser at home, but I'll save the details for later.

Setting up Your CSE Account

I support VNC in Contrib, so the first thing that you need to do is subscribe to "CONTRIB". This is easy to do with the subscribe command. Here is an example:

[rowland@gamma rowland]$ subscribe


?  #   Package           ?  #   Package           ?  #   Package
-  -   -------           -  -   -------           -  -   -------
   0   ACROREAD             7   EIFFEL            *  14  SMARCH        
   1   ACU-COBOL            8   HOMEBIN              15  SML           
*  2   ADMIN             *  9   JDK-CURRENT          16  SQR           
   3   CADENCE           *  10  LATEX2HTML        *  17  SSMS          
   4   CNADM             *  11  NETPBM            *  18  SYBASE        
*  5   CONSULT           *  12  OPERATOR          *  19  TETEX         
   6   CONTRIB              13  RESOLVE           *  20  VI            

Enter a command (a,i,q, or h for help), or a number to SUBSCRIBE: 6

Simply choose the number corresponding to the "CONTRIB" package, in this case 6 (though that is subject to change), from the list and your almost ready. Next you have to reinitialize your environment for the change to take place. The easiest way to accomplish that is to logout and login again. Once this is done, you should be able to do the following:

[rowland@gamma rowland]$ which vncserver
/usr/contrib/bin/vncserver

Creating a VNC Password

The first thing to do is create a password for connecting to any VNC sessions you start. The password is used for authentication when you connect to your remote VNC session. This keeps other people from connecting to your session, which would be a pretty big problem. You need to create a password that has a mix of case, at least one number, and at least one symbol. The first time you run the vncserver program it will create your VNC password. Here is an example:

[rowland@gamma rowland]$ vncserver

You will require a password to access your desktops.

Password:
Verify:

Note that I did not use the vncpasswd command. That is used to change your password once it is created. Running vncserver the first time does start a VNC session in addition to creating the passwd file by running vncpasswd for you. If at any time you wish to change your VNC password, simply run the vncpasswd program.

Starting a VNC Session

Once your password has been created you can start VNC sessions using the vncserver command. This session runs remotely on a stdsun machine. You use a VNC client locally (at home) to connect to that session. I modified the vncserver program to run Xsession automatically. This will give you the default CDE environment. Here is an example:

[rowland@gamma rowland]$ vncserver -depth 24 -geometry 1280x1024

New 'X' desktop is gamma:1

Creating default startup script /n/gold/4/rowland/.vnc/xstartup
Starting applications specified in /n/gold/4/rowland/.vnc/xstartup
Log file is /n/gold/4/rowland/.vnc/gamma:1.log

The vncserver program creates a default startup file in your personal ~/.vnc directory. This file runs Xsession to start CDE for you. The two command line arguments I used are probably all that you will ever need. The first, -depth 24, specified that the vncserver process started an X session at 24 bit color depth. I run my PC at 32 bit color depth, and you definitely want your VNC session and home PC's color depth to match!

Note: Because of "X11-isms", you should use 24 bit color with vncserver if you run 24 or 32 bit color at home. Yes, they do not exactly match, but trust me. If you do not, certain applications (like Java applications) will not run.

The next command line option, -geometry 1280x1024, specified that the VNC session desktop was 1280x1024 in size. The default is 1024x768, but that is way to small for "normal" use in my opinion. If you use the Windows VNC client program, it is possible to specify that it should use your whole Windows desktop, in which case you would want to start vncserver with the same resolution as your Windows desktop. You can play around with the geometry setting to find what you prefer. When you are finished with your VNC session, after reading the notes on exiting CDE and VNC below, you kill the vncserver process like this:

[rowland@gamma rowland]$ vncserver -kill :1
Killing Xvnc process ID 3859

Login to the machine on which you started vncserver and kill it with the -kill <display_number> command line option. Yes, the display number has importance!

Note: You must login to the machine on which you started vncserver. This means you can't just connect back to the stdsun alias again. Instead, you have to connect to the specific host on which you ran vncserver.

I used to have some notes here about environment settings that would cause vncserver not to run. I created a Perl wrapper script for vncserver that removes these from the environment. It also helps with controlling the number of vncserver processes running on each server. I have noticed a problem where users do not kill their vncserver process, but instead start yet another one. This unreasonably eats system resources. The wrapper script will inform you if there is a vncserver process running for you on the current Solaris login server. If there is, it also tells you how to kill it. You will not be able to start a new vncserver process until the currently running one is killed. Here is an example:

[rowland@psi rowland]$ vncserver -geometry 1280x1024 -depth 24
You are already running vncserver on this host:

Please run "vncserver -kill :1" before starting a new session.
If you have problems with this try "kill 20946".

This is important to conserve resources.  VNC login sessions consume a lot
of resources.  Please only run one copy on a server at a time.  Thanks.
If you have questions, please contact rowland@cse.ohio-state.edu.

Connecting From Home

One of the most important pieces of information about your VNC session is what display it is running on. When you start vncserver on a remote machine (stdsun server), it prints out something like the following:

New 'X' desktop is gamma:1

In this case the VNC session is running on gamma:1, which means the host gamma.cse.ohio-state.edu on display number 1. This is used by the vncviewer command to connect to the correct remote host and display number. The vncviewer command is run on your home machine in either Windows or some VNC supported UNIX operating system. The following is an example of using the UNIX vncviewer command to connect to the remote VNC session I started on gamma.cse.ohio-state.edu using display number 1:

[rowland@dsl-64-193-163-133 rowland]$ vncviewer gamma.cse.ohio-state.edu:1
VNC server default format:
  32 bits per pixel.
  Most significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 0 green 8 blue 16
Using default colormap which is TrueColor.  Pixel format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0

Notice how the "VNC server default format" (32 bits on the server, even though specified with the -depth 24 command line option) matches the "Using default colormap" (32 bits on the client). If you use a different color depth on your PC, you will need to start vncserver with that color depth or you will be in for numerous surprises later on! It will appear to work at first, but you will not like it much. Don't worry! This isn't as hard as it may seem.

In Windows the vncviewer program has a nice GUI interface accessible by clicking on its taskbar icon and setting a lot of options. I will not go into detail about how to configure the Windows client at this time.

Getting the VNC Viewer

You may have noticed that both vncserver and vncviewer are installed in Contrib. The vncviewer command in Contrib is not what you use to connect from home. Download the VNC software for your platform here. This software is under the GNU GPL license, so it is free software.

How do I use a Web Browser?

Magic! Just kidding. The vncserver command starts a small HTTP daemon that serves Java class files which your browser can probably grok. All that you have to do is point your browser to:

http://vncserver_host:58nn

The vncserver_host is the remote host on which you started vncserver. The port specifies the display number. In my case I would connect to gamma on port 5801, since my display was 01:

http://gamma.cse.ohio-state.edu:5801

Important Notes

Please keep in mind the following notes in particular. Much of this was mentioned before.

Exiting CDE and VNC

When you are done with your CDE session, exit like you normally do. The busy light will flash for a while, but CDE will not fully exit. This is normal in VNC, but don't be fooled! CDE is actually doing stuff when that light is flashing. Once the light is done you can kill the vncserver process normally (vncserver -kill <display_number>) and go about the rest of your day. Do not forget to kill your vncserver process!

It is possible to exit vncviewer and leave vncserver running remotely. You can then connect to it again later and everything will still running as you left it. This is perfectly fine to do, as long as you don't run your vncserver process for more than 24 hours.

Using the stdsun Alias

Although it might seem like a real pain sometimes, it is very important to use the stdsun.cse.ohio-state.edu DNS alias when accessing the CSE login servers. We have this alias so that the load on the login servers is spread out evenly. Here is a typical scenario for getting a remote VNC session going:

  1. Login to stdsun.cse.ohio-state.edu using SSH.
  2. Start vncserver.
    • Use the same color depth as your PC at home with the -depth command line option.
      • Be sure to use -depth 24 if you use 24 or 32 bit color on your home PC.
    • Use the -geometry command line option if you wish to have a resolution greater than 1024x768.
  3. Note the name of the stdsun machine and the display number, such as "gamma:1".
  4. On your home PC run vncviewer and tell it to connect to the remote vncserver running on "server:display". You will have to login with your VNC session password.
  5. Enjoy a better way to access the CSE login servers remotely.
  6. Exit CDE using the CDE panel or window manager.
    • Wait for the busy light to finish flashing.
  7. Login to the specific stdsun machine you noted before using SSH again. Do not use the stdsun alias here.
  8. Kill the vncserver process with vncserver -kill <display_number>.

Getting Help

First of all, do not send mail to help@cse.ohio-state.edu. This software is supported in Contrib by me. Send me email if you need help, but first read the Troubleshooting section, which follows. My email is conveniently located in a link at the top of this page.


Troubleshooting

These are some questions and answers that came to mind as I wrote this. If you have more questions, I am just an email away. I hope this helps out a little.

Who killed my VNC server process?

We kill processes that look like they have run-away. You can thank programs like the old installation of Netscape for that, but it is something that we need to do on occasion. You should kill your vncserver process when you are done. Yes, you can just disconnect and reconnect later, which is really nice, but if you are going to leave it sit for a long time, you might as well just kill it for the good of the community. If you run your vncserver process for more than 24 hours, I might kill it for you with no warning whatsoever. You've been warned here. You read this far, right?

How do I use a different window manager? CDE is too "old school" for me!

Welcome to the club! It is easy to start a different window manager. There are a couple in Contrib. All that you have to do is edit the ~/.vnc/xstartup file. An example xstartup file for Window Maker follows:

#!/bin/sh

/usr/contrib/bin/wmaker &

Why do I have problems running certain applications?

If you run your home PC at 24 or 32 bit color depth, start vncserver with a color depth of 24 bits with the command line option -depth 24. The 24/32 bit color issue is too much for me to get into here, but this will fix your problem.

I can't seem to run GUI Java applications or <insert app here>. I get an error about color depth not being supported.

You cannot run vncserver at 16 bit color depth without these problems. Blame the application developers for being too lazy to support the "hacked-up-ultra-lame" 16 bit color depth. Don't really blame them. I probably wouldn't bother supporting that color depth either, but I am not really an X11 programmer anyway.

When I start xemacs I get strange key-map warnings. What should I do?

Ignore them. They probably won't affect you. Just delete the warning buffer and go on your way.