Installation guide

C H A P T E R 2 Creating and Configuring Virtual Machines
55
scsi0:1.mode = "persistent"
machine.id = "the_id_for_my_first_vm"
<config_file_2>.vmx contains:
scsi0:1.present = TRUE
scsi0:1.name = "my_common_virtual_hard_drive.dsk"
scsi0:1.mode = "persistent"
machine.id = "the_id_for_my_second_vm"
Using machine.id, you may pass such strings as the Windows system ID (SID), a
machine name or an IP address. In the guest operating system startup script, you may
then have the guest service retrieve this string, which can then be used by your script
to set your virtual machine's system ID, machine name or IP address.
In the following example, we use a Linux guest to illustrate how you can use the guest
service to retrieve a string containing what becomes the virtual machine’s machine
name and IP address. We use RedHat62VM as the machine name and 148.30.16.24 as
the IP address.
1. Define the machine.id string. Define the following option in your virtual
machine’s configuration file (as described in Modifying the Configuration File
Directly (Advanced Users Only) on page 141):
machine.id = "RedHat62VM 148.30.16.24"
Then launch a virtual machine using this configuration file.
2. Retrieve the machine.id string in the virtual machine. In your system startup
script, before the network startup section, add the following command:
/etc/vmware/vmware-guestd --cmd 'machine.id.get'
Note: in a Windows guest, the command to retrieve the string is
VMwareService --cmd machine.id.get
You need to further customize this startup script so it uses the string the guest
service retrieved during startup to set the virtual machine’s network name to
RedHat62VM and its IP address to 148.30.16.24. This should be located in the
script before the network services are started. If you’re using a Windows 2000
guest operating system, for example, you can call the NetShell utility (netsh)
and pass it the contents of the string, which it can then use appropriately (that is,
it can set a new IP address for the virtual machine, if that is what was passed in
the string originally).
From the service console, you can prevent the service console from passing a string to
the guest operating system via the guest service. To do this, set the following line in
your virtual machine’s configuration file.