Tag Archive for 'install'

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.

Fedora minimal install

To get a basic, command line only, base packages install of Fedora, simply add “text” to the installer’s kernel line at boot.

This will then install around 200 base packages and give a small, clean, lean system. From here you can install whatever package or group you like to built it up to something you want.

See here for more options for Anaconda, the Fedora installer.

Update: Alternatively, select “Customize now” during the standard installation process and un-tick everything (yes, ALL package groups even the Base group!). This will then also install the same 200 base packages for a minimal system, but has the added benefit of providing the graphical installer. Use the netinstaller to reduce your initial download.

Groups are yum

Just discovered how I can install grouped packages in Fedora using Yum.

First, you can list the groups which are available in your repositories with:
yum grouplist

This will contact the online repositories to retrieve the lists and dump it to your terminal.

I wanted to install KDE 4.3.x (yes, Fedora has updated to the latest version from 4.2.x, which was impressive) so to do this I ran:
yum grouplist |grep -i kde

This returned two results, the desktop itself and a development group for KDE. Naturally I want the first one, so I then installed KDE via:
yum groupinstall "KDE (K Desktop Environment)"

It’s quite a nice easy way to install groups of packages, rather than figuring them all out individually.

I’m sure this will create some issues but presumably I can remove the group with:
yum groupremove "KDE (K Desktop Environment)"

Indeed, running this wants to remove only 65 of the just installed 127 packages.. d’oh.

Running the same command with –remove-leaves now wants to remove 143 packages. I still don’t get removing packages with Yum. Nevertheless, group install is handy.

Linux on an Apple Xserve EFI only machine

We have a few of these Apple Xserve machines at work which weren’t doing much, so I thought I’d make better use of them. Naturally, this meant installing Linux on them.

These machines do not have a BIOS (or even any emulation), they use EFI and as such won’t boot the standard Linux install media. I knew that Fedora could boot EFI, so that’s where I started, with Leonidas (version 11). Unfortunately, the install media just wouldn’t work on this device, presumably as it has no BIOS emulation.

To cut a long story short, I had to learn how EFI works in order to get it booting and it wasn’t an easy thing to discover!

Continue reading ‘Linux on an Apple Xserve EFI only machine’

Flash Fedora

I really really wish YouTube would switch to Theora so that I don’t have to install flash.. maybe one day when Google realises how much they’ll be paying in H.264 royalties.

Anyway, dream on.

So to get Flash working in Fedora it doesn’t work out of the box. Also, if you visit a flash site it tells you to download it manually and that ends up in a whole lot of pain.

I ended up downloading the 64bit version 10 alpha and installing it manually. Flash now works, but the install method is disappointing.

Edit: There’s a better way described in the Fedora Wiki

-c

Fedora – removing unwanted deps?

OK, so I have Fedora running on my main machine (the default GNOME install), more on that later. First I need to understand some basic principles of Yum.

I have Firefox and everything is dandy. I wanted to watch a YouTube clip so I installed gnash-plugin.

Then I wanted to remove it because it wasn’t performing particularly well, but I want to also remove dependencies it has pulled in, leaving my system in the same pristine state it was in before I installed it.

So how do you do this?

I installed the package gnash-plugin with the command:
sudo yum install gnash-plugin

This pulled down three dependencies: agg, boost and gnash itself.

What’s the correct way to remove gnash-plugin and all the dependencies?

If I run:
sudo yum remove gnash-plugin
Then it wants to only remove the gnash-plugin package itself, leaving all the dependencies. Fair enough.

If I run:
sudo yum remove gnash
Then it only wants to remove the gnash-plugin dependency and leaves the rest. Also probably fair enough.

If I run:
sudo yum remove --remove-leaves gnash-plugin
Then it wants to remove all the dependencies plus some others which were not brought in by gnash-plugin like Firefox.

I don’t want to remove Firefox!

Help?

-c