Setup VNC on CentOS/RHEL 6

The process of setting up VNC (and GNOME Desktop) is slightly different between CentOS 5 and 6. When using the CentOS 5 VNC installation method for CentOS 6, you will often get the error ‘Group GNOME Desktop Environment does not exist’ while attempting to install GNOME. This article will go over the process required to successfully setup VNC and GNOME on CentOS 6. This tutorial should work whether you are using a VPS, or using a Netinstall of CentOS 6. To begin with, you should use yum to download the GNOME Desktop environment. If you wish to use KDE instead of GNOME, install “KDE Desktop” instead of “Desktop”.

yum groupinstall "Desktop"

The typical yum installation process will take place. After the Desktop group has been successfully installed, install the TigerVNC server and the font required for CentOS 6 to work.

yum install tigervnc-server xorg-x11-fonts-Type1

Afterwards, the GNOME Desktop Environment should have been completed. You want to start the VNC server at that point. Login to the user you want to use the desktop for (typically a user other than root), and run the command:

vncserver

On your first time running the command, you will be asked to choose a password for VNC for the account After the password is set, you will see something like the following:

New 'fusionswift.com:1 (root)' desktop is fusionswift.com:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/fusionswift.com:1.log

Note for you, your VPS’s hostname will be in place of ‘fusionswift.com’. After the hostname, you will see that number. Add that number to 5900, and that will be the port VNC will be running on. In the above example, port 5901 will be used. To stop the vnc server, use the command, where number is the number you added to 5900:

vncserver -kill :number

2 thoughts on “Setup VNC on CentOS/RHEL 6

  1. dstewart

    Thank you, I have been trying to set CentOS 6 up with Tigervnc server the old way with vncpasswd. Doesnt work that way anymore.

  2. danielf

    Thanks a lot, I’ve been struggling a lot with this lately.
    Maybe you should transfer your method to the authors of the official CentOS VNC setup tutorial, since the stuff they write simply does not work on CentOS 6. (The real difference is minor, but deadly – as you state, you have to start vncserver as a command, not as a service (service vncserver start/stop) as per their instructions. Using the service wrapper won’t let vncserver create its startup environment, leaving you with a xterminal only (and that’s the better case).

Comments are closed.