Generating a Remote Console URL in vSphere 5
I’ve ran into a “real-world” situation where I actually needed to grant one person access to one VM within our organization. This normally wouldn’t be a big deal right, just let them RDP into the app and do what they need to do, however in this case the applications that were being tested had a major impact on the network. That being said, the VM was not connected to any production network at all, so right off the hop the RDP solutions is a no go. So then I thought about providing this user access via View, but it only supports a ‘desktop’ operating system. Then I remembered the Remote Console URL Now normally prior to vSphere 5 you could just go and click the ‘Generate Remote Console URL’ option that was available within the vSphere client. I’ve actually posted a how-to here. That being said, with the introduction of vSphere 5 that option has completely disappeared. Why? I have no idea! Maybe with the introduction of the Web Client they expect users to go that route instead – Either way, I hit the googles to see what was available…
Enter Mr. William Lam (blog/twitter)! Honestly every time I hit the web looking for a script or an answer to something virtuallyGhetto seems to be one of the firsts hits in the results; just as it was this time. William has a pretty nifty script called generateVMRemoteConsoleURL.pl which does just as the name states and has even been updated for vSphere 5. Head on over to his post here to get the script and more in-depth instructions on how to use it – it’s pretty simple and I’ve outlined the command I used below. I ran this from my vMA server but you could technically run it anywhere the vSphere CLI for perl is installed.
At a bare minimum all you need to pass is the vCenter IP/Name, authentication properties, and the VM name. Yup, it’s that simple.
./generateVMRemoteConsoleURL.pl --server vcenter.lab.local --username administrator --vmname MYVM
This will in turn produce output similar to that below….
After your done simply copy the URL into a browser and you are golden!
This workaround does differ from the older way a bit. The biggest difference is that of authentication. Whomever opens up this URL will have to authenticate into vCenter which means you will have to grant access to the person you sharing this with to the VM you are targeting. Not a huge deal, just give them VM User or Power User perms wherever they need it depending on the level of access you want them to have. The other catch to that is once they have permissions setup inside of vCenter, they will be able to log in using the either the client or webclient – so make sure you set them up proper and be sure they only apply to inventory items you want them to have access to.