How to install kernel headers for VMWare to match the running kernel (version 2.6.35-22-generic)

ubuntu-10.10vmware-server

I am trying to install VMWare Server 1.0.6 , and have also tried VMWare server 2.0.2 BOTH 64 bit, on ubuntu 10.10 64 bit.

But i i keep getting this error:

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /lib/modules/2.6.35-22-generic/build/include/

The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match
your running kernel (version 2.6.35-22-generic).  Even if the module were to
compile successfully, it would not load into the running kernel.

snaphot of stdout:

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /lib/modules/2.6.35-22-generic/build/include/


The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match
your running kernel (version 2.6.35-22-generic).  Even if the module were to
compile successfully, it would not load into the running kernel.

in /usr/src, i have:

root@pandora:/usr/src# ls -l
total 8
drwxr-xr-x 24 root root 4096 2011-02-02 18:38 linux-headers-2.6.35-22
drwxr-xr-x  7 root root 4096 2011-02-02 16:25 linux-headers-2.6.35-22-generic

and uname -a returns:

uname -a
Linux pandora 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010 x86_64 GNU/Linux

How do i resolve this problem

Best Answer

Creating two symlinks will fix your problem:

ln -s /lib/modules/2.6.35-22-generic/build/include/generated/utsrelease.h /lib/modules/2.6.35-22-generic/build/include/linux/utsrelease.h
ln -s /lib/modules/2.6.35-22-generic/build/include/generated/autoconf.h /lib/modules/2.6.35-22-generic/build/include/linux/autoconf.h

I found the solution on it-psycho.de and it worked well for me.