Setup VNC Server on CentOS

I recently had the task of setting up VNC Server on CentOS for a client of mine. VNC is very much like remote desktop in windows. You can even use VNC on Windows servers. I found VNC to be a little bit slower then remote desktop and it kept kicking me out every once in a while. Here are the steps I took to set it up:

First I opened the necessary ports.

Path to access the firewall:

Expand “Other ports” click add and type in the below port numbers:

Next you need to install VNC Server. Do this by typing the following command in a terminal session.

Make sure the VNC server service is started. You can do this by running a command or through the services GUI. See the pics below:

Path to CENT OS services:

VNC Server service:

Command to start the VNC Server service from terminal session:

Next configure the server to accept incoming connections. Here is the path:

Remote Desktop configuration:

Check the box next to the VNC Server service in the services GUI or run this command to make sure VNC Server service starts automatically when CENT OS boots up.

Now make sure you know what your IP is on this server. If you do not know run ifconfig in a terminal session. See the pic below:

No go to your client and see if you can remote into your server. You have to use a VNC Viewer for this. You can download it at one of the following links: http://www.tightvnc.com/download.html or http://www.realvnc.com/products/free/4.1/index.html . I used TightVNC for in my environment. It has a executable that does not require a install to run the app.

In the VNC viewer type: THEIPADDRESSOFYOURSERVER :0 (Example: 192.168.0.11 :0 Note: don’t forget to add a space after the IP address)

If you get prompted for a password then it worked.

All I needed to setup was root to have access to this server. The :0 on the end of the IP address when you VNC into the server represents the root account. If you need to enable VNC access for other accounts there are a few more steps to set the other users up. I will not be covering that in this post. You can review these steps at the link below.

I hope this post was helpful. Again If you need help visit this link http://wiki.centos.org/HowTos/VNC-Server?highlight=(VNC) for more information.

One comment to Setup VNC Server on CentOS

  • grateful_guy  says:

    I`ve been looking everywhere for a easy, nice looking post for setting up vnc server on a centos machine. SAved me a ton of time and headache. Thank you!

Leave a reply