jeudi 14 février 2008

VMware et un kernel 2.6.24.2

Je viens de compiler un kernel 2.6.24.2 pour Debian GNU/Linux "lenny". Tout fonctionne... sauf vmware qui n'arrive pas à compiler ses kernels modules.

Quand je tente de compiler les kernel modules de VMWare pour un kernel 2.6.24.2, j'obtiens ceci:
[root@cobra] /root>/usr/vmware/bin/vmware-config.pl 
Making sure services for VMware Server are stopped.
Stopping VMware services:
Virtual machine monitor done
Bridged networking on /dev/vmnet0 done
DHCP server on /dev/vmnet1 done
Host-only networking on /dev/vmnet1 done
DHCP server on /dev/vmnet8 done
NAT service on /dev/vmnet8 done
Host-only networking on /dev/vmnet8 done
Virtual ethernet done
Configuring fallback GTK+ 2.4 libraries.
In which directory do you want to install the mime type icons?
[/usr/share/icons]
What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications]
In which directory do you want to install the application's icon?
[/usr/share/pixmaps]
Trying to find a suitable vmmon module for your running kernel.
None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]
Using compiler "/usr/bin/gcc". Use environment variable CC to override.
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.24.2/build/include]
Extracting the sources of the vmmon module.
Building the vmmon module.
Building for VMware Server 1.0.0.
Using 2.6.x kernel build system.
make: entrant dans le répertoire « /tmp/vmware-config1/vmmon-only »
make -C /lib/modules/2.6.24.2/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: entrant dans le répertoire « /usr/src/linux-2.6.24.2 »
CC [M] /tmp/vmware-config1/vmmon-only/linux/driver.o
CC [M] /tmp/vmware-config1/vmmon-only/linux/driverLog.o
CC [M] /tmp/vmware-config1/vmmon-only/linux/hostif.o
/tmp/vmware-config1/vmmon-only/linux/hostif.c: In function 'HostIF_BrokenCPUHelper':
/tmp/vmware-config1/vmmon-only/linux/hostif.c:3042: warning: passing argument 1 of 'HostIFBrokenCPUHelper' discards qualifiers from pointer target type
CC [M] /tmp/vmware-config1/vmmon-only/common/comport.o
CC [M] /tmp/vmware-config1/vmmon-only/common/cpuid.o
In file included from include/asm/bitops.h:2,
from /tmp/vmware-config1/vmmon-only/./include/vcpuset.h:74,
from /tmp/vmware-config1/vmmon-only/./include/modulecall.h:23,
from /tmp/vmware-config1/vmmon-only/common/vmx86.h:19,
from /tmp/vmware-config1/vmmon-only/common/hostif.h:18,
from /tmp/vmware-config1/vmmon-only/common/cpuid.c:15:
include/asm/bitops_32.h:9:2: error: #error only can be included directly
make[2]: *** [/tmp/vmware-config1/vmmon-only/common/cpuid.o] Erreur 1
make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] Erreur 2
make[1]: quittant le répertoire « /usr/src/linux-2.6.24.2 »
make: *** [vmmon.ko] Erreur 2
make: quittant le répertoire « /tmp/vmware-config1/vmmon-only »
Unable to build the vmmon module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".
Execution aborted.

Ouille !
Solution:

  1. aller chercher le patch vmware-any-any-update115.tar.gz
  2. le décompresser (dans /tmp par exemple): time tar --preserve -zxvf vmware-any-any-update115.tar.gz
  3. là dedans, décompresser vmmon.tar: time tar --preserve -xvf vmmon.tar
  4. éditer vmmon-only/include/vcpuset.h et remplacer include "asm/bitops.h" en #include "linux/bitops.h"
  5. éditer vmmon-only/include/iocontrols_compat.h et mettre 167 comme VMMON_VERSION_V6
  6. éditer vmmon-only/include/iocontrols.h et mettre 167 comme VMMON_VERSION
  7. recompresser vmmon.tar en faisant: time tar --preserve -cvf vmmon.tar vmmon-only
  8. lancer runme.pl

5 commentaires:

Anonyme a dit…

Merci !

Super utile ton tuto.

Unknown a dit…

Super, ton tuto.

J'ai adapté ton tuto à l'installation de "VMware Workstation 6.0.3 for Linux" car j'ai rencontré le même problème sur ma machine (Dell XPS M1330 & Ubuntu 8.04 - Hardy Heron).

Merci.
Eric.

Unknown a dit…

Merci beaucoup !!
Tu m'as sauvé quand j ai passé de ubuntu 7.10 à 8.04 LTS!

Matheus a dit…

Un grand merci, très utile lors d'une migration etch (2.6.18) vers lenny(2.6.24-1).
J'ai du dans mon cas installer les header files de mon nouveau kernel.

gcc 4.2.3 installé donc:

export CC=/usr/bin/gcc-4.1.3

le reste tout pareil.

Unknown a dit…

merci beaucoup, je n'aurais jamais pu trouver seul