VirtualBox Guest additions in OpenSUSE 11.2

I don’t know if this will help anyone else, but I have OpenSUSE installed into a VirtualBox guest. Upgrading from 11.1 to Factory broke the VirtualBox guest additions (which was expected), but then trying to get the VirtualBox guest additions working again took some troubleshooting (which was not expected).

Here’s what I did to get the VirtualBox guest additions compiled and working in 11.2:

-Get to root in a shell (beyond the scope of this post…)

-Then make sure you have the kernel source and kernel-syms installed:

zypper in kernel-source kernel-syms

Then get over to /usr/src/linux and make sure the environment’s all setup (otherwise the VirtualBox test module won’t compile):


cd /usr/src/linux
make oldconfig && make prepare && make scripts && make dep

(don’t worry this isn’t compiling a real kernel… we just need the ‘stage set’ so to speak)

Then, copy the Module.symvers file from the linux-obj folder over to /usr/src/linux and ‘make prepare’ (this is something that the VirtualBox test explicitly looks for):

cp ../linux-obj/$HOSTTYPE/default/Module.symvers .
make prepare

(I used the $HOSTTYPE variable to automagically account for 32-bit or 64-bit systems)

After doing all this, you should be able to get the VirtualBox Additions to compile properly:

cd /media/VBOXADDITIONS_3.
./VBoxLinuxAdditions-x86.run

-or if you’re on a 64 bit arch:

./VBoxLinuxAdditions-amd64.run

You should get this if every goes well:

lnxvm:/media/VBOXADDITIONS_3. # ./VBoxLinuxAdditions-amd64.run                                   
Verifying archive integrity... All good.                                                                   
Uncompressing VirtualBox 3.0.6 Guest Additions for Linux installation................................................................................................................................................................................................................................         
VirtualBox 3.0.6 Guest Additions installation                                                                                                          
Attempt to remove old DKMS modules...                                                                                                                  
  removing module vboxadd version  3.0.6                                                                                                               
  removing module vboxvfs version  3.0.6                                                                                                               
  removing module vboxvideo version  3.0.6                                                                                                             
Done.                                                                                                                                                  
Building the VirtualBox Guest Additions kernel module...                                                                                               
Building the shared folder support kernel module...                                                                                                    
Building the drm support kernel module...                                                                                                              
Installing the VirtualBox Guest Additions...                                                                                                           

Successfully installed the VirtualBox Guest Additions.
You must restart your guest system in order to complete the installation.

(this was all tested on a 64 bit guest… your mileage may vary)

Oh here is the output from VirtualBox I was getting before I was able to get this resolved. Might help people who are Googling this problem:

VirtualBox 3.0.6 Guest Additions installation

Unable to insert a test module into your Linux kernel.  This may be because the kernel was built with a different version of GCC to the one which is currently installed, or because the kernel header files are incorrectly installed.

The command 'dmesg' may provide you with more information.                                                                                 
Building a test kernel module failed.  See the log file /var/log/vboxadd-install.log for more details.

Problems were found which would prevent the Guest Additions from installing.
                      
Please correct these problems and try again.

I notice you use the amd64.run installer…An openSUSE rpm is provided as well. AFAIK it resolves the dependencies, and installs fine.
From what I see, you marched into trouble by choosing the wrong install package. Then again you solved the trouble you met, and shared it here. Cheer for that :).

Haha thanks… yes now that I’m looking for it I see there’s a repo with a “VirtualBox guest tools” rpm it looks like

Index of /repositories/Virtualization:/VirtualBox/openSUSE_Factory

I based this writeup on all the Googling I did… everything I found (blogs, forums, etc) seemed to describe how to use the “.run” file, not simply saying “duh, just go install the rpm”

All fine up to her:

Never do things like that:

j.eng’s site - No cloneconfig needed!

P.S.

I am also running 11.2 (i586 and x86_64) under VirtualBox with guest additions and it worked for me without those unneeded (and non recommended) steps of “preparing the sources” (aka “messing them up for other, sane modules”) .

Thanks a lot ericgearhart! After lots of hours reading/searching documentation this thread finally helped me out. I have used your information also in another thread specifically for setting up a shared folder, I hope you don’t mind. Credit is given to your thread ofcourse :slight_smile:

Virtualbox Guest Additions: How to set a shared folder in OpenSUSE 11.2 guest - openSUSE Forums

Ok guys, Im having extreme difficulty with opensuse 11.2 and guest additions. Ive installed countless distros with guest additions and never once had this kind of trouble.

First I installed opensuse 11.2(KDE) from the netinstall cd.

After the installation the guest additions were already installed by default in the opensuse package manager. All seemed to be working fine except I got a warning message that says 3d acceleration isn’t working because the installed version of guest additions does not match my current version of virtualbox.

I figured ok this is an easy fix, so I loaded up the guset additions iso using vbox. I executed the .run as usual, and here is the output.

tj@linux-w60n:/media/CDROM> sudo ./VBoxLinuxAdditions-x86.run 

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:       

    #1) Respect the privacy of others.
    #2) Think before you type.        
    #3) With great power comes great responsibility.

root's password:
Verifying archive integrity... All good.
Uncompressing VirtualBox 3.1.4 Guest Additions for Linux.........
VirtualBox Guest Additions installer                             
You appear to have a version of the VBoxGuestAdditions software  
on your system which was installed from a different source or using a
different type of installer.  If you installed it from a package from your
Linux distribution or if it is a default part of the system then we strongly
recommend that you cancel this installation and remove it properly before   
installing this version.  If this is simply an older or a damaged           
installation you may safely proceed.  

