Skip to content

Instantly share code, notes, and snippets.

@trietptm
Last active July 9, 2023 15:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save trietptm/bd48d5376025560b1b43 to your computer and use it in GitHub Desktop.
Save trietptm/bd48d5376025560b1b43 to your computer and use it in GitHub Desktop.
Patch for install-vmware-tools REMnux script to use shared folders
The file install-vmware-tools is from REMnux v6 scripts: https://launchpad.net/~remnux/+archive/ubuntu/stable/+files/remnux-scripts_0.1.50.tar.gz
install-vmware-tools_TrietPTM is my patch for the "install-vmware-tools" script that’s present on REMnux v6 to fix a compatibility issue between VMware Tools and the Linux kernel included in Ubuntu, which prevents shared folders from working.
Other Ways You Can Help With REMnux: https://zeltser.com/remnux-v6-release-for-malware-analysis/
#!/bin/bash
if [ `whoami` != "root" ]; then
echo "Please run this script as as root. Exiting."
exit 2
fi
if [ "x$(dmidecode -s system-product-name | grep VMware)" == "x" ]; then
echo "This script only works within a VMware virtual machine. Exiting."
exit 1
fi
mount /mnt/cdrom 2>/dev/null
if [ ! -f /mnt/cdrom/VMwareTools*.tar.gz ]; then
echo ""
echo "Could not locate VMware Tools installer."
echo "Please activate the VMware Tools installation from outside this"
echo "virtual machine before running the script."
echo "Exiting."
exit 3
fi
apt-get purge -qq -y open-vm-tools-desktop open-vm-tools 2>/dev/null
WORKDIR=/tmp/vmware-tools-$$
mkdir $WORKDIR
cd $WORKDIR
echo "Extracting VMware Tools installer. This can take a minute or so."
echo "Once done, this script will activate the unattended installer."
tar xf /mnt/cdrom/VMwareTools*.tar.gz
sudo vmware-tools-distrib/vmware-install.pl --default
cd ..
rm -rf $WORKDIR
echo ""
echo "Done. Please reboot the system (sudo reboot) now."
#!/bin/bash
if [ `whoami` != "root" ]; then
echo "Please run this script as as root. Exiting."
exit 2
fi
if [ "x$(dmidecode -s system-product-name | grep VMware)" == "x" ]; then
echo "This script only works within a VMware virtual machine. Exiting."
exit 1
fi
mount /mnt/cdrom 2>/dev/null
if [ ! -f /mnt/cdrom/VMwareTools*.tar.gz ]; then
echo ""
echo "Could not locate VMware Tools installer."
echo "Please activate the VMware Tools installation from outside this"
echo "virtual machine before running the script."
echo "Exiting."
exit 3
fi
apt-get purge -qq -y open-vm-tools-desktop open-vm-tools 2>/dev/null
WORKDIR=/tmp/vmware-tools-$$
mkdir $WORKDIR
cd $WORKDIR
echo "Extracting VMware Tools installer. This can take a minute or so."
echo "Once done, this script will activate the unattended installer."
tar xf /mnt/cdrom/VMwareTools*.tar.gz
sudo vmware-tools-distrib/vmware-install.pl --default
git clone https://github.com/rasa/vmware-tools-patches.git
cd vmware-tools-patches
./download-tools.sh
./untar-and-patch.sh
./compile.sh
cd ../..
rm -rf $WORKDIR
echo ""
echo "Done. Please reboot the system (sudo reboot) now."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment