Thursday, January 5, 2012

Configure VNC server on Red Hat Enterprise Linux 5


VNC server on RHEL5

VNC or Virtual Network Computing is a graphical desktop sharing program that uses RFB (Remote framebuffer) protocol to take control of another remote machine. It’s a Client-Server communication Protocol. VNC Server is the program on the machine that shares it desktop. Server allows the client to take control of it. VNC Client or VNC viewer is the program that watches, control and interacts with the server. Multiple clients can access to the VNC server at the same time by using VNC viewer.

VNC was originally developed by the Olivetti Research Laboratory in Cambridge, United Kingdom.

VNC is platform-Independent software that means you can run it on windows, Linux or Macintosh system. In this tutorial I am going to showing you that how you can configure & use VNC server with VNC viewer on Linux System.


Pre-requisites of VNC Server:
  • A Linux Server with IP address 210.207.201.1 & hostname Vncserver.
  • One or more Linux Client with IP address 210.207.201.x & hostname clientx
  • Update /etc/hosts file on both Linux system or use DNS system for name resolution.
  • Firewall should be off on the server
 Note: where x is 1,2,.....

Necessary configuration for Server Machine

IP Configuration: Change your server & client machine IP address as like below.

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

#Broadcom Corporation Net link BCM57875 Gigabyte Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29: EB: B2: CA
ONBOOT=yes
TYPE=Ethernet
PEERDNS=no
USERCTL=no
IPV6INIT=no
IPADDR=210.207.201.1
NETMASK=255.255.255.0
NETWORK=210.207.201.0
BROADCAST=210.207.201.255

Changing Host name: Change your server & client machine name as like below.

[root@localhost ~]# vi /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=Vncserver

Restart or Reload the NIC card: After changing the NIC card and hosting name you have to restart the network of router machine by following this command.

[root@localhost ~]# service iptables stop
[root@localhost ~]# chkconfig iptables off
[root@localhost ~]# service network restart

 Checking and Installing Necessary packages for Server and Client Machine

On Server machine: check the following packages is instead or not by rpm command.

[root@Vncserver ~]#  rpm –qa vnc*
Vnc-server-4.1.2-9.el5

If installed then it will show the above package, but if not installed then you should install it by yum install command.

[root@Vncserver ~]# yum Install vnc* -y

Note: By default the package will be installed on your machine but if not installed then you should installed it via yum.

On Client machine: On client machine you need VNC viewer to connecting with Server, but this will not install by default on your machine, so you need to install it first. To check that it is already been installed or not then follow the instruction to verify the program.

Click on Application Menu → Accessories →VNC Viewer

If the program is not presented on the location then install it via yum command.

[root@client01 ~]# yum Install vnc* -y

Now check it again from the above instruction.

Server Configuration

Click Preferences from the System menu → Select Remote Desktop

This will launch a new window where you can set sharing and security for remote desktop.


Configure Remote desktop
  • Click Allow other users to view your desktop to enable desktop sharing.
  • Click Allow other user to control your desktop if you want to give him a control of your desktop, otherwise you can unchecked it, then user will just show your desktop, but can’t take control of your desktop.
  • Click Ask you for confirmation, if this is marked then your client can’t access until you give him permission from the server machine.
  • Provide a password into the password section; client will put this password while he will try to access the server
  • Then Click Close

Accessing From Client Machine

Click Accessories from the Application Menu → Click VNC Viewer.

 
Put the VNC Server IP address or host name to connect with VNC Server → Click OK


Now type the password of the VNC server machine that you have already been given during the Remote desktop settings of server machine.

Authentication Permission

When you try to connect with server machine from the client machine a pop-up window will be appear on you server desktop, just Click Allow to give the control


THAT'S ALL

19 comments: