Missing C header files
I installed VMware Workstation 9.0 on a fresh Debian Jessie/Sid installation, but when I ran it after the installation, I was greeted with the error message:
C header files matching your running kernel were not found. Refer to your distribution's documentation for installation instructions.
and a dialog to locate said missing headers manually.
I found the fix to this annoying issue on ArchLinux' Wiki. The directory structure of the header files has changed since Linux kernel 3.7, so the installer cannot find the file it's looking for. A simple symlink resolves this.
# ln -sv /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux
‘/usr/src/linux-headers-3.8-1-amd64/include/linux/version.h’ -> ‘/usr/src/linux-headers-3.8-1-amd64/include/generated/uapi/linux/version.h’
Now VMware Workstation would at least try to compile the kernel modules!
Error compiling kernel modules
But failed miserably in the process:
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-rWaQRn/vmci-only'
/usr/bin/make -C /lib/modules/3.8-1-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8-1-amd64'
CC [M] /tmp/modconfig-rWaQRn/vmci-only/linux/driver.o
CC [M] /tmp/modconfig-rWaQRn/vmci-only/linux/vmciKernelIf.o
CC [M] /tmp/modconfig-rWaQRn/vmci-only/common/vmciContext.o
CC [M] /tmp/modconfig-rWaQRn/vmci-only/common/vmciDatagram.o
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: initializer element is not constant
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: (near initialization for ‘vmci_driver.remove’)
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1754:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_probe_device’
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1982:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_remove_device’
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:119:12: warning: ‘vmci_probe_device’ used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:121:13: warning: ‘vmci_remove_device’ used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2063:1: warning: ‘vmci_interrupt’ defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2137:1: warning: ‘vmci_interrupt_bm’ defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1717:1: warning: ‘vmci_enable_msix’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[4]: *** [/tmp/modconfig-rWaQRn/vmci-only/linux/driver.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [_module_/tmp/modconfig-rWaQRn/vmci-only] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8-1-amd64'
make: *** [vmci.ko] Error 2
make: Leaving directory `/tmp/modconfig-rWaQRn/vmci-only'
Failed to build vmci. Failed to execute the build command.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-rWaQRn/vmci-only'
/usr/bin/make -C /lib/modules/3.8-1-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8-1-amd64'
CC [M] /tmp/modconfig-rWaQRn/vmci-only/linux/driver.o
CC [M] /tmp/modconfig-rWaQRn/vmci-only/common/vmciDoorbell.o
CC [M] /tmp/modconfig-rWaQRn/vmci-only/common/vmciDriver.o
CC [M] /tmp/modconfig-rWaQRn/vmci-only/common/vmciEvent.o
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: initializer element is not constant
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: (near initialization for ‘vmci_driver.remove’)
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1754:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_probe_device’
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1982:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_remove_device’
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:119:12: warning: ‘vmci_probe_device’ used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:121:13: warning: ‘vmci_remove_device’ used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2063:1: warning: ‘vmci_interrupt’ defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2137:1: warning: ‘vmci_interrupt_bm’ defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1717:1: warning: ‘vmci_enable_msix’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[4]: *** [/tmp/modconfig-rWaQRn/vmci-only/linux/driver.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [_module_/tmp/modconfig-rWaQRn/vmci-only] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8-1-amd64'
make: *** [vmci.ko] Error 2
make: Leaving directory `/tmp/modconfig-rWaQRn/vmci-only'
Failed to build vmci. Failed to execute the build command.
The contents of /usr/lib/vmware/modules/source/vmci.tar needed to be patched, according to this thread on the VMware forums.
# wget -O /tmp/vmware9.k3.8rc4.patch http://communities.vmware.com/servlet/JiveServlet/download/2182440-102649/vmware9.k3.8rc4.patch
# cd /usr/lib/vmware/modules/source
# tar xf vmci.tar
# cd vmci-only
# patch -p1 < /tmp/vmware9.k3.8rc4.patch
patching file linux/driver.c
# tar cf vmci.tar vmci-only
# rm -rf /usr/lib/vmware/modules/source/vmci-only
After that, I just had to run vmware
as root and the modules were built successfully.