2.0

Table Of Contents
VMware, Inc. 99
Chapter 5 Installing and Using VMware Tools
Creating Scripts to Override Default VMware Tools Scripts
YoucancreateyourownscriptstooverridethedefaultVMwareToolsscriptsthat
controlpowerstatechanges.
ScriptsarerunbytheVMwareToolsdaemon(VMwareService.exe onWindowsand
vmware-guestdonUNIX).Becausevmware-guestdisrunasrootonUNIXandas
SystemonWindows,thescriptsarerunina
separatesessionfromtheloggedinusers
session.TheVMwareToolsdaemonhasnoknowledgeofdesktopsessions,which
meansthatitcannotdisplaygraphicalapplications.Donotattempttousecustom
scriptstodisplaygraphicalapplications.
Beforecreatingcustomscripts,makesurethatthefollowingconditionsaremetinthe
guestoperatingsystem:
ThevirtualmachineisusingthelatestversionofVMwareTools.
TheVMwareToolsserviceisrunninginthevirtualmachine.
Dependingontheoperationthatthescriptperforms,thevirtualmachinehasa
virtualnetworkadapterconnected.Ifnot,thepoweroperationfails.
(UNIXguestsonly)ToeditascriptusingtheEditbuttonontheScriptstab,xterm
andvimustbeinstalledintheguestoperatingsystemandmustbeinyourPATH.
Youmustbearootusertoeditthescript.
To create scripts to override default VMware Tools scripts
1 Determinewhetheryouwanttocreateyourcustomscript
bymakingchangesto
thedefaultscriptandsavingittoanewlocation.
InWindowsguests,thedefaultscriptsarelocatedinthe
Program Files\VMware\VMware Toolsfolder.
OnUNIX,thedefaultscriptsarelocatedinthe/etc/vmware-toolsdirectory.
2Modifythedefaultscriptandsaveitwithadifferentnameorwritea
different
script.
OnWindowsguests,ifyouwriteanewscript,createthescriptasabatchfile.For
UNIX,createthescriptinanyexecutableformat(suchasshellorPerlscripts).
YoucanalsousetheEditbuttonontheScriptstaboftheVMwareToolscontrol
panelto
editacustomscript.Youcanalsoeditscriptsmanuallyusinganytext
editor.