How to use VMRC SDK to open VM console


I'm looking for some help to setup a custom solution that opens a console of a VM from a corporate intranet site. I'm new to the whole VMWare SDK world, but I've been able to easily use vCloud Suite SDK for .NET to expose some details on my User Interface. So far so good, but when it comes to VMRC plugin honestly it is totally unclear how to use it.

My need is just to show a button that opens a new web page with the console on it. In our infrastructure we're using vCloud Director
According to VMWare developer center, I downloaded VMware Remote Console (VMRC) SDK (version, linked from the main page, that comes with VMRC plugin installers and a directory where I can found vmrc-embed-example.html and vmrc-embed-example.js files. The first weird thing I've noticed is that the vmrc plugin installer included in SDK is different from the one shipped by our installed vCloud Director application. The first is named "VMware Remote Console Plug-in", the latter "VMware Client Support Plug-in". It looks like the first is an old version, but I cannot be sure about that of course, and I can't find a newer sdk on the other hand.

I payed attention to test the html page included in vmrc sdk with both plugins anyway (one at a time), just to try to understand. In both cases, running html page on the web browser and providing some data to use, I can connect succesfully to a VM, obtaining the following messages:

starting VMRC instance: modes: 0, messages: 1
startup returned "vmrc-np-t-{55D63FD3-925B-47C7-B96B-74659A57498E}"
connect succeeded
onConnectionStateChange - connectionState: 2, host: 172.18.x.y, datacenter: , vmId: vm-401, userRequested: true, reason: Connection successful.

That's all: from the messages it seems that it's working, but the box that should show the console remains white and nothing else happens. Any action on the other form's button results in error messages, among them the most recurrent is "Error calling method on NPObject!", that is the same message that pops up when trying to connect to a VM with no parameter or without pressing the startup button.

I really need some advice, any hint is appreciated, thanks in advance.

0 Kudos
1 Reply

After you've made a connection you should try setting the plugin to full screen mode by calling setFullScreen(true). I was receiving a black box in the middle of the screen until I had started setting to fullscreen. As far as the "Error calling method on NPObject", when I've had this message it was due to the fact the plugin was not ready for some reason, for example connecting to a vm and then immediately calling grapInput would result in this message. I was able to resolve by checking the plugin was ready (and in scope of the callee).

0 Kudos