{"id":470,"date":"2010-07-12T16:42:29","date_gmt":"2010-07-12T16:42:29","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2010\/07\/12\/how-do-i-turn-onoff-a-virtual-machine-from-the-command-line\/"},"modified":"2023-01-06T17:27:10","modified_gmt":"2023-01-06T17:27:10","slug":"how-do-i-turn-onoff-a-virtual-machine-from-the-command-line","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Virtualization\/Vmware\/how-do-i-turn-onoff-a-virtual-machine-from-the-command-line.html","title":{"rendered":"ESX4: Turn on\/off Virtual Machine using Command Line"},"content":{"rendered":"
Using the vmware-cmd command you can perform a number of actions on your Virtual Machines from the command line.<\/p>\n
Below shows you some of the functions you can perform :<\/p>\n
[root@ESX4 ~]# vmware-cmd -l
\n\/vmfs\/volumes\/4c16a0ec-2c7ebe2a-6ad5-0011s8azz71c\/OpenSolaris 2009.06\/OpenSolaris 2009.06.vmx
\n\/vmfs\/volumes\/4c16a0ec-2c7ebe2a-6ad5-0011s8azz71c\/CentOS 5 – Oracle\/CentOS 5 – Oracle.vmx
\n\/vmfs\/volumes\/4c16a0ec-2c7ebe2a-6ad5-0011s8azz71c\/CentOS 5a\/CentOS 5a.vmx<\/p>\n
Below shows you how to start a virtual machine, to stop it just change the start command for stop.<\/p>\n
[root@ESX4 ~]# vmware-cmd “\/vmfs\/volumes\/4c16a0ec-2c7ebe2a-6ad5-0011s8azz71c\/OpenSolaris 2009.06\/OpenSolaris 2009.06.vmx” start
\nstart() = 1<\/p>\n
There maybe another (and easier) way of listing the virtual machine status`s if so please send it in.<\/p>\n
vmware-cmd -l | sed ‘\/^$\/d’ |\u00a0 while read VMX ; do STATE=$(vmware-cmd\u00a0 “${VMX}” getstate | awk ‘ { print $3 } ‘) ;\u00a0 echo “${VMX}” = “${STATE}” ; done<\/p>\n","protected":false},"excerpt":{"rendered":"
Using the vmware-cmd command you can perform a number of actions on your Virtual Machines from the command line. Below shows you some of the functions you can perform : List Virtual Machines [root@ESX4 ~]# vmware-cmd -l \/vmfs\/volumes\/4c16a0ec-2c7ebe2a-6ad5-0011s8azz71c\/OpenSolaris 2009.06\/OpenSolaris 2009.06.vmx \/vmfs\/volumes\/4c16a0ec-2c7ebe2a-6ad5-0011s8azz71c\/CentOS 5 – Oracle\/CentOS 5 – Oracle.vmx \/vmfs\/volumes\/4c16a0ec-2c7ebe2a-6ad5-0011s8azz71c\/CentOS 5a\/CentOS 5a.vmx Turn On Virtual Machine Below … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"yoast_head":"\n