The vmrun commands are divided into function categories.

The following tables list vmrun commands and parameters for Fusion according to their function. Parameters are listed one per line. Parameters enclosed in square brackets are optional. The vertical bar indicates a keyword choice.

Reviewers: djohn Wed Nov 8 11:33:38 PST 2017

Please analyze the commands carefully. The tools I'm using are different than the tools used for the last version of the vmrun guide. I had to copy and paste everything, which might affect the formatting. I was often confused by terminology for concepts that might seem simple, such as "command" and "option." Therefore, please read everything and let me know if you think terms are incorrect or misleading.

The vmrun Power Commands and Parameters

Option

Parameters

Description

start

path to .vmx file

[ gui | nogui ]

Starts a virtual machine. The default gui option starts the machine interactively, which is required to display a VMware user interface. The nogui option suppresses the user interface, including the startup dialog box, to allow noninteractive scripting.

Reviewers: djohn Wed Nov 8 11:36:57 PST 2017

The term "VMware user interface"? Since this guide is just for Fusion, can I say "Fusion interface."

stop

path to .vmx file

[ hard | soft ]

Stops a virtual machine. Use the soft option to power off the guest after running shutdown scripts. Use the hard option to power off the guest without running scripts, as if you pressed the power button. The default is to use the powerType value specified in the .vmx file, if present.

reset

path to .vmx file

[ hard | soft ]

Resets a virtual machine. Use the soft option to run shutdown scripts before rebooting the guest. Use the hard option to reboot the guest without running scripts, as if you pressed the reset button. The default is to use the powerType value specified in the .vmx file, if present.

suspend

path to .vmx file

[ hard | soft ]

Suspends a virtual machine without shutting the virtual machine down, so local work can resume later. The soft option suspends the guest after running system scripts. On Windows guests, these scripts release the IP address. On Linux guests, the scripts suspend networking. The hard option suspends the guest without running the scripts. The default is to use the powerType value specified in the .vmx file, if present.

To resume virtual machine operations after the suspend command finishes, use the start command. On Windows, the IP address is retrieved. On Linux, networking is restarted.

pause

path to .vmx file

Pauses a virtual machine .vmx file. You can use the command to suspend virtual machine operations.

unpause

path to .vmx file

Resumes operations of a virtual machine from where you paused normal operations.

The vmrun Snapshot Commands and Parameters

Option

Parameters

Description

listSnapshots

path to .vmx file

[ showtree ]

Lists all snapshots in a virtual machine. The showtree option displays snapshots in tree format, with children indented under their parent.

snapshot

path to .vmx file

snapshot name

Creates a snapshot of a virtual machine. Because Fusion supports multiple snapshots, you must provide the snapshot name.

Because the forward slash defines path names, do not use the slash character in a snapshot name. Otherwise, specifying the snapshot path later becomes difficult.

deleteSnapshot

path to .vmx file

snapshot name

[ andDeleteChildren ]

Removes a snapshot from a virtual machine. Because Fusion supports multiple snapshots, you must provide the snapshot name. The virtual machine must be powered off or suspended. If the snapshot has children, they become children of the deleted snapshot's parent, and subsequent snapshots continue as before from the end of the chain.

The andDeleteChildren option deletes the specified snapshot and its children recursively.

See revertToSnapshot for solutions to name conflicts.

revertToSnapshot

path to .vmx file

snapshot name

or

path to .vmx file

snap1/snap2/snapN

Sets the virtual machine to its state at snapshot time. However if the virtual machine was powered on at the time of the snapshot, vmrun reverts it to a suspended state, but does not resume running the virtual machine.

If a snapshot has a unique name within a virtual machine, revert to that snapshot by specifying the path to the virtual machine's configuration file and the unique snapshot name.

If several snapshots have the same name, specify the snapshot by including a full pathname for the snapshot. A pathname is a series of snapshot names, separated by forward slash characters (/). Each name specifies a new snapshot in the tree. For example, the pathname Snap1/Snap2 identifies a snapshot named Snap2 that was taken from the state of a snapshot named Snap1.

The vmrun Network Adapter Commands and Parameters

