VMware 571773-B21 User Guide - Page 14
Use Custom VMware Tools Scripts, Option, Action, Windows, Linux Solaris, and FreeBSD, Windows guests
UPC - 884962097311
View all VMware 571773-B21 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 14 highlights
VMware Tools Configuration Utility User's Guide Use Custom VMware Tools Scripts You can use scripts to automate guest operating system operations when you change the power state of a virtual machine. You can also edit default scripts or associate custom scripts with power operations. On most guest operating systems, if VMware Tools is installed, you can configure settings so that one or more scripts run when the power state changes. 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 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 has no knowledge of desktop sessions, which means that it cannot display graphical applications. Do not attempt to use custom scripts to display graphical applications. IMPORTANT This utility cannot run scripts on Windows NT, Me, Windows 98, or Windows 95 guest operating systems. Scripts are not available on Mac guests. Prerequisites Perform one or more of the following tasks, as necessary: n To familiarize yourself with the default scripts, see "Default VMware Tools Scripts," on page 15. n On Linux, Solaris, and FreeBSD guests, to test, edit, or disable the running of a script, log in as root. n On Linux, Solaris, and FreeBSD guests, to edit a script, make sure xterm and vi are installed in the guest and are in your PATH, or specify which editor to use by setting the EDITOR environment variable. n If you plan to script the commands used in this procedure and need to know what the exit codes are, see "Exit Codes," on page 19. Procedure 1 Examine the contents of the default scripts to determine whether you want to create a custom script by making changes and saving the edited scripts in a new location. Option Windows Linux Solaris, and FreeBSD Action Edit scripts in Program Files\VMware\VMware Tools. Edit scripts in /etc/vmware-tools. 2 Write new scripts or modify default scripts and save them with new names. Option Windows guests Linux, Solaris, and FreeBSD guests Action If you write a new script, create the script as a batch file. Create the script in any executable format, such as a shell or Perl script. 3 Open a command prompt or terminal in the guest. 4 Change to the VMware Tools installation directory. Option Windows Linux and Solaris FreeBSD Action Change directories to C:\Program Files\VMware\VMware Tools. Change directories to /usr/sbin. Change directories to /usr/local/sbin. 14 VMware, Inc.