2.0

Table Of Contents
VMware, Inc. 101
Chapter 5 Installing and Using VMware Tools
Executing Commands After You Power Off or Reset a Virtual
Machine
InaLinux,Solaris,orFreeBSDguest,youcanusetheVMwareToolsservicetoexecute
specificcommandswhenyoushutdownorrestarttheguestoperatingsystem.Thisis
inadditiontoanyscriptthatyouspecifiedtorunwhenyoushutdowntheguest
operatingsystem.
1Useatext
editortoopenthefollowingfile:
/etc/vmware-tools/tools.conf
2Addoneorbothofthefollowingcommandstothefile:
halt-command = <command>
<command>isthecommandtoexecutewhenyoushutdowntheguest
operatingsystem.
reboot-command = <command>
<command>isthecommandtoexecutewhenyourestarttheguestoperating
system.
Passing a String from the Host to the Guest at Startup
Topassastringfromthehosttotheguestatstartup,youpassthestringfromyour
virtualmachine’sconfigurationfileinthehosttotheguestoperatingsystemwhenyou
poweronthevirtualmachine.
YoucanpassitemsliketheWindowssystemID(SID),amachinename,or
anIP
address.Insidetheguestoperatingsystemstartupscript,youcanhavetheservice
retrievethisstring.Thestringcanthenbeusedinanotherscripttosetyourvirtual
machine’ssystemID,machinename,orIPaddress.
Forexample,usethisstrategytomakecopiesofthesameconfiguration
file,adda
differentstringtoeach(eitherintheconfigurationfileitselforatthecommandline),
andusethesevariationsofthesameconfigurationfiletolaunchthesamevirtualdisk
innonpersistentmodemultipletimesinatrainingortestingenvironment.
Passingastringisalsousefulwhen
youwanttodeployvirtualmachinesonanetwork
usingacommon configurationfilewhileprovidingeachmachinewithitsownunique
identity.