HowTO: Install VNC Server On CentOS 6.3
1. Install Tigervnc Server
- [root@demo ~]# yum -y install tigervnc-server
2. Install X Windows and GNOME.
This used to be yum groupinstall "X Window System" "GNOME Desktop Environment", but is now simply:
- yum groupinstall "X Window System" "Desktop"
3. Create a user (or use and existing user) and create VNC login.
- [root@demo ~]# useradd david
- [root@demo ~]# passwd david
- Changing password for user david.
- New password:
- Retype new password:
- passwd: all authentication tokens updated successfully.
- [root@demo ~]# su - david
4. Switch to the user (su - user) and issue 'vncpasswd' to set the VNC password
- [david@demo ~]$ vncpasswd
- Password:
- Verify:
- [david@demo ~]$
5. Start VNC using 'vncserver :1'
- [david@demo ~]$ vncserver :1
- xauth: creating new authority file /home/david/.Xauthority
- New 'demo.domain.net:1 (david)' desktop is demo.domain.net:1
- Creating default startup script /home/david/.vnc/xstartup
- Starting applications specified in /home/david/.vnc/xstartup
- Log file is /home/david/.vnc/demo.domain.net:1.log
- [david@demo ~]$
6. Stop VNC using using 'vncserver -kill :1'
- [david@demo ~]$ vncserver -kill :1
7. Setting resolution:
In /etc/sysconfig/vncservers, add a line for each user.
NOTE: if you if you need to install Oracle software, use geometry 1024x768.
You can also do this via the shell using: vncserver :1 -geometry 1024x768 -depth xx
- # The VNCSERVERS variable is a list of display:user pairs.
- #
- # Uncomment the lines below to start a VNC server on display :2
- # as my 'myusername' (adjust this to your own). You will also
- # need to set a VNC password; run 'man vncpasswd' to see how
- # to do that.
- #
- # DO NOT RUN THIS SERVICE if your local area network is
- # untrusted! For a secure way of using VNC, see this URL:
- # http://kbase.redhat.com/faq/docs/DOC-7028
- # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
- # Use "-localhost" to prevent remote VNC clients connecting except when
- # doing so through a secure tunnel. See the "-via" option in the
- # `man vncviewer' manual page.
- # VNCSERVERS="2:myusername"
- # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
- VNCSERVERS="1:david"
- VNCSERVERARGS[1]="-geometry 1024x768"
For multiple users, simply add the user to the VNCSERVERS list and add a VNCSERVERARGS[x] entry.
So for three users:
- VNCSERVERS="1:david 2:bill 3:john"
- VNCSERVERARGS[1]="-geometry 1024x768"
- VNCSERVERARGS[2]="-geometry 1024x768"
- VNCSERVERARGS[3]="-geometry 640x480"
8. Open the port for the user, in this case 5801.
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 5801 -j ACCEPT
Save and restart IP Tables (/etc/init.d/iptables save | restart)
Source: http://www.davidghedini.com/pg/entry/vnc_server_on_centos_6
If ERROR comes like this:
ReplyDelete"WARNING: The first attempt to start Xvnc failed, possibly because the font
catalog is not properly configured. Attempting to determine an appropriate
font path for this system and restart Xvnc using that font path ...
Could not start Xvnc.
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids"
then update the required packages:
$ yum install pixman pixman-devel libXfont
Thanks ...
ReplyDeleteinstall vnc on centos 6