Reviewers: djohn Thu Oct 26 14:23:31 PDT 2017

This is new, so the description consists of info I got from listing the vmrun options. Can I get more info for these command options?

Option

Parameters

Description

listNetworkAdapters

path to .vmx file

Lists the network adapters in a virtual machine.

addNetworkAdapter

path to .vmx file

Network adapter type

[ Host nework ]

Adds a network adapter to a virtual machine.

setNetworkAdapter

path to .vmx file

Network adapter index

Network adapter type

[ Host nework ]

Updates a network adapter in a virtual machine.

deleteNetworkAdapter

path to .vmx file

Network adapter index

Removes a network adapter from a virtual machine.

The vmrun Host Network Commands and Parameters

Reviewers: djohn Thu Oct 26 14:23:31 PDT 2017

This is new, so the description consists of info I got from listing the vmrun options. Can I get more info for these command options?

Option

Parameters

Description

listHostNetworks

Reviewers: djohn Thu Oct 26 15:52:05 PDT 2017

Are there no parameters for this option?

Lists all networks on the host.

listPortForwardings

host network name

Lists all available port forwardings on a host network.

setPortForwarding

host network name

protocol

host port

guest ip

guest port

[Description]

Updates a network adapter in a virtual machine.

deletePortForwarding

host network name

protocol

host port

Deletes a port forwarding on a host network.

The vmrun Guest Operating System Commands and Parameters

The timeout, which is the wait for VMware Tools, is five minutes for all guest‐related commands.

Option

Parameters

Description

runProgramInGuest

path to .vmx file

[ -noWait | -activeWindow | -interactive ]

program name

[ program arguments ]

Runs a specified program in the guest operating system. The -noWait option returns a prompt immediately after the program starts in the guest, rather than waiting for it to finish. This option is useful for interactive programs. The -activeWindow option ensures that the Windows GUI is visible, not minimized. It has no effect on Linux. The -interactive option forces interactive guest login. It is useful for Vista and Windows 7 guests to make the program visible in the console window. You must provide the full pathname of a program accessible to the guest. Also provide fully accessible path names for any files specified in the program arguments, according to the requirements of the program. VMware Tools and a valid guest login are required.

Reviewers: djohn Fri Oct 27 12:48:20 PDT 2017

Windows Vista and 7 are specified in this description. Do we want to leave that? Do we want to add info for other Windows versions?

fileExistsInGuest

path to .vmx file

Checks whether the specified file exists in the guest operating system. VMware Tools and a valid guest login are required.

directoryExistsInGuest

path to .vmx file

directory path on guest

Checks whether the specified directory exists in the guest operating system. VMware Tools and a valid guest login are required.

setSharedFolderState

path to .vmx file

share name

path to folder on host

writable | readonly

Reviewers: djohn Mon Oct 30 09:09:00 PDT 2017

Is the writable | readonly info above presented properly, even though they are not enclosed in brackets and do not have hyphens before them?

Modifies the writability state of a specified folder shared between the host and a guest virtual machine. The value for the share name parameter is a mount point in the guest file system. The value for the path to folder on host parameter is the exported directory on the host. To make a shared folder writable or read-only, include the writable or readonly parameter.

addSharedFolder

path to .vmx file

share name

path to folder on host

Adds a folder to be shared between the host and guest. The value for the share name parameter is a mount point in the guest file system. The value for the path to folder on host parameter is the exported directory on the host. On Windows guests, there might be a delay before shared folders are visible to the InGuest options.

removeSharedFolder

path to .vmx file

share name

Removes the guest virtual machine’s access to a shared folder on the host. The value for the share name parameter is a mount point in the guest file system.

enableSharedFolders

path to .vmx file

[runtime]

Allows the guest virtual machine, specified by .vmx file, to share folders with its host. After enabling, run the addSharedFolder option to specify each host folder to share. The optional [runtime] argument limits the sharing of folders until the virtual machine is powered off. Otherwise, the setting persists at next power on.

disableSharedFolders

path to .vmx file

[runtime]

