Sunday, 6 June 2010

VirtualBox PUEL on OpenSUSE on 64 bit machine

It took me a while to solve this problem, therefore here is the solution for everyone...

I installed the PUEL version of VirtualBox from the virtualbox.org website, the version for personal use and evaluation.
There is the OSE version included in OpenSUSE, but that does not support USB connections.

Now for the PUEL version, you need to build the kernel module for VirtualBox.
You might need to install gcc and make, and also the kernel sources.
I will come to the details of the kernel sources later.

When I ran /etc/init.d/vboxdrv setup, I got the error in /var/log/vbox-install.log:
make -f /usr/src/linux-2.6.31.12-0.2/scripts/Makefile.modpost
scripts/mod/modpost -m -a -i /usr/src/linux-2.6.31.12-0.2-obj/i386/desktop/Module.symvers -I /tmp/vbox.3/Module.symvers -o /tmp/vbox.3/Module.symvers -S -K /usr/src/linux-2.6.31.12-0.2-obj/i386/desktop/Module.markers -M /tmp/vbox.3/Module.markers -w -c -s
FATAL: /tmp/vbox.3/vboxdrv.o has no symtab?
I looked for symtab on the Internet, and found that it has to do with conflicts in the architecture.

It took me a while to have a look at the versions of kernel packages I had installed:
rpm -qa | grep kernel
This showed for my system, that the package for kernel-syms was not for x86_64, but for 586. This caused the error with symtab.

Solution (please check the result of rpm above to know which exact version of the kernel you are using):
zypper install kernel-syms-2.6.31.12-0.2.1.x86_64
As an example, here is what rpm -qa | grep kernel shows after I installed the correct packages:
kernel-xen-devel-2.6.31.12-0.2.1.x86_64
kernel-syms-2.6.31.12-0.2.1.x86_64
kernel-desktop-2.6.31.12-0.2.1.x86_64
kernel-debug-devel-2.6.31.12-0.2.1.x86_64
kernel-desktop-devel-2.6.31.12-0.2.1.x86_64
linux-kernel-headers-2.6.31-3.4.noarch
kernel-default-devel-2.6.31.12-0.2.1.x86_64
kernel-source-2.6.31.12-0.2.1.noarch
Then building the kernel module for VirtualBox worked.