VMware Guest - Connect

Declaration

<AMVMWAREGUEST ACTIVITY="connect" HOSTTYPE="text (options)" 
SERVER="text" USERNAME="text" PASSWORD="text (encrypted)" 
VMPATH="text" GUESTUSERNAME="text" 
GUESTPASSWORD="text (encrypted)" CONSOLE="YES/NO" 
LAUNCHGUI="YES/NO" OPENVMTIMEOUT="number" POWERONTIMEOUT="number" 
TOOLSTIMEOUT="number" LOGINTIMEOUT="number" CONNECTIONTIMEOUT="number" 
SESSION="text" />

Description

Connects to the specified guest operating system and creates a session in which to link subsequent VMware Guest activities. To work with a virtual machine, you must first connect to the host where the virtual machine is stored. If the virtual machine is on a host running VMware Workstation, you can connect to it only from a client on the same host. If the virtual machine is on a host running VMware Server, you can connect to that host whether it is a local or remote host. VMware Workstation currently allows you to manipulate virtual machines only from the local host.

Practical Usage

Allows you to access any networked host machine that is running VMware Server from a single client machine.

Connection Parameters

Property

Type

Required

Default

Markup

Description

Host type

Text (options)

Yes

VMWare VI Server

  1. HOSTTYPE="Server"

  2. HOSTTYPE="Workstation"

  3. HOSTTYPE="VIServer"

  4. HOSTTYPE="Player"

Indicates the VMware software type running on the host where the virtual machine is located. If you are using VMware Server to connect to a remote host, it does not matter which VMware product (if any) is running on the local host. The available options are:

  • VMWare Server (1.0x)

  • VMWare Workstation

  • VMWare VI Server (ESX/ESXi, vCenter, VMWare Server 2.0)

  • VMWare Player

Host name

Text

Yes if Host is VMWare Server or VMWare VI Server

(Empty)

  1. SERVER="host.server.com"

  2. SERVER="xxx.xxx.xxx.xxx"

The host name or IP address of the computer where the virtual machine is located. This parameter is active only if the Host type parameter is set to VMWare Server (1.0x) or VMWare VI Server (ESX/ESXi, vCenter, VMWare Server 2.0).

[Host] Username

Text

Yes if Host is VMWare Server or VMWare VI Server

(Empty)

USERNAME="theUser"

The username identifying a valid user account on the virtual machine. This parameter is active only if the Host type parameter is set to VMWare Server (1.0x) or VMWare VI Server (ESX/ESXi, vCenter, VMWare Server 2.0).

[Host] Password

Text

Yes if Host is VMWare Server or VMWare VI Server

(Empty)

PASSWORD="encrypted"

The password identifying a valid user account on the virtual machine. This parameter is active only if the Host type parameter is set to VMWare Server (1.0x) or VMWare VI Server (ESX/ESXi, vCenter, VMWare Server 2.0).

Virtual machine path

Text

Yes

(Empty)

VMPATH=

"c:\My Virtual Machines\<vm_name>.vmx"

The path to the virtual machine. (Example: c:\My Virtual Machines\<virtual_machine_name>.vmx ).

[Guest] Username

Text

Yes

(Empty)

GUESTUSERNAME="user"

The username to authenticate the guest user.

[Guest] Password

Text

Yes

(Empty)

GUESTPASSWORD="encrypted"

The password to authenticate the guest user.

Log onto console session

Yes/No

No

No

CONSOLE="yes"

If set to YES, the user will be logged onto the console session. This parameter is set to NO by default.

Launch GUI

Yes/No

No

No

LAUNCHGUI="yes"

If set to YES, a GUI (Graphic User Interface) will appear on the desktop upon connection. If set to NO (default), no GUI will be launched and operations will execute in the background.

Open VM timeout

Number

No

60

OPENVMTIMEOUT="2"

The maximum time period in seconds during which this activity must be completed or the step times out. The default value is 60 seconds.

Power on timeout

Number

No

60

POWERONTIMEOUT="3"

The maximum time period in seconds during which the VM must power on or the step times out. The default value is 60 seconds.

VMware tools timeout

Number

No

300

TOOLSTIMEOUT="4"

The maximum time period in seconds during which VMWare Tools must start on the guest operating system or the step times out. The default value is 300 seconds.

Log on timeout

Number

No

60

LOGINTIMEOUT="5"

The maximum time period in seconds during which the log on process must be completed or the step times out. The default value is 60 seconds.

Connection timeout

Number

No

60

CONNECTIONTIMEOUT="6"

The maximum time period in seconds during which a connection must be established or the step times out. The default value is 60 seconds.

Session

Text

No

GuestOSOpsSession1

SESSION="MySession"

The name of the session to create for this connection.

Example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: This sample task uses several VMware Guest OS activities. It creates a session using the VMware Guest - Connect activity, logs onto the guest VMware using the VMware Guest - Log on activity, and checks if a specific guest file exists on the host using the VMware Guest - File exists activity. If the guest file exists, it is copied over to the host machine using the VMware Guest - Copy activity. The task ends with a VMware Guest - Disconnect step. Comments are included in the task to explain each step.

<AMVARIABLE NAME="myVar">
</AMVARIABLE>
<!-- Create a guest session. -->
<AMVMWAREGUEST ACTIVITY="connect" HOSTTYPE="Workstation" 
VMPATH="C:\Users\Username\Documents\Virtual Machines\Windows Server 2008 x86\Windows Server 2008 (experimental).vmx" 
GUESTUSERNAME="Techsupport" GUESTPASSWORD="AM1ag7WmWg7U1xbulaHHhbEOLvMrSDiPrC4aME" 
CONSOLE="yes" LAUNCHGUI="yes" OPENVMTIMEOUT="90" POWERONTIMEOUT="90" />
<!-- Log onto guest. -->
<AMVMWAREGUEST ACTIVITY="login" LOGINUSERNAME="Techsupport" LOGINPASSWORD="AM1ag7WmWg7U1xbulaHHhbEOLvMrSDiPrC4aME" 
LOGINCONSOLE="yes" TIMEOUT="3000" />
<!-- Check if a specific guest file exists. -->
<AMVMWAREGUEST ACTIVITY="file_exists" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" RESULTVARIABLE="myVar" />
<!-- If guest file exists, copy it over to the host machine. -->
<AMIF EXPRESSION="%myVar% = True">
<AMVMWAREGUEST "guest_to_host" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" HOSTFILE="C:\Users\techsupport\Desktop\hello.txt" />
</AMIF>
<!-- Close Connection -->
<AMVMWAREGUEST ACTIVITY="disconnect" />