Stops the guest virtual machine, specified by .vmx file, from sharing folders with its host. The optional [runtime] argument limits the stop applied to the sharing of folders until the virtual machine is powered off. Otherwise, the setting persists at next power on.

listProcessesInGuest

path to .vmx file

Lists all processes running in the guest operating system. VMware Tools and a valid guest login are required.

killProcessInGuest

path to .vmx file

process ID

Stops a specified process in the guest operating system. VMware Tools and a valid guest login are required. The process ID can be any number listed after pid= in the output of the listProcessesInGuest option.

runScriptInGuest

path to .vmx file

[ -noWait | -activeWindow | -interactive ]

interpreter path

script text

Runs the specified command script in the guest operating system. See the runProgramInGuest entry for an explanation of options. The interpreter path option runs the script. Provide the complete text of the script, not a filename. VMware Tools and a valid guest login are required.

deleteFileInGuest

path to .vmx file

path to file on guest

Deletes the give file from the guest operating system. VMware Tools and a valid guest login are required.

For Vista and Windows 7 restrictions on this command, see note in “Guest to Host File Operations” on page 17.

Reviewers: djohn Fri Oct 27 12:53:56 PDT 2017

What's "give file"? Google doesn't make it clear to me. If I can't figure it out easily, I'm guessing it will confuse others, too. Is there something else we can stay instead of "give file."
Reviewers: djohn Fri Oct 27 12:48:20 PDT 2017

Windows Vista and 7 are specified in this description. Do we want to leave that? Do we want to add info for other Windows versions?

createDirectoryInGuest

path to .vmx file

directory path on guest

Creates the specified directory in the guest operating system. VMware Tools and a valid guest login are required.

For Vista and Windows 7 restrictions on this command, see note in “Guest to Host File Operations” on page 17.

Reviewers: djohn Fri Oct 27 12:48:20 PDT 2017

Windows Vista and 7 are specified in this description. Do we want to leave that? Do we want to add info for other Windows versions?

deleteDirectoryInGuest

path to .vmx file

directory path on guest

Deletes the specified directory from the guest operating system. VMware Tools and a valid guest login are required.

For Vista and Windows 7 restrictions on this command, see note in “Guest to Host File Operations” on page 17.

Reviewers: djohn Fri Oct 27 12:48:20 PDT 2017

Windows Vista and 7 are specified in this description. Do we want to leave that? Do we want to add info for other Windows versions?

createTempfileInGuest

path to .vmx file

Creates a temporary file in the guest operating system, and returns the path name of the temporary file created. The path name varies according to the operating system. You can run the deleteFileInGuest option to remove the file. VMware Tools and a valid guest login are required.

listDirectoryInGuest

path to .vmx file

directory path on guest

Lists contents of the specified directory in the guest operating system. VMware Tools and a valid guest login are required.

CopyFileFromHostToGuest

path to .vmx file

file path on host

file path in guest

Copies a file from the host to the guest operating system. VMware Tools and a valid guest login are required. Specify the source file name, or host file name, before the destination file name, or guest file name.

For Vista and Windows 7 restrictions on this command, see note in “Guest to Host File Operations” on page 17.

Reviewers: djohn Fri Oct 27 12:48:20 PDT 2017

Windows Vista and 7 are specified in this description. Do we want to leave that? Do we want to add info for other Windows versions?

CopyFileFromGuestToHost

path to .vmx file

file path in guest

file path on host

Copies a file from the guest operating system to the host. VMware Tools and a valid guest login are required. Specify the source file name, or guest file name, before the destination file name, or host file name.

renameFileInGuest

path to .vmx file

original filename

new filename

Renames or moves a file in the guest operating system. VMware Tools and a valid guest login are required. Specify the source file name, or original file name, before the destination file name.

typeKeystrokesInGuest

path to .vmx file

keystroke string

Adds the keystroke string provided in the command to the guest operating system.

Reviewers: djohn Fri Nov 3 08:49:57 PDT 2017

The typeKeystrokesInGuest option was not in the vmrun guide. Therefore, this option is new. The only description is the description that is listed when one types vmrun. I don't even understand what the above description means. Can I get a more descriptive and clear explanation?

