C header files location -- VMWare Fusion and OpenSUSE 11

Hi everyone,

I’m not sure if this is the right place but… I’m currently trying to run OpenSUSE 11.0 within OS X using VMWare Fusion and having issues trying to install VMWare Tools.

The issue I’m having is that it can’t find C header files that match my running kernel – where would these be located?

Thanks,

J

**Your kernel was built with “gcc” version “4.3.1”, while you are trying to use
“/usr/bin/gcc” version “4.3”. This configuration is not recommended and VMware
Tools may crash if you’ll continue. Please try to use exactly same compiler as
one used for building your kernel. Do you want to go with compiler
“/usr/bin/gcc” version “4.3” anyway? [no] yes

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /usr/src/linux-obj/x86_64/default/include/

The directory of kernel headers (version 2.6.25.11-0.1-default) does not match
your running kernel (version 2.6.25.5-1.1-default). Even if the module were to
compile successfully, it would not load into the running kernel.

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include]

Hi,

The linux kernel headers will be available in your system once you have installed the package linux-kernel-headers-2.6.25-8.1.noarch.rpm

Find details here:
Novell: openSUSE 11.0: linux-kernel-headers

Use yast to download and install it.

Regards.

Thanks for the quick reply.

Okay, so I ran the package from the DVD and it gave me the error message that it had already been installed?

J

Hi,

Could you please clarify what exactly the problem scenario is?
Specifically, are you trying to install the Vmware Tools in a Mac Os X host when you get those messages or they come from within the Open Suse system guest?
When you state "The issue I’m having is that it can’t find C header files that match my running kernel – where would these be located? " you mean the kernel headers of the Mac Os X system or the Open Suse 11 one?

What I told you before was related to Open Suse not to Mac Os.

Anyway, in a Open Suse system you can find out the releases of gcc and the specific version used to compile the kernel using, for example the commands:

  1. gcc --version

  2. rpm -q gcc

  3. modinfo scsi_mod | grep vermagic

The output of the first two commands contains the release of gcc installed in your system, while the third gives you the one used to build one of the kernel modules that you will likely find in every linux system nowdays.

Unless you have upgraded/compiled manually the kernel and/or upgraded/installed the gcc package, they should match.

Regards.

He has the includes and headers installed but he didn’t reboot after upgrading the kernel.

Thanks carboncore, Chrysantine. Okay, so more information…

I installed opensuse from a disk image file on a virtual hard disk using VMWare Fusion.

To attain good performance, VMWare asks that you install a set of ‘tools’ on the guest system. This amounts to VMWare putting a directory with an installer script in it onto virtual hard disk which you can then run from the terminal window within the guest OS.

On running this on the first boot of the virtual machine (after installation) it ran into problems: it couldn’t find make or gcc. So I installed these using yast, possibly leading the discrepant versions of gcc and the first error message – will this be an issue?

The second error message is related to the fact that I can’t answer the question:

“What is the location of the directory of C header files that match your running kernel?”

If I give it the default answer of /usr/src/linux/include it says that it can’t find headers in the directory.

If I give it a different, explicit directory as I posted before, I get the error that the versions don’t match.

carboncore: These should be the open suse files since I don’t think the installer script can ‘see’ the host hard disk straightforwardly. So… I’m trying to find the C header files that match my kernel build. – I’m at work right now but when I get back I can give you the other information.

Chrysantine: So I have the headers etc, but where are they? Even after a re-boot, the guest OS (open suse) says that it can’t find them in /usr/src/linux/include

Install kernel-source.

zypper in kernel-source

Or use YAST. That should take care of it.

You’re making the same mistake as I did.

Look closely at the error message :

The directory of kernel headers (version 2.6.25.11-0.1-default) does not match
your running kernel (version 2.6.25.5-1.1-default)

You are running kernel 2.6.25.5-1.1 but the kernel header files which you have installed are for version 2.6.25.11-0.1

Make sure that you have the exact same version of the headers as your running kernel !
So, downgrade the header file package or upgrade the kernel and reboot.

Chrysantine: this returns the error that I already have it installed. A re-boot doesn’t change the situation on the installer and the error message is:

