Removing unwanted VMware Tools modules

I had a fault raised to me a few weeks back, over a Windows VM that was flagging a warning in it’s eventlog:

vnetfilter

I set up a test VM using the same base image, and found that it also had the same issue.

Some digging around in the VMware KB turned up this article. We don’t use vShield on this particular environment, and a little more investigation showed the HGFS driver also loaded. Basically, the base VM template had a “Full” VMware Tools install instead of the normal “Typical” install.

I figured there should be a way of removing the unwanted modules, and this page seemed to imply it was possible. We don’t like to do anything interactively, so I moved straight to the command line.

start /wait setup.exe /S /v" /qn REBOOT=R ADDLOCAL=ALL REMOVE=VShield,Hgfs"

..looked like it should do the trick.

A quick trial run though, showed it left the VShield and Hgfs modules installed.

My next attempt, deleting the vShield and vmHgfs “services” and running the same command line, also fundamentally failed. This time it actually reinstalled the drivers when I let it do an automatic tools upgrade to match the host.

My next approach was to perform an uninstall of the VMtools, so that I could do a clean install without the unnecessary modules. This of course failed because the VM was running on VMXNET3, and removing the VMtools removed the drivers and broke the link to the automation server!

The final solution I ended up with, was the following scripting steps:

  1. Copy VMtools install files to target VM
  2. Copy VMXNET3 drivers to target VM
  3. Uninstall VMTools (with a powershell script)
    Install VMXNET3 drivers with “pnputil” utility
    Reboot the VM
  4. Reinstall VMtools without the VShield and Hgfs services (using the command line shown above)

I hope this helps anyone in the same predicament. If anyone has found a way of automating just the removal of the vShield and HFGS drivers, please let me know!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s