9.0

Using vmrun to Control Virtual Machines
10 VMware, Inc.
Running VMware vSphere Remotely
InVMwarevSphere,usethe-TflagtoconnecttoanESX/ESXihostortothevCenterServer.
vmrun -T esx
vmrun -T vc
VMwarevSphererequiresadditionalflagsforconnectionstoanESX/ESXihostortovCenterServer(VC):
-h <hostName or IPaddr>
-P <portNumber>
-u <adminLogin on ESX/ESXi or VC>
-p <adminPassword on ESX/ESXi or VC>
Theportnumberdefaultsto443.Youcanalsospecifytheportnumberinthe-hoptionafterthehostnameor
IPaddress,separatedbyacolon,usingstandardURLsyntax.Forexample,thefollowingcommandlistsall
runningvirtualmachinesonaremoteESX/ESXihost:
vmrun -T esx -h esx.example.com:8333 -u root -p secretpw list
AsoftheVIX1.10release,ifyoudonotspecifyadministratorloginnameandpassword,vmrunpromptsyou
forauthenticationinformation.AlsoasoftheVIX1.10release,youdonotneedtospecifyleadinghttps://
andtrailing/sdkwiththe-hoption.
Running VMware Server Remotely
TosetthehosttypeforremoteaccesstoVMwareServer2.0,usethe-Toptionwith-handotheroptions.
vmrun -T server -h vm2.example.com:443 -u root -p secretpw list
TosetthehosttypeforremoteaccesstoVMwareServer1.0.x,usethemandatory-Toption,the-hoptionwith
thehostnameinsteadoftheURL,andthe-Poptionwiththeportnumber.
vmrun -T server1 -h vm1.example.com -P 443 -u root -p secretpw list
Virtual Machine Run Reference
Thissectiondocumentsthesyntaxofcommandsinthevmrunutility.
Path to VMX File
VMwarestoresvirtualmachinesasapackagethatincludesthevirtualmachinesettingsfile(<vnname>.vmx)
andthevirtualdisks.Whenrequired,youmustprovidethecompletepathtothe.vmxfile.The.vmtnfileis
similar,forteams.Hereareexamplesofwherethe.vmxfilemightbelocated:
DatastoreonanESX/ESXihost
[datastore1] Win XP/Win XP.vmx
WorkstationforWindowspath
C:\Documents and Settings\<username>\My Documents\My Virtual Machines\Win XP\Win XP.vmx
WorkstationforLinuxpath
/home/<username>/VirtualMachines/Ubuntu/Ubuntu.vmx
VMwareFusionforMacOSXpath
~/Documents/Virtual Machines.localized/Windows XP Home.vmwarevm/Windows XP Home.vmx
NOTEOnVMwareFusion,Workstation,andPlayer,poweringonavirtualmachinewiththedefaultgui
optionrequiresawindowsystem(userinterface)toberunningonthehost.ESX/ESXihosts,vCenterServer,
andVMwareServer(discontinued)donotimposethisrequirement.
IMPORTANTForthevmruncommandsthatrequireVMwareTools,youmustinstallthelatestVMwareTools
packageand,especiallyafteroperatingsystemupdates,keepVMwareToolsuptodate.