For example, when you power off a virtual machine, by default the poweroff-vm-default script runs if the virtual machine is set to shut down the guest operating system rather than abruptly power off.
Scripts are run by the VMware Tools service, or daemon (vmtoolsd). Because
vmtoolsd is run as root on Linux, Solaris, and FreeBSD and as System on Windows, the scripts are run in a separate session from the session of the logged-in user. The VMware Tools daemon does not detect desktop sessions, which means that it cannot display graphical applications. Do not attempt to use custom scripts to display graphical applications.