Fixing Issue With Missing Kernel Headers When Installing VMware Tools in Linux Virtual Machine

When installing VMware Tools in more recent Linux releases, the following error would occur even when the kernel headers were already installed.

Searching for a valid kernel header path...
The path "" is not a valid path to the 3.8.0-19-generic kernel headers.
Would you like to change it? [yes] yes

Enter the path to the kernel header files for the 3.8.0-19-generic kernel? /lib/modules/3.8.0-19-generic/build/include

The path "/lib/modules/3.8.0-19-generic/build/include" is not a valid path to
the 3.8.0-19-generic kernel headers.
Would you like to change it? [yes]

The installer would not find the header files even when the correct path was manually provided.

The reason is that, in version 3.7 of the Linux kernel, the version.h file needed by the VMware Tools installer have been relocated from /usr/src/linux-headers-$(uname -r)/include/linux to /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux, and the installer has not been updated to handle that.

The solution would be to create a symbolic link to version.h at the location where VMware Tools installer expects it.

$ ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

References

[1] https://cmanios.wordpress.com/2013/06/12/fix-vmware-tools-kernel-header-path-is-not-valid-error/
[2] http://askubuntu.com/questions/131351/how-to-install-vmware-tools/286003#286003
[3] https://lkml.org/lkml/2012/7/20/419

Advertisements