Trouble setting up vbox VM with 4.12 kernel

The back story: I’m setting up a new laptop for evaluation. Unfortunately the hardware is very new (Kabylake, UHD, etc), and I was unable to get it usable on the default kernel (4.4). Tried 4.8, 4.10, 4.11 with limited success, but it works right out of the box with 4.12.

My problem: The last remaining issue is getting Win 10 running in a Virtualbox VM (This is a must. Dual boot or KVM isn’t an option). When I try to start loading Win 10 I get an error message indicating the need to run vboxconfig. Here’s what I’ve got so far.

linux-d3-360:~ # vboxconfig
Installing all required packages...
Building kernel modules...


Build of VirtualBox host kernel modules failed.
Look at /var/log/virtualbox.log to find reasons.
linux-d3-360:~ # 

virtualbox.log shows

=== Building ‘vboxdrv’ module ===
make[1]: Entering directory ‘/usr/src/kernel-modules/virtualbox/src/vboxdrv’
make KBUILD_VERBOSE= SUBDIRS=/usr/src/kernel-modules/virtualbox/src/vboxdrv SRCROOT=/usr/src/kernel-modules/virtualbox/src/vboxdrv CONFIG_MODULE_SIG= -C /lib/modules/4.12.4-1.g2a27bf2-default/build -j4 modules
make[2]: Entering directory ‘/usr/src/linux-4.12.4-1.g2a27bf2-obj/x86_64/default’
make[3]: Entering directory ‘/usr/src/linux-4.12.4-1.g2a27bf2-obj/x86_64/default’
make[3]: *** …/…/…/linux-4.12.4-1.g2a27bf2: No such file or directory. Stop.
make[3]: Leaving directory ‘/usr/src/linux-4.12.4-1.g2a27bf2-obj/x86_64/default’
Makefile:24: recipe for target ‘__sub-make’ failed
make[2]: *** [__sub-make] Error 2
make[2]: Leaving directory ‘/usr/src/linux-4.12.4-1.g2a27bf2-obj/x86_64/default’
Makefile:305: recipe for target ‘vboxdrv’ failed
make[1]: *** [vboxdrv] Error 2
make[1]: Leaving directory ‘/usr/src/kernel-modules/virtualbox/src/vboxdrv’
Makefile:40: recipe for target ‘all’ failed
make: *** [all] Error 2

To my inexpert eye it looks like I"m missing a directory, but…


linux-d3-360:~ # ls /usr/src/linux-4.12.4-1.g2a27bf2-obj/x86_64/default/
.config  .kernel-binary.spec.buildenv  Makefile  Module.supported  Module.symvers  arch  include  scripts  tools
linux-d3-360:~ # 

What am I missing and/or doing wrong?

Post:

zypper se -si virtualbox vbox kernel

You should also post whether you installed Virtualbox by downloading the install from the Oracle website or if you installed from the openSUSE repositories. If you installed from the openSUSE repos, you shouldn’t need to build any modules, a pre-compiled kernel should be provided to you with all that’s necessary.

As for building kernel modules, you need

  • The kernel-devel package for your kernel. Technically, it should be the exact package for your kernel but I’ve been successful in the past with only the generic package by running the following in an elevated console
zypper in kernel-devel
  • You need to install the usual C build tools… the following are most important
zypper in gcc make

TSU

Thanks for that tip. The virtualbox-host-kmp-default version was incorrect. It was still the holdover from the 42.3 default kernel (4.4.x)

Problem solved.

Here’s the corrected result

Reading installed packages...

S  | Name                        | Type    | Version                       | Arch   | Repository           
---+-----------------------------+---------+-------------------------------+--------+---------------------
i+ | kernel-default              | package | 4.12.4-1.1.g2a27bf2           | x86_64 | Downloads            
i+ | kernel-default              | package | 4.9.39-2.1                    | x86_64 | Downloads            
i+ | kernel-default              | package | 4.4.76-1.1                    | x86_64 | openSUSE-Leap-42.3-0
i+ | kernel-default-devel        | package | 4.12.4-1.1.g2a27bf2           | x86_64 | Downloads            
i  | kernel-firmware             | package | 20170530-9.1                  | noarch | openSUSE-Leap-42.3-0
i  | nfs-kernel-server           | package | 1.3.0-28.1                    | x86_64 | openSUSE-Leap-42.3-0
i+ | virtualbox                  | package | 5.1.26-318.1                  | x86_64 | Virtualization       
i+ | virtualbox-host-kmp-default | package | 5.1.26_k**4.12.4_1.g2a27bf2-****2.1** | x86_64 | Downloads            
i+ | virtualbox-host-source      | package | 5.1.26-318.1                  | noarch | Virtualization       
i  | virtualbox-qt               | package | 5.1.26-318.1                  | x86_64 | Virtualization     

I should have included that info. Installed from the openSUSE repos. I stopped downloading from Oracle a long time ago. It’s just easier from the repos, and I can’t tell the difference in my usage.

Usually updating your system resolves these kinds of kernel inconsistencies.
In fact, updating your system should be a SOP before major system changes like installing Virtualbox, and only rarely afterwards

Just run the following in an elevated console.

zypper up

TSU

