Note: The steps in this article require root access to the host, either at the physical console or using SSH. For more information on enabling root access, see:
ESXi 4.x, 5.x, 6.x, 7.0.x and 8.x
To power on a virtual machine from the command line:
- List the inventory ID of the virtual machine with the command:
vim-cmd vmsvc/getallvms |grep <vm name>
Note: The first (leftmost) column of the output shows the vmid.
- Check the power state of the virtual machine with the command:
vim-cmd vmsvc/power.getstate <vmid>
- Power-on the virtual machine with the command:
vim-cmd vmsvc/power.on <vmid>
Note:
vim-cmd depends on hostd working properly. If hostd is stopped, you might see the following error after executing vim-cmd:
Failed to login: Connection refused: The remote service is not running, OR is overloaded, OR a firewall is rejecting connections.