Tuesday, November 29, 2011

Install VNC Server on CentOS

First install vncserver as user root

#yum install vnc-server

then add user who runs vncserver
#adduser vncuser

Now setup VNC Password for this user

#su - vncuser
vncserver

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.

VNCSERVERS="1:vncuser"
VNCSERVERARGS[1]="-geometry 1024x768"

Now start VNC Server

# service vncserver start

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

To start VNC Server on boot

#chkconfig vncserver on

2 comments:

  1. Thanks. Really appreciated however, something is missing. Need to uncomment 2 lines from "xstartup" from .vnc within your home dir. Just completed all steps indicated by you, however without uncomment this 2 lines seems it just "plain" desktop.

    imho

    ReplyDelete