Skip to content

Instantly share code, notes, and snippets.

@ngocdon0127
Forked from antoniojxk/vnc-on-centos-6.md
Last active April 1, 2018 06:53
Show Gist options
  • Select an option

  • Save ngocdon0127/f1eebbb813ecab0cd6d5503524457fbb to your computer and use it in GitHub Desktop.

Select an option

Save ngocdon0127/f1eebbb813ecab0cd6d5503524457fbb to your computer and use it in GitHub Desktop.
how to install VNC on CentOS 6.8
  • install vnc-server (tigervnc-server on cenOS 6.8.)
[root@apaternina nfs]# yum install vnc-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.uniminuto.edu
 * extras: centos.uniminuto.edu
 * updates: centos.uniminuto.edu
Package tigervnc-server-1.1.0-18.el6.x86_64 already installed and latest version
Nothing to do
  • install vnc client
[root@apaternina nfs]# yum install vnc
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.uniminuto.edu
 * extras: centos.uniminuto.edu
 * updates: centos.uniminuto.edu
Package tigervnc-1.1.0-18.el6.x86_64 already installed and latest version
Nothing to do
  • Create the VNC users accounts
$ su -
# useradd vnc-user
  • Edit the server configuration.
vi /etc/sysconfig/vncservers 

VNCSERVERS="1:vnc-user"
VNCSERVERARGS[1]="-geometry 640x480"
  • Set your users' VNC passwords.
[root@apaternina nfs]# su vnc-user
[vnc-user@apaternina nfs]$ vncpasswd
Password:
Verify:
[vnc-user@apaternina nfs]$ cd /home/vnc-user/.vnc/
[vnc-user@apaternina .vnc]$ ls
passwd
[vnc-user@apaternina .vnc]$ exit
exit
[root@apaternina nfs]# 
  • Confirm that the vncserver will start and stop cleanly.
[root@apaternina ~]# service vncserver start
Starting VNC server: 1:vnc-user xauth: (stdin):1:  bad display name "apaternina:1" in "add" command

New 'apaternina:1 (vnc-user)' desktop is apaternina:1

Starting applications specified in /home/vnc-user/.vnc/xstartup
Log file is /home/vnc-user/.vnc/apaternina:1.log

                                                           [  OK  ]
[root@apaternina ~]# service vncserver stop
Shutting down VNC server: 1:vnc-user                       [  OK  ]
[root@apaternina ~]# chkconfig vncserver on
  • Create and customize xstartup scripts.
  • Amend the iptables.
  • Start the VNC service.
  • Test each VNC user.
  • Additional optional enhancements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment