Well, VMWare tools sometimes fails to install into a Linux guest with recent kernel.

The error is something like this: The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match your running kernel (version 2.6.18.2-34-default). Even if the module were to compile successfully, it would not load into the running kernel.

With this bug you cannot sync the time with your hosting server, automate shutdown tasks, etc… This problem exist because the kernel source code structure is changed in recent kernels (I guess > 2.6.18). The VMWare tools installation script is looking for the string “#define UTS_RELEASE $kernel_number” into /usr/src/kernels/$(uname -r)*/include/linux/version.h but the UTS_RELEASE variable is now into the file utsrelease.h.

To fix this, you can patch the VMWare tools installation script or just add the content of utsrelease.h to version.h. I suppose the second solution is the fastest one 🙂

To do this:

# cd /usr/src/kernels/$(uname -r)*/include/linux
# cat utsrelease.h >> version.h

Happy virtualization folks! 🙂


14 Comments

J · March 15, 2008 at 17:32

I am having this problem, but I cannot get this to work. I have no “/usr/src/kernels” folder but I did find the files under “/usr/sec/linux-headers-2.6.22-14-generic” Unfortunately, evern as root, I cannot edit version.h.

This is driving me mental, I am not that experienced with Linux and I was expecting a Windows-like “Next, next, next” install. Not sure who is at fault – VMWare or Ubuntu, but *NONE* of the install instructions I found work!

But thanks for at least giving me an idea what the problem is!

Paolo · March 15, 2008 at 17:49

Hi J,
well it’s hard to say really who is in fault here, anyway, some months ago the guys behind Ubuntu have added to the partner repository VMware Server.
To install VMware with the Ubuntu package manager, you have to fire up Adept Manager, then Adept->Manage Repositories, go to the Third-Party Software tab and enable deb http://archive.canonical.com/ubuntu gutsy partner.

Now you should have the VMware-server package available to install. Of course, you need the serial number to complete the installation, check the VMware website for more informations.

I hope this helps.

Paradigmatico · June 29, 2008 at 03:36

Thanks a lot, this solution worked for me on my Virtual Debian with kernel 2.6.18-6-686. I just switched the kernels folder for linux-headers.

Alexander Reichman · August 8, 2008 at 12:29

Thank you very much for your advice!

# cd /usr/src/kernels/$(uname -r)*/include/linux
# cat utsrelease.h >> version.h

Alex

Dan Pope · October 16, 2008 at 03:18

This will only work if permissions on the version.h file allow it to be modified. Even being logged in as root isn’t enough, because it is a read-only file. You can change that however.

Navigate to /usr/src/linux-headers-2.6.24-21-generic/include/linux or whatever the relevant directory is on your system. Then change the file permissions of the version.h file by

sudo chmod 777 version.h

(It will ask for your password to authenticate your identity before allowing you privileges.)

To find out *exactly* what your kernel version is, at the command line type ‘uname -r’ without quotes.

Once you have changed the permissions you can successfully use Paolo’s commands. Thanks Paolo!

[Sadly although all this fixes one thing, I can’t get any further with my install, now getting a seemingly sadistic error “The kernel defined by this directory of header files does not have the same address space size as your running kernel.”

I have tried all kinds of things unsuccessfully trying to get VMWare Tools to install on a kubuntu 8.04 guest OS. At this point, I’ve come to realise that it is actually quicker and easier constructing a 2nd machine to run Linux on!]

Dan Pope · October 16, 2008 at 17:31

After more fiddling around modifying files I got a little further, then thought I’d have a look for a newer version of VMWare (with perhaps a newer version of vmware tools!) Don’t ask me why I didn’t do this before. I was using 5.5.2 – upgraded to 5.5.8 and the install almost worked. No shared folders (vmhgfs failed to compile) but clipboard support and synchronised clocks work now at least! No mousewheel though (that didn’t work before installing vmware tools either), and no accelerated network interface. Also, graphics performance is still remarkably lacklustre compared to running a Windows guest OS with tools installed.

It does surprise me that vmware haven’t made more of an effort to support Ubuntu, since it is one of the most popular linux distros out there. VMWare have done all the really hard work, of actually writing the vm. 0.1% more effort would double the usefulness of it to a great deal of users. I guess their target market is virtualised servers which don’t necessarily need to run ubuntu at all, certainly not as a guest.

Still, it’s useful!

jockyw2001 · October 27, 2008 at 13:40

Thx! Works a treat
(Clarkconnect 4.3 in VMware Workstation 5.5.1 build-19175)

Frank · December 12, 2008 at 21:44

Hey, I am trying to install VMWare tools (for Worstation 5.5.9) on Fedora Core 9.

I initially had the version @@VMWARE@@ UTS_RELEASE problem when running vmware-config-tools.pl.

Thanks to your post, I fixed that, but it still does not work. Here’s the message when trying to build vmhgfs:

Building the vmhgfs module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config4/vmhgfs-only`
make -C /lib/modules/2.6.25-14.fc9.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.25-14.fc9.i686`
CC [M] /tmp/vmware-config4/vmhgfs-only/cpName.o

In file indlued from include/linux/string.b:11
from /tmp/vmware-config4/vmhgfs-only/cpName.h:18,
from from /tmp/vmware-config4/vmhgfs-only/cpName.c:18;
include/linux/types.h:40; error: conflicting types for `uintptr_1`
/tmp/vmware-config4/vmhgfs-only/vm_basic_types.h:160: error: previous declaration of `uintptr_1` was here
make[2]: *** [/tmp/vmware-config4/vmhgfs-only/cpName.o] Error 1
make[1]: *** [_module_/tmp/vmware-config4/vmhgfs-only/cpName.o] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.25-14.fc9.i686`
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/vmware-config4/vmhgfs-only`
Unable to build the vmhgfs module.

Can someone give me a hand with that ?

Marco Mueller · December 16, 2008 at 10:37

Hello,

I also tried the workaround and patches version.h. That worked for me. But the build still fails. The problem looks similar to Frank’s.

Bye
Marco

Archie · May 3, 2010 at 11:44

Hi,

if someone stumbless across this, I had a recent problem with autoconf.h not being in /include/kernel directory, as in 2.6.33 kernel it has been moved to /include/generated

a simple symlink solved it

(in /include/kernel do ln -s ../generated/autoconf.h autoconf.h )

worked like a charm (running Gentoo distro)

TJ · October 24, 2010 at 18:23

Fuck this, if you do this the next error will be:

“The path “/usr/src/linux/include” is a kernel header file directory, but it
does not contain the file “linux/autoconf.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.

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

Which of course not true, but just to make sure I recompiled my custom kernel and didn’t work, fuck vmware…

Andrew · January 5, 2011 at 01:58

Fantastic work! However, it did need a little modifications a few more steps on my system. This applies to openSuSE 11.3 x64… that would be with kernel 2.6.34.7-0.5-default

1. Change directory
cd /lib/modules/2.6.34.7-0.5-default/build/include/linux/

2. This was noted by another commenter, at least in part:
cat ../generated/utsrelease.h >> version.h

2. Create some symlinks because files moved…
ln -s ../generated/autoconf.h autoconf.h

Thanks!

Rod · January 19, 2011 at 05:05

i used this command… i dont know why but ustrelease.h was in the generated folder, not linux. anyways hope this helps you, it got me past this error, but now i have more errors to debug:

cat ../generated/utsrelease.h >> version.h

Adam · February 24, 2011 at 17:01

Hi,

Thank you very much this worked for me!

Ubuntu 10.10,Linux i686, vmware tools 4-0-0….

Leave a Reply to Rod Cancel reply

Avatar placeholder

Your email address will not be published. Required fields are marked *