Configure VNC Server on CentOS

Introduction

Some times we need to use the graphical interface, or just connect to a server or a VPS to do some tasks, it's very important in some cases to use the graphical tool. for this reason i decide to write this tutorial to show you how to configure the vnc server on your own server in a simple steps.

Installing KDE:

Normally, when you are using a VPS you will use the command line and SSH connection, therefor we have to install at the first time a graphical interface, i choose the KDE interface and i will work on it. So you must connect to your server, computer or VPS using SSH connection.

The first command to run is : 

#yum groupinstall  "KDE Desktop"

this command will install KDE. and when it ask you to download any thing type 'y' and press 'enter'.

Now we have done the first step and we installed the KDE interface. the next step will be installing the vnc server.

Installing VNC Server:

In order to install a VNC Server you need to type the commands shown bellow.
First command : 
#yum install vnc-server vnc

When it ask you to download packages, type yes and download it, as it illustrated on the picture bellow :


When the installation finished, we can install the vnc server, which in CentOS is not vnc-server but its name is tigervnc-server, so lets installed it. Type the command :

#yum install tigervnc-server

And as we did before, when its ask you to download packages download all. Now after we installed the vnc server we can configure it, as i use a vps and i want to illustrate this method i will use my root user, if you want to do it you can create other users to use the vnc. So for me the next step will be setting vnc server, by using the command :
#vncpasswd

Well, it's time to configure our vncserver, so you can now edit the configuration file located on /etc/sysconfig/vncservers, i am using the vi editor, and you can use the editor you wish.

#vi /etc/sysconfig/vncservers 



In my case the configuration file will be as shown on the next picture :


You can add more than user on this configuration file, separate each user by space, and affect to each user a number (id) which will be used on the next line for arguments.
Finally, you can run you vnc server, to do that you must run the command line :

#service vncserver start


Now, and after all we have done, we can access our server using vnc client, see the next picture :


You must type the server name or the IP:Number, the number represent the id on you configuration file, so am connecting to my vnc server with my root username. and a dialog box request your password, type it.


And that's all, you will see your desktop, and you can control your computer using the VNC.


I hope i explained clearly the steps you need to install your VNC server on your own server.

Downloads:










0 commentaires: