After a vApp is powered on, you can retrieve a screen ticket from one of its virtual machines. You use that ticket with the VMRC browser plug-in to gain access to the console of the virtual machine.

A screen ticket is a string that includes the virtual machine’s IP address, its managed object reference, and a residual that is encoded as described in RFC 2396. Each Vm element in a vApp includes a link where rel="screen:acquireTicket" if the virtual machine it represents is powered on. You can use that link to retrieve a screen ticket that you can use with the VMRC API to open a VMware Remote Console for the virtual machine.

Verify that you are logged in to the vCloud API as a system administrator or member of an organization in the cloud.

Verify that the virtual machine whose console you want to display is powered on.

Verify that your browser has an installed copy of the vmware-vmrc plug-in. This plug-in is installed by your browser whenever you use the vCloud Director Web Console to access the console of a running virtual machine. After this plug-in is installed, you can find it in the folder where your browser stores plug-ins.

1

Retrieve the screen ticket.

POST a request to the acquireTicket link of the Vm.

Request:

POST https://vcloud.example.com/api/vApp/vm-4/screen/action/acquireTicket

Response:

200 OK
Content-Type: application/vnd.vmware.vcloud.screenTicket+xml
...
<ScreenTicket xmlns="http://www.vmware.com/vcloud/v1.5" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://www.vmware.com/vcloud/v1 ...>ticket-string
 </ScreenTicket>

The ticket string itself has the following form:

mks://ip-address/VM-MoRef/ticket=encoded-ticket

ip-address is the IP address of the virtual machine.

VM-MoRef is the managed object reference of the virtual machine.

encoded-ticket is the encoded screen ticket. You must decode this ticket using a function such as the Java URLDecoder or PERL url_escape before you can use it.

2

Use the ticket with the VMRC API.

The ticket is valid for 30 seconds. To use it, you must initialize the VMRC browser plug-in and use the VMRC API, as described in the VMware Technical Note Using the VMRC API.