VNC stands for Virtual Network Computing.

Using VNC
VNC uses a standard client-server model. This means you must first start run the vnc server to create a session, then connect to that session with the client. When you're close the client, the session doesn't end; it keeps running, waiting for the next time you wish to connect to it. This is nice, since the session stays active perpetually, but it may lead to some issues if you forget this fact. First, it means you shouldn't start a new server every time you wish to connect, unless you kill have killed the previous server. Second, remember that when you close the client, any programs that you were running are still running; so any application you didn't close which locked a file still has it locked, which means that if you log in from somewhere else, you may not be able to access that file.

For example, if you had firefox open in vnc and closed the client without first closing firefox, then log into firefox from a computer in the department, it will force you to choose a new profile... it's the same as if you were logged in to one computer running firefox and walked over to another computer, logged in, and tried to start firefox there, too.

Starting the Server
To use VNC you must first log in to your account as normal and run

% vncserver
from the command line. This creates a VNC server on the host you whatever host you are logged into. You should read the the manpage to find out about the command-line options available to you. If it is your first time using VNC, it will ask you for a password. If you don't ask for a specific screen, it will assign you one. If the machine you are logged into is "host" and your username is "user", then you should see a line like the following:
    New 'host:# (user)' desktop is host:#
where # is a particular number. A particular computer may be running many instances of VNC for many people at once, so this number tells you how to find the vnc screen you've just created on that server.

Starting the client
Now, if you are sitting at one of the computers in the department, you may run

% vncviewer host:#
replacing "host" and # as appropriate to log into the session you've created.

To connect from home, it's slightly more complicated. SUNY Binghamton does not allow direct VNC connections, since it is insecure. You can get around this by tunnelling with ssh. It sounds complicated, but it's not; I promise. Once you've got a Windows VNC client such as RealVNC or TightVNC, and an ssh client, then you're ready. You simply ask your ssh client to make a tunnel specifying a port on your home computer along with the destination computer and port, then connect and log in with that client, and then with the VNC client, connect to the specified port on your home computer. Here is a nice step by step guide to connecting to your VNC server through a tunnel. Be aware that if you have active firewall software, you must tell it not to block the port on your home computer (in the guide, they use port 5901).

Killing the server
You may leave the server running as long as you wish; it should stay ready and waiting, unless the host it is running on is shut down. If you don't plan on using vnc much, it's not a bad idea to shut the server down when you're done with it, and start a new server next time. To shut the server down, log in to the host it is running on and run:

 % vncserver -kill :#
If you can't remember where, when, or how many vnc servers you have running, you can check by looking in your .vnc directory.
% ls ~/.vnc
Each file named host:#.pid indicates a separate instance of the server. Unless you have a good reason, you shouldn't really have more than one instance of the vnc server running at any particular time. So killing old ones isn't a bad idea.

Configuration
VNC creates a folder .vnc in your home directory, which contains the following files:

up home