VMware Guest - Disconnect

Declaration

<AMVMWAREGUEST ACTIVITY="disconnect" SESSION="text" />

Related Topics   

Description

Disconnects a VMware guest OS connection and ends a VMware session initially established using the Connect activity.

Practical Usage

Disconnects a currently connected VMware guest operating system connection.

Parameters

Connection

Property

Type

Required

Default

Markup

Description

Session

Text

No

GuestOSOpsSession1

SESSION="MySession"

The session name associated to the guest OS connection to disconnect. Disconnecting an existing connection also ends the session associated with that connection.

 

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

 

Description: 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.

Copy
<AMVARIABLE NAME="myVar" VALUE="" />
<!-- 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>
<AMVMWAREGUEST COPYFROM="guest_to_host" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" HOSTFILE="C:\Users\techsupport\Desktop\hello.txt" />
<AMIF ACTIVITY="end" />
<!-- Close Connection -->
<AMVMWAREGUEST ACTIVITY="disconnect" />