6.0

VMware, Inc. 5
Command-Line Management in vSphere 5 and vSphere 6 for Service Console Users
Using the ESXi Shell
EachESXihostincludesanESXiShell,whichisdisabledbydefault.Administratorscanusethatshellto
performtroubleshootingandadvancedtaskssuchastestingscriptsinnonproductionenvironments.
Youcanaccesstheshellasfollows:
Enablelocalaccessandusethelocalshellonthephysicalconsoleorusingaserialport.See“ESXiShell
LocalAccess”onpage 5.
EnableSSHaccessandusetheshelloveramanagementnetworkwithSSH.See“ESXiShellAccess”on
page 5.
TheESXiShellincludesthefollowingcommandsets.
ESXi Shell Access
AnESXisystemincludesadirectconsolethatallowsyoutostartandstopthesystemandtoperformalimited
setofmaintenanceandtroubleshootingtasks.ThedirectconsoleincludestheESXiShell.TheESXiShell
includesasetoffullysupported
ESXCLIcommandsandasetofcommandsfortroubleshootingand
remediation.YoumustenableaccesstotheESXiShellfromthedirectconsoleofeachsystem.Youcanenable
accesstothelocalESXiShelloraccesstotheESXiShellwithSSH.
ESXi Shell Local Access
TheESXiShellisdisabledbydefault.YoucanenabletheESXiShellfortroubleshootingfromthedirectconsole.
AllESXCLIcommandsthatareavailableintheESXiShellarealsoincludedinthevCLIpackage.Installthe
vCLIpackageordeploythevMAvirtualappliance,andruncommandsagainstyour
ESXihosts,insteadof
runningcommandsintheESXiShellitself.SeeGettingStartedwithvSphereCommandLineInterfaces.
I
MPORTANTESXiShellisintendedforexperiencedCLIusers.Minorerrorsintheshellcanresultinserious
problems.InsteadofrunningcommandsdirectlyintheESXiShell,usevCLIcommandsorPowerCLIcmdlets.
Command Set Description
ESXCLIcommands ExtensiblecommandframeworkformanagingmanyaspectsofvSphere.
Runesxcli --helptoseealltop-levelnamespaces.Youcanrun--helpatanylevelofthe
hierarchy.
TheesxclicommandsetintheESXiShellandtheesxclivCLIcommandsetsupportthesame
functionality.WhenrunningvCLIcommands,you
mustspecifythetargetserverand
authenticationoptions.
esxcfg-commands
(deprecated)
SetofcommandsformanagingmanyaspectsofvSphere.Mostesxcfg-commandsavailable
intheESX4.xserviceconsoleareavailableintheESXiShellbutaredeprecatedinESXi5.0and
willberemovedinafuturerelease.
UseESXCLI
commandsinsteadofesxcfg-commands.IfnoESXCLIcommandexists,usethe
vicfg-commandsinthevCLIcommandset.
Othercommands AsmallsetofPOSIX-stylecommandsisincludedintheshell(see“ShellCommands”on
page 9).ThesecommandsarenotsupportedbyVMwarebutareincludedforusein
troubleshooting
situations.UsethevSphereClientorVMwarecommandsinsteadwhere
possible.
localclicommands SetoftroubleshootingcommandsforusewithVMwareTechnicalSupport.localcli
commandsequivalenttoESXCLIcommandsbutbypassthehostdaemon(hostd).
Warning:localclicommandsareonlyforsituationswhenhostdisunavailableandcannot
berestarted.After
yourunalocalclicommand,youmustrestarthostd.Usinglocalcli
commandsinothersituationsisnotsupported.Aninconsistentsystemstateandpotential
failurecanresult.
NOTEForsecurityreasons,youshouldenableESXiShellonlywhenrequired.