Command lines for administering a VMware ESXi host from the ESX Shell or over SSH, checked against Broadcom's ESXCLI reference and vSphere documentation for release 9.1, which calls the hypervisor ESX. Most rows are esxcli commands, grouped by task; other shell tools such as vmkfstools, esxtop and pktcap-uw appear only where Broadcom prints them. Every esxcli command reads as namespace, then action, and esxcli --help works at any level. Capitals mark values you replace.
Daemon control namespaceControls daemons that were built with the Daemon SDK.
esxcli device
Device manager namespace
esxcli esxcli
ESXCLI introspection namespaceReports on the command set itself, for example a list of every command on the host.
esxcli graphics
Graphics namespace
esxcli hardware
Hardware namespaceReports CPUs, memory, PCI devices, IPMI sensors and the platform, and configures a few hardware settings.
esxcli iscsi
iSCSI namespaceSets up software and hardware iSCSI adapters, discovery addresses, CHAP and sessions.
esxcli licensing
Licensing namespaceHolds the operations that manage license credentials on the host.
esxcli memtier
Memory tiering namespaceTurns memory tiering on or off and sets its devices and tier ratio.
esxcli network
Networking namespaceCovers virtual switches, port groups, VMkernel IP settings, DNS, the firewall and physical adapters.
esxcli nsx
NSX namespace
esxcli nvme
NVMe namespaceLists NVMe adapters, controllers and namespaces and reads device logs such as SMART data.
esxcli rdma
RDMA namespaceWorks on the RDMA protocol stack, including the device list and the packet sniffer.
esxcli sched
Scheduler namespaceHolds the VMkernel properties and settings that deal with scheduling.
esxcli software
Software image namespaceLists and changes what is installed: VIBs, components, image profiles, the base image and the acceptance level.
esxcli storage
Storage namespaceCovers devices, paths, adapters, multipathing plug-ins and VMFS and NFS datastores.
esxcli system
System namespaceCovers host name, time, maintenance mode, modules, advanced settings, syslog, core dumps, accounts and shutdown.
esxcli vm
Virtual machine namespaceLists running virtual machines and force-stops one that no longer responds.
esxcli vsan
vSAN namespaceReads and changes vSAN cluster membership, vSAN networking and the disks vSAN has claimed.
Help, output format and remote targets 7
Examples in Broadcom's guides contain a connection-options placeholder after esxcli; in the ESX Shell on the host you leave it out, as the rows here do.
Command
What it does
esxcli --help
Show help at any levelAdd it after a namespace or a command to see what is available below that point.
esxcli esxcli command list
List every commandPrints all commands the targeted host supports, so it also reveals what a partner VIB added.
esxcli --formatter=csv storage filesystem list
Print output as CSVThe formatter option goes before the namespace and also accepts xml and keyvalue.
esxcli --formatter=keyvalue storage filesystem list
Print key-value outputRedirect the result to a file when another program has to parse it.
esxcli --server myESXi --username user1 --password 'my_password' storage nfs list
Target a host remotelyConnection options stand before the namespace; inside the ESX Shell they are not needed.
esxcli --server MyVC --vihost MyESXi storage filesystem list
Run a command through vCenterNeeded for a host in lockdown mode; you are asked for the vCenter user name and password.
esxcli --server MyESXi --help
Check commands on a remote hostLists what that host offers, so you can confirm a command exists there before running it.
System and maintenance mode 23
Command
What it does
esxcli system version get
Show version and buildPrints product name, version and build number; --alternate reports the image in the other boot bank.
esxcli system hostname get
Show host and domain nameReturns the host name, the domain and the fully qualified name.
esxcli system hostname set --host NEW_HOST_NAME
Set the host nameReturns an error on a host that takes its network settings from DHCP.
esxcli system uuid get
Show system UUID
esxcli system time get
Show system time
esxcli system stats uptime get
Show uptimeThe value is given in microseconds.
esxcli system stats installtime get
Show first install dateThe date stays the same after later updates of the host.
esxcli system boot device get
Show boot device
esxcli system ntp get
Show NTP configurationAdd --server-names to print only the server host names.
esxcli system maintenanceMode get
Check maintenance mode state
esxcli system maintenanceMode set --enable true
Enter maintenance modeThe host switches only once every virtual machine on it is suspended or migrated.
esxcli system maintenanceMode set --enable false
Exit maintenance modeReports an error when the host has already left maintenance mode.
esxcli system shutdown reboot --reason REASON
Reboot the hostThe reason is mandatory, the host has to be in maintenance mode, and --delay waits a number of seconds.
esxcli system shutdown poweroff --reason REASON
Power off the hostA managed host drops its vCenter connection but stays in the inventory.
esxcli system process list
List UserWorld processes
esxcli system module list --enabled=true
List enabled VMkernel modules
esxcli system module list --loaded=true
List loaded VMkernel modules
esxcli system module set --module MODULE_NAME --enabled=true
Enable a VMkernel modulePass --enabled=false to disable the module instead.
esxcli system module parameters list --module MODULE_NAME
List module parametersUse it after a change to confirm how the module is configured.
esxcli system module parameters set -m MODULE -p "a=1 b=1 c=1"
Set module parametersSeveral values go into one quoted string, separated by spaces.
esxcli system settings advanced list -o /VMFS3/MaxAddressableSpaceTB
Show one advanced optionWithout -o every VMkernel advanced option is listed; --delta keeps only changed ones.
esxcli system settings advanced set -o /Mem/MemEagerZero -i 1
Set an advanced optionPass a number with -i and a text value with -s.
esxcli system settings kernel list -o execInstalledOnly
Show one kernel settingLeave out -o to list all VMkernel kernel settings.
Users, roles and security 15
Command
What it does
esxcli system account list
List local user accounts
esxcli system account add --id USER --password PASSWORD --password-confirmation PASSWORD
Create a local userAdd --description for a full name; shell access is allowed by default for new users.
esxcli system account set --id USER --shell-access false
Turn off a user's shell accessLeaves the account usable through the API only.
esxcli system account remove --id USER
Delete a local user
esxcli system permission list
List permissionsThe second column says whether an entry is a user or a group.
esxcli system permission set --id test1 -r ReadOnly
Assign a roleRoles are Admin, ReadOnly and NoAccess; add --group true when the ID names a group.
esxcli system permission unset --id test1
Remove a permission
esxcli system settings encryption get
Show secure configuration modePrints the mode, TPM or NONE, and whether secure boot is required.
esxcli system settings encryption set --mode=TPM
Switch to TPM modeFor hosts whose TPM is active in firmware; once set it cannot be undone.
esxcli system settings encryption recovery list
List recovery keysKeep the output in a safe remote place; it holds the recovery ID and key.
esxcli system security keypersistence enable
Turn on key persistenceCheck first that the host runs in TPM mode.
esxcli system tls server get
Show server TLS profileShows the profile for the next boot; --show-current-boot-profile gives the values in use now.
esxcli system tls server set --profile MANUAL
Change the TLS profileProfiles are COMPATIBLE (the default), NIST_2024 and MANUAL; the change needs a reboot.
esxcli system security certificatestore list
List CA certificates
esxcli system security certificatestore add --filename LOCAL_FILE
Add a CA certificateRequired before the host can log to a remote syslog server over TLS.
Network adapters and VMkernel interfaces 22
Command
What it does
esxcli network nic list
List physical adapters
esxcli network nic get -n vmnicX
Show one adapter's settings
esxcli network nic down --nic-name=vmnic0
Bring an uplink downThe name has to be one that the nic list command shows.
esxcli network nic up --nic-name=vmnic0
Bring an uplink up
esxcli network nic set --nic-name NIC --auto
Autonegotiate speed and duplexFixed values go in --speed and --duplex instead.
esxcli network nic stats get -n vmnic0
Show adapter statistics
esxcli network nic vlan stats get -n vmnic0
Show per-VLAN packet countsCounts packets sent and received for each active VLAN on the NIC.
esxcli network nic tso get
Check TSO stateTells for each physical adapter whether TCP segmentation offload is on.
esxcli network ip interface list
List VMkernel interfacesShows port group, MTU and current state of every VMkernel adapter.
esxcli network ip interface ipv4 get
Show IPv4 settingsIncludes the DHCP settings of each VMkernel NIC; -n limits the output to one of them.
esxcli network ip interface ipv4 address list
Show IPv4 addresses and gatewaysThe Gateway column gives the gateway of each VMkernel port.
esxcli network ip interface ipv6 address list
List IPv6 addressesLimit the output to one interface with --interface-name.
esxcli network ip interface add --interface-name VMK --portgroup-name MY_PORTGROUP
Add a VMkernel interfaceThe new interface still needs an IPv4 or IPv6 configuration.
esxcli network ip interface ipv4 set --interface-name VMK --ipv4 IP_ADDRESS --netmask=255.255.255.0 --type=static
Set a static IPv4 addressA static setup needs the address, the netmask and the interface name.
esxcli network ip interface ipv4 set --interface-name VMK --type=dhcp
Use DHCP on an interface
esxcli network ip interface set --interface-name INTERFACE --mtu MTU
Set the interface MTUThe same command turns an interface on or off with --enabled.
esxcli network ip interface remove --interface-name INTERFACE
Remove a VMkernel interfaceThe interface can also be picked by its port group with --portgroup-name.
esxcli network ip interface tag get --interface-name INTERFACE
Show interface service tagsTags such as Management, VMotion or VSAN mark the traffic an adapter carries.
esxcli network ip connection list
List active connectionsThe counterpart of netstat on Linux.
esxcli network ip neighbor list
Show the ARP tableAdd --interface-name to see the neighbors of a single VMkernel interface.
esxcli network ip netstack list
List TCP/IP stacks
esxcli network ip set --ipv6-enabled=false
Turn off IPv6The change takes effect only after the host is rebooted.
Virtual switches and port groups 17
Command
What it does
esxcli network vswitch standard list
List standard switchesOutput covers port count, MTU, uplinks, port groups and CDP settings.
esxcli network vswitch standard add --vswitch-name=vSwitch42
Create a standard switchAdd --ports to choose the number of ports instead of the default.
esxcli network vswitch standard remove --vswitch-name=vSwitch42
Delete a standard switchNot possible while VMkernel networks or virtual machines still use ports on it.
esxcli network vswitch standard set --mtu=9000 --vswitch-name=vSwitch1
Set the switch MTUThe new size applies to every uplink assigned to the switch.
esxcli network vswitch standard set --cdp-status=listen --vswitch-name=vSwitch1
Set the CDP modeAccepted values are down, listen, advertise and both.
esxcli network vswitch standard uplink add --uplink-name=vmnic15 --vswitch-name=vSwitch0
Attach an uplinkThe adapter joins as standby until the failover policy makes it active.
esxcli network vswitch standard uplink remove --uplink-name=vmnic15 --vswitch-name=vSwitch0
Detach an uplink
esxcli network vswitch standard policy failover get --vswitch-name VSWITCH
Show failover policy
esxcli network vswitch standard policy security get --vswitch-name VSWITCH
Show security policy
esxcli network vswitch standard policy shaping get --vswitch-name VSWITCH
Show traffic shaping policy
esxcli network vswitch standard portgroup list
List port groupsEach port group appears with its switch, active clients and VLAN ID.
esxcli network vswitch standard portgroup add --portgroup-name NAME --vswitch-name VSWITCH
Add a port groupBoth the port group name and the switch are required.
esxcli network vswitch standard portgroup remove --portgroup-name NAME --vswitch-name VSWITCH
Delete a port group
esxcli network vswitch standard portgroup set -p PG_NAME --vlan-id 4095
Set VLAN 4095 on a port groupID 4095 lets the port group reach port groups on other VLANs.
esxcli network vswitch standard portgroup set --vlan-id 0 -p g42
Remove VLAN taggingVLAN ID 0 switches the VLAN off for that port group.
esxcli network vswitch standard portgroup policy failover set -p testPortgroup --active-uplinks vmnic3,vmnic5 --standby-uplinks vmnic1,vmnic0,vmnic6,vmnic7
Set active and standby uplinksA new active list replaces the old one, so name the adapters you want kept as standby.
esxcli network vswitch dvs vmware list
List distributed switchesAdd --vds-name to show a single distributed switch.
DNS, hosts file and routes 10
Command
What it does
esxcli network ip dns server list
List DNS serversServers appear in the order they are used; nothing is returned when DNS is not set up.
esxcli network ip dns server add --server SERVER
Add a DNS serverRun it once per server to configure several.
esxcli network ip dns server remove --server SERVER
Remove a DNS server
esxcli network ip dns search list
List DNS search domainsAdd -N with a netstack name, for example vmotion, to query another TCP/IP stack.
esxcli network ip dns search add --domain DOMAIN
Add a DNS search domain
esxcli network ip hosts list
List hosts file entries
esxcli network ip hosts add --hostname www.samplehostname.com --ip xx.xx.xx.xx
Add a hosts file entryEntries made this way survive a reboot of the host.
esxcli network ip hosts remove --hostname www.samplehostname.com --ip xx.xx.xx.xx
Remove a hosts file entry
esxcli network ip route ipv4 list
List IPv4 routesUse -N to read the table of another network stack.
esxcli network ip route ipv4 add --gateway GATEWAY --network NETWORK
Add a static IPv4 routeWrite the network with its prefix length, or the word default for the default route.
Firewall 12
Command
What it does
esxcli network firewall get
Show firewall statusReports whether the firewall is enabled and loaded and what the default action is.
esxcli network firewall set --default-action false
Drop traffic by defaultfalse makes the default action drop, true makes it pass.
esxcli network firewall set --enabled true
Turn the firewall on
esxcli network firewall refresh
Reload firewall rule setsRe-reads the rule set files, provided the firewall module is loaded.
esxcli network firewall ruleset list
List firewall rule sets
esxcli network firewall ruleset list --ruleset-id sshServer
Check one rule setShows whether that one rule set is enabled.
esxcli network firewall ruleset set --ruleset-id sshServer --enabled true
Enable a rule set
esxcli network firewall ruleset set --ruleset-id sshServer --allowed-all false
Limit a rule set to listed IPsAfter this only addresses on the allowed list can reach the service.
Apply a complete imageThe JSON software specification names the base image, the add-on and the components.
esxcli software component signature verify
Verify component signaturesWith --rebooting-image it checks an image that was applied but not yet booted.
Hardware 17
Command
What it does
esxcli hardware cpu list
List CPUs
esxcli hardware cpu global get
Show global CPU properties
esxcli hardware memory get
Show memory informationThe output includes how much memory counts as reliable.
esxcli hardware pci list
List PCI devicesFilter with --class and a hexadecimal class ID.
esxcli hardware pci pcipassthru list
List PCI passthrough devices
esxcli hardware platform get
Show platform information
esxcli hardware clock get
Show hardware clock time
esxcli hardware bootdevice list
Show boot device order
esxcli hardware power policy get
Show the power policy
esxcli hardware trustedboot get
Show trusted boot statusCovers the TPM and DRTM state.
esxcli hardware ipmi sdr list
List IPMI sensor data
esxcli hardware ipmi sel list
List the IPMI event log
esxcli hardware usb passthrough device list
List USB passthrough devices
esxcli hardware usb passthrough device enable -d busId:dev:VendorID:ProductID
Enable USB passthroughCopy the device string from the USB device list; the change affects every virtual machine.
esxcli hardware usb passthrough device disable -d busId:dev:VendorID:ProductID
Disable USB passthrough
esxcli memtier config get
Show memory tiering configuration
esxcli memtier enable -d DEVICE_1
Turn on memory tieringPut the host in maintenance mode first.
Logs, core dumps and SNMP 27
Command
What it does
esxcli system syslog config get
Show syslog configurationShows the current global values such as log directory, rotations and remote host.
esxcli system syslog config set --default-rotate=20
Keep 20 log rotationsAll logs then keep twenty rotations before the oldest is overwritten.
esxcli system syslog config set --loghost='myhost.mycompany.com'
Send logs to a remote hostWith a bare host name the logs travel over UDP port 514.
esxcli system syslog config set --loghost='tcp://myhost.mycompany.com:1514'
Send logs over TCPThe tcp:// prefix and the number after the colon choose transport and port.
esxcli system syslog config logger set --id=vmkernel --size=2048 --rotate=10
Set rotation for one loggerKeeps ten VMkernel log files and rotates each at 2 MB.
esxcli system syslog mark --message="this is a message!"
Write a marker to all logsThe message appears in every log at the same time.
esxcli system syslog reload
Reload the syslog daemonRun it after configuration changes so that they take effect.
esxcli system syslog config logfilter list
List log filters
esxcli system syslog config logfilter add --filter="10|Hostd|mark"
Add a log filterThe three parts are the allowed match count, the application ident and a Python regular expression.
esxcli system coredump partition list
List diagnostic partitionsAlso marks which partition is active and which is configured for the next boot.
esxcli system coredump partition set --unconfigure
Deactivate the diagnostic partitionSet a new partition straight away, because the host is left without one.
esxcli system coredump network set --interface-name vmk0 --server-ip 10xx.xx.xx.xx --server-port 6500
Point core dumps at a collectorNames the VMkernel NIC plus the address and port of the dump collector.
esxcli system coredump network set --enable true
Enable network core dumps
esxcli system coredump network check
Test the dump collector setup
esxcli system coredump network get
Show dump collector settings
esxcli system coredump file add
Create a core dump fileWith no options the system picks the datastore, a unique file name and a size that fits the host memory.
esxcli system coredump file list
List core dump filesThe Active and Configured columns show whether a file is in use.
esxcli system coredump file set --smart --enable true
Activate a core dump file--smart lets the host choose the file with its own selection algorithm.
esxcli system snmp get
Show SNMP agent settings
esxcli system snmp set -c public
Set SNMP communitiesSeparate several communities with commas; each run overwrites the earlier list.
esxcli system snmp set -t target.example.com@163/public
Set the SNMP trap targetThe format is address@port/community; traps go to UDP 162 when no port is given.
esxcli system snmp set --enable true
Enable the SNMP agent
esxcli system snmp test
Send a test trapThe agent sends a warmStart trap to the configured target.
esxcli system auditrecords local enable
Enable local audit records
esxcli system auditrecords remote enable
Send audit records to syslog hosts
vm-support
Collect a support bundleWrites a .tgz with logs and configuration; look for it under /var/tmp.
vm-support -p -i INTERVAL -d DURATION
Collect performance snapshotsProduces the snapshots that esxtop plays back in replay mode.
Performance and packet capture 11
vmkping is taken from a Broadcom Knowledge Base article written for vSphere 7.x and 8.x; the 9.1 guides name the utility without printing a command line.
Command
What it does
esxtop
Start esxtop interactivelyRuns only in the ESX Shell of the host and needs root privileges.
esxtop -b -a -d 10 -n 3
Run esxtop in batch modeCollects all counters three times, ten seconds apart; redirect the output to a CSV file.
esxtop -h
Show esxtop options
esxtop -R VM-SUPPORT_DIR_PATH
Replay a vm-support snapshotOnly works with snapshots taken on the same ESX version.
esxcli network diag ping --host HOST
Ping a network hostFurther options pick the outgoing interface, the packet count and the don't-fragment bit.
vmkping -I vmk0 x.x.x.x -s 1472 -d -c 3
Test VMkernel connectivitySends three pings from vmk0 that must not be fragmented; the size is the MTU minus 28.
Capture packets at a VM portThe switch port ID identifies the virtual machine adapter.
pktcap-uw --vmk vmkX
Capture on a VMkernel adapterWithout further options it shows the packets leaving the adapter.
pktcap-uw --capture Drop
Capture dropped packetsThe output also states why and where each packet was dropped.
vSAN 5
Command
What it does
esxcli vsan network list
List vSAN VMkernel adapters
esxcli vsan storage list
List disks claimed by vSANAdd --device to show a single disk.
esxcli vsan cluster get
Show vSAN cluster membership
esxcli vsan cluster join --cluster-uuid UUID
Join a vSAN cluster
esxcli vsan cluster leave
Leave the vSAN cluster
No row on this page matches that filter.
Notes
Host identity and health
esxcli system version get returns the product, version and build, the first thing support asks for, and esxcli system holds host name, time, maintenance mode, modules and advanced settings. A host must be in maintenance mode before esxcli system shutdown reboot will run, and the command insists on a reason. esxcli hardware cpu list and esxcli hardware memory get report the physical resources, and esxcli hardware goes on to PCI devices, IPMI sensors and the power policy. esxcli software lists installed VIBs and components and applies image profiles: esxcli software vib list before an upgrade, esxcli software profile update to bring the host to a profile from a depot.
VMs, network and storage
esxcli vm process list shows running VMs with their World IDs, and esxcli vm can stop a VM that no longer responds to vSphere: soft first, then hard, then force. esxcli network ip interface list shows VMkernel interfaces, and esxcli network goes on to vSwitches, port groups, firewall rule sets and NIC statistics, which is where a management-network mistake is fixed from the console. esxcli storage filesystem list lists datastores, mounted or not, and esxcli storage covers devices, paths, multipathing policies and NFS mounts; esxcli iscsi, esxcli nvme and esxcli vsan are the protocol-specific namespaces. Virtual disk files are handled by vmkfstools, not by esxcli.
Running esxcli remotely
The same command set runs from a Linux, Windows or macOS workstation once the standalone ESXCLI package is installed, and from PowerCLI through Get-EsxCli, so scripts written against the console work elsewhere. Remote runs put connection options such as --server before the namespace; a host in lockdown mode is reached through vCenter with --server and --vihost. Put --formatter=csv, xml or keyvalue before the namespace for output that scripts can parse. esxcli esxcli command list prints every command the host supports, which is the way to discover what a partner VIB has added. esxcli licensing manages license credentials and esxcli daemon controls daemons built with the Daemon SDK.
Questions
How do I find the ESXi version from the command line?
esxcli system version get. It prints the product name, version and build number.
How do I force-kill a hung VM?
Run esxcli vm process list to get the World ID, then esxcli vm process kill --type soft --world-id ID. If the VM is still running, repeat with hard, and use force only as the last resort.
How do I see all esxcli commands?
esxcli esxcli command list prints every command the host supports, including those a partner VIB has added. esxcli --help lists the namespaces.
Can I get machine-readable output?
Yes. Put --formatter=csv, --formatter=xml or --formatter=keyvalue directly after esxcli, before the namespace, as in esxcli --formatter=csv storage filesystem list.
How do I put an ESXi host into maintenance mode from the shell?
esxcli system maintenanceMode set --enable true. The host enters the mode once its virtual machines are suspended or migrated; esxcli system maintenanceMode get shows the current state.