When you use Guest Customization Scripts, it's important to define when they are running.
We will need a vApp with VMs in it. To test the results in this recipe, it is good if you have a Linux and a Windows VM so that you can test the results better.
Select a VM that you want to configure with Guest Customization.
Right-click on the VM and select Properties.
Click on Guest OS Customization.
Make sure you have enabled Guest Customization and then scroll down to the end of the page.
In the large textbox, enter the following scripts depending on your operating system:
The following is the Linux script:
#!/bin/sh if [ x$1 == x"precustomization" ]; then /bin/date > /tmp/VMStatus echo VM Precustomization >> /tmp/VMStatus Hostname >> /tmp/VMStatus elif [ x$1 == x"postcustomization" ]; then /bin/date >> /tmp/VMStatus echo postcustomization >> /tmp/VMStatus Hostname...