Search Blog Post

Tuesday, August 27, 2013

VNC Configuration



                                                VNC Configuration

 Installing the required packages
·         The server package is called 'vnc-server'. Run the command: rpm -q vnc-server
·         The result will be either package vnc-server is not installed or something like vnc-server-4.0-11.el
·         If the server is not installed, install it with the command: yum install vnc-server
Make sure to install a window manager in order to get a full-featured GUI desktop
·         You can use the command yum groupinstall "GNOME Desktop Environment" to install the Gnome Desktop and requirements
·         If you are running CentOS 6, the command is yum groupinstall Desktop
·         If you are running CentOS 6, the server is: tigervnc-server not: vnc-server

Create the VNC user accounts

·         useradd oracle
·         passwd oracle

Edit the server configuration

·         Edit /etc/sysconfig/vncservers, and add the following to the end of the file
·         VNCSERVERS="1:root 2:oracle"
·         VNCSERVERARGS[1]="-geometry 640x480"
·         VNCSERVERARGS[2]="-geometry 640x480"
·         VNCSERVERARGS[3]="-geometry 800x600"

Set your users' VNC passwords

·         su - oracle
·         $ vncpasswd
·         [~]$ cd .vnc
·         [.vnc]$ ls
·         passwd
·         [.vnc]$ exit
·          

Confirm that the vncserver will start and stop cleanly

·         We will create the xstartup scripts by starting and stopping the vncserver as root. We also enable the vncserver service to be automatically started.
# /sbin/service   vncserver start
# /sbin/service   vncserver stop
# /sbin/chkconfig vncserver on

Amend the iptables (MOST IMPORTANT STEP)

·         The iptables rules in /etc/sysconfig/ need to be amended to open the VNC ports; as needed, if a local ipv6 setup is being used, those need to be amended as well:
[root@abc21 sysconfig]# cat iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
[root@abc21 sysconfig]#         

Start the VNC server

Start from the user through which you want to use VNC
# /sbin/service vncserver start

Starting vncserver at boot

To start vncserver at boot, enter the command:
/sbin/chkconfig vncserver on 


No comments:

Post a Comment