WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Automating silent installation of VMware Tools on Linux w/Automatic Kernel Modules

06.17.2015 by William Lam // 14 Comments

There was a recent question that was posted internally looking for a way to automate the silent installation of VMware Tools for Linux guest operating systems which also required enabling additional VMware Tools features like VMware's Automatic Kernel Modules. Currently, there are two options of installing VMware Tools for Linux guests, the first is by using VMware Tools Operating Specific Packages (OSPs) which can be found here or you can be manually install VMware Tools if an OSP does not exist or if you prefer to install interactively.

The second approach is what we will be focusing on and specifically with an emphasis on Automation 🙂 Once the VMware Tools installer is extracted, you will find a Perl script that does the actual magic called vmware-install.pl

Screen Shot 2015-06-17 at 8.13.19 AM
The VMware Tools installer supports two modes of installation:

  1. Interactive
  2. Unattended with VMware defaults

The second option sounds like what we want but the problem is that the defaults have already been pre-selected by VMware and they can not be changed as far as I know. To use this option, you would specify the following:

./vmware-install.pl -d default

Here is a complete working snippet that I shared awhile back which will completely automate the installation of VMware Tools using the "default" method and is the quickest way to install VMware Tools for Linux guestOSes:


mkdir -p /mnt/vmw-tools && mount /dev/cdrom /mnt/vmw-tools && VMW_TOOLS=$(ls /mnt/vmw-tools/ | grep .gz) && cp -f /mnt/vmw-tools/${VMW_TOOLS} /tmp/ && umount /mnt/vmw-tools && rmdir /mnt/vmw-tools && tar -zxvf /tmp/${VMW_TOOLS} -C /tmp/ && cd /tmp/vmware-tools-distrib/ && ./vmware-install.pl -d default && rm -rf vmware-tools-distrib/ && rm -f /tmp/${VMW_TOOLS} && cd ~

view raw

gistfile1.txt

hosted with ❤ by GitHub

The solution above is great if you are okay with the defaults. However, if you wish to change any of the default settings such as the location of the installation or enabling additional VMware Tools capabilities, it is definitely not ideal. Unfortunately, as mentioned earlier these are the only two supported installation mechanisms. Now, just imagine you need to roll out a custom installation of VMware Tools and having to perform the installation manually, there must be a way right?

Luckily, there is and this is actually a trick that I have used for many installers which require some user interaction. Below is an updated script of performing a silent installation of VMware Tools, but instead of using the defaults I have created an "answer" file which contains the input that you would manually enter and redirecting that into the installer. In this particular case, I have left the system defaults in terms of the paths and documentation of where VMware Tools will be installed and focus on enabling additional capabilities such as VMware automatic kernel modules.

The last four lines in the answer file (no, no, yes, no) maps to the following VMware Tools capabilities:

  • VMware Host-Guest Filesystem
  • vmblock enables dragging or copying files
  • VMware automatic kernel modules
  • Guest Authentication

You can change these based on your requirements but the current script only enables "VMware automatic kernel modules". I think a great feature enhancement to the VMware Tools installer is the ability to accept a silent configuration file, so that this use case can be better supported and more resilient in case additional options are added.


#!/bin/bash
# Create temp workign directory
mkdir -p /mnt/vmw-tools
# Mount VMware Tools ISO
mount /dev/cdrom /mnt/vmw-tools
# Retrieve the VMware Tools package name from the directory
VMW_TOOLS=$(ls /mnt/vmw-tools/ | grep .gz)
# Copy VMware Tools package to /tmp
cp -f /mnt/vmw-tools/${VMW_TOOLS} /tmp/
# Unmount the VMware Tools ISO
umount /mnt/vmw-tools
# Clean up and remove temp mount directory
rmdir /mnt/vmw-tools
# Extract VMware Tools installer to /tmp
tar -zxvf /tmp/${VMW_TOOLS} -C /tmp/
# Change into VMware Tools installer directory
cd /tmp/vmware-tools-distrib/
# Create silent answer file for VMware Tools Installer
# If you wish to change which Kernel modules get installed
# The last four entries (no,no,yes,no) map to the following:
# VMware Host-Guest Filesystem
# vmblock enables dragging or copying files
# VMware automatic kernel modules
# Guest Authentication
# and you can also change the other params as well
cat > /tmp/answer << __ANSWER__
yes
/usr/bin
/etc
/etc/init.d
/usr/sbin
/usr/lib/vmware-tools
yes
/usr/share/doc/vmware-tools
yes
yes
no
no
yes
no
__ANSWER__
# Install VMware Tools and redirecting the silent instlal file
./vmware-install.pl < /tmp/answer
# Final clean up
rm -rf vmware-tools-distrib/
rm -f /tmp/${VMW_TOOLS}
cd ~

view raw

gistfile1.sh

hosted with ❤ by GitHub

