Dec 272012
 

Using a Mac with VMware ESX(i) is a pain, since very scarce support is available for the poor lovers of the apple 🙂

Luckily, once you enable ssh access on the hypervisor, the following commands come very handy:

ESXi 5.0

To power on a virtual machine from the command line:
  1. List the inventory ID of the virtual machine with the command:vim-cmd vmsvc/getallvms |grep <vm name>

    Note: The first column of the output shows the vmid.

  2. Check the power state of the virtual machine with the command:vim-cmd vmsvc/power.getstate <vmid>
  3. Power-on the virtual machine with the command: 

    vim-cmd vmsvc/power.on <vmid>

ESXi 4.1

To power on a virtual machine from the command line:
  1. List the inventory ID of the virtual machine with the command:vim-cmd vmsvc/getallvms |grep <vm name>

    Note: The first column of the output shows the vmid.

  2. Check the power state of the virtual machine with the command:vim-cmd vmsvc/power.getstate <vmid>
  3. Power-on the virtual machine with the command:vim-cmd vmsvc/power.on <vmid>

ESXi 4.0

To power on a virtual machine from the command line:
  1. List the inventory ID of the virtual machine with the command:vmware-vim-cmd vmsvc/getallvms |grep <vm name>

    Note: The first column of the output shows the vmid.

  2. Check the power state of the virtual machine with the command:vmware-vim-cmd vmsvc/power.getstate <vmid>
  3. Power on the virtual machine with the command:vmware-vim-cmd vmsvc/power.on <vmid>

 

ESX 4.0 and ESX 4.1

To power on a virtual machine from the command line:
  1. To list the path of all the virtual machines on the host:vmware-cmd -l
  2. Get the state of the virtual machine with the command:vmware-cmd <path to the VMX file> getstate
  3. Power on the virtual machine with the command:vmware-cmd <path to the VMX file> start

Enjoy.