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
- 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:
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.