3 Easy Ways Connecting to Your VM in Private Cloud

Several folks asked me about how to use vSphere(VI) Java API to connect to a VM running on vSphere. The quick answer is vSphere Java API is not designed for this. You will need VMware Remote Console, browser plug-in, remote desktop/VNC, SSH client etc. However, it can help you to get the information required by the console or plug-in. Tal Altman from CISCO suggested that it be a topic for doublecloud.org. Here it is.

There are 3 ways to connect to the VM from your client side outside the vSphere and Web Access which have built-in support for console access.

Time to learn how to "Google" and manage your VMware and clouds in a fast and secure

Using browser plug-in to either IE or Firefox (Note: this is NOT supported by VMware. Please don’t call the company tech support for this.)

Using Remote Desktop, VNC or SSH

The first two connect to the ESX host, and work even there is no guest OS installed on the VM. The last one assumes you have guest OS installed, and have IP network and server components in place already.

Note that these 3 ways work for the VMs in the public cloud as well if the related ports are open in your firewall. It is, however, not the case for most enterprises, therefore I particularly say it’s for VMs in private cloud. If you don’t have firewall issue, feel free to give it a try with public cloud as well.

Let’s go over one by one in details and see how vSphere Java API helps.

I am a newbie to vmware development but I have the following requirement. I have to create a web application to which clients connect and then each client sees their list of virtual machines. Through the web interface, they issue commands to start/stop etc their virtual machines. This part is OK. The problem is how do the clients get access to the console. Your article talks about it but I am not clear on how to incorporate this in my application.
Any help will br greatly appreciated.
Thank You

Tanuj,
I assume you will create a web application. If so, you can embed the console in your browser which should be pre-installed with VMware remote console plug-in. If you have VMware Web Access run once, you should have that plugin installed already.
-Steve

Actually, the clients do not go to the vmware web access page but to our custom web interface page and login. So, all the clients will have to install the vmware remote console plugin in their browsers ?

I would like to use your solution no. 2, but it looks like for the current version of vsphere 4.0 the solution does not work. It would be great if you could give me some pointers on how to make it work.

I got the url to open the vm console directly but here while trying to hit that link , it is taking me to vcenter authentication screen instead of direct vm console [ windows / linux ]….wat needs to be done to override this authentication issue.

It is opening the VMware remote console with a popup message “Error opening the remote virtual machine \: Missing server name or connection configuration file name.” Here I get the vmx path from api and all other crediantlies are write. Can you explain what is the meaning of that message.

Sorry for the late response from my end . The issue is like i am able to frame the URL{to open remote console } using UUID and Mor ID as per guidelines from vmware.

When i try to hit that URL from my browser, it is taking me to a page where i have to enter user credentials for vmware.After successful authentication , the page is getting routed to vm’s remote console.

I just like to know whether there is any provision to bye pass this authentication mechanism, i meant something like pre-authenticated session.

NEED HELP?

My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.