Child pages
  • Using VNC via ssh tunneling
Skip to end of metadata
Go to start of metadata

VNC (Virtual Network Computing) is a free product that we recommend. Using VNC, you can create a virtual desktop on a remote system and then use the VNC client program running on your machine to display this desktop.  There are VNC client and server programs available for most platforms, including Linux, Windows, or MacOS. Since you can run X clients (such as xterm, emacs, or eclipse) within the VNC desktop, you can then display them from your machine.

Below are some examples of how to use VNC.  In these examples, we will use ssh tunneling for security. 

Example 1: Windows Client -> Linux Server

For clarity, we will use as the server on which you will start your VNC server.  Here are the steps to do this:

  1. Install PuTTY -  On your Windows system, you will need to install an SSH client program.  Putty is a very popular one and you can download it from the Putty download site.  We recommend that you download and install the Windows Installer which will be named something like putty-x.y-installer.exe

  2. Install a VNC Client - There are several VNC clients programs available for Windows but we recommend using ssvnc which can be downloaded from  Download the zip file and unzip it anywhere you want but the common convention is to put all packages under C:\Program Files\ (or C:\Program Files (x86)\, if you are using a 64-bit Windows).  If you have Symantec Endporint Protection running on your system, you may get a warning like the following but it is harmless.

  3. Log Into Server - Using PuTTY,  SSH into the linux server (ie.

  4. Start the VNC Server - You can now start the VNC server on the remote linux system by running vncserver as follows:

    $ vncserver
    You will require a password to access your desktops.
    New ' (shei)' desktop is
    Starting applications specified in /u/shei/.vnc/xstartup
    Log file is /u/robh/.vnc/

    The first time you run vncserver, it will prompt you for an access password that you will need when you connect from your vnc client.  You must NOT use a password here that you are using anywhere else (ie. do not use your IU network ID passphrase).  This password is stored in a very weakly encrypted format in your ~/.vnc/passwd file so someone getting read access to that file could easily determine your password.  If you happen to forget your password, you can remove this ~/.vnc/passwd file and vncserver will create a new one the next time you run it.


    In addition, you will need to know the server display name which will be of the form "server.domain:N".  In the above example, the display name is

  5. Start the VNC Client- Back on your Windows machine, you will now need to run the ssvnc client you installed earlier.  When you start ssvnc, you will see a screen:

              The VNC Host Display will be of the form username@display where display was obtained in the previous step.  Make sure that you have checked the "Use SSH" before you click on the "Connect" button.  If ssvnc client can connect to the remote server, it will prompt you for the VNC password you created in Step 4:

    Once connected, you should see your VNC destop where you can start any programs you want.

  6. Kill the VNC Server Session - When you are done, you should kill the VNC session you have running on the remote system.  You can do this logging into the remote server ( in this example) using PuTTY and killing the session with something like:

    $ vncserver -kill :6

    You will substitute the display number in this example (6) with the actual display number you obtained from step 4.

  7. Customize Your Environment (optional) - You can decide what program or scripts to be invoked automatically when the VNC server starts by editing your ~/.vnc/xstartup file.  If you have never set up one before, the vncserver will create a default one for you which you can then modify.
  • No labels