Contents

Executing Scripts When the Virtual Machine’s Power State Changes

You can run scripts in the guest operating system when you change the power state of a virtual machine; that is, when you power on, power off, suspend, resume or reset the virtual machine.

Scripts should help automate guest operating system operations when you change the virtual machine’s power state.

You perform these power operations from the toolbar buttons and menus in the consoles.

Scripts can run when using the power buttons in the VMware Management Interface. For more information, see Understanding the VMware Management Interface.

Scripts can be executed only when the VMware guest operating system service is running. The guest service starts by default when you start the guest operating system.

Default scripts are included in VMware Tools. On a Windows host, the default script executed when suspending a virtual machine releases the IP address of the virtual machine while the default script executed when resuming a virtual machine renews the IP address of the virtual machine. On a Linux host, the default script executed when suspending a virtual machine stops networking for the virtual machine while the default script executed when resuming a virtual machine starts networking for the virtual machine.

In addition, you can create your own scripts. The scripts you can run must be batch files for Windows hosts but can be any executable format (such as shell or Perl scripts) for Linux hosts. You should have a thorough familiarity with these types of scripts before you modify the default scripts or create your own.

If you create your own scripts, you must associate each script with its particular power operation. This is done on the Scripts tab in the VMware Tools control panel.

In order for scripts and their associate power operations to work, the following conditions must be met:

Issues to Consider

Related Topics:

Back to top

© 2001-2002 VMware, Inc. All rights reserved.