Short answer: the ESXi Shell commands you actually use fall into a small set: esxcli for host, network, storage and software state, vim-cmd for VMs when hostd works, vmkping for VMkernel connectivity and MTU tests, esxtop for live performance, and /etc/init.d/hostd restart or /etc/init.d/vpxa restart for stuck management agents. Enable SSH only for troubleshooting. Every esxcli command below exists in ESX 9.0 and in ESXi 8.0 U3 unless noted otherwise.
This is a curated list, grouped by task, not a full reference. For the complete namespace tree see ESXCLI commands for ESXi 8.0 and ESXCLI commands for ESX 9.0. Commands were checked against Broadcom’s ESXCLI Command Reference (8.0.3, 9.0.0 and 9.1.0); non-esxcli commands are taken from the Broadcom KB articles cited in each section. Placeholders: vmk0, vmnic0, datastore1, 10.0.0.10, naa.xxx.
Enable the ESXi Shell and SSH
The ESX Shell is deactivated by default and Broadcom recommends activating it for troubleshooting only. The shell is independent of lockdown mode: if the service is running, you can still log in to it even when the host is in lockdown mode. Two services matter: ESXi Shell (local console, Alt+F1) and SSH (remote, TCP 22).
- vSphere Client: select the host, Configure > System > Services, select SSH or ESXi Shell, Edit Startup Policy > Start and stop manually, then Start.
- Host Client: Manage > Services, select
TSM(ESXi Shell) or the SSH service, Actions > Start. - DCUI:
F2> Troubleshooting Options > Enable ESXi Shell / Enable SSH. The same menu has Modify ESXi Shell and SSH timeouts.
Set a timeout so the service does not stay open. The availability timeout is the advanced option UserVars.ESXiShellTimeOut (seconds, 0 = disabled). To check SSH daemon settings from the shell:
esxcli system settings advanced list -o /UserVars/ESXiShellTimeOut
esxcli system ssh server config list
Sources: KB 311213 (Using ESXi Shell in ESXi), TechDocs Using the ESX Shell (9.0).
Host info and version
| Task | Command |
|---|---|
| Version and build | vmware -vl |
| Version, build, update level | esxcli system version get |
| Hostname and FQDN | esxcli system hostname get |
| Vendor, model, serial | esxcli hardware platform get |
| CPU packages, cores, threads | esxcli hardware cpu global get |
| Physical memory | esxcli hardware memory get |
| Uptime (microseconds) | esxcli system stats uptime get |
| Time and NTP | esxcli system time get; esxcli system ntp get |
| Boot device | esxcli system boot device get |
| Disk and ramdisk usage | df -h; vdf -h |
vmware -v / vmware -vl come from KB 345263 (determining the build number) and KB 323110; df -h and vdf -h (ramdisk usage, useful when /, /tmp or /var/log is full) from KB 318926 (investigating disk space).
Maintenance mode and reboot
esxcli system maintenanceMode get
esxcli system maintenanceMode set --enable true
esxcli system shutdown reboot --reason "Patching"
esxcli system maintenanceMode set --enable false
esxcli system shutdown reboot and poweroff take a --reason; the reference states the host must be in maintenance mode. On vSAN hosts, --vsanmode controls data evacuation; decide it before you enter maintenance mode, not after. Take a configuration backup first (vim-cmd hostsvc/firmware/sync_config then vim-cmd hostsvc/firmware/backup_config, KB 313510; details in Backup and restore ESXi host configuration data).
Networking
| Task | Command |
|---|---|
| Physical NICs, link, speed, driver | esxcli network nic list |
| NIC details, firmware, driver version | esxcli network nic get -n vmnic0 |
| NIC counters and errors | esxcli network nic stats get -n vmnic0 |
| VMkernel interfaces, MTU, netstack | esxcli network ip interface list |
| vmk IPv4 addresses | esxcli network ip interface ipv4 get |
| vmk service tags (Management, vMotion…) | esxcli network ip interface tag get -i vmk0 |
| Routing table | esxcli network ip route ipv4 list |
| DNS servers | esxcli network ip dns server list |
| Standard vSwitches and port groups | esxcli network vswitch standard list; esxcli network vswitch standard portgroup list |
| Distributed switches seen by the host | esxcli network vswitch dvs vmware list |
| VMs with active ports | esxcli network vm list |
| ARP table | esxcli network ip neighbor list |
| Open connections | esxcli network ip connection list |
| Firewall rulesets | esxcli network firewall ruleset list |
vmkping and the MTU test
vmkping sends ICMP from a specific VMkernel interface. For a 9000 MTU path, use -d (do not fragment) and a payload of 8972 bytes (9000 minus 28 bytes of IP and ICMP headers); for 1500 use 1472. Add -S vmotion when the vmk is on the vMotion TCP/IP stack.
vmkping -I vmk1 10.0.0.10 -d -s 8972
vmkping -I vmk1 -S vmotion 10.0.0.10 -d -s 8972
vmkping -I vmk0 10.0.0.10 -d -s 1472 -c 3
esxcli network diag ping --host 10.0.0.10 --interface vmk1 --df --size 8972 --count 3
If 1472 works and 8972 fails, something in the path (vSwitch, uplink, physical switch port) is still at 1500. Sources: KB 313061 (testing jumbo frame pings), KB 344313 (testing VMkernel connectivity with vmkping). KB 313061 also lists esxcfg-vswitch -l and esxcfg-vmknic -l for a quick MTU overview.
Storage
| Task | Command |
|---|---|
| Devices (LUNs, NVMe, local disks) | esxcli storage core device list |
| One device | esxcli storage core device list -d naa.xxx |
| Paths and their state | esxcli storage core path list |
| Multipathing policy per device | esxcli storage nmp device list |
| HBAs | esxcli storage core adapter list |
| HBAs, detailed (9.0+) | esxcli storage core adapter listdetailed |
| Rescan all adapters | esxcli storage core adapter rescan --all |
| Mounted datastores (VMFS, NFS, vSAN) | esxcli storage filesystem list |
| VMFS extents to device mapping | esxcli storage vmfs extent list |
| VAAI status | esxcli storage core device vaai status get -d naa.xxx |
| Manual UNMAP on VMFS | esxcli storage vmfs unmap --volume-label datastore1 |
| NFS v3 / v4.1 mounts | esxcli storage nfs list; esxcli storage nfs41 list |
Mount an NFS v3 datastore; --connections sets the number of TCP connections (nconnect, see nconnect support in the ESXi NFS client):
esxcli storage nfs add --host 10.0.0.10 --share /export/ds01 --volume-name nfs-ds01 --connections 4
esxcli storage nfs remove --volume-name nfs-ds01
Caution: storage vmfs unmap generates I/O on the array; run it outside peak hours. Do not remove an NFS datastore that still has registered or running VMs.
VMs from the shell
vim-cmd needs a responsive hostd. esxcli vm process works on the running VM world and is the fallback for a VM that ignores power operations.
| Task | Command |
|---|---|
| List registered VMs and their vmIDs | vim-cmd vmsvc/getallvms |
| Power state | vim-cmd vmsvc/power.getstate 12 |
| Power on / guest shutdown / hard off | vim-cmd vmsvc/power.on 12; vim-cmd vmsvc/power.shutdown 12; vim-cmd vmsvc/power.off 12 |
| Snapshots | vim-cmd vmsvc/get.snapshot 12 |
| Hung tasks of a VM | vim-cmd vmsvc/get.tasklist 12 |
| Register a VM | vim-cmd solo/registervm /vmfs/volumes/datastore1/vm01/vm01.vmx |
| Running VMs with World ID | esxcli vm process list |
| Kill a stuck VM | esxcli vm process kill -t soft -w 2750434 |
Caution: use kill -t soft first, then hard, and force only as a last resort. If esxcli itself does not respond, Broadcom suggests localcli with the same syntax. Sources: KB 308360 (common VM tasks via CLI), KB 308457 (powering off an unresponsive VM).
Services and logs
/etc/init.d/hostd restart
/etc/init.d/vpxa restart
tail -f /var/log/hostd.log
tail -f /var/log/vmkernel.log
Restart hostd or vpxa individually when the host shows as disconnected or not responding in vCenter, then wait 1–2 minutes. Caution: Broadcom warns not to use services.sh restart (or Restart Management Agents in the DCUI) on hosts running vSAN, LACP, NSX, or shared graphics (vGPU, vDGA, vSGA); restart single services instead. Source: KB 320280 (restarting management agents).
| Task | Command |
|---|---|
| Syslog configuration | esxcli system syslog config get |
| Set remote syslog target | esxcli system syslog config set --loghost udp://10.0.0.10:514 |
| Apply syslog changes | esxcli system syslog reload |
| Write a marker into all logs | esxcli system syslog mark --message "start of test" |
| Advanced settings changed from default | esxcli system settings advanced list --delta |
| Core dump target | esxcli system coredump partition get; esxcli system coredump file list |
Performance: esxtop basics
Run esxtop in the SSH session and switch views with single keys: c CPU, m memory, n network, d disk adapter, u disk device, v disk per VM, V show only VMs, f fields, h help, q quit.
For support cases, collect batch data to a datastore (-b batch, -a all metrics, -d interval in seconds, -n number of samples). 300 samples at 2 s = 10 minutes:
esxtop -b -a -d 2 -n 300 > /vmfs/volumes/datastore1/esxtop-$(hostname)-$(date +"%FT%H:%M").csv
Make sure the target datastore has free space and is not the one you are troubleshooting. Sources: KB 382249 (using esxtop), KB 370279 (collecting esxtop batch data).
Software and VIBs
| Task | Command |
|---|---|
| Base image (ESXi version in the image) | esxcli software baseimage get |
| Installed components | esxcli software component list |
| Installed VIBs | esxcli software vib list |
| One VIB in detail | esxcli software vib get -n <vib-name> |
| Image profile | esxcli software profile get |
| Host acceptance level | esxcli software acceptance get |
| Verify VIB signatures | esxcli software vib signature verify |
| Profiles in an offline depot | esxcli software sources profile list -d /vmfs/volumes/datastore1/depot.zip |
| Dry-run a component install | esxcli software component apply -d /vmfs/volumes/datastore1/component.zip --dry-run |
--dry-run exists on component apply, vib install, vib remove and profile update; use it before every change. On vLCM-managed clusters, remediate from vCenter instead. A quick check for NSX VIBs before any management-agent restart: esxcli software vib list | grep -E 'nsx|vsipfwlib'.
ESX 9 notes
ESX 9.0 adds two top-level namespaces, licensing and nsx; 9.1 adds memtier. None exist in 8.0 U3, and memtier is not in 9.0.
| Task | Command |
|---|---|
| License credentials (9.0+) | esxcli licensing credential list |
| License entitlement assignments (9.0+) | esxcli licensing entitlement list |
| Stop NSX services (9.0+) | esxcli nsx services stop |
| Memory tiering status (9.1) | esxcli memtier status get |
| Memory tiering devices (9.1) | esxcli memtier device list |
| Memory tiering configuration (9.1) | esxcli memtier config get |
Caution: the reference describes esxcli nsx services stop as stopping NSX services with the tn-delete option. It is not a diagnostic command; use it only under an NSX procedure or support guidance. Other 9.0 additions worth knowing: esxcli storage core adapter listdetailed, esxcli nvme auth get and the esxcli vsan dedup namespace. The full diff is in ESXCLI changes from ESXi 8.0 U3 to ESX 9.0 and 9.1.
Full command lists
For the complete list see the full ESX 9.0 ESXCLI list and the ESXCLI 8.0 mindmap.
Sources
- Broadcom ESXCLI Command Reference 9.0.0 (also 8.0.3 and 9.1.0)
- TechDocs: Using the ESX Shell (vSphere 9.0)
- TechDocs: Activate Access to the ESX Shell Using the vSphere Client (9.0)
- TechDocs: Enable ESX Shell and SSH Access with the DCUI (9.0)
- KB 311213 (Using ESXi Shell in ESXi)
- KB 345263 (Determining the build number of ESXi and vCenter)
- KB 323110 (Determining network/storage firmware and driver version)
- KB 318926 (Investigating disk space on an ESXi host)
- KB 313510 (Back up and restore the ESXi host configuration)
- KB 313061 (Testing jumbo frame pings from ESXi)
- KB 344313 (Testing VMkernel connectivity with vmkping)
- KB 308360 (Common VM tasks via command line)
- KB 308457 (Powering off an unresponsive VM)
- KB 320280 (Restarting management agents in ESXi)
- KB 382249 (Using esxtop and interpreting esxtop statistics)
- KB 370279 (Collecting esxtop batch data)