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 tigervncand 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 192.168.10.1
192.168.10.1:1 and 192.168.10.1:2
And input vnc password(we set in step3)
VNC Client In Windows
VNC viewer for Windows VNC Downloadand 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
0 comments:
Post a Comment