Thursday 4 April 2013

Setup VNC to Access GNOME Desktop on CentOS 6

Setup VNC to Access GNOME Desktop on CentOS 6 using UltraVNCViewer


Now that you have your VPS running and have set up FTP access you may want to move away from using command line and start to use a GUI. To do this you must install a Desktop Environment and VNC service. For this tutorial I will be using GNOME Desktop Environment and tigervnc.

Install and set up VNC


Start off by logging into root with the command

su

After correctly entering the password you should be logged in as root. Now run the command

yum install tigervnc-server

and enter y when prompted.

You should see Complete! when the server is successfully installed.

Log into the user you wish to access VNC with using the command:

su username

Create a VNC password for the user with the command

vncpasswd

You will be prompted to create and verify a password that you will use to log in to VNC with.

You now need to edit the VNC configuration file. For this you need to use a command line text editor. CentOS comes with vi for editing files however many people find nano easier to use. For this tutorial I will use vi however you may use whichever is easiest. (nano can be installed as root with the command yum install nano).

Open /etc/sysconfig/vncservers in vi with the command:

vi /etc/sysconfig/vncservers

You will now be in the vi editor with the file vncservers open. You can use the arrow keys to move around the file. To edit the file press i. You need to change the lines:


# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
to:

VNCSERVERS="1:username"
VNCSERVERARGS[1]="-geometry 800x600"

Replacing username with the username you assigned the VNC password to above. Once you have made these changes press escape, then type :x and press enter. This should save the file and exit vi. To confirm you have made the changes use the command:

cat /etc/sysconfig/vncservers

And you should see the changes.

Install GNOME Desktop Environment


To install the GNOME Desktop Environment enter the command as root:

yum installgroup "Desktop"

Press y and enter when prompted. If successful you should see Complete!

Start the VNC Service and Connect

Start the VNC Service with the command:

service vncserver start

You should see a success message if the service has started successfully.

To connect to the VNC Service I am using UltraVNCViewer. You can download this from here. Open UltraVNCViewer and you should see this screen:


Enter the IP Address of your server next to VNC Server: and add :1 to the end to indicate the port number.

Press connect and you should be prompted for a password. Enter the password you used for the VNC Password and you should connect. You should now be displayed a GUI as shown below:


Congratulations! You have now got your desktop and VNC successfully running. Now you can use the GUI to install new software instead of using the command line.

Note: If you attempt to connect to the VNC Server and it is just a black square try and restart the server. This has helped before.

If you have any comments or questions feel free to leave them below.

Thanks!

1 comment:

  1. Want to get free premium VPS Servers? Must visit Zolute and get now!

    ReplyDelete