The path “/usr/src/linux/include” is a kernel header file directory, but it
does not contain the file “linux/version.h” as expected. This can happen if
the kernel has never been built, or if you have invoked the “make mrproper”
command in your kernel directory. In any case, you may want to rebuild your
kernel.

LRE: how do I undertake either the upgrade or the downgrade?

Should I also upgrade gcc to match? I have the gcc from yast, so I guess I only need to upgrade?

Thanks again all.

carboncore: here’s the info you suggested I get. In particular modinfo doesn’t work.

> gcc --version
gcc (SUSE Linux) 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> rpm -q gcc
gcc-4.3-39.1

> modinfo scsi_mod | grep vermagic
bash: modinfo: command not found

Hi,

Run modinfo as root, not as a regular user account.

Regards.

Hi,

Ignore my latest post. In Open Suse 11 no information regarding the release of gcc is included in the vermagic tag of a given module, so that in this case there is no point in using modinfo.
I was at a SLES 1O system this morning when I suggested running that command to find out easily what release of gcc was used to build it, but in Open Suse 11 that does not apply.
Sorry for the confusion.

Now from the output of the first two commands, your system is running the right gcc release, so we can rule out gcc as the source of the problem.

Regarding the other packages involved in the issue, they should be:

  1. linux-kernel-headers: 2.6.25-8.1

  2. kernel-default: 2.6.25.5-1.1

And, if you have installed the kernel source, it should be

  1. kernel-source: 2.6.25.5-1.1

So, proceed as suggested by LRE and Chrysantine to make them all match.

Hope this helps.

Regards.

Thanks again carboncore. Any idea how to proceed as they suggest? If not, I’ll just wait for them to post ;).

Chrysantine/LRE – any thoughts to my previous Qs? Thanks!

Right, make sure you have the “OSS” and “Main Update Repository” enabled in YAST / Software / Repositories.

Then run su -c “zypper up -t package” which will upgrade all packages, including kernel and kernel-source to the latest versions.

Then re-try the whole ordeal.

Thanks Chrysantine – that seemed to reinstall everything including the kernel headers but there’s still nothing appropriate in /usr/src/linux/include so it still fails to install. Might the headers have been installed elsewhere?

Do you think it might be worth going from scratch? I can remove the virtual HD and reinstall relatively trivially.

J

Hi

I just wanted to say that I had the same error trying to install VMWare Server 1.0.6 on OpenSuSE 11.

I solved doing this:

  1. Install kernel-sources
  2. Update kernel to the same level of the kernel-sources
  3. Restart
  4. Then I made every step like you did.

Note: I didn’t point the sources to the default folder vmware suggests. The new folder was automatically detected so if I were you I might re install.

Regards and thank you because this post saved me =)

I would just like to say I am going through the same exact issues with VMWare Fusion here :\

So, if I figure anything out I’ll be sure to let you know

Same with OS11 VMPlayer 2.xx. The GCC version mismatch warning was not an issue, this has been explored in other threads. As usual the kernel headers didn’t work, had to install kernel-sources.
But I understand that when using OS11 as a guest it already has precompiled tools packages, at least for Virtualbox?

This was definitely a bit confusing for me as well, but I believe I found a solution.

Contrary to what I though, and contrary to many posts you see, the version of the kernel headers does NOT have to match your running kernel. I know, I know . . . just listen though.

The headers are intended for each major revision, so if you are trying to find them for say kernel 2.6.25.16-0.1 you will never find them, the latest you will find is 2.6.25-8.1. Also you can’t just down grade your kernel 25-8.1 as that version is not available in the repos.

A catch 22 right? I found the solution was to install kernel-syms - which also installs the full kernel sources, like this:

Callandor:~ # rpm -qa | grep kernel
kernel-syms-2.6.25.16-0.1
kernel-debug-2.6.25.16-0.1
kernel-source-2.6.25.16-0.1
linux-kernel-headers-2.6.25-8.1
kernel-default-2.6.25.16-0.1

Now, when I run vmware-config.pl it correctly find the kernel headers at /lib/modules/2.6.25.16-0.1-default/build/include

I know that is not very intuitive, but this worked fine for me.

Prior to this I tried making the kernel match the header package and even when I did I still got errors the headers did not contain the proper files.

I hope the above helps others.

LewsTherin