Automate silent install of VMware Tools including enabling Automatic Kernel Module Update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 ~ |
William, loved your post on this. http://www.virtuallyghetto.com/2015/06/automating-silent-installation-of-vmware-tools-on-linux-wautomatic-kernel-modules.html
I'm actually thinking of incorporating this into https://github.com/rasa/vmware-tools-patches/ if that's OK with you. He has an excellent one touch script that grabs the latest tools and applies just the right patches for your system, and that also includes the kernel headers mentioned by @RAGNOARAKNOS.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thats brilliant, is there a means to check whether the linux devheaders are already installed before the installation starts?