2013. szeptember 4., szerda

VMware Tools annoyance install troube

Ever faced the problem that you are unable to install a simple VMwaretools package on your newly installed nice Linux? (In this example: 13.04 Ubuntu)
Mount the cd, copy and unpack the tar, start the install script... and so on, you know the order. And be surprised with the message:

Searching for a valid kernel header path... The path "" is not valid. Would you like to change it?[yes]
This looks serious but can be easily solved by:
apt-get install build-essential linux-headers-$(uname -r)
and then
ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

We happy Vincent?
Unfortunately we not.
WMvare tools reinstalling process the tells us some sad words:

[...]
Detected the kernel headers at "/lib/modules/3.8.0-19-generic/build/include".
The path "/lib/modules/3.8.0-19-generic/build/include" appears to be a valid
path to the 3.8.0-19-generic kernel headers.
Would you like to change it? [no]

Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-8gevFc/vmci-only'
/usr/bin/make -C /lib/modules/3.8.0-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  CC [M]  /tmp/modconfig-8gevFc/vmci-only/linux/driver.o
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:127:4: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:127:4: error: initializer element is not constant
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:127:4: error: (near initialization for ‘vmci_driver.remove’)
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:1754:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_probe_device’
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:1982:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_remove_device’
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:119:12: warning: ‘vmci_probe_device’ used but never defined [enabled by default]
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:121:13: warning: ‘vmci_remove_device’ used but never defined [enabled by default]
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:2063:1: warning: ‘vmci_interrupt’ defined but not used [-Wunused-function]
/tmp/modconfig-8gevFc/vmci-only/linux/driver.c:2137:1: warning: ‘vmci_interrupt_bm’ defined but not used [-Wunused-function]
/tmp/modconfig-8gevFc/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[2]: *** [/tmp/modconfig-8gevFc/vmci-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/modconfig-8gevFc/vmci-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
make: *** [vmci.ko] Error 2
make: Leaving directory `/tmp/modconfig-8gevFc/vmci-only'
&@#&@##&@&@@@@
Keep calm. Say you unpacked the tools to /usr/
So:
cd /usr/vmware-tools-distrib/
wget http://blog.gnu-designs.com/downloads/vmware-tools-linux-kernel-3.8_vmci_pci_hotplug_struct.patch
tar -xvf lib/modules/source/vmci.tar


Now, your directory looks like:

b# ls -l
drwxr-xr-x  2 root root   4096 jul   14  2012 bin
drwxr-xr-x  2 root root   4096 jul   14  2012 doc
drwxr-xr-x  4 root root   4096 jul   14  2012 etc
-rw-r--r--  1 root root 251898 jul   14  2012 FILES
lrwxrwxrwx  1 root root     13 jul   14  2012 INSTALL -> ./doc/INSTALL
drwxr-xr-x  2 root root   4096 jul   14  2012 installer
drwxr-xr-x 14 root root   4096 jul   14  2012 lib
drwxr-xr-x  5 root root   4096 jul   14  2012 vmci-only
lrwxrwxrwx  1 root root     31 jul   14  2012 vmware-install.pl -> ./bin/vmware-uninstall-tools.pl
-rw-r--r--  1 root root   1285 aug   23 00:10 vmware-tools-linux-kernel-3.8_vmci_pci_hotplug_struct.patch

Patch that driver:

root@server:/usr/vmware-tools-distrib# patch -p0 < /usr/vmware-tools-distrib/vmware-tools-linux-kernel-3.8_vmci_pci_hotplug_struct.patch
patching file vmci-only/linux/driver.c
Repack it.
root@server:/usr/vmware-tools-distrib# tar -cf vmci.tar vmci-only/
Overwrite the original bad one.
root@server:/usr/vmware-tools-distrib# cp vmci.tar lib/modules/source/

One more try! Reinstall now says:

---
Detected the kernel headers at "/lib/modules/3.8.0-19-generic/build/include".
The path "/lib/modules/3.8.0-19-generic/build/include" appears to be a valid
path to the 3.8.0-19-generic kernel headers.
Would you like to change it? [no]

Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-PYbj5R/vmci-only'
/usr/bin/make -C /lib/modules/3.8.0-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/linux/driver.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/linux/vmciKernelIf.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciContext.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciDatagram.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciDoorbell.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciDriver.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciEvent.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciHashtable.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciQPair.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciQueuePair.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciResource.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/common/vmciRoute.o
  CC [M]  /tmp/modconfig-PYbj5R/vmci-only/driverLog.o
  LD [M]  /tmp/modconfig-PYbj5R/vmci-only/vmci.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-PYbj5R/vmci-only/vmci.mod.o
  LD [M]  /tmp/modconfig-PYbj5R/vmci-only/vmci.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-PYbj5R/vmci-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-PYbj5R/vmci-only'
cp -f vmci.ko ./../vmci.o
make: Leaving directory `/tmp/modconfig-PYbj5R/vmci-only'

Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-uWidjn/vmci-only'
/usr/bin/make -C /lib/modules/3.8.0-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/linux/driver.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/linux/vmciKernelIf.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciContext.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciDatagram.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciDoorbell.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciDriver.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciEvent.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciHashtable.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciQPair.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciQueuePair.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciResource.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/common/vmciRoute.o
  CC [M]  /tmp/modconfig-uWidjn/vmci-only/driverLog.o
  LD [M]  /tmp/modconfig-uWidjn/vmci-only/vmci.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-uWidjn/vmci-only/vmci.mod.o
  LD [M]  /tmp/modconfig-uWidjn/vmci-only/vmci.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-uWidjn/vmci-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-uWidjn/vmci-only'
cp -f vmci.ko ./../vmci.o
make: Leaving directory `/tmp/modconfig-uWidjn/vmci-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-uWidjn/vsock-only'
/usr/bin/make -C /lib/modules/3.8.0-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  CC [M]  /tmp/modconfig-uWidjn/vsock-only/linux/af_vsock.o
  CC [M]  /tmp/modconfig-uWidjn/vsock-only/linux/notify.o
  CC [M]  /tmp/modconfig-uWidjn/vsock-only/linux/notifyQState.o
  CC [M]  /tmp/modconfig-uWidjn/vsock-only/linux/stats.o
  CC [M]  /tmp/modconfig-uWidjn/vsock-only/linux/util.o
  CC [M]  /tmp/modconfig-uWidjn/vsock-only/linux/vsockAddr.o
  CC [M]  /tmp/modconfig-uWidjn/vsock-only/driverLog.o
  LD [M]  /tmp/modconfig-uWidjn/vsock-only/vsock.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-uWidjn/vsock-only/vsock.mod.o
  LD [M]  /tmp/modconfig-uWidjn/vsock-only/vsock.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-uWidjn/vsock-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-uWidjn/vsock-only'
cp -f vsock.ko ./../vsock.o
make: Leaving directory `/tmp/modconfig-uWidjn/vsock-only'

 [....]

Whooohooooo, bingo!

Nincsenek megjegyzések:

Megjegyzés küldése