A Quick Guide to VNC Server on CentOS 6

After searching through several guides, all complete in one way or another, however, not complete enough, I put the pieces together into this guide. This particular configuration is a basic VNC server with two users. After creating the second user, the process can be repeated for additional users.

Install the VNC Server

yum install tigervnc-server -y

Edit the /etc/sysconfig/vncservers file. Note that on the VNCSERVERS line that there is a space between each number:user and that each VNCSERVERARGS[num] has a separate line with the cooresponding number to the user.

VNCSERVERS="2:root 3:testuser"
VNCSERVERARGS[2]="-geometry 800x600"
VNCSERVERARGS[3]="-geometry 800x600"

Set passwords, as root

vncpasswd
Password:
Verifiy:

Then as the new user, if not exist, create one.

useradd testuser
passwd testuser
su testuser
vncpasswd
exit

Start and enable the server.

service vncserver start
chkconfig vncserver on

Add firewall exceptions.

iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
service iptables save
service iptables restart

After creating another user, and after a successful connection to the server through VNC, the user is greeted with the Authenticate window. Authentication is required to set the network proxy used for downloading packages. Ana pplication is attempting perform an action that requires privileges. Authentication as the super user is required to perform this action. Then prompts for the password for root. Cancel will close the window.

auth

However, to remove this prompt from future logons. Open a terminal window and type gnome-session-properties or from the GUI System > Preferences > Startup Applications. Then uncheck “PackageKit Update Applet”. Go to the vncserver and restart it. The issue is resolved.

sapmgr

 

Source(s)
http://orclcorner.blogspot.com/2012/12/fixing-authentication-is-required-to.html
http://rbgeek.wordpress.com/2012/06/26/how-to-install-vnc-server-on-centos-6/