For reference to the source material (and proper credit) I used these as guides to getting this working:<br><br><a href="http://www.linuxdynasty.org/how-to-automate-the-install-of-vmware-tools-after-any-kernel-update.html">http://www.linuxdynasty.org/how-to-automate-the-install-of-vmware-tools-after-any-kernel-update.html</a><br>
<br><a href="http://drcs.ca/blog/?p=181">http://drcs.ca/blog/?p=181</a><br><br><div class="gmail_quote">2009/12/18 James Hogarth <span dir="ltr"><<a href="mailto:james.hogarth@gmail.com">james.hogarth@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">After a little head scratching and hiccups I managed to get my vmware guests kickstarting and including the vmware tools install and config as part of the kickstart process... using the vmxnet driver. <br>
<br>Testing in our environments has shown the vmxnet driver to be superior and we wanted to use it on our guests but of course since it isn't part of the kernel source the guests had to be built with e1000 emulated NICs and then changed over afterwards....<br>

<br>Seeing that there are probably others in the same situation I thought that popping the steps I took onto the mailing list would be good for others - and when I have to do it in 6 months for Centos 5.5 again (or 6) I can search this list for the instructions ;)<br>

<br>This should work in any rpm based kickstartable distrobution but was tested on Centos 5.4 x86_64.<br><br>First you will need a reference system with VMwareTools already installed onto in order to get the kernel module and check the PCI IDs your modules are.<br>

<br>From the PXE or kickstart ISO you are using unpack your initrd to a work directory....<br><br><pre><code>mkdir /tmp/work<br>cd /tmp/work<br>cp /mnt/dvd/images/pxeboot/initrd.img .<br>mkdir initrd<br></code><code>cd initrd<br>

zcat ../initrd.img | cpio -id<br></code><br><font size="2"><span style="font-family: arial,helvetica,sans-serif;"></span></font></pre>On the reference PC check the PCI ID for your modules....<br><pre><code><br>lspci | grep -i -E 'vmware.*ethernet|ethernet.*vmware'</code></pre>


<br>It will look something like:<br><pre><code><br>00:11.0 Ethernet controller: VMware VMXNET Ethernet Controller (rev 10)</code><br></pre><br>Next get the full vendor/product ID for the driver where the PCI ID is 00:11.0 in the example above.<br>

<pre><code><br>lspci -n | grep -i  '15ad'</code></pre>
<br>Look for the line matching the PCI ID found above and make a note of the product ID...<br><br>The example from my case is:<br><br><pre><code>lspci -n00:11.0 0200: 15ad:0720 (rev 10) | grep -i  '15ad'</code></pre>


<br>Where the vendor ID can be seen as 15ad and the product ID to make a note of is above is 0720<br><br>Next we need to expand the modules cpio archive to add our vmware module to it.<br><br><pre><code>mkdir /tmp/work/modules<br>

cd /tmp/work/modules<br>zcat ../initrd/modules/modules.cgz  | cpio -id</code><code><br>cd /tmp/work/modules/2.6.*/x86_64<br>cp /lib/modules/`uname -r`/misc/vmxnet*.ko .<br>chmod 744 vmxnet*<br></code><br></pre>Depending on the version of VMwareToosl you have you may have separate vmxnet.o and vmxnet.ko modules in /lib/modules/`uname -r`/misc - and you may also jave vmxnet and vmxnet3 modules.... For the 2.6 kernel you will need the vmxnet*.ko modules. If your module is symlinked to the .o version (as in my case) make sure you grab the actual file ;)<br>

<br>Next pack back up the modules cpio archive....<br><br><pre><code>cd /tmp/work/modules<br>find . | cpio -o -H crc | gzip -9 > /tmp/work/initrd/modules/modules.cgz<br></code></pre><br>Note that the type is crc here....<br>

<br>Next we need to tell our kernel/initrd about our new modules....<br><br><pre><code>cd /tmp/work/initrd/modules<br>vi pci.ids<br></code></pre><br>Look for the section with the vmware vendor ID of 15ad and add your ethernet modules to this... for reference here is my part of that file after the addition:<br>

<br><pre><code>15ad  VMware<br>        0405  SVGA II Adapter<br>        0710  SVGA Adapter<br>        0720  VMware VMXNET Ethernet Controller (rev 10)<br></code></pre>
<br>Note that you might need the vmxnet3 driver added too depending on your version of VMwareTools....<br><br>Next append to the initrd modules-info alias info....<br><br><pre><code>vmxnet<br>        eth<br>        "VMware VMXNET Ethernet Controller (rev 10)"<br>

<br></code></pre>
Remember to add a vmxnet3 section if required... On the reference system get the entries required for the modules.alias file....<br><br><pre><code>grep vmxnet /lib/modules/2.6.18-164.6.1.el5/modules.alias <br>alias pci:v000015ADd00000720sv*sd*bc*sc*i* vmxnet<br>

alias pci:v00001022d00002000sv*sd*bc*sc*i* vmxnet</code><br></pre><br>Append these to the modules.alias file in /tmp/work/initrd/modules<br><br>Next pack all this back up....<br><br><pre><code>cd /tmp/work/initrd<br>find . | cpio -o -H newc | gzip -9 > /tmp/work/initrd.img.vmxnet<br>

</code></pre>
<br>Copy this initrd.img file to your PXE tree or ISO or however you want to use this (renaming it if need be)...<br><br>That's the hard work done and that will allow a kickstart of the system using the vmxnet network driver instead of the e1000 driver. But that is only good for the kickstart itself this next final bit is to allow the system to still have a network interface after the kickstart is over.... <br>

<br>On the spacewalk server create a post script for your kickstart containing something like the following:<br><br><pre><code>/usr/bin/yum install -y --nogpgcheck VMwareTools<br>sed -i -e '/^\#.*$/d' -e '/^HWADDR=.*$/d' /etc/sysconfig/network-scripts/ifcfg-eth0<br>

echo "rkernel=`uname -r`<br>if [ -e /etc/vmware-tools/not_configured ]; then<br>    echo "vmware-tools not configured for running kernel $rkernel"<br>    echo "running <a href="http://vmware-config-tools.pl" target="_blank">vmware-config-tools.pl</a>"<br>

    /usr/bin/<a href="http://vmware-config-tools.pl" target="_blank">vmware-config-tools.pl</a> -d<br>    echo "vmware-tools now compiled for running kernel $rkernel"<br>    echo "restarting system"<br>
    reboot<br>fi" >> /etc/rc.local<br>
</code></pre>

This assumes that the VMwareToosl rpm is somewhere in your channels. It removes any comments from the ifcfg-eth0 file and removes the HWADDR restriction so that the system doesn't rename it to ifcfg-eth0.bak or somesuch on changes to network interface - this was valid for Centos 5.4 YMMV.... The rc.local addition is important as <a href="http://vmware-tools-config.pl" target="_blank">vmware-tools-config.pl</a> detects module to install based on the running kernel - this is of course different in the kickstart. This will also allow a kernel upgrade and if need be the system will auto-configure on next boot. The reboot is there to ensure that any network services etc or any dependencies on network/vmware running during start up are met.<br>

<br>Hope this is helpful to someone apart from me next distro update ;)<br><font color="#888888"><br>James<br>
</font></blockquote></div><br>