i+ | virtualbox                  | package | 5.1.26-318.1                  | x86_64 | Virtualization       
i+ | virtualbox-host-kmp-default | package | 5.1.26_k4.12.4_1.g2a27bf2-2.1 | x86_64 | Downloads            
i+ | virtualbox-host-source      | package | 5.1.26-318.1                  | noarch | Virtualization       
i  | virtualbox-qt               | package | 5.1.26-318.1                  | x86_64 | Virtualization

I would delete the Leap42.3 -Virtualization Repo and enable the Kernel:stable:kmp Repo:

http://download.opensuse.org/repositories/Kernel:/stable:/KMP/standard/

Actually I had run both zypper patch and zypper up just before installing Vbox, however there must have been a mixup. No biggie, I got it working now.

Thank you for your response.

Good point, Thanx

If you prefer the Virtualbox app from the Virtualization repo, don’t remove the repo.
The repo is probably providing more than just the Virtualbox modified kernel.

TSU

In both are the same Versions of Virtualbox-Packages.
But in the Virtualization Repo are also other Packages than Virtualbox.

And in the kernel:stable:kmp Repo are also some Packages build against the running kernel:stable such as bbswitch.

Read this with interest because of wrestling with vbox issues in both Tumbleweed and Leap 42.3, I’ve got the same kind of mismatch as caprus

Output of zypper se -si virtualbox vbox kernel:


S  | Name                           | Type    | Version               | Arch   | Repository                
---+--------------------------------+---------+-----------------------+--------+--------------------------
i+ | devel_kernel                   | pattern | 20170518-6.1          | x86_64 | openSUSE-Leap-42.3-Oss    
i+ | kernel-default                 | package | 4.4.79-19.1           | x86_64 | openSUSE-Leap-42.3-Update
i+ | kernel-default                 | package | 4.4.76-1.1            | x86_64 | openSUSE-Leap-42.3-Oss    
i  | kernel-default-devel           | package | 4.4.79-19.1           | x86_64 | openSUSE-Leap-42.3-Update
i  | kernel-default-devel           | package | 4.4.76-1.1            | x86_64 | openSUSE-Leap-42.3-Oss    
i  | kernel-devel                   | package | 4.4.79-19.1           | noarch | openSUSE-Leap-42.3-Update
i  | kernel-devel                   | package | 4.4.76-1.1            | noarch | openSUSE-Leap-42.3-Oss    
i  | kernel-firmware                | package | 20170530-9.1          | noarch | openSUSE-Leap-42.3-Oss    
i  | kernel-macros                  | package | 4.4.79-19.1           | noarch | openSUSE-Leap-42.3-Update
i  | kernel-source                  | package | 4.4.79-19.1           | noarch | openSUSE-Leap-42.3-Update
i  | kernel-source                  | package | 4.4.76-1.1            | noarch | openSUSE-Leap-42.3-Oss    
i  | kernel-syms                    | package | 4.4.79-19.1           | x86_64 | openSUSE-Leap-42.3-Update
i  | kernel-syms                    | package | 4.4.76-1.1            | x86_64 | openSUSE-Leap-42.3-Oss    
i+ | patterns-openSUSE-devel_kernel | package | 20170518-6.1          | x86_64 | openSUSE-Leap-42.3-Oss    
i+ | virtualbox                     | package | 5.1.26-25.1           | x86_64 | openSUSE-Leap-42.3-Update
i  | virtualbox-host-kmp-default    | package | 5.1.26_k**4.4.76_1-****25.1** | x86_64 | openSUSE-Leap-42.3-Update
i+ | virtualbox-host-source         | package | 5.1.26-25.1           | noarch | openSUSE-Leap-42.3-Update
i  | virtualbox-qt                  | package | 5.1.26-25.1           | x86_64 | openSUSE-Leap-42.3-Update

I’m running virtulabox installed from the leap updates repo btw

So I can see that the kernel-default version is a newer version than the virtualbox-host-kmp-default package, what I don’t know is where to get the correct version of virtualbox-host-kmp-default

If that’s even the best way to go about fixing this

Be much appreciated if anyone’s able to point me in the right direction

That last post of mine asking for help on the version mismatch was a bit hasty sorry

Added the virtualizion repo and switched virtualbox and it’s related packages to the ones from there and now everything matches

Although I still have no sound … ‘Sigh’

Stuff like sound are usually related to Guest Tools/Additions.
So, if you create an openSUSE Guest, those should be installed automatically and there shouldn’t be a problem.

If you create any other distro or a Windows Guest,
Then you’ll probably have to install drivers manually.

TSU

Thanks for the info there tsu2

I have virtualbox-guest-kmp-default, virtualbox-guest-tools and virtualbox-guest-X11 installed in the Leap 42.3 vm, and I also installed the Extension Pack from the Virtualbox website in a bid to get usb and sound support working (vbox was asking for it)

I’m using vbox from the Virtualization repo because I couldn’t get the vbox guest additions to install in any opensuse vm using the virtualbox rpm from their website, though I’m going to try their rpm again as I’ve discovered a possible cause for the guest additions failure with their rpm, on my system etc/init.d/vboxdrv did not get installed so I added a symlink in /etc/initit.d pointing to /usr/lib/virtualbox/vboxdrv.sh

Plan on seeing if that solves the problem after work tonight