Categories // Automation, ESXi, vSphere Tags // linux, vmware tools

Quick Tip - Upgrading VMware Tools for Nested ESXi 6.0

04.03.2015 by William Lam // 2 Comments

I have received several questions about this in the last couple of weeks regarding the process of upgrading VMware Tools for running Nested ESXi 5.x and 6.0 when the physical ESXi host has been upgraded to ESXi 6.0. Instead of individual replies, I thought I would share this quick tip. First off, VMware Tools for Nested ESXi provides a very specific set of capabilities for Nested ESXi guests as shown below:

  • Provides guest OS information of the nested ESXi Hypervisor (eg. IP address, configured hostname, etc.).
  • Allows the nested ESXi VM to be cleanly shut down or restarted when performing power operations with the vSphere Web/C# Client or vSphere APIs.
  • Executes scripts that help automate ESXi guest OS operations when the guest’s power state changes.
  • Supports the Guest Operations API (formally known as the VIX API).

Unlike traditional VMware Tools which may provide updated capabilities with each new release, VMware Tools for Nested ESXi exposes only a subset of those capabilities which has not changed between ESXi 5.x and 6.0. This is an important fact to be aware of because you may see "Unsupported older version" for the VMware Tools status in the vSphere Web/C# Client and this is perfectly fine and expected.

Here is a screenshot of a Nested ESXi 5.5 VM with VMware Tools installed running on top of an upgraded physical ESXi 6.0 host:

upgrading_nested_esxi_vmware_tools_vsphere_6_1
In this scenario, the VMware Tools status will be reported as "Unsupported older version" because the version of VMware Tools does not match the latest version of VMware Tools included with ESXi 6.0. However, you should not be alarm as the expected functionality listed above will continue to work without any problems and you can just ignore the UI warning. The only way to get rid of this warning is to upgrade the Nested ESXi VM to ESXi 6.0 which I go over in more details below. I know upgrading may not be an option if you still wish to run ESXi 5.x, but as far as I know, there will not be an update to VMware Tools VIB for ESXi 6.0 as it is now pre-installed with ESXi 6.0.

Here is a screenshot of the same VM which has now been upgraded to ESXi 6.0 running on top of an upgraded physical ESXi 6.0 host:

upgrading_nested_esxi_vmware_tools_vsphere_6_2
In this case, the VMware Tools status will be reported as "Unsupported older version" because the version of VMware Tools does not match the latest version of VMware Tools included with ESXi 6.0. However, because VMware Tools now comes pre-installed with ESXi 6.0. We can easily remedy this by removing the VMware Tools VIB we installed for ESXi 5.x by running the following ESXCLI command and then rebooting:

esxcli software vib remove -n esx-tools-for-esxi

Once the ESXi host has rebooted, the VMware Tools that is pre-installed with ESXi 6.0 will automatically start up if it detects it is running as a VM. If you now look at your vSphere Web/C# Client, you will see that VMware Tools status shows current and is also the default behavior if you are running Nested ESXi 6.0 VM on top of physical ESXi 6.0 host.

upgrading_nested_esxi_vmware_tools_vsphere_6_3
With VMware Tools being pre-installed with ESXi 6.0 and only loaded when it detects it is being run as a VM, you no longer need to worry about manually installing additional VIBs get the benefits of having VMware Tools installed for your Nested ESXi VMs.

Categories // ESXi, Nested Virtualization, vSphere 6.0 Tags // ESXi 6.0, nested, nested virtualization, vmtoolsd, vmware tools, vSphere 6.0

VMware Tools is now pre-installed with Nested ESXi 6.0

02.26.2015 by William Lam // 9 Comments

I just came across this super awesome little tidbit from Core Nested ESXi Engineer Jim Mattson, that ESXi 6.0 now comes per-installed with VMware Tools when running Nested ESXi. This means you no longer have to manually install the VMware Tools for Nested ESXi but ESXi will be able to automatically detect that it is running inside of a VM and automatically startup the vmtoolsd process.

Disclaimer: Nested ESXi is not officially supported by VMware, please use at your own risk.

Screen Shot 2015-02-26 at 9.25.12 AM
This new feature of Nested ESXi is agnostic to the underlying physical ESXi version as well as the virtual hardware version. The only requirement is that the Nested ESXi is running ESXi 6.0. Talk about ease of use, this just made Nested ESXi that much cooler as if it was not already! 🙂

If you need to directly call into the vmtoolsd process for extracting OVF properties/etc. make sure you have correct library paths setup before running the vmtoolsd command, else you will get an error. To do so, run the following two commands:

export LD_LIBRARY_PATH=/usr/lib/vmware/vmtools/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib/vmware/vmtools/bin:$PATH

Categories // ESXi, Nested Virtualization, vSphere 6.0 Tags // nested virtualization, vmware tools, vSphere 6.0

  • « Previous Page
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...