9.0
Table Of Contents
Using vmrun to Control Virtual Machines
12 VMware, Inc.
deleteSnapshot
(VMwareServeralways
deletestherootsnapshot.)
Removesasnapshotfromavirtualmachine(.vmxfile).
Forproductsthatsupportmultiplesnapshots,youmust
providethesnapshotname.
Thevirtualmachinemustbepoweredofforsuspended.
Ifthesnapshothaschildren,theybecomechildrenofthe
deletedsnapshot’sparent,andsub
sequentsnapshots
continueasbeforefromtheendofthechain.
TheandDeleteChildrenoptiondeletesthespecified
snapshotanditschildrenrecursively.
SeerevertToSnapshotforsolutionstonameconflicts.
<pathto.vmxfile>
<snapshotname>
[ andDeleteChildren ]
revertToSnapshot
(VMwareServeralways
revertstotherootsnapshot.)
Setsthevirtualmachinetoitsstateatsnapshottime.
How
everifthevirtualmachinewaspoweredonatthe
timeofthesnapshot,vmrunrevertsittosuspendedstate,
butdoesnotresumerunningthevirtualmachine.
Ifasnapshothasauniquenamewithinavirtual
machine,reverttothatsnapshotbyspecifyingthepath
tothevirtualmachine’scon
figurationfileandthe
uniquesnapshotname.
Ifseveralsnapshotshavethesamename,specifythe
snapshotbyincludingafullpathnameforthesnapshot.
Apathnameisaseriesofsnapshotnames,separatedby
forwardslashcharacters(/).Eachnamespecifiesanew
snapshotinthetree.Forexample,thepathname
Snap1/Snap2ident
ifiesasnapshotnamedSnap2that
wastakenfromthestateofasnapshotnamedSnap1.
<pathto.vmxfile>
<snapshotname>
or
<pathto.vmxfile>
<snap1/snap2/snapN>
Guest Operating System Commands
Thetimeout(waitforVMwareTools)isfiveminutesforallguest‐relatedcommands.
runProgramInGuest Runsaspecifiedprogramintheguestoperatingsys
tem.
The-noWaitoptionreturnsapromptimmediatelyafter
theprogramstartsintheguest,ratherthanwaitingforit
tofinish.Thisoptionisusefulforinteractiveprograms.
The-activeWindowoptionensuresthattheWindows
GUIisvisible,notminimized.IthasnoeffectonLinux.
The-interactiveoptionforcesinteractivegu
estlogin.
ItisusefulforVistaandWindows7gueststomakethe
programvisibleintheconsolewindow.
Youmustprovidethefullpathnameofaprogram
accessibletotheguest.Alsoprovidefullaccessible
pathnamesforanyfilesspecifiedintheprogram
arguments,accordingtorequirementsoftheprogram.
VM
wareToolsandavalidguestloginarerequired.
<pathto.vmxfile>
[ -noWait |
-activeWindow |
-interactive ]
<programname>
[<programarguments>]
runScriptInGuest Runsthespecifiedcommandscriptintheguest
operatingsystem.
SeerunProgramInGuestforanexplanationofoptions.
Theinterpreterpathisthecommandthatrunsthescript.
Providethecompletetextofth
escript,notafilename.
VMwareToolsandavalidguestloginarerequired.
<pathto.vmxfile>
[ -noWait |
-activeWindow |
-interactive ]
<interpreterpath>
<scripttext>
listProcessesInGuest Listsallprocessesrunningintheguestoperating
system.VMwareToolsandavalidguestloginare
required.
<pathto.vmxfile>
killProcessInGuest Stopsaspecifiedprocessintheguestope
ratingsystem.
VMwareToolsandavalidguestloginarerequired.
TheprocessIDcanbeanynumberlistedafterpid=in
theoutputoflistProcessesInGuest.
<pathto.vmxfile>
<processID>
fileExistsInGuest Checkswhetherthespecifiedfileexistsintheguest
operatingsystem.VMwareToolsandavalidguestlogin
arerequired.
<pat
hto.vmxfile>
<pathtofileonguest>
Table 2. vmrun Commands and Parameters (Continued)
Command Description Parameters