SuSE 9.1 vs. VMware (vmware-config-tools.pl vs. kstrdup )

I’m testing out SuSE 9.1 on VMware 4.5.2 on top of Windows XP.

VMware comes with the ‘vmware-tools’ package, which enhances performance and usability when running SuSE or any flavor of Linux under VMware.

Unfortunately, vmware-tools fails to build with the following error:

# ./vmware-config-tools.pl

(… snip …)

make[1]: Entering directory `/usr/src/linux-2.6.1-111′

/tmp/vmware-config/vmhgfs-only/cpName.o

/tmp/vmware-config/vmhgfs-only/cpNameLinux.o

/tmp/vmware-config/vmhgfs-only/dev.o

/tmp/vmware-config/vmhgfs-only/dev.c:20:

/tmp/vmware-config/vmhgfs-only/main.h:184: error: conflicting types for ‘kstrdup’

include/linux/slab.h:121: error: previous declaration of `kstrdup’

make[2]: *** [/tmp/vmware-config/vmhgfs-only/dev.o] Error 1

make[1]: *** [_module_/tmp/vmware-config4/vmhgfs-only] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.1-111′

make: *** [vmhgfs.ko] Error 2

make: Leaving directory `/tmp/vmware-config/vmhgfs-only’

Unable to build the vmhgfs module.

EWW! GROSS!

This is because the function ‘kstrdup’ in the vmware-tools source (in the vmhgfs module) is conflicting with the function ‘kstrdup’ in the Linux kernel source, in mm/slab.c , drivers/md/dm-ioctl.c , and a few other places.

To work around this error, you need to modify the vmware-tools source a little bit.

- Find the file vmhgfs.tar and untar it:

cd modules/source

cp vmhgfs.tar vmhgfs.tar.old

tar xvf vmhgfs.tar

cd vmhgfs-only

- in main.c main.h and driver.c , replace the string ‘kstrdup’ with something unique, like ‘vmkstrdup’.

Then tar it back up, remove your old temprary files and re-run the tool again:

cd ..

tar cf vmhgfs.tar vmhgfs-only

rm -rf vmhgfs-only

Rerun vmware-config-tools.pl and it should work!

2 Responses to “SuSE 9.1 vs. VMware (vmware-config-tools.pl vs. kstrdup )”

  1. unkljim says:

    Congratulations on the birth of your son; I imagine that was sometime in 2005.

    I am now in South Florida. I moved back here December 15, 2004 to be more available to my 84 year old mother.

    I flew her out after Hurricane Wilma hit here in October to stay with my nephew and his family in Sunnyvale. I got to have a raging Halloween for 2 nights in SF.

    Give my regards to Rosie/Laura!

  2. Mike says:

    Thanks for this post, and the step by step instructions. I just ran into the same problem running Redhat Enterprise 4. Works like a charm now

Leave a Reply