Thursday, May 2, 2013

Install VNC server on Eucalyptus backed instances



One thing I must admit, working on Desktop saves time (and in some cases even lives :D). In this post, to get the desktop access, I'll show how to install VNC server on instances running on Eucalyptus private cloud.

I have a large instance running Centos 6.3 EMI which I have downloaded from their EUCASTORE.



If you haven't authorized your eucalyptus group to grant network access on port 5900 and 5901, do it by running the following command on your cluster-controller (cc)

# euca-authorize -P tcp -p 5900-5901 -s 0.0.0.0/0 your-sercurity-group

 

1) The first step is to install required packages.
Login into the instance and run all the following commands as a root ( or super) user.

1.1) # yum groupinstall desktop
1.2) # yum install tigervnc-server
1.3) # yum install xorg-x11-fonts-Type1


2) Setup a password 
Next step is to authorize a user to grant access to vnc server. You can either create a new user or simply grant the access to the 'root' user. For each user you need to setup a vnc-server password for them:

# vncpasswd


3) Configure VNC
Edit the /etc/sysconfig/vncservers file using your favourite editor and add the following lines at the end:

VNCSERVERS="1:vncuser"
VNCSERVERARGS[1]="-geometry 1600x1200"




You can set the resolution as per your choice and can even configure multiple users like this:

VNCSERVERS="1:vncuser1 2:vncuser2 3:vncuser3"
VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 800x600"
VNCSERVERARGS[3]="-geometry 1600x1200"

4) Clean Start VNC server
Before doing anything, lets start and stop the VLC server so that it initializes our settings and create the necessary files.

# service vncserver stop
# service vncserver start


Setup VNC server to start at boot :

#chkconfig vncserver on

5) Edit xstartup script for each user

Login to each user and edit their ~/.vnc/xstartup script. Comment out the last line (append the #) and add the following line:

exec gnome-session &



6) Restart VNC server

The final step is to restart the VNC server and we are done with installing the VNC server on that instance.

# service vncserver restart

7) Install VNC client

Install vnc client on the machine from where you want to remotely connect to the instance:

# yum install vnc

Note: On windows machine you can install the VNC client from here: http://www.realvnc.com/download/viewer/


8) Connect to VNC server




Press ok and enter the password



And enjoy the desktop :)





In the next tutorial, I'll show how to install HBase on the instances to get the full power of Eucalyptus's infrastructure as a service to do some massive data processing.