Flipkart

Thursday, January 5, 2017

Configuring VNC Server on Linux

Install the VNC Server.
( Method – 1 )
For RHEL , CentOS ,OEL.
 # yum install tigervnc-server
 For Ubuntu.
 # apt-get install tigervnc-server
 Edit the “/etc/sysconfig/vncservers” file to configure the required displays.
The following entries enable VNC for display numbers “:2” and “:3”. Notice multiple “display:user” pairs are defined on a single line, but the arguments for each display are defined separately.
 VNCSERVERS=”2:root 3:admin”
VNCSERVERARGS[2]=”-geometry 1280×1024 -nolisten tcp -localhost”
VNCSERVERARGS[3]=”-geometry 1280×1024″
 Press Shift +C
 :wq!
 Set the VNC password for any users defined in the “/etc/sysconfig/vncservers” file.
 # su admin
# vncpasswd
Password:
Verify:
Enable the “vncserver” service for autostart and start the service.
# chkconfig vncserver on
# service vncserver start
 You should now be able to use a VNC viewer to connect to system using the display numbers and passwords defined.
Use the following commands to stop the service and disable autostart.
# service vncserver stop
# chkconfig vncserver off
 (Method -2 )
 Install the VNC Server.
 # yum install tigervnc-server
 Create a new configuration file for each of the display numbers you want to enable. In the following case, I am setting up the display number “:3”. Notice how the display number is included in the configuration file name.
 # cp /lib/systemd/system/vncserver@.service  /lib/systemd/system/vncserver@:3.service
 Run the following command.
 # systemctl daemon-reload
 Set the VNC password for the user defined in the new configuration file.
 # su – oracle
$ vncpasswd
Password:
Verify:
$ exit
Enable the service for autostart and start the service.
# systemctl enable vncserver@:3.service
# systemctl start vncserver@:3.service
 You should now be able to use a VNC viewer to connect to system using the display number and password defined.
Use the following commands to stop the service and disable autostart.
 # systemctl stop vncserver@:3.service
# systemctl disable vncserver@:3.service
Done. Thanks

No comments:

Post a Comment