Guest OS Operations - Login

Declaration

<AMVMWAREGUEST ACTIVITY="login" LOGINUSERNAME="text" LOGINPASSWORD="AM2lWcZt+rmhSThZ3y3kubxJA==aME" LOGINCONSOLE="yes" TIMEOUT="number" SESSION="text" />

See Also

Guest OS Operations - Disconnect, Guest OS Operations - File Exists, Guest OS Operations - Get Environment Variable, Guest OS Operations - Get File Information, Guest OS Operations - Get Guest Variable, Guest OS Operations - Kill Process, Guest OS Operations - List Directory, Guest OS Operations - List Process, Guest OS Operations - Login, Guest OS Operations - Logout, Guest OS Operations - Open URL, Guest OS Operations - Rename File, Guest OS Operations - Run Program, Guest OS Operations - Run Script

Description

Establishes a guest operating system authentication context that can be used with guest activities for the given virtual machine handle.

Practical Usage

Allows you to log into a guest OS.

Parameters

Guest OS Operations Properties

Property

Type

Required

Default

Markup

Description

Username

Text

Yes

(Empty)

LOGINUSERNAME="theUsername"

The name of a user account on the guest operating system.

Password

Number

No

(Empty)

LOGINPASSWORD="encrypted"

The password of the account identified by Username.

Login to console session

Yes/No

No

No

LOGINCONSOLE="yes"

If set to YES, logs in a user into a console session on the guest OS. This parameter is set to NO by default.

Timeout (seconds)

Text

Yes

(Empty)

TIMEOUT="20"

The maximum value in seconds that this activity should be allowed to execute.

Connection Properties

These properties allow you to create a custom connection for this activity or link it to a session previously established (using the Connect activity) that contains pre-defined connection parameters.

Property

Type

Required

Default

Markup

Description

Provide Connection

 

 

 

 

Indicates where this activity's connection should originate from. Different parameters become active depending on the option selected. The available options are:

  • Custom (Default) - A custom set of credentials will be entered for this activity. Select this option if performing a single operation.

  • Session Based - Credentials should derive from a session created in a previous step with the use of the Connect activity. This allows several operations to be linked to a single session, eliminating redundancy. Multiple sessions can exist in a single task.

Host Type

Text (options)

Yes

VMWare Workstation

HOSTTYPE="Server"

The VMware software 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.

  • VMWare Server (1.0x)

  • VMWare Workstation

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

  • VMWare Player

Host

Text

Yes

(Empty)

SERVER="host.server.com"

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 or VMware VI Server.

Username

Text

Yes

(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 or VMware VI Server.

Password

Text

Yes

(Empty)

PASSWORD="AM1DWVc+PAIZ6"

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 or VMware VI Server.

Guest Credentials

VM Path

Text

Yes

(Empty)

VMPATH=

"C:\Users\{Username}\Documents

\Virtual Machines\Windows Server 2008 x86\Windows Server 2008.vmx"

The path and file name (.vmx file) to the guest operating system. For example: C:\Users\{Username}\Documents\Virtual Machines\Windows Server 2008 x86\Windows Server 2008.vmx. This parameter is active only if the Host Type parameter is set to VMWare Workstation  or VMWare Player.

Username

Text

Yes

(Empty)

GUESTUSERNAME="user"

The username for authentication on the guest operating system.

Password

Text

Yes

(Empty)

GUESTPASSWORD="password"

The password for authentication on the guest operating system.

Login to console session

Yes/No

No

No

CONSOLE="yes"

If set to YES, logs in a user into a 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. If set to NO (default), no GUI will be launched and operations will execute in the background.

Timeout in seconds (optional)

Open VM

Number

No

60

OPENVMTIMEOUT="2"

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

Power On

Number

No

60

POWERONTIMEOUT="3"

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

VMWare Tools

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.

Login

Number

No

60

LOGINTIMEOUT="5"

The maximum time period in seconds during which the login process must be completed or the step times out.

Connection

Number

No

60

CONNECTIONTIMEOUT="6"

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

Session Based Parameters

Session

Text

No

GuestOSSession

SESSION="MySession"

The session name. This allows several operations to be linked to a single session, eliminating redundancy. Multiple sessions can exist in a single task. This parameter is available only if the Provide Connection parameter is set to Session Based.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or AutoMate extended functions, which can be entered by surrounding the expression in percentage signs (example: %FileDateTime(myVar)% or %myVar%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on function

More on extended functions
More on the expression builder

Example

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

 

This task uses several VMware Guest OS activities. It creates a session using the Connect activity, logs onto the guest VMware using the Login activity, and checks if a specific guest file exists on the host using the File Exists activity. If the guest file exists, it is copied over to the host machine using the Copy activity. The task ends with a 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 COPYFROM="guest_to_host" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" HOSTFILE="C:\Users\techsupport\Desktop\hello.txt" />

</AMIF>

<!-- Close Connection -->

<AMVMWAREGUEST ACTIVITY="disconnect" />

 

↑ Top of Page