connectNamedDevice

path to .vmx file

device name

Connects the device named in the command to the guest operating system.

Reviewers: djohn Fri Nov 3 08:49:57 PDT 2017

The connectNamedDevice option was not in the vmrun guide. Therefore, this option is new. The only description is the description that is listed when one types vmrun. I don't even understand what the above description means. Can I get a more descriptive and clear explanation?

disconnectNamedDevice

path to .vmx file

device name

Disconnects the device named in the command from the guest operating system.

Reviewers: djohn Fri Nov 3 08:49:57 PDT 2017

The connectNamedDevice option was not in the vmrun guide. Therefore, this option is new. The only description is the description that is listed when one types vmrun. I don't even understand what the above description means. Can I get a more descriptive and clear explanation?

captureScreen

path to .vmx file

output path on host

The specified output file on the host is in PNG format. A valid guest login is required.

writeVariable

path to .vmx file

[ guestVar | runtimeConfig | guestEnv ]

Reviewers: djohn Mon Oct 30 09:53:35 PDT 2017

The preceding options don't need hyphens, such as -guestVar?

variable name

variable value

Writes a variable to the virtual machine state or guest. You can set either a non‐persistent guest variable, guestVar, a runtime configuration variable,runtimeConfig, as stored in the .vmx file, or an environment variable, guestEnv, in the guest operating system. A guest variable is a runtime‐only value that provides a simple way to pass runtime values in and out of the guest. Environment variables require VMware Tools and a valid guest login. With Linux, setting the guest environment also requires root login.

readVariable

path to .vmx file

[ guestVar | runtimeConfig | guestEnv ]

variable name

Reads a variable from the virtual machine state or guest. You can get a guest variable, a runtime configuration as stored in the .vmx file, or environment variables in the guest operating system. Reading the guestEnv variable requires a valid guest login. See the preceding writeVariable entry for a description of variable types.

getGuestIPAddress

path to .vmx file

[ -wait ]

Gets the IP address of the guest.

Reviewers: djohn Fri Nov 3 08:49:57 PDT 2017

The getGuestIPAddress option was not in the vmrun guide. Therefore, this option is new. The only description is the description that is listed when one types vmrun. I don't even understand what the above description means. There's no description of the [ -wait ] parameter. Can I get a more descriptive and clear explanation?

The vmrun General Commands and Parameters

Option

Parameters

Description

list

Lists all running virtual machines.

upgradevm

path to .vmx file

Upgrades a virtual machine to the current virtual hardware version. Has no effect if the virtual hardware version is the most recent supported.

installTools

path to .vmx file

Prepares to install VMware Tools in the guest operating system. In Windows guests with autorun enabled, the VMware Tools installer starts by itself. In Linux guests without autorun, the command connects the virtual CD‐ROM drive to the VMware Tools ISO image suitable for the guest, but the installer does not start.

You must complete the installation with additional manual steps, as described in the product documentation.

checkToolsState

path to .vmx file

Checks the current VMware Tools state.

Reviewers: djohn Thu Nov 2 09:40:50 PDT 2017

checkToolsState is new. It's not in the old vmrun guide. Is there more info for the description?

deleteVM

path to .vmx file

Deletes a virtual machine.

clone

path to .vmx file

destination .vmx file path

full|linked

[-snapshot=Snapshot Name]

[-cloneName=Name]

Creates a copy of the virtual machine.

The vmrun Template Virtual Machine Commands and Parameters

Option

Parameters

Description

downloadTemplateVM

path to .vmx file

Reviewers: djohn Fri Nov 3 10:28:42 PDT 2017

Running the vmrun command for this option shows the following parameter Path for new VM. However, all the other command options display Path to vmx file. Notice that I list path to .vmx file above because that is used over and over again in this guide. Is it incorrect for this command option?

[ -wait ]

Downloads the virtual machine to be used as a template.

Reviewers: djohn Thu Nov 2 09:40:50 PDT 2017

downloadTemplateVM is new. It's not in the old vmrun guide. Is there more info for the description? What's the [ -wait ] option for?