Here’s a really quick way of installing VNC on your server or desktop machine. VNC is similar to Remote Desktop in Windows in that you can connect to your computer remotely and have access to a GUI. It comes in handy if you have a VPS and you’re not quite familiar with bash, or if you would like to use applications that require a GUI.
1. Log in as the root user on your server and run:
yum install vnc-server firefox
This installs the vnc server and the firefox browser. You can opt out of installing Firefox and install another one instead, or not install it at all if you do not plan to use a browser.
2. Most dedicated servers and home computers can skip this step if you wish to use GNOME (as they already have gnome installed). Should you choose to use KDE, you can then type:
yum groupinstall “KDE (K Desktop Environment)”
If are unsure if you have gnome installed already, you can easily run:
root@server3 [~]# gnome-panel --version
Gnome gnome-panel 2.16.1
and it will let you know what version you have. If you don’t already have GNOME and wish to use it, just run:
yum groupinstall "GNOME Desktop Environment"
Some admins with a VPS may already have a control panel setup, in which GNOME will give you issues installing because it wants to use a certain version of Apache. To bypass this, run this instead:
yum groupinstall "GNOME Desktop Environment" --skip-broken
3. Log out as the root user, and log in as the user you want to run VNC under (or just type su username). Type:
and it will prompt you to enter a password. Make sure to remember this password as it is the password that you will use to log into VNC.
4. After that, type:
vncserver -kill :1
nano ~/.vnc/xstartup (or use the editor of your choice) and there are two lines you need to uncomment. They are:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
Just remove the # sign from in front of them. Also you will need to comment out the line that says twm & (just put a # in front of it), then finally start a new line and add kde & for KDE or gnome & for GNOME. After all said and done, the lines will look like this:
6. Once the file is saved, you may type vncserver :1 and connect to VNC using the username, and the password that you typed in step 3.