Resources‎ > ‎Ravana‎ > ‎Using Ravana‎ > ‎

Using VNC

posted ‎‎Sep 9, 2009 2:15 PM‎‎ by Catherine Hanson   [ updated ‎‎Nov 2, 2009 5:01 AM‎‎ ]
If you are to run any GUI software on ravana, or on any of its nodes,
it is highly recommended that you use VNC rather than forwarding
X through SSH.  VNC is preferred overing forwarding anX connection
because:
  • Most of the time rendering of GUI is faster in VNC since it is done remotely on ravana and then rendered picture only is sent to your client. That is why interfaces which require a lot of X messages (eg mozilla, MOTIF interface of matlab, etc) are responding better in VNC.
  • All the applications you are running within VNC server remain alive (running) even if you disconnect your client. Thus if you are running FSL or Matlab you don't need to kill it before you disconnect and it will remain running for as long as necessary. In contrast if your SSH connection with forwarded X gets disconnected you loose the running software and it might become a dangling process out of your control and occupying CPU.
* If you turn on high compression for the client you can work remotely
in X even over dial-up connection. It will not be as nice as a high-bandwidth
connection but at least it could be used in the case of emergency.
The only drawback of VNC I am aware of is that it doesn't fully (or some
servers at all) implement GL features, thus any software which require
opengl might fail to run.

Organization of VNC

VNC consists of 2 parts: server (you start on ravana) and a client (which you run on your desktop or laptop you are working at)

Server

There are different flavors of the VNC servers (confirming to the same standard but with different additional features, if there were any):
  • Tightvncserver lacks GL support but has embedded compression
  • vnc4server has some GL support, that is why it is of my preference, and thus by default vncserver comand is aliased to it.
To startup a VNC server on ravana simply run vncserver or you can also provide desired size (may be to match your laptop screen):
> vncserver -geometry 1024x768 
.....
New 'ravana:4 (yoh)' desktop is ravana:4

Points to note:
  • geometry parameter is optional and you can use some other standard size.
But this one is recommended since it is available on most of the desktops/laptops.
  • Reported back to you :4 means that it is 4th running X server. Thus it will open a port 5904 to listen for the clients. It will be useful later on when you connect to running server. I will abbreviate it as X for generality.
  • On the first run you might be asked to provide a password for the VNC server. Please use secure enough passwords, since otherwise your VNC server could be hijacked. If you need to change password in the future, just run vncpasswd
  • If you ever need to kill running VNC server just run vncserver -kill :X, where X=4 in this example and can be different in yours.
  • That is all on a server side configuration. Simple like that :-)

Client

Depending on the OS you are connecting from you might use different clients. Tightvnc has clients for Windows, Linux, Unix (SRC) and Java viewer. Debian GNU Linux comes with packages xtightvncviewer, xvnc4viewer, and others, which contains the viewer.
  • Since all VNC connections are not encrypted on their own, ravana doesn't allow VNC connections to be made from outside of the permitted subnetwork. That is why if you are to access VNC server on ravana, you need first to create an SSH tunnel with forwarded 590X port (where X=4 in our example)

Linux

To connect from linux using xtightvncviewer or xvnc4viewer you need to run a simple command which will also take care about creating an SSH tunnel (you might need to knock first if you are trying to get connected from outside of the trusted network, ie from home):
xtightvncviewer -via ravana.rutgers.edu  ravana.rutgers.edu:X
It will prompt you first for SSH password to your "via" host if you are not using SSH keys with an ssh-agent. And then it will prompt you for VNC server password you provided earlier.

Windows

A nice description of how to setup SSH tunnel forwarding using putty SSH client for Windows, is available online here and here.