Skip to content

Instantly share code, notes, and snippets.

@ilanh
ilanh / vmware-tools-install.bash
Last active June 28, 2022 09:18
Install VMware Tools to linux virtual machines, first run will uninstall open-vm-tools, second run will install tools. (ubuntu, debian, centos, redhat)
#!/bin/bash
# you can run it directly from console using:
# curl -L -s https://gist.github.com/ilanh/da30692e33d5796f813d451031453be2/raw/ | sudo -H sh
if lsblk -fp | grep iso9660 | grep 'VMware Tools' ; then
echo "Found Tools CD";
else
echo "Tools CD not found!";
echo "Removing open-vm-tools";
if [ -f /etc/redhat-release ]; then yum remove -y open-vm-tools; fi
if [ -f /etc/lsb-release ]; then apt remove open-vm-tools --purge -y ; fi