VMware Guest - Disconnect
Declaration
<AMVMWAREGUEST ACTIVITY="disconnect" SESSION="text" />
Description
Disconnects a VMware guest OS connection and ends a VMware session initially established using the VWware Guest - 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. |
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
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" 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" />