9.0

Using vmrun to Control Virtual Machines
14 VMware, Inc.
removeSharedFolder
(VMwarevSphereand
VMwareServerdonot
supportsharedfolders.)
Removestheguestvirtualmachine’saccesstoashared
folderonthehost.Thesharenameisamountpointin
theguestfilesystem.
<pathto.vmxfile>
<sharename>
setSharedFolderState
(VMwarevSphereand
VMwareServerdonot
supportsharedfolders.)
Modifiesthewrit
abilitystateofaspecifiedfoldershared
betweenthehostandaguestvirtualmachine(.vmxfile).
Thesharenameisamountpointintheguestfilesystem.
Thepathtofolderistheexporteddirectoryonthehost.
Asharedfoldercanbemadewritableorreadonly.
<pathto.v
mxfile>
<sharename>
<pathtofolderonhost>
writable |readonly
captureScreen Capturesthescreenofthevirtualmachinetoalocalfile.
ThespecifiedoutputfileonthehostisinPNGformat.
Avalidguestloginisrequired.
<pathto.vmxfile>
<outputpathonhost>
writeVariable Writesavariabletothevirtualma
chinestateorguest.
Youcanseteitheranonpersistentguestvariable
(guestVar),aruntimeconfigurationparameteras
storedinthe.vmxfile,oranenvironmentvariable
(guestEnv)intheguestoperatingsystem.Aguest
variableisaruntimeonlyvaluethatprovidesasimple
waytopassrunt
imevaluesinandoutoftheguest.
EnvironmentvariablesrequireVMwareToolsandvalid
guestlogin.WithLinux,settingtheguestenvironment
alsorequiresrootlogin.
Providethevariablenameanditsvalue.
<pathto.vmxfile>
[ guestVar |
runtimeConfig |
guestEnv ]
<variablename>
<variablevalue>
readVariable Readsavariablefromthevirtualmachinest
ateorguest.
Youcangetaguestvariable,aruntimeconfigurationas
storedinthe.vmxfile,orenvironmentvariablesinthe
guestoperatingsystem.ReadingtheguestEnvrequires
avalidguestlogin.
Seeaboveforadescriptionofvariabletypes.
<pathto.vmxfile>
[ guestVar |
runtimeConfig |
guestEnv ]
<variablename>
Maintenance Commands
list Listsallru
nningvirtualmachines. None
upgradevm Upgradesavirtualmachinetothecurrentversionof
virtualhardware.Hasnoeffectifthevirtualhardware
versionisthemostrecentsupported.
<pathto.vmxfile>
installTools PreparestoinstallVMwareToolsintheguestoperating
system.InWindowsguestswithautorunenabled,the
VMwareToolsinstallerst
artsbyitself.InLinuxguests
withoutautorun,thiscommandconnectsthevirtual
CDROMdrivetotheVMwareToolsISOimagesuitable
fortheguest,buttheinstallerdoesnotstart.Youmust
completetheinstallationwithadditionalmanualsteps,
asdescribedintheproductdocumentation.
<pathto.vmxfile>
register
(Registra
tionnotsupported
onWorkstationoron
VMwareFusion.)
Registersthespecifiedvirtualmachine,addingittothe
host’sinventory.Pathformatdependsontheproduct.
ForESX/ESXihosts,"[datastore1] vm/vm.vmx"
(startingwiththedatastore)istypical.
<pathto.vmxfile>
unregister
(Registrationnotsupported
onWorkstationoron
VMwareFusion.)
Unregistersthespecifiedvi
rtualmachine,removingit
fromthehost’sinventory.Pathformatdependsonthe
product.ForESX/ESXi,"[datastore1] vm/vm.vmx"
(startingwiththedatastore)istypical.
<pathto.vmxfile>
listRegisteredVM Listsallregisteredvirtualmachines. None
deleteVM Removesthespecifiedvirtualmachine. <pathto.vmxfile>
Table 2. vmrun Commands and Parameters (Continued)
Command Description Parameters