VMware, Inc. 427
Chapter 19 Setting and Using Policies and Customizing VMware Player
# Description:
# This sample script passes information defined on the host to the guest.
# It assumes that the machine name is defined in the environment variable
# TEST_MACHINENAME and that the asset tag is defined in the environment
# variable TEST_ASSETTAG. (These are fictitious variables used for this # #
sample).
#
# Input to script:
# None.
#
# Returns:
# 0 if successful.
#
# Expected output:
# Set of acceptable key/value pairs where the values are fetched from the
# environment variables. These values can be retrieved from within the
# Guest operating system using the VMware Tools.
my $machine_name = $ENV{TEST_MACHINENAME};
my $asset_tag = $ENV{TEST_ASSETTAG};
my $host_mac = $ENV{TEST_MACHINEMAC};
if (defined $machine_name) {
print "machine.id=".$machine_name . "\n";
}
if (defined $asset_tag) {
print "guestinfo.assetTag=".$asset_tag . "\n";
}
if (defined $host_mac) {
printf "guestinfo.mac=".$host_mac . "\n";
}
exit(0);
Example of a Power-On Hook Script
ThefollowingexampleiswritteninPerl.ItisinstalledbyWorkstationas
sample_poweron.pl.YouneedaPerlinterpretertorunthisscript.
#
# VMware Sample Script
#
# Sample script for ACE power-on hook
#
# Description:
# This sample script implements a power-on hook for ACE. This can be used
# in addition to authentication to control the circumstances under which an
# ACE is allowed to run.
Comentarios a estos manuales