Minimum Install VNC Remote Desktop Server on Centos

On this tutorial we are going to install VNC server on a Centos 5.6 Linux VPS. The objective is to install minimum packages to save disk space and keep the package installation minimum.

To install VNC server and Gnome desktop, run this command:

Then create a normal user to run the VNC service and create password to login to VNC remote session:

You’ll see: passwd this file is storing the password for login to VNC session

Next is editing VNC server configuration /etc/sysconfig/vncservers and add the new user to list of VNC server:

Add the user to list of VNC server:

Now let’s start the vncserver service to generate xstartup script where we’ll configure it to start Gnome desktop environment.

You’ll see: <hostname>:1.log passwd xstartup

We need to modify the xstartup script so Gnome session is called when we start the VNC server



Save the modification, go back as root and let’s start the VNC server

Download Tight VNC client here:

After you installed the Tight VNC client, run it and you’ll see this form:

VNC Connection

VNC Connection

On the VNC Server field, insert your VPS IP address followed with ‘:1’ and then click on Connect. You’ll be asked for a password, this is the password you created when you run vncpasswd command.

If you need VPS hosting with VNC remote desktop installed, please contact HalfDedi at or email, they have a great VPS service

17 thoughts on “Minimum Install VNC Remote Desktop Server on Centos

  1. fajrih

    sorry i cant……….

    when i write vncpasswd =====> -bash: vncpasswd: command not found

    and when i write ls .vnc/ ======> ls: .vnc/: No such file or directory

    can you help me

    1. Talk Web ID Post author

      that means you haven’t install vnc server, please run the yum command on the very first step above.

      1. magicguest

        That means he uses centos 6.
        So, the server is: tigervnc-server not: vnc-server

      1. Rey

        I have the same problem. When connecting to the VNC server it just shows a blank grey screen.
        My VPS’s virtualization is OpenVZ with 512MB RAM(1GB Burst).
        any help would be much appreciated.


  2. wallpapers

    Hello, i tried to install it, but when i’m tried this comand

    ls .vnc/

    show :

    [root@149 ~]# su – johndoe
    [johndoe@149 ~]$ ls .vnc/
    ls: .vnc/: No such file or directory

    how can i resolve it ? thank’s

  3. freehdwallpapers

    When i’lm runing service vncserver start i get :

    root@149 ~]# service vncserver start
    Starting VNC server: no displays configured [ OK ]

    1. Talk Web ID Post author

      that means you didn’t follow the steps carefully:

      nano /etc/sysconfig/vncservers



  4. jawad

    I successfully completed all steps,but still “failed to connect to server”,m running centOS 6 as VNCSERVER and windows 7 as a client viewer.Help will be appreciatedd…

  5. bob

    I have this set up, but do not have the nano editor, so I cannot edit files. I do not have vi either. How do I get an editor?


  6. Mirko

    -bash-3.2# service vncserver stop
    Shutting down VNC server: 1:johndoe [FAILED]

    -bash-3.2# service vncserver start
    Starting VNC server: 1:johndoe A VNC server is already running as :1

    Why? 🙁

    1. Talk Web ID Post author

      run this command to see if vnc server already running: ps aux | grep ‘vnc’

      make sure you execute the commands as root


Leave a Reply

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