VMware, Inc. 131
Chapter 5 Installing and Using VMware Tools
To use a string in a startup script to set a name and IP address
1Definethestringbyusingoneofthefollowingmethods:
Onthehostmachine,addthefollowinglinetoyourvirtualmachine’s
configurationfile(.vmxfile):
machine.id = "W2K-VM 148.30.16.24"
Openthevirtualmachineusingthisconfigurationfile.
Openthevirtualmachinefromthecommandlinebyenteringthefollowing
ononeline:
“C:\Program Files\VMware\VMware Workstation\vmware -s
'machine.id=W2K-VM 148.30.16.24' C:\Virtual
Machines\win2000\win2000.vmx”
2Dooneofthefollowingtoretrievethestringinthevirtualmachine:
InaWindowsguest,enterthefollowingcommandtoretrievethestring:
vmtoolsd --cmd machine.id.get
InaLinuxguest,intheoperatingsystem’sstartupscript,addthefollowing
commandbeforethenetworkstartupsection.Forexample:
/usr/sbin/vmtoolsd --cmd 'machine.id.get'
Thelocationofvmtoolsddependsonthedirectoryyouspecifyatthetimeof
installation.
3Furthercustomizethisstartupscriptsothatitusesthestringtheserviceretrieved
duringstartuptosetthevirtualmachine’snetworknametoW2K‐VMandits
IP addressto148.30.16.24.
4Placethisstringinthescriptbe
forethecommandtostartthenetworkservices.
Ifyou’reusingaWindows2000guestoperatingsystem,forexample,youcancall
theNetShellutility(netsh)andpassitthecontentsofthestring,whichusesthe
stringaccordingly.Thatis,itcansetanewIPaddressforthevi
rtualmachine,if
thatiswhatwa
spassedinthestringoriginally.
Passing Information Between the Guest and Another Program
TheVMwareToolsserviceallowsyoutouseVMwareprogrammaticinterfacesto
managevirtualmachinesfromyourownindependentprogramsandfromexisting
frameworksdevelopedbypartnersandthirdparties.
FormoreinformationabouttheVMwareInfrastructureSDK,gototheVMwareAPIs
andSDKsDocumentationpageoftheVMwareWebsite.
Kommentare zu diesen Handbüchern