Configure VNC server in Linux

VNC provide secure remote desktop control(GUI) sharing to other machines over network. VNC server is capable of  sharing multiple desktop to more than one users at a time. Many users can work on a single PC with GUI at a time.This Post will help you to configure VNC in all RPM based Linux distributions(Redhat, CentOS, Fedora, etc)
Steps to install and configure VNC server/client in linux OSThis example helps you to configure a vnc server with two VNC windows. So two different  users (user1 and user2)can access the vnc server at a time.

Step1: Install the packages server and client(4nos)
[root@server ~#]yum install tigervnc*

Step2: Edit the vnc configuration file with your requirements
[root@server ~#]vi /etc/sysconfig/vncservers
#add 3 new lines or edit existing lines like below( user1 & user2 are two new VNC users, 1 & 2 are Display numbers, 950×700 is display resolution, depth 24 is color depth)
VNCSERVERS=”1:user1 2:user2″
VNCSERVERARGS[1]=”-geometry 950×700 -nolisten tcp -depth 24″
VNCSERVERARGS[2]=”-geometry 950×700 -nolisten tcp -depth 24″
#save the file

Step3: Create users and set password(users are user1 & user2)
[root@server ~#]useradd user1
[root@server ~#]useradd user2

Step4: Note: logout from root and login as two new users and set vnc access password
[root@server ~#]su user1
[user1@server ~#]vncpasswd
#(input vnc password and verify, this password is required for vnc connection)
[root@server ~#]su user2
[user2@server ~#]vncpasswd
#(input vnc password and verify, this password is required for vnc connection)

Step5: Login as root and start vnc service
[root@server ~#]service vncserver start

Step6:Acess vnc server from client computers(windows and linux)
Important: By default VNC server will listen ports based on Display number. Here i used two displays(1 and 2) . so VNC server will listen in 5901/tcp and 5902/tcp . So u must  open these port in firewall(iptables) or Disable firewall(iptables).
VNC client In linux
[root@server ~#]yum listall tigervnc

and go to Applications>Internet>TigerVNC Viewer
and input address in the below format
<ipaddress>:<display number>

For example: if ip address of vnc server is   and
And input vnc password(we set in step3)
VNC Client In Windows
VNC viewer for Windows VNC Download
and input server address and display number same as above (Linux)
VNC Server managemant

Start/stop/restart/reload service
[root@server ~#]service vncserver start
[root@server ~#]service vncserver stop
[root@server ~#]service vncserver restart
[root@server ~#]service vncserver reload

kill a vnc Window (eg: display 1)  , Note: first login as user1
[user1@server ~#]vncserver -kill :1

to start again
[user1@server ~#]vncserver :1

Was this helpfull ?


Related Posts Plugin for WordPress, Blogger...

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons