Posted Tuesday, 17 November 2009 at 18:21 by Andrew Liu
Tagged: linux | fedora | virtualisation
Read more blogs...
At time of writing, VirtualBox 2.1.4 is out, and this is the version I will install on my Fedora 10 box. You can go to the download sections of VirtualBox at this url . Many thanks to this post by Derek Hildreth for inspiration. My walkthrough here follows Derek's closely, but with a few more bugs and tweaks that I encountered that I had to work around.
I used the Fedora 9 ("Sulphur") / 10 ("Cambridge") option (i386). Make sure you go the the above url, copy the right version, and use the given url (the url's may change from time to time).
$ wget http://download.virtualbox.org/virtualbox/2.1.4/VirtualBox-2.1.4_42893_fedora9-1.i386.rpm ... 100%[======================================>] 34,508,694 404K/s in 85s
You will also need some kernel development packages. Depending on what is already on your system, the below output may differ to my output.
$ yum install make automake autoconf gcc kernel-devel dkms Loaded plugins: refresh-packagekit fedora | 2.8 kB 00:00 updates | 2.3 kB 00:00 updates/primary_db | 2.9 MB 00:04 Setting up Install Process Parsing package install arguments Package 1:make-3.81-14.fc10.i386 already installed and latest version Package automake-1.10.1-2.noarch already installed and latest version Package autoconf-2.63-1.fc10.noarch already installed and latest version Package gcc-4.3.2-7.i386 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package dkms.noarch 0:2.0.19.1-1.fc10 set to be updated ---> Package kernel-devel.i686 0:2.6.27.19-170.2.35.fc10 set to be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: dkms noarch 2.0.19.1-1.fc10 fedora 90 k kernel-devel i686 2.6.27.19-170.2.35.fc10 updates 5.5 M Transaction Summary ================================================================================ Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 5.6 M Is this ok [y/N]: y Downloading Packages: (1/2): dkms-2.0.19.1-1.fc10.noarch.rpm | 90 kB 00:00 (2/2): kernel-devel-2.6.27.19-170.2.35.fc10.i686.rpm | 5.5 MB 00:08 -------------------------------------------------------------------------------- Total 653 kB/s | 5.6 MB 00:08 ============================== Entering rpm code =============================== Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : kernel-devel 1/2 Installing : dkms 2/2 =============================== Leaving rpm code =============================== Installed: dkms.noarch 0:2.0.19.1-1.fc10 kernel-devel.i686 0:2.6.27.19-170.2.35.fc10 Complete!
I also needed the qt packages too.
$ yum install qt qt-x11 Loaded plugins: refresh-packagekit Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package qt-x11.i386 1:4.4.3-15.fc10 set to be updated ---> Package qt.i386 1:4.4.3-15.fc10 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: qt i386 1:4.4.3-15.fc10 updates 3.5 M qt-x11 i386 1:4.4.3-15.fc10 updates 13 M Transaction Summary ================================================================================ Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 16 M Is this ok [y/N]: y Downloading Packages: (1/2): qt-4.4.3-15.fc10.i386.rpm | 3.5 MB 00:06 (2/2): qt-x11-4.4.3-15.fc10.i386.rpm | 13 MB 00:18 -------------------------------------------------------------------------------- Total 651 kB/s | 16 MB 00:25 ============================== Entering rpm code =============================== Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : qt 1/2 Installing : qt-x11 2/2 =============================== Leaving rpm code =============================== Installed: qt.i386 1:4.4.3-15.fc10 qt-x11.i386 1:4.4.3-15.fc10 Complete!
Unfortunately, the above failed, and after some investigation, I found an invalid symbolic link at "/lib/modules/2.6.27.12-170.2.5.fc10.i686/build". This had to be fixed up (using some common sense).
$ ls -al /lib/modules/2.6.27.12-170.2.5.fc10.i686/ total 3040 drwxr-xr-x 7 root root 4096 2009-02-06 05:27 . drwxr-xr-x 5 root root 4096 2009-03-25 14:05 .. lrwxrwxrwx 1 root root 52 2009-02-06 05:27 build -> ../../../usr/src/kernels/2.6.27.12-170.2.5.fc10.i686 drwxr-xr-x 2 root root 4096 2009-01-21 18:21 extra drwxr-xr-x 9 root root 4096 2009-02-06 05:27 kernel -rw-r--r-- 1 root root 433925 2009-02-06 05:27 modules.alias -rw-r--r-- 1 root root 375886 2009-02-06 05:27 modules.alias.bin -rw-r--r-- 1 root root 1571 2009-01-21 18:21 modules.block -rw-r--r-- 1 root root 69 2009-02-06 05:27 modules.ccwmap -rw-r--r-- 1 root root 368434 2009-02-06 05:27 modules.dep -rw-r--r-- 1 root root 466977 2009-02-06 05:27 modules.dep.bin -rw-r--r-- 1 root root 147 2009-02-06 05:27 modules.ieee1394map -rw-r--r-- 1 root root 375 2009-02-06 05:27 modules.inputmap -rw-r--r-- 1 root root 13391 2009-02-06 05:27 modules.isapnpmap -rw-r--r-- 1 root root 10 2009-01-21 18:21 modules.modesetting -rw-r--r-- 1 root root 1697 2009-01-21 18:21 modules.networking -rw-r--r-- 1 root root 74 2009-02-06 05:27 modules.ofmap -rw-r--r-- 1 root root 65894 2009-01-21 18:21 modules.order -rw-r--r-- 1 root root 289843 2009-02-06 05:27 modules.pcimap -rw-r--r-- 1 root root 1135 2009-02-06 05:27 modules.seriomap -rw-r--r-- 1 root root 144619 2009-02-06 05:27 modules.symbols -rw-r--r-- 1 root root 192499 2009-02-06 05:27 modules.symbols.bin -rw-r--r-- 1 root root 643463 2009-02-06 05:27 modules.usbmap lrwxrwxrwx 1 root root 5 2009-02-06 05:27 source -> build drwxr-xr-x 2 root root 4096 2009-01-21 18:21 updates drwxr-xr-x 2 root root 4096 2009-02-06 05:27 vdso drwxr-xr-x 2 root root 4096 2009-01-21 18:21 weak-updates $ cd /lib/modules/2.6.27.12-170.2.5.fc10.i686/ $ rm build rm: remove symbolic link `build'? y $ ln -s /usr/src/kernels/2.6.27.19-170.2.35.fc10.i686 build $ ls -al total 3040 drwxr-xr-x 7 root root 4096 2009-03-25 14:15 . drwxr-xr-x 5 root root 4096 2009-03-25 14:05 .. lrwxrwxrwx 1 root root 45 2009-03-25 14:15 build -> /usr/src/kernels/2.6.27.19-170.2.35.fc10.i686 drwxr-xr-x 2 root root 4096 2009-01-21 18:21 extra drwxr-xr-x 9 root root 4096 2009-02-06 05:27 kernel -rw-r--r-- 1 root root 433925 2009-02-06 05:27 modules.alias -rw-r--r-- 1 root root 375886 2009-02-06 05:27 modules.alias.bin -rw-r--r-- 1 root root 1571 2009-01-21 18:21 modules.block -rw-r--r-- 1 root root 69 2009-02-06 05:27 modules.ccwmap -rw-r--r-- 1 root root 368434 2009-02-06 05:27 modules.dep -rw-r--r-- 1 root root 466977 2009-02-06 05:27 modules.dep.bin -rw-r--r-- 1 root root 147 2009-02-06 05:27 modules.ieee1394map -rw-r--r-- 1 root root 375 2009-02-06 05:27 modules.inputmap -rw-r--r-- 1 root root 13391 2009-02-06 05:27 modules.isapnpmap -rw-r--r-- 1 root root 10 2009-01-21 18:21 modules.modesetting -rw-r--r-- 1 root root 1697 2009-01-21 18:21 modules.networking -rw-r--r-- 1 root root 74 2009-02-06 05:27 modules.ofmap -rw-r--r-- 1 root root 65894 2009-01-21 18:21 modules.order -rw-r--r-- 1 root root 289843 2009-02-06 05:27 modules.pcimap -rw-r--r-- 1 root root 1135 2009-02-06 05:27 modules.seriomap -rw-r--r-- 1 root root 144619 2009-02-06 05:27 modules.symbols -rw-r--r-- 1 root root 192499 2009-02-06 05:27 modules.symbols.bin -rw-r--r-- 1 root root 643463 2009-02-06 05:27 modules.usbmap lrwxrwxrwx 1 root root 5 2009-02-06 05:27 source -> build drwxr-xr-x 2 root root 4096 2009-01-21 18:21 updates drwxr-xr-x 2 root root 4096 2009-02-06 05:27 vdso drwxr-xr-x 2 root root 4096 2009-01-21 18:21 weak-updates
Finally, install the RPM. As before, your RPM filename may differ than that I have below. ** WARNING ** - the below command takes a while to run. The following output will result if your system cannot locate the kernel development source (see the relinking of the invalid symbolic link above - you may have a similar problem.
$ rpm --install VirtualBox-2.1.4_42893_fedora9-1.i386.rpm Creating group 'vboxusers'. VM users must be member of that group! No precompiled module for this kernel found -- trying to build one. Messages emitted during module compilation will be logged to /var/log/vbox-install.log. Compilation of the kernel module FAILED! VirtualBox will not start until this problem is fixed. Please consult /var/log/vbox-install.log to find out why the kernel module does not compile. Most probably the kernel sources are not found. Install them and execute /etc/init.d/vboxdrv setup as root.
If the development sources are in place, you should get the following output.
$ rpm --install VirtualBox-2.1.4_42893_fedora9-1.i386.rpm Creating group 'vboxusers'. VM users must be member of that group! No precompiled module for this kernel found -- trying to build one. Messages emitted during module compilation will be logged to /var/log/vbox-install.log. Success!
Ok, once here, we need to setup the VirtualBox drivers.
$ /etc/init.d/vboxdrv setup Stopping VirtualBox kernel module [ OK ] Recompiling VirtualBox kernel module [ OK ] Starting VirtualBox kernel module [ OK ]
Which all points to a good installation. Now we need to add someone (yourself) to the 'vboxusers' group. Remember to turn off SELinux if you have this installed (my preference is just to turn it off as it tends to do more harm than good in my opinion).
$ usermod -G vboxusers -a aliu
Now run VirtualBox!
$ VirtualBox
1 - create a new group called “usb”;
2 - locate file usbfs: in my case is /sys/bus/usb/drivers (I suggest to find the file with a usb device inserted);
3 - modify file /etc/fstab inserting a line containing the right path and the number corresponding the “usb” group :
none /sys/bus/usb/drivers usbfs devgid=503,devmode=664 0 0
4 - command mount -a;
5 - start VB and try…;
Now this seems pretty normal in hindsight, but this got me stumped, and I spent a day scratching my head before it occurred to me. Basically, because I installed Fedora 10 at some stage (obviously), and at some later point I installed the kernel-headers, Fedora had already released new kernel-header packages. So I had the following versions installed at some point in time:
$ rpm -qa | grep kern kerneloops-0.12-1.fc10.i386 kernel-2.6.27.5-117.fc10.i686 kernel-devel-2.6.27.19-170.2.35.fc10.i686 kernel-headers-2.6.27.12-170.2.5.fc10.i386 kernel-2.6.27.12-170.2.5.fc10.i686 kernel-firmware-2.6.27.12-170.2.5.fc10.noarch
Notice the different versions for 'kernel-headers' when compared to 'kernel-devel'? Well, when installing VirtualBox, that naturally takes the headers to compile the necessary drivers. Then when it tries to install.... it all falls apart....
$ /etc/init.d/vboxdrv restart Stopping VirtualBox kernel module [ OK ] Starting VirtualBox kernel module [FAILED] (modprobe vboxdrv failed. Please use 'dmesg' to find out why)
And of course, you get an interesting message when running 'dmesg'.
$ dmesg ... intel_rng: FWH not detected vboxdrv: version magic '2.6.27.19-170.2.35.fc10.i686 SMP mod_unload 686 4KSTACKS ' should be '2.6.27.12-170.2.5.fc10.i686 SMP mod_unload 686 4KSTACKS ' vboxdrv: version magic '2.6.27.19-170.2.35.fc10.i686 SMP mod_unload 686 4KSTACKS ' should be '2.6.27.12-170.2.5.fc10.i686 SMP mod_unload 686 4KSTACKS '
The numbers differ oh so slightly, but enough for the compilation to complain and fail. You need to update (or downgrade) the kernel-headers (or vice versa). After complications trying to downgrade, I just ended up upgrading what was required (which was the kernel).
$ yum update kernel
This sounds nasty, but ended up being fairly painless. Strangely enough, when I look at the kernel packages, there are multiples in place.
$ rpm -qa | grep kern kernel-devel-2.6.27.19-170.2.35.fc10.i686 kerneloops-0.12-1.fc10.i386 kernel-2.6.27.5-117.fc10.i686 kernel-firmware-2.6.27.19-170.2.35.fc10.noarch kernel-2.6.27.12-170.2.5.fc10.i686 kernel-2.6.27.19-170.2.35.fc10.i686
I think this is normal.... I'm not a kernel hacking expert by any means though. I did have to reboot the server though (more as a safety precaution than anything else). When it all came back online, the vboxdrv setup command worked!
Good Luck!
Posted Thursday, 18 March 2010 at 20:51 by Andrew Liu
Posted Monday, 08 March 2010
Updated Tuesday, 09 March 2010 at 02:09 by Andrew Liu
Posted Friday, 05 March 2010 at 23:13 by Andrew Liu
Posted Thursday, 04 March 2010 at 04:34 by Andrew Liu
Posted Wednesday, 03 March 2010 at 20:15 by Andrew Liu