About nixCraft

Topics

Start and stop VMWARE VPS / virtual machine guest operating system from command line

Posted by Vivek Gite [Last updated: July 3, 2007]

Vmware server comes with the nifty vmware-cmd utility. It allows an administrator to perform various operations on a virtual machine from Linux command line / shell prompt such as:

=> Stop / Start VM

=> Get VM status

=> Setup variables

=> Powerdown VM and much more

Task: Lists the virtual machines on the local server

You can list all servers and config file, enter:
# vmware-cmd -l
Output:

/nas/vms/Ubuntu/Ubuntu.vmx
/nas/vms/FreeBSD/FreeBSD.vmx
/nas/vms/OpenBSD/OpenBSD.vmx
/nas/vms/Debian4/Debian4.vmx
/nas/vms/CentOS5/CentOS5.vmx

Turn on VM / Power up VPS

Just pas start option to vmware-cmd,
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx start

To stop VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx stop

To reset VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx reset

To suspend VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx suspend

Find out if OpenBSD VM is on or off:
# vmware-cmd /disk2.vmware/vms/OpenBSD/OpenBSD.vmx getstate
Output:

getstate() = off

vmware-cmd offers other options, please consult VMWARE documentation for more information.

E-mail this to a friend      Printable version

You may also be interested in other helpful articles:

Discussion on This Article:

  1. Sir Geek Says:

    One minor problem with your 1st command to list the VMs. The command should be vmware-cmd -l

  2. vivek Says:

    Sir Geek,

    Thanks for the heads up… post has been updated

  3. Husain Says:

    I have installed VMWare Server 1.0.4 on RHEL5.1 64 bit version. When I try to power on a virtual machine the OS panics. I am not a linux expert so I have no idea as to how to deal with this issue. I do not have physical access to the server and remotely I was able to take a screenshot of the panic screen. The last line read “Kernel Panic - not syncing: Fatal exception”.

    Your help would be highly appreciated.

  4. Mark Hentov Says:

    Hmm. After a reboot vmware seems not to be running. I can’t connect or start any virtual machines.
    What daemons need to be enabled with chkconfig? What modules need to load?

  5. vivek Says:

    Try
    /etc/init.d/vmware start

    Did you upgraded kernel? If so you need to reconfigure vmware
    vmware-config.pl -d

  6. Jay Says:

    Thank you!

    A friends server went down due to power failure and this info helped me solve the problem.

    Where can i get a complete list of such commands?

    oh and by the way, you still need to change the -1 to -l (L) because had he not have seen the error we would not have been able to use the info here. Also, please let people know that the information after # vmware-cmd /this/blah/blah is the path and will be different for all users

    Cheers and thanks again

    Jay

  7. Phil Says:

    vmware-cmd -?

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , ,

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.