Hardware

Tip: Working with VMware Workstation from the command line

VMware Workstation not only has an advanced user interface, but it also allows you to manage it from the command line. In this post, Steven S. Warren will show you how to work with the VMware Workstation command line.

VMware Workstation not only has an advanced user interface, but it also allows you to manage it from the command line. In this post, Steven S. Warren will show you how to work with the VMware Workstation command line.

—————————————————————————————————————————————————————

Included with VMware Workstation is a command line with switches that will enable you to do a host of things. The syntax for using VMware Workstation from the command line is as follows:

Vmware [-x] [-X] [-q] [-s <variablename>=<value>] 
[-m] [-v] [/<path_to_config>/<config>.virtual machine]
[X toolkit options]
Table 1: Command-Line Switches

Switch Description
-x Powers on the virtual machine automatically when VMware Workstation starts.
-X Automatically turns on VMware Workstation and puts the virtual machine in full-screen mode.
-q Closes the virtual machine's tabs when the virtual machine powers off. If there are no other machines open, it exits the program as well.
-s Sets the specified variable to the specified value. Any variable names and values that are valid in the configuration file may be specified on the command line with the -s switch.
-m On a Linux host, starts the program in Quick Switch mode.
-v Displays the product name, version, and build number.
/<path_to_config>/<config>.virtual machine Launches a virtual machine using the specified configuration file.
X toolkit options Can be passed as arguments, although some of them (most notably the size and title of the VMware Workstation window) cannot be overridden.

For example, you can create a batch file that automatically opens VMware and runs a particular virtual machine. The syntax is as follows:

"c:program filesvmwarevmware workstationvmware.exe" -x "D:My Virtual MachinesWindows Server 2003 Enterprise Editionwinnetenterprise.vmx"

Figure A illustrates the command line in action. You can continue playing around with the command line until you create the applicable configurations for your environment.

Editor's Picks

Free Newsletters, In your Inbox