Howto install VNC server

Steps in nut shell

For RHEL4
——————
up2date @”KDE (K Desktop Environment)”
up2date vncserver
——————

For RHEL5 or Centos
——————
yum groupinstall “KDE (K Desktop Environment)”
yum install vncserver
——————

Edit the lines below in the file /etc/sysconfig/vncservers and add a user “test” (user should be a valid user created on your server and not just simply a name).
——————
VNCSERVERS=”1:test”
VNCSERVERARGS[1]=”-geometry 1024×768 -depth 16″
——————

Add a password
——————
$ vncpasswd
Password:
Verify:
——————

Edit the startup script
———————-
$ vi ~/.vnc/xstartup

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
———————-

Go for Reboot…….(for KDE installation to take effect)

When the server is back
Type the command below to start the VNC server.
———————-
$ vncserver :1
———————-

Test whether the port is listening.
———————-
telnet localhost 5901
———————-

Open up the port 5901 in your Firewall settings.

From your local machine telnet to the VNC port

———————-
telnet IP 5901
———————-

The server is now ready to serve the request.

Connect to VNC server from your local machine.
Allow 5901 in your firewall (local machine)

Now from the console type

—————————
vncviewer IP:5901
It will ask for you login
—————————
\\\\\\\\\\\\\\\\\\\\\\\\\\

How To install VNCserver?


This part is to be done with the server.

Usually Linux servers are not installed with graphical interface(only text mode).
However, for VNC to gain access of the userfriendly interface like windows, KDE (K desktop environment) is installed.

Installation of KDE or GNOME

===========================

RHEL4
up2date @”KDE (K Desktop Environment)”

RHEL5 or Centos
yum groupinstall “KDE (K Desktop Environment)”

===========================

Reboot is required for this to take effect.
We will go for reboot after the complete installation.

VNC server

===========================
RHEL4
up2date vncserver

RHEL5 or Centos
yum install vncserver
===========================

The installation is over.

Next part is to configure VNC.

===========================
Add a user(s)

Next we need to add at least 1 VNC user, open the file /etc/sysconfig/vncservers as root and add the information

——————
VNCSERVERS=”1:test”
VNCSERVERARGS[1]=”-geometry 1024×768 -depth 16″
——————

VNCSERVERS=”1:test”, this sets up a users for the vnc server, you can add as many as you like here. The VNCSERVERARGS[1] line refers to the arguments for user 1, in this case the only user (user should be a valid user created on your server and not just simply a name).

Geometry sets the size and depth sets the colour depth
Assuming the client machine has a resolution of 1024×768 and the depth 16

The Port number is obtained 5900 + usernumber.
Here the port number is 5901

If, for example I have 20 users to access the server.
The user 10 will be connecting to port 5900+10

The user should in /etc/sysconfig/vncservers as

VNCSERVERS=”10:newone”
VNCSERVERARGS[10]=”-geometry 1024×768 -depth 16″

Setting password for vncserver

Add a password that must be given before a connection can be established, open a terminal and type:

——————
$ vncpasswd
Password:
Verify:
——————

Edit some startup options and start the server

To start the server we type the command ‘vncserver’ and the session you wish to start (if you have set up more than 1 entry in the
/etc/sysconfig/vncservers file:

$ vncserver :1

To start 10th user

$ vncserver :10

The part below will be shown up.

+++++++++++++++++++++++++
Starting VNC server: 1:test
New ‘linux.test:1 (test)’ desktop is linux.test:1

Starting applications specified in /home/test/.vnc/xstartup
Log file is /home/test/.vnc/linux.test:1.log
+++++++++++++++++++++++++


Next, we need to edit the startup script in the .vnc folder in your home directory.

———————-
$ vi ~/.vnc/xstartup

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
———————-

Next we need to restart vncserver to pick up the change we just made.
To restart the vncserver we need to kill the process and start a new one as root

———————-
$ vncserver -kill :1
Killing Xvnc process ID 15562
———————-

Go for Reboot.

Type the command below to start the VNC server.

———————-
$ vncserver :1
———————-

Test whether the port is listening.

———————
telnet localhost 5901
———————-

Open up the port 5901 in your Firewall settings.

From your local machine telnet to the VNC port

———————-
telnet IP 5901

———————-

The server is now ready to serve the request.

 

Connect to VNC server.

If your local machine is running Linux (Fedora).

—————————
First we should allow port access 5901(VNC port).
Allow 5901 in your firewall (local machine)

Now from the console type

vncviewer IP:5901
It will ask for you login

You need to install the VNC viewer in your local machine.

If your local machine is running Windows, then please use the link to install the VNC client.

http://www.internetfixes.com/remote_setup/vnc_install.htm