You can associate custom scripts with power operations.

When VMware Tools is installed, one or more default scripts run on the guest whenever you change the power state of the virtual machine. You change the power state by using menu commands or by clicking the Suspend, Resume, Power On, and Power Off buttons. For example, when you power off a virtual machine, by default the poweroff-vm-default script runs.

For Windows guest operating systems, you can write new scripts or modify default scripts and save them with new names and then configure VMware Tools to use your custom script instead of the default script.

For Linux, Mac OS X, Solaris, and FreeBSD guests, you can write scripts and place them in a certain directory, and then VMware Tools runs your scripts in addition to the default scripts. For power-on and resume operations, the default scripts run before the custom scripts. For suspend and power-off, the default scripts run after the custom scripts. This way, VMware Tools stops services only after the custom scripts finish their work and, conversely, restores the same services before the custom scripts attempt to use the services.)