Monthly Archive for July, 2011

How to install and run VirtualBox on Fedora (and Kororaa)

Kevin on the Kororaa Forums asked a question about VirtualBox and why it needs kernel modules.

Just wondering if someone could give me an idea of what Kernel Modules are and what they do in relation to Virtual Box? Every time I try to install VB it says you need “this” or “that” (mostly kernel modules) and I have no idea where to look, what they are, and what they do, so I am hoping to learn something. Also, if I get VB to work, and “they” update the kernel, do I have to add modules again or? Basically when I install VB, what do I have to install along side it?

Here’s my reply, as it might be useful for anyone running Fedora (note, this is using the latest package from Oracle, rather than the pre-compiled OSE in the Fedora repos).

Background
So your operating system is made up of three (main) components:

  • Physical hardware (computer bits)
  • Kernel (software which talks to your hardware and makes it work, think drivers)
  • Software (talks to your kernel to get to your hardware)

Your kernel is what makes your computer work (this is actually what Linux is, a kernel) and it’s actually the most important part of the operating system. When you’re talking about VirtualBox, it needs to create fake hardware on top of your real hardware, so to do that, it needs a driver. Drivers sit in the kernel layer.

The Linux kernel has thousands of drivers in it, but it does not have VirtualBox drivers in it (yet). This means you need to compile these and load them into your running kernel of you want to use VirtualBox. Once you do that, your kernel will have the fake hardware that the VirtualBox software needs to run. Drivers which you can load and unload into the kernel are called modules.

The VirtualBox host computer needs these drivers, but the VirtualBox guest also needs some drivers to make full use of the fake hardware. When you install Linux or Windows as a VirtualBox guest, the hardware is fake, so that OS needs drivers too! Some of those drivers (like audio and network) are already in the Linux kernel, so if your guest is running Linux, you just need drivers for the video, etc.

Requirements
In order to compile the drivers for VirtualBox (on both host and guest) on Linux you need some development libraries, compiler program (such as GCC), as well as the headers for the running kernel. You need the headers because you need to compile a driver to load into the kernel and it needs to know detailed information about it.

Fortunately, if you’re using Kororaa, all of the required tools and packages are already installed! :-) All you need to do is build the drivers.

If you’re running a vanilla instance of Fedora, then you need to install the build tools like so:
su -c 'yum install gcc kernel-devel'

Now you have the build tools required to compile the drivers.

Automatically building drivers after kernel update
Modules are for a specific kernel and so when you get a kernel update, you need to re-compile the drivers for VirtualBox hosts and guests. Fortunately, there’s a neat little package called DKMS (Dynamic Kernel Module Support Framework) which will do this for you automatically – and of course Kororaa comes with this pre-installed.

If you’re running Fedora, you can easily install it like so:
su -c 'yum install dkms time'

When you install VirtualBox (see below), it will register the drivers with DKMS and on boot it will re-compile them for you, if it needs to. So, you just need to do it once and forget! Any updates to VirtualBox that are pulled in will also be automatically updated.

Building drivers on the host
Because Kororaa has all of the requirements for VirtualBox (including the package repository), all you need to do to get VirtualBox up and running is to install it using the package manager. If you prefer, you can install it manually like so (note the version is currently 4.1):
sudo yum install VirtualBox-4.1

Again, if you’re using vanilla Fedora, then you need to grab the VirtualBox repository file so that you can install VirtualBox from the Oracle repository (the packaged version from Fedora is usually a few versions behind).
su -c 'wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo'

Now you can install VirtualBox on Fedora:
su -c 'yum install VirtualBox-4.1'

You should see something like this during the install process:
No precompiled module for this kernel found -- trying to build one.
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMS [ OK ]
Starting VirtualBox kernel modules [ OK ]

As you can see, the modules were successfully compiled and registered with DKMS for future automatic compilation.

Group permissions
Just remember that any user who wants to run and use VirtualBox on the host needs to be in the vboxusers group. You can use the users graphical tool to do this (system-config-users), or add them to the group by running the command (substitute chris with your username):
sudo gpasswd -a chris vboxusers

Then just run VirtualBox and away you go!

Building drivers on the guest
Once you have your host up and your guest operating system installed, the way to install the required drivers is using the built in method. Once you have booted your guest operating system, simply click the Devices menu at the top, and click Install Guest Addons.

Install Guest Addons
This will load a CD in your guest and you can run the autorun.sh script from the disk, which will ask you for the root password and then detect your operating system and compile the drivers for you.

Run Guest Addons
Once again, if your guest is running Kororaa too, then you already have the required build tools and libraries. If not, you will need to install them first – how this is done depends on your distro (for Fedora, see above).

Remember, with DKMS you will automatically get updated drivers this way after a kernel update.

That’s it! Just reboot your guest and away you go.

Kororaa 15 (Squirt) Beta 2 released

The second beta release of Kororaa 15 (codename “Squirt”) has been released and is available for download, in 32 and 64 bit with KDE 4.6 and GNOME 3.

This release fixes the black screen issue that some users were reporting, as well as having the desktop theme customisations for KDE (as well as GNOME) correctly applied. The usual Kororaa goodies apply.

The GNOME 3 desktop has a custom theme applied, as well as several extensions to provide an enhanced user experience.
Kororaa 15 Beta desktop - GNOME

The KDE desktop has a custom layout with specific default applications, such as Firefox for the web and VLC for media.
Kororaa 15 Beta desktop - KDE

Derived from Fedora 151, this updated release comes with the usual Kororaa extras out of the box, such as:

  • Tweaked KDE 4.6 and GNOME 3 base systems
  • Third party repositories (Adobe, Chrome, RPMFusion, VirtualBox)
  • Firefox 5 as the default web browser (with integration tweaks for KDE)
  • Firefox extensions included (Adblock Plus, Flashblock, Xclear)
  • Microblogging client (Choqok for KDE, Gwibber for GNOME)
  • Full multimedia support (excluding Flash, see next)
  • Installer for Adobe Flash, AMD/ATI and NVIDIA video drivers
  • Video editor (Kdenlive for KDE, OpenShot for GNOME)
  • VLC as the default media player
  • KSplice, for rebootless kernel updates
  • SELinux enabled (particularly worthwhile for Flash)
  • English (Australian/British) support & dictionaries
  • and more..

Bug fixes:

  • Fixed the black screen issue
  • Applied custom desktop changes in KDE and 32bit GNOME

Known issues

  • Nothing reported yet..

We’d love to hear your feedback on the forums, so download it today and let us know! :-)

Thanks!

Note: Kororaa is not provided or supported by the Fedora Project. Official, unmodified Fedora software is available through the Fedora Project website.

Kororaa 15 beta – black screen test

After hours of testing on several machines, I was finally able to reproduce the “black screen issue” some users reported with the Kororaa 15 Beta Live image (only on one, my ThinkPad X201). I should mention, this was with a new build which will become Beta2. I almost gave up trying and it wasn’t until the very last boot (when I thought everything was good) that I stumbled across it. So, this could be a red-herring – to me it seems like a kernel issue which might just apply to my laptop.

Anyway, I seem to have narrowed it down to only occurring if I had rebooted my machine, as opposed to powering it off first. If I powered off the machine first before booting the Live image, then it worked perfectly. If I rebooted, it failed.

I would like someone else who had the problem to test this theory for me, to see whether it really is the case (it does not look X related to me). It’s a simple test, just power off your machine, then try the Live DVD/USB.

I will release a new image tomorrow to address some other issues, but I’m not convinced that this issue is completely solved. Of course it could be completely unrelated! :-)

Thanks!
-c

Kororaa 15 beta bug – X not starting

Some users have reported that X (graphical interface) doesn’t start when booting the Live DVD.

Symptoms:
The Live DVD boots to a black screen and the login manager doesn’t display.

Expected results:
The Live DVD boots to the login manager and then to the desktop.

Work around:
When the computer arrives as the black screen you can switch terminals, log in as root and start the appropriate login manager (whether GNOME or KDE).

GNOME:
Alt + F2
root
gdm

KDE:
Alt + F2
root
kdm

I have not yet been able to reproduce this error, so I’m not sure why it’s happening. If you have further information or make any discoveries, please let us know on the forums.

Sorry for the trouble!

Thanks,
Chris

Jindebah – my favourite coffee place

Every morning for the last four years my work colleagues and I have gone up the road for coffee. It’s not just any coffee mind you, it’s the best coffee at The Fresh Roast Coffee House in Mitchell (there’s also the Jindebah Cafe in Cowlishaw St, Tuggeranong).

This is where Quentin and his team import coffee beans from all around the world (plus some grown themselves) and roast them perfectly in-house, winning lots of awards in the process. They have more than fifty different types of coffee available.

Needless to say, I’ve built up a good relationship with Quentin over the years and (with the help of a friend) recently updated their website for them so that they can manage it themselves. Now that I’ve resigned from my position at the National Archives, I won’t be heading into The Fresh Roast Coffee House for my morning coffee, but I will continue to order beans for use with my coffee machine at home.

If you’re looking for the best, freshly roasted coffee in Canberra (they ship all around Australia, free in the ACT) make sure you check out Jindebah. Some of my favourite coffees are:

If you’re looking for a nice Mandehling, I quite like the Sumatran Kudu Mas.

If you’re a decaf person, I quite like the Colombian Excelso.

I’ll miss Quentin and everyone at Jindebah, so thanks for your friendly service over the years. You won’t get rid of me that easily, I’ll certainly be back from time to time to say hello (and down a beautiful cup of the best coffee in Canberra).

-c

Kororaa 15 (Squirt) Beta released

Update: There is a bug on some machines where X doesn’t start. See the blog entry for details and work around. Sorry about that, I’m working on a new Beta release.

The first beta release of Kororaa 15 (codename “Squirt”) has hit the mirrors, and is available for download, in 32 and 64 bit with KDE 4.6 and GNOME 3.

Kororaa 15 Beta desktop - GNOME

The GNOME 3 desktop has a custom theme applied, as well as several extensions to provide an enhanced user experience.

Updated to Fedora Remix 15, it comes with the usual Kororaa extras out of the box:

  • Tweaked KDE 4.6 and GNOME 3 base systems
  • Third party repositories (Adobe, Chrome, RPMFusion, VirtualBox)
  • Firefox as the default web browser (with integration tweaks for KDE)
  • Firefox extensions included (Adblock Plus, Flashblock, Xclear)
  • Microblogging client (Choqok for KDE, Gwibber for GNOME)
  • Full multimedia support (Flash installable)
  • Video editor (Kdenlive for KDE, OpenShot for GNOME)
  • VLC as the default media player
  • KSplice, for rebootless kernel updates
  • Installers for Adobe Flash, AMD/ATI and NVIDIA video drivers
  • SELinux enabled (particularly worthwhile for Flash)
  • English (Australian/British) support & dictionaries

New features:

  • Updated Fedora Remix 15
  • Customised GNOME 3

Known issues

  • KDE: The Kororaa changes to the desktop (like custom application menus) have not been applied, so it has the default layout. However, Firefox is still the default browser and VLC the default video player, etc.
  • GNOME: The 32bit version does not have the desktop changes applied, so it has the default theme and layout (64bit is correct). You can use the GNOME Tweak Tool to enable the file manager to control the desktop, and enable the custom desktop theme. Sorry about that!

We’d love to hear your feedback on the forums, so download it today and let us know! :-)

Thanks!