Tech

Guides
 

Remotely control VMware Server machines

By Vincent Danen, TechRepublic
Monday, June 12, 2006 10:44 AM
Learn to control VMware Server from the command line.
The ability of VMware Server to run virtual machines "behind-the-scenes" is a great boon. This means you no longer have to have the GUI screen open on your desktop, taking up valuable screen real-estate. It also means that you can switch your virtual machines to another machine that is constantly up and have your virtual machines available to you at any time, keeping them up and running around the clock.

Running the server without a GUI interface makes it more difficult to control the machines, but with a little effort, you can get the same functionality via the command line. You will still want the GUI in order to change configuration options and create new machines, however.

The vmware-cmd program is your gateway to controlling virtual machines. The general syntax of the vmware-cmd for use with a VMware Server instance on the same machine is:

$ vmware-cmd [config] [option] ...

Assume you have a virtual machine of Mandriva in /var/lib/vmware/Virtual Machines/Mandriva. To get the status of the machine--whether it's on or off--you would use:

$ vmware-cmd /var/lib/vmware/Virtual\ Machines/Mandriva/Mandriva.vmx getstate VMControl: use vnc for unifiedDraw getstate() = off

As you can see, the virtual machine is turned off. To start this virtual machine you would use:

$ vmware-cmd /var/lib/vmware/Virtual\ Machines/Mandriva/Mandriva.vmx start VMControl: use vnc for unifiedDraw start() = 1

If you have the vmware-console running at the same time, you would see the virtual machine start. This is an easy way to start virtual machines at boot: simply call vmware-cmd with the configuration of each virtual machine that you want to start and the start command in a script like /etc/rc.d/rc.local.

Prior to shutting down your machine, you can signal the virtual machines in a similar manner by using the suspend command. This will suspend each virtual machine to disk, allowing you to issue the start command later to resume the machine from where you left off. Obviously, suspending a machine will make starting it up much faster than doing a full shutdown and start each time you have to restart the host system.

Looking at the output of vmware-cmd -h will give you a lot of other options that you can play with to manipulate virtual machines. The ability to start, suspend, and stop virtual machines from the command line (or a script) is perhaps vmware-cmd's most useful feature.



WORTHWHILE?

0

0 votes
Blog

Talkback 0 comments

There are currently no comments for this post.


Guest user

Guest user

Level: 
Joined: —
Already a member? Log in »



 

Loading...

Whitepapers/Case Studies

Downloads

Open Source News



Tech Jobs Now!

Tags

  1. canada
  2. e - mail
  3. fedora project
  4. gnome
  5. linux
  6. linux distribution
  7. mandriva
  8. mysql
  9. open source
  10. operating systems
  11. password
  12. red hat inc.
  13. repository
  14. security
  15. server
  16. ssh
  17. tool
  18. ubuntu
  19. vincent danen
  20. web