Control VMware virtual machines from the command line

The vmrun command makes administering VMware virtual machines fast and easy when you’re stuck dealing with VMware Server 2.0. I really hate the web interface. It’s not responsive and in my opinion, a huge step backwards from the old 1.x consoles. If you’re trying to start, stop, pause, take a snapshot, or revert to a snapshot through the web gui, you’re going to spend about 10x more time launching the gui, waiting, waiting, and more waiting while the web app loads. I prefer to use the command line for just about everything, so using vmrun was a natural fit for me. In a one liner, I can do all these things without ever leaving the keyboard.

# vmrun –help

vmrun version 2.0.0 build-122956
Usage: vmrun [AUTHENTICATION-FLAGS] COMMAND [PARAMETERS]
AUTHENTICATION-FLAGS
--------------------
These must appear before the command and any command parameters.
   -h <hostName>  (not needed for Workstation)
   -P <hostPort>  (not needed for Workstation)
   -T <hostType> (ws|server|server1)
     for example, use '-T server' for Server 2.0
                  use '-T server1' for Server 1.0
   -u <userName in host OS>  (not needed for Workstation)
   -p <password in host OS>  (not needed for Workstation)
   -gu <userName in guest OS>
   -gp <password in guest OS>

Power Commands

start           Path to vmx file
stop            Path to vmx file
reset           Path to vmx file
suspend         Path to vmx file
pause           Path to vmx file
unpause         Path to vmx file

Snapshot Commands

snapshot             Path to vmx file
deleteSnapshot       Path to vmx file
revertToSnapshot     Path to vmx file

Easy enough… So here’s a couple of examples:

$ vmrun -u root -h ‘https://localhost:8222/sdk’ -p start “/home/vmware/Fedora10.vmx”
$ vmrun -u root -h ‘https://localhost:8333/sdk’ -p pause “/home/vmware/Gentoo.vmx”

Posted by admica   @   27 March 2009

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« Install Bro - Network Intrusion Detection System
Next Post
Uptime »
Powered by Wordpress   |   Lunated designed by ZenVerse