Bring Xfce to a CentOS 6 box

[last update 11-01-2013]
As many of the tutorials about this subject, present on the Internet were either outdated
or incomplete, I thought to log my adventure into installing CentOS 6 with Xfce on my
recently rented VPS server.
So all you’ll need is SSH access to your box, and to be ready to get your hands dirty.
Log in with your root account into the box’s shell:
ssh root@host
The next thing to do is to enable a extra repository in order to be able to install Xfce on
your box. I recommend to use the EPEL {Extra Packages for Enterprise Linux} repository
and to do so you need to find the latest epel-release package; and to do so I used the official rpm package.
You might be lucky and at the time of reading this to be able to install this package
directly from CentOS6’s repos with:
yum install epel-release
but if your a bit less lucky install it manually:
rpm -Uvh
Now that you are all set up with the EPEL repo, let’s go on with installing Xfce applications CentOS collection
yum groupinstall Desktop Xfce Fonts
After the packages installation is all done you need to set up a vnc server, after all there 
is no point in installing a Desktop Manager if you don’t intend to connect to it and see it. 
yum install tigervnc-server
Now make sure all your packages are updated:
yum update
At this point if you don’t already have a user besides the root user, you should create one
and assign it the desktop by setting a vnc password for it. I’ll use the name gui in these
useradd gui
passwd gui
su gui
Now enter a password for the desktop user, this password will be when you’ll remote
connect to the newly installed server. After that return to your root shell user with the
exit command.

Now it’s time to configure the vnc server configuration, but first we need a CLI text
editor to edit the configuration, I’ll use nano for that.
yum install nano
nano /etc/sysconfig/vncservers
The configuration file should reflect which user is going to be responsible for the
Graphical User interface and how the desktop would be like. So I’ll use a simple
VNCSERVERARGS[1]=”-geometry 1024×768  -nolisten tcp -localhost
Important note: The italic part should be added to secure the connection with a SSH tunnel
Note: make sure this two lines are uncommented
Now let’s quickly start and stop the vncserver in order to get the default startup
configuration file ready. So ..
service vncserver start
Now you are ready to log in using the VNC client of your choise. I use RealVNC, but any
client would do the job.
If you didn’t use SSH tunneling for your setup then you can connect by providing
host:1 and your vnc password to any VNC client.
Now let’s add this server to the startup configuration:
Check vncserver and press ok. From now on your vnc server will start at boot time.
If you createad a secure vnc connection open a tunnel first
I love this lightweight desktop, it takes just about 100MB of RAM on the server and is not
wasting valuable resources.

Leave a Reply

Your email address will not be published. Required fields are marked *