Virtualization Pro

Oct 17 2008   1:49PM GMT

Starting a VMware Server virtual machine with vmrun



Posted by: Rick Vanover
Virtualization, VMware, Rick Vanover, VMware Workstation

Having a virtual machine or series of virtual machines start up from a script or remote command can be a time saver, especially when compared with logging into the Web interface. VMware Server 2 and prior versions offer the vmrun command for six major tasks that you can perform on a virtual machine: starting, stopping, resetting, pausing, unpausing and suspending. Let’s run through an example that I recently saved as scripts on my VMware Server 2 (build 116503) installed on a Linux server.

The following command will start the virtual machine named ScriptStart1:

vmrun -T server -h https://dhcp-122:8333/sdk -u root -p rootpass start “[standard] ScripitStartVM1/ScriptStartVM1.vmx”

Once that command is launched, the receipt of this command is represented in the scrolling log accessible through VMware Server Web Access. This is shown in the figure below:

Command visible in the scrolling log of VMware Infrastructure Web Access

One important note that in this example the command is case sensitive to the datastore path, so the VM name of ScriptStart1 cannot be represented any way other than its location in the datastore. The path and .vmx file name may vary in situations where the VM has undergone name changes or copy operations from another VM.

There are quite a lot of parameters passed to the VMware server with the vmrun command, and it is important to note a few attributes of the command. The parameters are designated below:

  • T - VMware platform, server is the designation for VMware Server
  • h - This URL is the host system. Note the port assignment will be set during installation. This example was a default configuration
  • u -p - username and password sent to the host
  • start - the command sent to the host

The last parameter is the path to the virtual machine within the datastore.

Aside from this quick example of a basic start command, vmrun has many other features, such as installing VMware Tools, adding shared folders, killing a process in a guest VM and reverting to a snapshot. One positive point about vmrun is that it can be used in both VMware Server (versions 1 and 2) and VMware Workstation products. There is a lot more to vmrun, and the full command documentation can be found in the vmrun control document available on the VMware website.

Comment on this Post


You must be logged-in to post a comment. Log-in/Register

Markweee  |   Jan 31 2011   7:10AM GMT

These applications have to figure out changed blocks on their own so being able to get this information for free using the vStorage advanced programming interfaces is extremely valuable to them.
<a href="http://www.thesisdom.com/" rel="nofollow">Thesis</a> AND <a href="http://www.dissertationdom.com/" rel="nofollow">Dissertation</a> AND <a href="http://www.essaydom.com/" rel="nofollow">Essay</a>


 

Rocks2011  |   Jul 30 2011   3:43PM GMT

Well, I am so excited that I have found this your post because I have been searching for some information about it almost three hours. You helped me a lot indeed and reading this your article I have found many new and useful information about this subject
Abilene Roofing Contractors


 

Profes  |   Aug 16 2011   9:40PM GMT

You guys should think of arranging some gallery to exhibit them out there! Personally I adore custom essays on this topic because they help us arise the awareness in people.

juicy couture outlet


 

Profes  |   Aug 28 2011   9:31PM GMT

Keep writing, continue to inspire, to keep creating
Marc Jacobs Outlet