Can't install guest

Hello again
I recently installed Virtualbox . But I cant install a guest os . The boot log states

[FAILED] Failed to start LSB: VirtualBox Linux Additions kernel modules.

the vbox log

[Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
Makefile:186: 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.
make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG= -C /usr/src/linux modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        \
echo >&2;                            \
echo >&2 "  ERROR: Kernel configuration is invalid.";        \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";    \
echo >&2 ;                            \
/bin/false)

  ERROR: Kernel configuration is invalid.
         include/generated/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 ./Module.symvers
           is missing; modules will have no dependencies and modversions.

make -f scripts/Makefile.build obj=/tmp/vbox.0
/tmp/vbox.0/Makefile:186: 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.
  gcc -Wp,-MD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.8/include -I./arch/x86/include -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -m64 -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fno-delete-null-pointer-checks -O2 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -I/usr/src/linux/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxdrv/ -I/tmp/vbox.0/vboxdrv/include -I/tmp/vbox.0/vboxdrv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -Wno-declaration-after-statement -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(SUPDrv_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxdrv)" -c -o /tmp/vbox.0/linux/SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c
In file included from <command-line>:0:0:
././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
 #include <generated/autoconf.h>
                                ^
compilation terminated.
scripts/Makefile.build:273: recipe for target '/tmp/vbox.0/linux/SUPDrv-linux.o' failed
make[2]: *** [/tmp/vbox.0/linux/SUPDrv-linux.o] Error 1
Makefile:1359: recipe for target '_module_/tmp/vbox.0' failed
make[1]: *** [_module_/tmp/vbox.0] Error 2
Makefile:289: recipe for target 'vboxdrv' failed
make: *** [vboxdrv] Error 2
/usr/sbin/rcvboxdrv: line 335: /usr/share/virtualbox/src/vboxhost/build_in_tmp: No such file or directory

and “zypper se dkms” is not installed.

It seems to me I have to recompile the kernel after I install dkms. Is that right?
Is there a beginners way of recompiling the kernel

Thank you, for your help, always appreciated.

How exactly?

But I cant install a guest os .

What error do you get when you try to install it?
How do you try to install it?
And what kind of guest?

The boot log states

[FAILED] Failed to start LSB: VirtualBox Linux Additions kernel modules.

On the host or the guest?
On the host this is normal. The guest additions are supposed to run in a (Linux) guest only.

the vbox log

So you cannot even run VirtualBox itself yet?
You need the kernel development packages installed to be able to compile the kernel module.
Enter YaST->Software Management, click on View, select “Patterns” and install the “Kernel development” pattern.

Why don’t you just install the virtualbox packages included in openSUSE though?
No need to compile a kernel module in that case.
But you should remove the VirtualBox from Oracle first, which you seemed to have installed.

and “zypper se dkms” is not installed.

Why should “zypper se dkms” be installed, that’s a command to search for the package “dkms” in the configured repos, not a package… rotfl!

Joke aside, dkms is available from Packman.
But as mentioned, you could just as well install the openSUSE virtualbox packages instead.

It seems to me I have to recompile the kernel after I install dkms. Is that right?

No.

OK
There a re a few questions i don’t have the answers too, I cannot remember exactly how i installed it but i added the vbox repo and installed these
“make automake autoconf gcc kernel-syms kernel-source”
The guest was going to be CentOS
I thought I asked a question on the installation here a mounth ago, can’t find it now.
Perhaps I should start again?
Could you advise on the proper method please?

You don’t have an answer to the question whether you can start VirtualBox or not? :wink:

I cannot remember exactly how i installed it but i added the vbox repo

Which “vbox repo”?
The one from virtualbox.org?

Obviously, otherwise you wouldn’t have to (and actually couldn’t even) build the kernel module.

and installed these
“make automake autoconf gcc kernel-syms kernel-source”

This is not enough. You need at least kernel-devel and kernel-desktop-devel (or similar) as well.

Again, install the “Kernel development” pattern, that includes everything needed.

The guest was going to be CentOS

Ok, but doesn’t matter at the moment as you don’t even come as far as installing the guest.

I thought I asked a question on the installation here a mounth ago, can’t find it now.

Have you looked in your profile for your previous posts?

Could you advise on the proper method please?

There is no “proper method” really.
You basically have two choices:

  • install VirtualBox from virtualbox.org:
    For this you need to install the “Kernel development” pattern, then install the VirtualBox package and everything should work. If you already installed it, run “sudo rcvboxdrv setup” to rebuild the host kernel module.
    You will have to rebuild the kernel module after each (host) kernel update, or you can install dkms to automate that.

Another drawback: They added the version number to the package name, so you have to manually uninstall the older version and then install the newer one in case of major updates.

  • install openSUSE’s virtualbox:
    Just enter YaST->Software Management and tick it or run “zypper in virtualbox”. It should just work then (even after kernel updates), although you have to add your user to the “vboxusers” group to actually run/use it (I think that’s necessary with the package from virtualbox.org too though).
    And note that this one has USB support disabled by default, you need to copy and modify an udev rules file to enable it (feel free to ask or search the forums).
    Possible disadvantage: this is an older version which only gets bugfix and security updates (like most other packages in openSUSE). There is an additional repo though which always has the latest version (you can find it in YaST’s “Community Repositories” list).

Otherwise there is no difference, they both are exactly the same software with the same features.

But make sure you don’t have both installed, this will give you problems sooner or later.
Oracle’s package is called “VirtualBox-x.y” (where x.y is the version), openSUSE’s consists of several packages, virtualbox (all lower case!), virtualbox-qt (the standard GUI), and virtualbox-host-kmp-xxx (the host kernel module).

Simplifying an answer for the OP:

Based on your original post, you never completed installing virtualbox.

You might be missing other things, but your install is currently failing specifically because it can’t find the kernel “Development Headers.” You should not have installed the package “kernel source”, that is for re-building the entire kernel including its base image. Virtualbox only needs to create and install kernel modules and doesn’t need to modify the whole kernel, so you should have instead installed the package “kernel-devel” which will automatically install the package for your particular installed kernel (which might be desktop, default, vanilla, etc). So, the following command installs the correct package after which you can run your virtualbox install again

zypper in kernel-devel

The dkms package is optional, if it’s missing it won’t cause an install failure. DKMS enables the application to automatically re-build whenever a new, upgraded kernel is downloaded and installed. If it’s missing, then you just need to run the virtualbox install again manually… which will be a tiresome headache for most which is why the dkms package is recommended.

You shouldn’t have to worry about re-compiling the kernel at any time.
That’s what the virtualbox install script is supposed to do for you so you don’t have to know the details… All you have to do is provide it the packages it’s asking for (and currently you are missing kernel-devel).

HTH,
TSU