Issues installing guest additions (Virtualbox)

I’m running openSUSE guest in Windows 7 host. I get the following error in the log when I try to install guest additions http://pastebin.com/uk6RWXyn Where do I go from here? Thanks.

On 2015-07-31 23:36, Inds wrote:
>
> I’m running openSUSE guest in Windows 7 host. I get the following error
> in the log when I try to install guest additions

It is telling you exactly what to do. I’ll trim it:


> --------------------
Warning: using /usr/src/linux as the source directory of your Linux
kernel. If this is not correct, specify KERN_DIR= and run Make again.

grep: /usr/src/linux/include/linux/version.h: No such file or directory

ERROR: Kernel configuration is invalid.";

Run 'make oldconfig && make prepare' on kernel src to fix it.";


I guess that you did not install the kernel sources, nor did you prepare
them.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

You miss some kernel development packages (kernel-desktop-devel and kernel-devel).

But the guest additions are included in openSUSE, there should be no need to compile/install them manually.

So I have to specify kernel directory, how do I find out what my kernel directory is? And I had no idea I had to install kernel sources. I would think guest additions would already be compatible.

Wolf, if guest additions are already included then wouldn’t my shared folders from my host be appearing in the computer panel?

On 2015-08-01 01:36, Inds wrote:
>
>
> So I have to specify kernel directory, how do I find out what my
> kernel directory is? And I had no idea I had to install kernel sources.

You don’t understand. /If/ you want to /build/ the guest additions, you
need to install at least part of the kernel sources (Wolfi said which).
And no, you don’t need to specify where: the script says that because it
can not find them, and it is asking you to tell it where /you/ placed them.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

You should be able to mount a shared folder with “mount”, and you should be able to specify one in /etc/fstab to be mounted automatically.

IF I wanna build it? What’s my alternative?

I tried downloading and installing the packages Wolfi spoke of and I get this: Pasteboard - Uploaded Image

I didn’t see this post. But I also don’t see any shared folder so how do I mount?

I’m sure you must be thoroughly confused by the suggestions you’re getting.

First, unless you’re not running on an x86/x64 platform, you shouldn’t have the Port repo installed.
Is there some reason you are using that repo?

As wolfi posted, openSUSE will automatically install the community version of VBox Guest Additions if you installed openSUSE as a Guest. It’s one of those cool things openSUSE does for you automatically you won’t find in other distros. The only way you might not have Guest Additions automatically installed is if you created your Guest in some weird, unusual way… like cloning a physical machine as a Guest.

But, there is a difference between the community version of Guest Additions and the proprietary version which compiles against your kernel. Shared Folders for example is not supported in the community version. If you want that, you have to replace the community Guest Additions with a Proprietary version. If you simply want things like auto display re-sizing, the community tools will provide. I don’t remember if a shared clipboard between HostOS and Guest requires the proprietary version or not. The community version should also support allowing your mouse to move from within the Guest to the Host and back again without manually releasing the mouse with a keystroke combination.

If you think you might be happy with just re-sizing the display, check whether that still works or not. If not, then your attempts to build your own Guest Additions may have broken it and may need to be replaced anyway.

If you need or want proprietary Guest Additions those are typically provided by running the “Install Guest Additions” which typically involves mounting the VBoxGuestAdditions.iso in the virtual CDROM.

Assuming you’re installed on an x86/x64 system, the following zypper command is all you need to run to address the problem in your pastebin, zypper will automatically select the correct package providing kernel headers based on your installed kernel (most likely kernel-desktop). The location is not important because kernel headers will be installed in your system PATH. The only reason why you’re being prompted for a location is because the required files are not found so the install is wondering if you installed in a different location, but that’s not the problem.

zypper in kernel-devel

It looks like you have the other prerequisites installed in your openSUSE already (make, gcc) so you should be successful building your Guest Additions.

After you successfully install your Guest Additions which generally means you’ll have installed the proprietary version, you can test by configuring “Shared folders” in your Guest properties (with the Guest powered off), then powering on the Guest and trying to mount the shared folder. The VBox documentation is fairly accurate describing how to do this but if you have a problem doing that, then post here again.

HTH,
TSU

Hm? How do you know he has the “Ports” repo installed? This isn’t mentioned any where AFAICS.
But yes, the “Ports” repo is not intended for x86/x86_64 systems, it is the port of openSUSE to ARM and PPC.

As wolfi posted, openSUSE will automatically install the community version of VBox Guest Additions if you installed openSUSE as a Guest. It’s one of those cool things openSUSE does for you automatically you won’t find in other distros. The only way you might not have Guest Additions automatically installed is if you created your Guest in some weird, unusual way… like cloning a physical machine as a Guest.

But, there is a difference between the community version of Guest Additions and the proprietary version which compiles against your kernel. Shared Folders for example is not supported in the community version.

Shared Folders are supported. Only auto-mounting is not supported.
I’m not sure why, but I think the “proprietary” version (it is not really proprietary, and actually compiled from the same sources) additionally installs some system service to take care of that.

To mount a shared folder, do as described in the VirtualBox manual:
https://www.virtualbox.org/manual/ch04.html#sf_mount_manual

I.e. something like:

mount -t vboxsf *sharename* *mountpoint*

or add something like this to /etc/fstab to mount it during boot:

*sharename*   *mountpoint*   vboxsf   defaults  0   0

PS: It should also be noted that you should uninstall openSUSE’s guest packages first before you install them manually, if you want to do that.
Uninstall all that begins with virtualbox-guest, i.e. virtualbox-guest-kmp-xxx, virtualbox-guest-x11, and virtualbox-guest-tools.

