This package provides an interface to the VIX library for manipulating VMware virtual machines. The package uses the VIX COM interface and therefore only runs on Windows although the virtual machines themselves may run any operating system.
This document describes V1.0 of the vix package and is intended to be a command reference. For a more complete example of usage, see http://www.magicsplat.com/blog/automating-vmware-with-vix.
The package has the following prerequisites:
The package is available from the Files area of the SourceForge project at http://sourceforge.net/p/tcl-vix.
It is distributed as a Tcl module 'vix-VERSION.tm'. Place this file anywhere in a directory included in the list of module directories searched by Tcl. Alternatively, install it with the command
tclsh vix-VERSION.tm install ?TARGETDIR?
If TARGETDIR is not specified, it will install to a suitable directory in the module path.
Load the module
package require vix
All commands are placed within the vix namespace. The package must be initialized before any other calls are made:
vix::initialize
This allocates internal resources required for further use of the package. Conversely, resources should be released when the package is not required:
vix::finalize
Note that all objects created using the Host and VM classes must be destroyed before calling finalize.
These calls may be made multiple times in an application as long any other VIX calls are made after an initialize call without an intermediate finalize call.
To manipulate a virtual machine, first connect to the VMware host that contains it.
vix::Host create host
The above call will connect to a VMware Workstation host on the local system. For connecting to other VMware products and remote systems, see the documentation for the Host class.
Once connected to a host, we can obtain an object corresponding to a virtual machine:
set vm [host open "c:/Virtual Machines/vm1-win8pro/vm1-win8pro.vmx"]
The specified path may be a file path to the virtual machine's VMS file as in the case of VMware Workstation or a storage path as in the case of the ESX/ESXi products.
You can open multiple virtual machines from a single Host object. All such VM objects must be destroyed before destroying the owning Host object.
The above call returns a VM object which may then be used to manipulate the associated virtual machine using any of the methods of the VM class. For example,
$vm power_on
will power on the virtual machine. The supported methods include commands to manipulate system state, copy files to and from the virtual machine, start programs and so on.
There are some additional important points to be noted about using these methods. See the documentation of the VM.wait_for_tools and VM.login for details.
When no longer needed, the objects should be destroyed.
$vm destroy host destroy
Note that this does *not* change the state of the VMware host or the virtual machines themselves.
Finalizes the vix package
Finalizes the vix package
This command must be called after finishing with the use of the vix package to release internal resources. Before calling this command, all vix objects should have been destroyed.
Once this command returns, the initialize command must be called before the application makes use of the package again.
Initializes the vix package
Initializes the vix package
This command initializes internal resources used for interfacing to VMware hosts. It must be called before using any other commands from the package.
connect | Establishes a connection to the host system represented by this object. |
constructor | Constructor for the class |
destructor | Destructor for the class |
disconnect | Disconnects the object from the associated VMware host. |
open | Returns a VM object representing a virtual machine on this VMware host |
register | Registers a virtual machine with a VMware host |
registered_vms | Returns a list of virtual machines that are registered on the host |
running_vms | Returns a list of virtual machines that are running on the host |
trace_VM | Internal command to track virtual machines. Do not call directly. |
type | Returns the type of the VMware host software |
unregister | Unregisters a virtual machine with a VMware host. |
version | Returns a string containing the version of the VMware host software |
wrappee | Returns the underlying twapi::Automation COM object |
::vix::_VixHandle
Class representing a host system running VMware software
args | Additional options. |
-connect BOOLEAN | if true (default), automatically connects to the host. If false, caller must separately call the connect method. |
-hostname HOSTNAME | specifies the name of the host system. Defaults to the local system. Cannot be specified if HOSTTYPE is workstation or player. Must be specified in other cases. |
-hosttype HOSTTYPE | specifies the type of VMware host software. HOSTTYPE must be one of workstation for VMware Workstation (default), workstation_server for VMware Workstation in shared mode, server for VMware Server 1.0, player for VMware Player and vi_server for VMware Server 2.0, vCenter and ESX/ESXi. |
-password PASSWORD | the password associated with the account. Ignored if -hostname is not specified. |
-port PORTNUMBER | specifies the port number to connect to on the host. Ignored if -hostname is not specified. |
-username USER | name of the account to use to connect to the host system. Ignored if -hostname is not specified. |
Class representing a host system running VMware software
The specified host is not contacted until the connect method is invoked.
Establishes a connection to the host system represented by this object.
Establishes a connection to the host system represented by this object.
This method must be called before any virtual machines can be opened on the host system. The method may be called multiple times with calls being no-ops if the connection is already established.
Disconnects the object from the associated VMware host.
force | (optional, default 0) if 0, an error is raised if any associated VM objects exist. If 1, the associated VM objects are forcibly destroyed before disconnecting. |
Disconnects the object from the associated VMware host.
The application should normally ensure that all VM objects associated with this host have been closed before calling disconnect.
The connect method may be called to reestablish the connection.
Returns a VM object representing a virtual machine on this VMware host
vm_path | absolute path to the VMX file for the virtual machine on the VMware host. The path must be in the syntax expected by the VMware host operating system. |
Returns a VM object representing a virtual machine on this VMware host
For VMware server and ESX/ESXi hosts, the virtual machine must have been registered.
Registers a virtual machine with a VMware host
vm_path | absolute path to the VMX file for the virtual machine on the VMware host. The path must be in the syntax expected by the VMware host operating system. |
Registers a virtual machine with a VMware host
For VMware Server and ESX/ESXi hosts, a virtual machine must be registered before it can be accessed with the open call. For other VMware host types, this call is ignored. Registration is a one-time operation and may also be done through the VMware command line or user interface.
Returns a list of virtual machines that are registered on the host
Returns a list of virtual machines that are registered on the host
Each element of the returned list contains the path of the registered virtual machine. This command is only relevant for ESX/ESXi and VMware Server hosts.
Returns a list of virtual machines that are running on the host
Returns a list of virtual machines that are running on the host
Each element of the returned list contains the path from which the virtual machine was created.
Internal command to track virtual machines. Do not call directly.
oldname | |
newname | |
op |
Internal command to track virtual machines. Do not call directly.
Returns the type of the VMware host software
Returns the type of the VMware host software
The returned value is one of the values accepted for the '-hosttype' option to the connect method.
Unregisters a virtual machine with a VMware host.
vm_path | absolute path to the VMX file for the virtual machine on the VMware host. The path must be in the syntax expected by the VMware host operating system. |
Unregisters a virtual machine with a VMware host.
For VMware Server and ESX/ESXi hosts, a virtual machine must be registered before it can be accessed with the open call. This method removes a registered VM from the host inventory.
Returns a string containing the version of the VMware host software
Returns a string containing the version of the VMware host software
Returns a string containing the version of the VMware host software
Returns the underlying twapi::Automation COM object
Returns the underlying twapi::Automation COM object
The command will raise an error if there is no associated wrapped COM object.
child | Returns a child snapshot |
constructor | Constructor for the class |
description | Returns the description name of the snapshot |
destructor | Destructor for the class |
display_name | Returns the display name of the snapshot |
number_of_children | Returns the number of children of the snapshot |
parent | Returns the parent snapshot |
wrappee | Returns the underlying twapi::Automation COM object |
::vix::_VixHandle
Represents a snapshot of a virtual machine.
comobj | Wrapped VIX Automation object |
Represents a snapshot of a virtual machine.
Objects of this class should not be created directly. They are returned by various methods of objects of this class and the VM class.
The methods of this class allow invoking of various operations on virtual machine snapshots.
Returns a child snapshot
index | index of the children snapshots |
Returns a Snapshot object representing the child snapshot at the specified index position.
Returns a child snapshot
Returns the description name of the snapshot
Returns the description name of the snapshot
Returns the description name of the snapshot
Returns the display name of the snapshot
Returns the display name of the snapshot
Returns the display name of the snapshot
Returns the number of children of the snapshot
Returns the number of children of the snapshot
Returns the number of children of the snapshot
Returns the parent snapshot
Returns the parent snapshot
Returns the parent snapshot
Returns the underlying twapi::Automation COM object
Returns the underlying twapi::Automation COM object
The command will raise an error if there is no associated wrapped COM object.
add_shared_folder | Adds a shared folder to the virtual machine. |
constructor | Constructor for the class |
copy_from_vm | Copies a file or directory from the virtual machine. |
copy_to_vm | Copies a file or directory to the virtual machine. |
create_snapshot | Creates a new snapshot of the virtual machine. |
current_snapshot | Returns a Snapshot object representing the current snapshot of the virtual machine |
delete_snapshot | Deletes a snapshot of the virtual machine and all associated state |
destructor | Destructor for the class |
dir | Returns the contents of a directory in the virtual machine. |
disable_shared_folders | Disables the use of shared folders for the virtual machine. |
enable_shared_folders | Enables the use of shared folders for the virtual machine. |
exec | Executes a program in the virtual machine. |
fstat | Returns information about a file or directory. |
get_snapshot | Returns a Snapshot object representing the named snapshot of the virtual machine |
getconfig | Returns the value of an variable in the virtual machine configuration |
getenv | Returns the value of an environment variable in the virtual machine |
getvar | Returns the value of a guest variable in the virtual machine |
isdir | Check if the specified path is a directory |
isfile | Check if the specified path is a regular file. |
kill | Terminates a process in the virtual machine. |
login | Establishes a login context on the associated virtual machine. |
logout | Logs out of a login context |
memory_size | Returns the memory size configured for the virtual machine |
mkdir | Creates a new directory in the virtual machine |
name | Returns the name of the virtual machine |
ncpus | Returns the number of CPU's configured for the virtual machine |
os | Returns the operating system running in the virtual machine |
path | Returns the full path of the VMX file for the virtual machine |
pause | Pauses the execution of the virtual machine. |
pids | Returns a list of process ids running in the virtual machine. |
power_off | Powers off the associated virtual machine. |
power_on | Powers on the associated virtual machine. |
power_state | Returns the power state of the virtual machine |
processes | Retrieves detailed information about the processes running in the virtual machine. |
read_file | Returns a content of a file in the virtual machine |
readonly? | |
reboot | Reboots the associated virtual machine. |
remove_shared_folder | Removes a shared folder from the virtual machine. |
rename | Renames a file or directory in the virtual machine. |
reset | Resets the associated virtual machine. |
revert_to_snapshot | Reverts the virtual machine to the specified snapshot |
rmdir | Deletes a directory in the virtual machine |
rmfile | Deletes a file in the virtual machine |
root_snapshot | Returns a Snapshot object corresponding to the root snapshot at the specified position |
root_snapshot_count | Returns the number of root snapshots of the virtual machine. |
running? | Returns '1' if the virtual machine running, else '0' |
script | Runs a script in the virtual machine using the specified program |
setenv | Sets the value of an environment variable in the virtual machine |
setvar | Sets the value of a guest variable in the virtual machine |
shared_folder_path | Returns the shared folder path in the virtual machine |
shared_folders | Returns list of shared folders in the virtual machine. |
shutdown | Shuts down the associated virtual machine. |
ssl_error | |
suspend | Suspends the associated virtual machine. |
team_member? | Returns '1' if the virtual machine is a member of a team, else '0' |
team_path | Returns the path to the virtual machine team |
tempfile | Creates a temporary file in the virtual machine. |
tools_state | Returns the state of VMware tools in the virtual machine |
trace_Snapshot | Internal command to track virtual machines. Do not call directly. |
unpause | Resumes the execution of a paused virtual machine. |
upgrade_hardware | Upgrades the hardware of the virtual machine |
upgrade_vmware_tools | Upgrades VMware Tools in the virtual machine |
wait_for_tools | Waits for VMware Tools to be running in the virtual machine. |
wrappee | Returns the underlying twapi::Automation COM object |
write_file | Returns content to a file in the virtual machine |
::vix::_VixHandle
Represents a virtual machine on a VMware host.
comobj | Wrapped VIX Automation object |
Represents a virtual machine on a VMware host.
Objects of this class should not be created directly. They are returned by the open method of an Host object.
The methods of this class allow invoking of various operations on the associated virtual machine.
The associated VM may or may not be running.
Adds a shared folder to the virtual machine.
share_name | the share name in the virtual machine |
host_path | path of the directory on the host system to be shared |
args | Additional options. |
-mode MODE | the sharing mode, r or readonly (default) for read-only shared and rw or readwrite for shares that can be read or written |
Adds a shared folder to the virtual machine.
NOTE: on Windows there may be a delay before the shared path is usable in the virtual machine.
This method requires VMtools to be running in the virtual machine.
Copies a file or directory from the virtual machine.
guest_path | file or directory path in the guest virtual machine. This must be an absolute path in a format valid for the guest operating system. |
local_path | target local file path where the file or directory is to be copied |
Copies a file or directory from the virtual machine.
The method copies a file or a directory tree from the virtual machine to the local file system overwriting existing files and merging directories. Errors may result in partial copies.
This method requires a login context to have been established.
Copies a file or directory to the virtual machine.
local_path | target local file path where the file or directory is to be copied |
guest_path | file or directory path in the guest virtual machine. This must be an absolute path in a format valid for the guest operating system. |
Copies a file or directory to the virtual machine.
The method copies a file or a directory tree from the local file system to the virtual machine, overwriting existing files and merging directories. Errors may result in partial copies.
This method requires a login context to have been established.
Creates a new snapshot of the virtual machine.
name | name to assign to the snapshot. This need not be unique |
args | Additional options. |
-description TEXT | a text description for the snapshot |
-includememory BOOLEAN | If false (default), memory is not saved with the snapshot. If true, the current memory content is saved. |
Creates a new snapshot of the virtual machine.
Returns a Snapshot object representing the current snapshot of the virtual machine
Returns a Snapshot object representing the current snapshot of the virtual machine
Returns a Snapshot object representing the current snapshot of the virtual machine
Deletes a snapshot of the virtual machine and all associated state
snapshot | the Snapshot object to be removed |
args | Additional options. |
-recurse BOOLEAN | if specified as true, children of the specified snapshot are also deleted. Default is false. |
Deletes a snapshot of the virtual machine and all associated state
Note this deletes the actual snapshot of the virtual machine. The snapshot object has to be destroyed by the caller after the method returns.
Returns the contents of a directory in the virtual machine.
path | absolute directory path in the virtual machine. |
args | Additional options. |
-details BOOLEAN | by default, the method returns a list of names. If this option is specified as true, the details of each directory entry is returned. |
Returns the contents of a directory in the virtual machine.
This method requires a login context to have been established.
Disables the use of shared folders for the virtual machine.
Disables the use of shared folders for the virtual machine.
This method requires VMtools to be running in the virtual machine.
Enables the use of shared folders for the virtual machine.
Enables the use of shared folders for the virtual machine.
This method requires VMtools to be running in the virtual machine.
Executes a program in the virtual machine.
program | absolute path of the program to run |
args | Additional options. |
-activatewindow BOOLEAN | specifies if the program window should be activated. See below for more |
-cmdargs CMDLINE | command line to pass to the program |
-wait BOOLEAN | Specifies whether to wait for the program to complete (default 0) |
Returns the process id, exit code and elapsed time in seconds as a triple.
Executes a program in the virtual machine.
The program must not assume a specific working directory and any passed arguments should not be based on that assumption either.
Programs that interact with the user and need to display on the desktop console require that login context have been created with the -interactive option to Host.login. The -activatewindow option is only relevant for such programs. A true value for the option ensures that the created window is visible and not minimized. This option is only effective for Windows virtual machines.
Note that if -wait is not specified as true, only the process id element in the return value is valid.
This method requires a login context to have been established.
Returns information about a file or directory.
path | file path in the virtual machine. This must be an absolute path in a format valid for the guest operating system. |
Returns information about a file or directory.
This method requires a login context to have been established.
Returns a Snapshot object representing the named snapshot of the virtual machine
name | name of the snapshot. This can include a path through the snapshot tree with each snapshot separated by '/' |
Returns a Snapshot object representing the named snapshot of the virtual machine
VMware does not enforce uniqueness of snapshot names. In case of duplicates, the method raises an exception.
Returns the value of an variable in the virtual machine configuration
var | name of the environment variable |
Returns the value of an variable in the virtual machine configuration
This method requires the virtual machine to be running.
Returns the value of an environment variable in the virtual machine
envvar | name of the environment variable |
Returns the value of an environment variable in the virtual machine
This method requires a user login context to have been established and the returned value is based on that user context.
Returns the value of a guest variable in the virtual machine
var | name of the guest variable |
Returns the value of a guest variable in the virtual machine
This method requires the virtual machine to be running.
Check if the specified path is a directory
path | directory path in the virtual machine. This must be an absolute path in a format valid for the guest operating system. |
Returns 1 if the specified path is a directory and false otherwise.
Check if the specified path is a directory
This method requires a login context to have been established.
Check if the specified path is a regular file.
path | file path in the virtual machine. This must be an absolute path in a format valid for the guest operating system. |
Returns 1 if the specified path is a regular file and false otherwise.
Check if the specified path is a regular file.
Note in particular that the method will return 0 even in the case that the path exists but is not a regular file, such as a directory or a device.
This method requires a login context to have been established.
Terminates a process in the virtual machine.
pid | process id of the process to be terminated |
Terminates a process in the virtual machine.
This method requires a login context to have been established.
Establishes a login context on the associated virtual machine.
username | the login account name |
password | the password for the account |
args | Additional options. |
-interactive BOOLEAN | Indicates whether the login session requires an interactive context. See more below. |
Establishes a login context on the associated virtual machine.
Several VM operations, for example the ones for files, require a login context on the virtual machine. This method establishes such a context. The virtual machine operating system will enforce access permissions based on this context.
The method may be called multiple times to change the login context. To invalidate the context, use the logout method.
By default, the login context does not have an interactive desktop associated with it. Specifying the -interactive option as true will create such a interactive context which may be required for executing programs with a graphical user interface with the run method. However, note that creation of an interactive context requires the same user to be currently logged in to the virtual machine console.
Note that not all guest operating systems are supported by the login method. Moreover, Linux virtual machines must be running X11 for interactive contexts.
This method requires VMWare Tools to be running in the virtual machine.
Logs out of a login context
Logs out of a login context
The current context created with the login method is closed. Any methods that require a user context on the virtual machine should not be called until a new context is reestablished.
This method requires VMWare Tools to be running in the virtual machine.
Returns the memory size configured for the virtual machine
Returns the memory size configured for the virtual machine
Returns the memory size configured for the virtual machine
Creates a new directory in the virtual machine
path | directory path in the guest virtual machine. This must be an absolute path in a format valid for the guest operating system. |
Creates a new directory in the virtual machine
The directory is created if it does not exist. It is not an error for the directory to already exist.
This method requires a login context to have been established.
Returns the name of the virtual machine
Returns the name of the virtual machine
Returns the name of the virtual machine
Returns the number of CPU's configured for the virtual machine
Returns the number of CPU's configured for the virtual machine
Returns the number of CPU's configured for the virtual machine
Returns the operating system running in the virtual machine
Returns the operating system running in the virtual machine
The returned value is an internal VMware name specific to an operating system, for example winxppro.
Returns the full path of the VMX file for the virtual machine
Returns the full path of the VMX file for the virtual machine
Returns the full path of the VMX file for the virtual machine
Pauses the execution of the virtual machine.
Pauses the execution of the virtual machine.
When the virtual machine is paused, method that operate on the guest should not be called except those related to machine state such as power_off, reset etc.
Call the unpause method to resume execution of the virtual machine.
WARNING: do NOT call any commands that require virtual machine operation while it is paused.
Returns a list of process ids running in the virtual machine.
Returns a list of process ids running in the virtual machine.
This method requires a login context to have been established.
Powers off the associated virtual machine.
Powers off the associated virtual machine.
The virtual machine, which must have been powered on, is turned off with the equivalent of a hardware switch. Unlike the shutdown method, the virtual machine's operating system is not involved and VMware Tools need not be running on it.
Powers on the associated virtual machine.
args | Additional options. |
-hide BOOLEAN | If false (default), the user interface is displayed on Workstation and Player VMware hosts. If true, the user interface is not shown. |
Powers on the associated virtual machine.
The associated virtual machine is powered on or resumed from a suspended state. Note that after powering on commands that require the use of VMware Tools on the virtual machine should not be used until the latter is up and running. The command wait_for_tools can be used for this purpose.
Returns the power state of the virtual machine
Returns the power state of the virtual machine
The returned value is a list of one or more values from the following: powering_off, powered_off, powering_on, powered_on suspending, suspended, tools_running, resetting, blocked_on_msg, paused, resuming.
Retrieves detailed information about the processes running in the virtual machine.
Retrieves detailed information about the processes running in the virtual machine.
The return value is a sextuple containing
This method requires a login context to have been established.
Returns a content of a file in the virtual machine
guest_path | file or directory path in the guest virtual machine. This must be an absolute path in a format valid for the guest operating system. |
args | options are passed to the fconfigure Tcl command to control CRLF mode, encoding etc. |
Returns a content of a file in the virtual machine
Returns a content of a file in the virtual machine
Reboots the associated virtual machine.
Reboots the associated virtual machine.
The virtual machine, which must be in a running state, is shut down cleanly using the running operating system and restarted. This is in contrast to the reset method.
The command requires VMware Tools to be running on the virtual machine.
Removes a shared folder from the virtual machine.
share_name | the share name in the virtual machine |
Removes a shared folder from the virtual machine.
This method requires VMtools to be running in the virtual machine.
Renames a file or directory in the virtual machine.
from | absolute file path in the virtual machine. |
to | absolute file path in the virtual machine. |
Renames a file or directory in the virtual machine.
This method requires a login context to have been established.
Resets the associated virtual machine.
Resets the associated virtual machine.
The virtual machine, which must have been powered on, is turned off and on with the equivalent of a hardware reset. Unlike the reboot method, the virtual machine's operating system is not involved and VMware Tools need not be running on it.
Reverts the virtual machine to the specified snapshot
snapshot | The Snapshot object to revert to |
args | Additional options. |
-hide BOOLEAN | If false (default), the user interface is displayed on Workstation and Player VMware hosts. If true, the user interface is not shown. Only applies if the snapshot was taken with the virtual machine powered on. |
-poweroff BOOLEAN | If true, the restored virtual machine is powered off even if it was powered on when the snapshot was taken. Default is false. |
Reverts the virtual machine to the specified snapshot
The virtual machine state is restored to that when the snapshot was taken. Note that after reverting to a snapshot, commands that require the use of VMware Tools on the virtual machine should not be used until the latter is up and running. The command wait_for_tools can be used for this purpose.
Deletes a directory in the virtual machine
path | directory path in the guest virtual machine. This must be an absolute path in a format valid for the guest operating system. |
Deletes a directory in the virtual machine
The entire tree under the specified directory is deleted. It is not an error if the directory does not exist.
This method requires a login context to have been established.
Deletes a file in the virtual machine
path | file path in the guest virtual machine. This must be an absolute path in a format valid for the guest operating system. |
Deletes a file in the virtual machine
The specified file is deleted. It is not an error if it does not exist.
This method requires a login context to have been established.
Returns a Snapshot object corresponding to the root snapshot at the specified position
index | position of the root snapshot |
Returns a Snapshot object corresponding to the root snapshot at the specified position
Returns a Snapshot object corresponding to the root snapshot at the specified position
Returns the number of root snapshots of the virtual machine.
Returns the number of root snapshots of the virtual machine.
Returns the number of root snapshots of the virtual machine.
Returns 1 if the virtual machine running, else 0
Returns 1 if the virtual machine running, else 0
Returns 1 if the virtual machine running, else 0
Runs a script in the virtual machine using the specified program
program | absolute path of the script interpreter to run |
script | the text of the script to run. The size of the script is limited to about 60,000 characters. |
args | Additional options. |
-wait BOOLEAN | Specifies whether to wait for the program to complete (default 0) |
Returns the process id, exit code and elapsed time in seconds as a triple.
Runs a script in the virtual machine using the specified program
The program and script must not assume a specific working directory.
Note that if -wait is not specified as true, only the process id element in the return value is valid.
This method requires a login context to have been established.
Sets the value of an environment variable in the virtual machine
envvar | name of the environment variable |
val | value to set for the variable |
Sets the value of an environment variable in the virtual machine
The method sets the value of the specified environment variable in the virtual machine.
This method requires a user login context to have been established and the returned value is based on that user context. The scope of the set environment variable in the virtual machine is dependent on its operating system. On Windows guests, UAC has to be disabled for this command to work.
Sets the value of a guest variable in the virtual machine
var | name of the guest variable |
val | value to set for the variable |
Sets the value of a guest variable in the virtual machine
The method sets the value of the specified guest variable in the virtual machine. Guest variables are simply a means to associate data with a virtual machine and only exist while it is running. Use the getvar method to set the value of a guest variable.
This method requires the virtual machine to be running.
Returns the shared folder path in the virtual machine
Returns the shared folder path in the virtual machine
This method requires VMware Tools to be running in the virtual machine.
Returns list of shared folders in the virtual machine.
Returns list of shared folders in the virtual machine.
The return value consists of triples each containing information about one shared folder. The first element of the triple is the share name in the virtual machine, the second is the shared directory on the host, and the third is either readonly or readwrite.
Shuts down the associated virtual machine.
Shuts down the associated virtual machine.
The virtual machine, which must be in a running state, is shut down cleanly using the running operating system. This is in contrast to the power_off method.
The command requires VMware Tools to be running on the virtual machine.
Suspends the associated virtual machine.
Suspends the associated virtual machine.
The virtual machine, which must have been powered on, is suspended. It can be resumed by calling the power_on method.
Returns 1 if the virtual machine is a member of a team, else 0
Returns 1 if the virtual machine is a member of a team, else 0
Returns 1 if the virtual machine is a member of a team, else 0
Returns the path to the virtual machine team
Returns the path to the virtual machine team
The command will raise an error if the virtual machine is not part of a team. Use the team_member? method to check.
Creates a temporary file in the virtual machine.
Returns the full path to the created file.
Creates a temporary file in the virtual machine.
Creates a temporary file in the virtual machine. The deletion of the file, if required, is up to the application.
This method requires a login context to have been established.
Returns the state of VMware tools in the virtual machine
Returns the state of VMware tools in the virtual machine
The returned value is one of unknown, running, or not_installed.
Internal command to track virtual machines. Do not call directly.
oldname | |
newname | |
op |
Internal command to track virtual machines. Do not call directly.
Resumes the execution of a paused virtual machine.
Resumes the execution of a paused virtual machine.
Upgrades the hardware of the virtual machine
Upgrades the hardware of the virtual machine
The machine must be powered off before attempting to upgrade the virtual hardware; otherwise the method returns an error.
Upgrades VMware Tools in the virtual machine
Upgrades VMware Tools in the virtual machine
Some version of VMware Tools must already be running in the virtual machine.
Waits for VMware Tools to be running in the virtual machine.
timeout | (optional, default 10) specifies a timeout in seconds to wait. If the tools are not running within this time, the command completes with an error. A 0 or negative value indicates an indefinite wait. Default value is 10 seconds. |
Waits for VMware Tools to be running in the virtual machine.
Several VM methods require VMware Tools to be running. An application can call this method to wait for this. Generally this is only required after powering on or resuming a virtual machine.
Returns the underlying twapi::Automation COM object
Returns the underlying twapi::Automation COM object
The command will raise an error if there is no associated wrapped COM object.
Returns content to a file in the virtual machine
guest_path | file or directory path in the guest virtual machine. This must be an absolute path in a format valid for the guest operating system. |
data | |
args | options are passed to the fconfigure Tcl command to control CRLF mode, encoding etc. |
Returns content to a file in the virtual machine
Returns content to a file in the virtual machine