VMware Tools scripts can help automate guest operating system operations when you change the virtual machine's power state.
On the Scripts tab you can enable, disable and run scripts that are associated with changing a virtual machine's power state.
Note: Scripts cannot be run in FreeBSD guest operating systems.
On a Windows host, provided the virtual machine is configured to use DHCP, the script that executes when you suspend a virtual machine releases the IP address of the virtual machine. The script that executes when you resume a virtual machine renews the IP address of the virtual machine.
On a Linux host, the script that executes when you suspend a virtual machine stops networking for the virtual machine. The script that executes when you resume a virtual machine starts networking for the virtual machine.
To disable a script, deselect the check box for the appropriate script then select the path to the script and delete it.
Note: Default scripts for suspending and resuming are written to work together. If you disable the script of one of these actions, disable the script for the other action as well.
A default script for each power operation is included in VMware Tools. These scripts are located in the guest operating system in /etc/vmware-tools.
When You ...
|
This Default Script Runs
|
---|---|
Suspend the guest operating system
|
suspend-vm-default
|
Resume the guest operating system
|
resume-vm-default
|
Power off the guest operating system
|
poweroff-vm-default
|
Power on the guest operating system
|
poweron-vm-default
|
If the virtual machine is running under GSX Server, VMware Server, or ESX Server, you can use the default script or you can substitute a script you created for each power state change. In addition, if you are logged in as root, you can test a script or disable the running of a script. Complete the following steps.
Note: To edit scripts from the Scripts tab, xterm and vi must be installed in the guest operating system. The user trying to edit the script must be a root user and must have vi and xterm in his or her PATH. Otherwise, scripts can be edited manually in any text editor.
Note: If you plan to test scripts in a Turbolinux 7.0 guest operating system, you need to update the Turbolinux guest operating system. This is a known issue with Turbolinux. Go to ftp://ftp.turbolinux.com/pub/TurboLinux/stable/ tested/Workstation/7/i586/initscripts-7.0.0-18.i586.rpm.