Specifications
www.vmware.com
92
VMware GSX Server Virtual Machine Guide
Executing Commands After You Power Off or Reset a
Virtual Machine
In a Linux guest, you can have the VMware Tools service execute specific commands
when you shut down or restart the guest operating system. This is in addition to any
script that you may have specified to run when you shut down the guest operating
system.
In order to execute these commands, you need to modify
/etc/vmware-tools/tools.conf. The commands are:
halt-command = <command>
(where <command> is the command to execute when you shut down the guest
operating system)
reboot-command = <command>
(where <command> is the command to execute when you restart the guest
operating system)
Passing a String from the Host Operating System to the
Guest Operating System
With GSX Server and knowledge of a scripting language like Perl or NetShell (in a
Windows 2000 guest operating system), you can pass a string from your virtual
machine's configuration file in the host operating system to the guest operating
system when you use the configuration file to launch a virtual machine.
What you pass to the guest operating system is up to you. You should pass a string
only if you have a good understanding of a scripting language and know how to
modify system startup scripts.
There are two ways of passing strings to a virtual machine's guest operating system:
1. You can place a string in the virtual machine's configuration file by setting the
string to the machine.id parameter.
For example, you can set this string:
machine.id = "Hello World."
2. You pass the string to the guest operating system from the command line when
you launch the virtual machine. See example 1 below.
You can pass items like the Windows system ID (SID), a machine name or an IP
address. Inside the guest operating system startup script, you have the service retrieve
this string, which can then be used in another script you write and include in the
startup script to set your virtual machine's system ID, machine name or IP address.