Skip to main content

Installing Gnome on CentOS with VirtualBox

·3 mins

Remember Me? #

In the last blog-post we have installed a basic CentOS 6.2. From there on we are going to setup a graphical user interface. Since we might need another server system in the future we are not going to modify our current installation.

VirtualBox can duplicate your virtual machine by creating a clone. You need to shutdown your virtual machine in order to do so.

After I have cloned the virtual machine I have booted up the new one. Unfortunately the network connection did not work. There was no network interface.

While I was investigating, I came across /etc/sysconfig/network that held the old hostname. I have changed that to centos62-desktop.

Of course the problem was still there, I had no network interface eth0.

Multiple Network Configurations

The first entry was from the original image, I have removed that. Now go back to /etc/sysconfig/network-scripts/ifcfg-eth0 and add the correct hardware address with the parameter HWADDR, in my case HWADDR="08:00:27:50:5e:77". It was important that the address is provided within quotation marks. It wouldn’t work without. Yep, that took some time to find out.

Let’s Get That Desktop #

That little terminal window is a good start, but of course I want a desktop environment for serious development work where I need an IDE. So I did the following command to get the necessary binaries:

{% highlight none %} yum groupinstall basic-desktop desktop-platform x11 fonts {% endhighlight %}

Thanks to this post.

After you are done with the installation type startx. There we are, we got ourselves a new desktop.

But wait a second, you also have this strange mouse behaviour? I had it. The cursor only used part of the guest OS desktop space and “jumped out” to the host desktop. Really weird.

To get around this I had to install the Virtual Box Guest Additions, that is described here.

Those were the commands from the article:

{% highlight none %} yum update kernel* yum install kernel-devel yum install gcc {% endhighlight %}

Additionally I had to install make as well to make it run.

{% highlight none %} yum install make {% endhighlight %}

But no, there was no /media directory. The solution can be found here.

{% highlight none %} mkdir /media/VirtualBoxGuestAdditions mount -r /dev/cdrom /media/VirtualBoxGuestAdditions {% endhighlight %}

Again another step to success. Still not done. Got the following error message: “Building the OpenGl support module” [FAILED]

OpenGI Module Failed

A simple command did the trick.

{% highlight none %} export MAKE=’/usr/bin/gmake -i' {% endhighlight %}

Am sorry, but don’t know anymore where I got this from. Thanks to the one providing it!

After installing the guest additions again everything was green and the strange mouse behaviour was gone.

Congratulations we now have a running CentOS 6.2 with a desktop.

Gnome Desktop

Post-Work #

Additionally I have installed Firefox.

{% highlight none %} yum install firefox {% endhighlight %}

You shouldn’t do everything as root while working with Linux. Therefore I have created another user I will do stuff with in the future.

{% highlight none %} adduser myNewUser passwd myNewUser {% endhighlight %}

To be able to look up command usage I have installed the man system.

{% highlight none %} yum install man {% endhighlight %}

Done for today!