TightVNCServer on Ubuntu (HP Microserver build)


As part of the HP Microserver build: seeking to have a backup remote administration (VNC) service I opted to install TightVNCServer. TightVNC is a free remote control software package which allows you to see the desktop of a remote machine and control it with your local mouse and keyboard, just like you would do it sitting in the front of that computer. TightVNC is free for both personal and commercial usage, and compatible with standard VNC software. The main reasons for installing TightVNC are that I often find it to be faster and more responsive than the Ubuntu built-in Remote Desktop VNC server, vino, and also I find that vino can often be unreliable with the screen not updating. Read on...

Install TightVNCServer
Installing TightVNCServer can be done through the built in Ubuntu package manager. I however, installed TigthVNCServer through Webmin's software package manager as part of the Microserver's headless install. Once installed TightVNCServer will need to be configured:

  1. Open a new terminal and run 'TightVNCServer' to get the server up and running
  2. Set the default TightVNCServer password
  3. Reconfirm the default TIghtVNCServer password 
  4. Set whether the server should be view-only as opposed to allowing control
  5. The server should now be running most likely on port 5901, 
  6. To confirm the port the VNC server is running on run from the terminal sudo netstat -pl | grep Xtightvnc 
  7. Connect to the VNC server on the port discovered above using another PC and an appropriate VNC client. 
Keyring & VNC Server
On rebooting the VNC server should start automatically but may not allow logins until the user keyring is unlocked. There are a couple aways around this one is to remove the password on the keyring in Ubuntu (this is not recommended as it will substantially lower your security) but can be done as follows:

  1. Go click Applications > Accessories > Passwords and Encryption keys
    The should be entries there listing an array of keyring password.
  2. Right click on them and select change password
  3. Enter the old password if you have one then leave the new password blank. (A warning message should appear)
A more elegant approach is to change the password key for the VNC server to match your VNC password, which therefore doesn't require the keyring to be unlocked. 

Here's how to do it for Vino the default Ubuntu remote desktop server: 
  1. Go click Applications->Accessories->Passwords and Encryption Keys
  2. Right click Passwords:default and unlock it.
  3. You should be able to expand the tree and find a listing for vino. Right click and delete it.
  4. Close Passwords and Encryption Keys.
  5. Open gconf-editor and navigate to /desktop/gnome/remote_access
  6. Create a BASE64 encoded password (here)
  7. Enter in your BASE64 encoded password into the vnc_password key.
  8. Save the config and close the editor.
  9. Reboot and you can now use your VNC client to connect to your machine without being first prompted with the keyring.
     
     
 Here's how to do it for TightVNCServer: 
  
  1. I've still not been able to figure this out as of yet.
Autostart VNC
To enable TightVNCServer to start at boot I added at line to the rc.local start up script here's how:

sudo gedit rc.local

Add the line:

su - username -c "/usr/bin/tightvncserver" 

Save and close. Done! 

Optimal VNC Viewer settings 
As a side note if you are using the Tight VNC viewer to access another VNC server I have found I obtain the best quality/performance using the client with the following parameters:

xtightvncviewer -bgr233 -encodings "tight" -compresslevel 9 -quality 0 vncserveripaddress::vncserverport

2 comments:

  1. A suggestion for line 6 "Create a BASE64 encoded password (here)":

    Rather than relying on some website to generate your base64 encoding, use your command prompt and enter the command:
    $ echo -n | base64

    ReplyDelete
  2. Sorry - some characters I had in that comment got treated as html and omitted... Here is the command line:

    $ echo -n your-password | base64

    Replace "your-password" with your password, of course.

    ReplyDelete