HostOnNet Blog

Install VNC Server on CentOS

Looking for Linux Server Admin or WordPress Expert? We can help.

First install vncserver as user root

yum install vnc-server

I wanted VNC run as user “flashwebhost” as it is not recommended to use Desktop as user root, so i created a user

adduser flashwebhost

Now setup VNC Password for this user

su - flashwebhost

It ask password 2 times. You need this password to connect with VNC Viewer.

Now kill the VNC Server

vncserver -kill :1

:1 is display number. Mostly it will be 1.

Type exit to go back to root shell.

Now edit /etc/sysconfig/vncservers

vi /etc/sysconfig/vncservers

Add following content to the file, save and exit.

VNCSERVERARGS[1]="-geometry 1024x768"

Now start VNC Server

[root@sam /]# service vncserver start
Starting VNC server: 1:flashwebhost
New 'sam.localhost:1 (flashwebhost)' desktop is sam.localhost:1

Starting applications specified in /home/flashwebhost/.vnc/xstartup
Log file is /home/flashwebhost/.vnc/sam.localhost:1.log

                                                           [  OK  ]
[root@sam /]#

Now you will be able to connect to the server with SERVER-IP:1

To start VNC Server on boot

chkconfig vncserver on

Posted in Virtualization

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.