So now I open up the package manager and removed everything virtualbox. (I choose taboo never install, just incase it tries to install again)

Then I tried the .run again

tj@linux-w60n:/media/CDROM> sudo ./VBoxLinuxAdditions-x86.run 
root's password:                                                
Verifying archive integrity... All good.                        
Uncompressing VirtualBox 3.1.4 Guest Additions for Linux.........
VirtualBox Guest Additions installer                             
tar: Record size = 8 blocks                                      
Building the VirtualBox Guest Additions kernel modules               failed
(Your system does not seem to be set up to build kernel modules.           
Look at /var/log/vboxadd-install.log to find out what went wrong)          
Installing the Window System drivers                                       
Installing X.Org Server 1.6 modules                                  done  
Setting up the Window System to use the Guest Additions              done  
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.                              

Installing graphics libraries and desktop services components        done
tj@linux-w60n:/media/CDROM>

I figured, ok I must be missing some build essentials. I started up the package manager again and installed linux-kernel-headers, kernel-source, kernel-syms, make, and gcc.

Tried again, and same result

tj@linux-w60n:/media/CDROM> sudo ./VBoxLinuxAdditions-x86.run
root's password:
Verifying archive integrity... All good.
Uncompressing VirtualBox 3.1.4 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version of VirtualBox Guest Additions...
tar: Record size = 8 blocks
Building the VirtualBox Guest Additions kernel modules               failed
(Your system does not seem to be set up to build kernel modules.
Look at /var/log/vboxadd-install.log to find out what went wrong)
Installing the Window System drivers
Installing X.Org Server 1.6 modules                                  done
Setting up the Window System to use the Guest Additions              done
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services components        done
tj@linux-w60n:/media/CDROM>

I checked /var/log/vbox-install.log this time

tj@linux-w60n:/var/log> cat vboxadd-install.log
Makefile:25: Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.                                                                               
grep: /usr/src/linux/include/linux/version.h: No such file or directory         
make KBUILD_VERBOSE=1 -C /usr/src/linux SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules                                                                         
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (           \
        echo;                                                           \       
        echo "  ERROR: Kernel configuration is invalid.";               \       
        echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";      \                                                               
        echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \                                                                       
        echo;                                                           \
        /bin/false)

  ERROR: Kernel configuration is invalid.
         include/linux/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*

  WARNING: Symbol version dump /usr/src/linux-2.6.31.12-0.1/Module.symvers
           is missing; modules will have no dependencies and modversions.

make -f scripts/Makefile.build obj=/tmp/vbox.0
/tmp/vbox.0/Makefile:25: Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.
grep: /usr/src/linux/include/linux/version.h: No such file or directory
  gcc -Wp,-MD,/tmp/vbox.0/.test.o.d  -nostdinc -isystem /usr/lib/gcc/i586-suse-linux/4.4/include -Iinclude  -I/usr/src/linux-2.6.31.12-0.1/arch/x86/include -include include/linux/autoconf.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-red-zone -mcmodel=kernel -maccumulate-outgoing-args -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fomit-frame-pointer -I/usr/src/linux/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 -DVBGL_VBOXGUEST -DVBGL_HGCM -DVBOX_WITH_HGCM  -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(test)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxadd_test)"  -c -o /tmp/vbox.0/test.o /tmp/vbox.0/test.c
/tmp/vbox.0/test.c:1: error: code model 'kernel' not supported in the 32 bit mode
/tmp/vbox.0/test.c:1: sorry, unimplemented: 64-bit mode not compiled in
make[2]: *** [/tmp/vbox.0/test.o] Error 1
make[1]: *** [_module_/tmp/vbox.0] Error 2
make: *** [vboxadd_test] Error 2
tj@linux-w60n:/var/log>

Thats when I found this thread. Now the only problem is Akoellh’s post scared me. Is this correct that I should not do as said in the first post, or is Akoellh wrong? All I know is that the packages in the repos are not the correct version, and the kernel modules are not building correctly. Please can somebody point me in the right direction here before I bork my install.

I had the same result, and followed the steps above (at least up to “make oldconfig && make prepare && makescripts && make dep”)

This produced an error message, but then the Guest Additions installation suceeded.

Hi,

VirtualBox 3.1.6 with openSUSE 11.2 loaded.

When I tried to add the Guest Additions I got this far

$ ./VBoxLinuxAdditions-amd64.run
.
.
.
Doing non-kernel setup of the Guest Additions done
Starting the VirtualBox Guest Additions failed
(modprobe vboxguest failed)
.
.
.

The end of /var/log/vboxadd-install.log looked fine (showed no error).

At the end of /var/log/messages though I find this which I think is probably significant:

Mar 29 0:29:20 linux-hqoq kernel 508.449047] vboxguest: disagrees about version of symbol module-layout

pat

for i in $(find /lib/modules/$(uname -r) -iname "*vbox*") ; \
do  echo $i ; rpm -qf $i ; /sbin/modinfo $i ; done

thanx - interesting output.

But I got the Guest Additions to build (and work) already by deleting the VM and starting over.

I’m not really sure what did the trick, but I’d guess it was leaving out the

cp ../linux-obj/$HOSTTYPE/default/Module.symvers .
make prepare

part

hi everyone,

first of all i needd point out that i am quite new to linux environment. I recently installed openSuse 11.2 using virtual box to my host win7 system. I tried to use files from host system and after a brief research i figured that i needed to install guess addition. but here is the problem, i couldn’t install it properly. I followed several walkthroughs about it but after all the error is the same: " Building the VirtualBox Guest Addition kernel modules Failed (Your system does not seem to be set up to build kernel modules)"

any suggestions will be appreciated…