Tuesday, February 26, 2008

@@VMWARE@@ UTS_RELEASE

Paolo Conti wrote how to hack VMware tools to work on linux kernels 2.6.18

[CITATION FROM http://www.atlink.it/~conti/2007/12/19/vmware-uts_release/]

Well, VMWare tools sometimes fails to install into a Linux guest with recent kernel.

The error is something like this: The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match your running kernel (version 2.6.18.2-34-default). Even if the module were to compile successfully, it would not load into the running kernel.

With this bug you cannot sync the time with your hosting server, automate shutdown tasks, etc… This problem exist because the kernel source code structure is changed in recent kernels (I guess > 2.6.18). The VMWare tools installation script is looking for the string “#define UTS_RELEASE $kernel_number” into /usr/src/kernels/$(uname -r)*/include/linux/version.h but the UTS_RELEASE variable is now into the file utsrelease.h.

To fix this, you can patch the VMWare tools installation script or just add the content of utsrelease.h to version.h. I suppose the second solution is the fastest one :)

To do this:

cd /usr/src/kernels/$(uname -r)*/include/linux
cat utsrelease.h >> version.h

Happy virtualization folks! :)

Saturday, February 23, 2008

Eth0 disappears after cloning

When I used VMWare Cloning of Debian Gold image everything was OK except networking. Eth0 disappeared and Eth1 came up. It's due to MAC address persistent association in /etc/udev/rules.d/z25_persistent-net.rules. Solution is to avoid persistent association. If you open this file you'll see that old MAC address is associated with eth0 so you can change this MAC address. However, the easiest solution is just delete file /etc/udev/rules.d/z25_persistent-net.rules. File will be created after next reboot but with MAC address of current network card.