On 2015-08-01 09:16, wolfi323 wrote:
>
> tsu2;2721953 Wrote:
>>
>> First, unless you’re not running on an x86/x64 platform, you shouldn’t
>> have the Port repo installed.
>> Is there some reason you are using that repo?
> Hm? How do you know he has the “Ports” repo installed? This isn’t
> mentioned any where AFAICS.

In a “pasteboard.co” photo he posted of an error he gets when “tried
downloading and installing the packages Wolfi spoke of” :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Ah, ok. I’ve seen it now. For some reason I didn’t click on that link before…

But yes, that repo should be removed again.

I did zypper in kernel-devel as you instructed. Same error when I try to install guest additions from ISO.

/tmp/vbox.0/Makefile.include.header:100: 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 CONFIG_MODULE_SIG= -C /usr/src/linux SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
make[1]: gcc: Command not found
cat: write error: Broken pipe
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.include.header:100: 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/.VBoxGuest-linux.o.d  -nostdinc -isystem  -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-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -O2 -fomit-frame-pointer -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.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/vboxguest/ -I/tmp/vbox.0/vboxguest/include -I/tmp/vbox.0/vboxguest/r0drv/linux -D__KERNEL__ -DMODULE -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(VBoxGuest_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxguest)" -c -o /tmp/vbox.0/VBoxGuest-linux.o /tmp/vbox.0/VBoxGuest-linux.c
/bin/sh: gcc: command not found
scripts/Makefile.build:273: recipe for target '/tmp/vbox.0/VBoxGuest-linux.o' failed
make[2]: *** [/tmp/vbox.0/VBoxGuest-linux.o] Error 127
Makefile:1359: recipe for target '_module_/tmp/vbox.0' failed
make[1]: *** [_module_/tmp/vbox.0] Error 2
/tmp/vbox.0/Makefile.include.footer:79: recipe for target 'vboxguest' failed
make: *** [vboxguest] Error 2
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.


My reason for needing guest additions is to interact with some partitions on my host system. I don’t care about resizing of the screen and other features, though they are useful. The screen does automatically resize and I do have bidirectional clipboard so it does seem like I have that community one installed that you talk about. But I need shared folder capabilities.
And yes I have the x86/x64 version. Hopefully I’m running x64 as I intended, though.

/tmp/vbox.0/Makefile.include.header:100: 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 CONFIG_MODULE_SIG= -C /usr/src/linux SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
make[1]: gcc: Command not found

You’re actually missing the compiler to build the kernel modules.
Install gcc, or better enter YaST->Software Management, click on “View”, select “Patterns” and install the “Kernel development” pattern.

My reason for needing guest additions is to interact with some partitions on my host system. I don’t care about resizing of the screen and other features, though they are useful. The screen does automatically resize and I do have bidirectional clipboard so it does seem like I have that community one installed that you talk about. But I need shared folder capabilities.

As I wrote already, shared folders work fine with openSUSE’s guest packages.
It’s only auto mount that doesn’t work, you have to mount them manually (but that can be done during boot if you add an entry to the fstab) as explained in the documentation and by me already.

Sorry, I didn’t see your post (again!). Blah! That’s definitely a lot easier if everything is already in order.

mount -t vboxsf sharename mountpoint

*What do I type for sharename and mountpoint? The shared folder on my host is drive U:\

And I’m gonna have to install gcc and others anyway because I’ll be compiling x265, the thing I intend to use opensuse for: x265 encoding. Hopefully I’ll be smart enough to pick all that up on my own.

For mountpoint you can choose what you want, that’s where you can access the shared folder afterwards. The folder has to exist though, so create it first if necessary. (or use something existing like /mnt).

The sharename should be the same as you configured in VirtualBox’s shared folder settings.

And I’m gonna have to install gcc and others anyway because I’ll be compiling x265, the thing I intend to use opensuse for: x265 encoding. Hopefully I’ll be smart enough to pick all that up on my own.

Why compile that?
Just install it from Packman, I’d say…

Since wolfi is so insistent that pre-compiled VBox additions should work,
I’d be willing to say go ahead and give it a try… :slight_smile:
If you already have a package installed, you’d have to do a “force re-install” of the package since if the package with appropriate version already exists, nothing will happen…

zypper install -f *packagename *

Otherwise, you can build your own (which I’ve always done). Yes, I didn’t notice the gcc missing error which needs to be addressed.

TSU

Ah, thank you, that makes sense. Finally it’s working.

Forgive my stupidity. I had every intention of being Linux-retarded since I’m a newb but what I didn’t intend was to be computer-retarded that I forget to refresh the page before replying. I have just proven right every myth of how stupid the average Windows user is. >.<

Why compile that?
Just install it from Packman, I’d say…

Because I need the very latest version. https://bitbucket.org/multicoreware/x265/wiki/Home this page says I need Mercurial and cmake. I’ll see how much I can accomplish on my own.
Thanks again.

Good! :wink:

Because I need the very latest version. https://bitbucket.org/multicoreware/x265/wiki/Home this page says I need Mercurial and cmake. I’ll see how much I can accomplish on my own.

Depends on what you mean with “the very latest version”.
Packman does have the latest relased version 1.7.

But you probably need something newer, a development snapshot?
Packman used to package them in the past, but mainly because there was no released version yet…

But you should find all you need to compile it in the standard repos (i.e. in YaST).
Maybe install the “C/C++ development” pattern (as explained earlier), to have the basics for compiling stuff.

I thought you were talking about precompiled binaries (which are often outdated by months). Is Packman a program that automatically compiles x265 sources or something? If so I’ll use it.
https://bitbucket.org/multicoreware/x265/get/7c83f7755422.zip
That’s the latest x265 to date.