VMware {code} Community
piuhapofuhpaosf
Contributor
Contributor

Problem with VMRC connection using MOID

We're trying to create VMRC shortcuts for VMs so that our users can console into a VM without needing the full VI Client. We've had some success creating .bat files that looks like this:

set path=%path%;%ProgramFiles(x86)%\VMware\Infrastructure\Virtual Infrastructure Client\4.0;%ProgramFiles%\VMware\Infrastructure\Virtual Infrastructure Client\4.0;%ProgramFiles%\Common Files\VMware\VMware Remote Console Plug-in;

vmware-vmrc.exe -h <hostname> -u <user> -p <pass> "\[<datastore name>\] path_to/filename.vmx"

Sometimes these work just fine. However, sometimes this method simply fails for no apparent reason. The error message we get when it fails is:

"Unable to connect to the MKS: Could not connect to pipe
.\pipe\vmware-authdpipe:The system cannot find the file specified."

In each case, the path to the vmx file is correct, but the connection fails. Actually, the connection works partially because the VMRC client displays the network information and the CD/DVD drive connection information for the VM, and it also loads the VM's name. However, the console display for the VM doesn't come up, and the error is displayed.

I've seen various posts where VMWare folks have verified that they know about this seemingly random failure, but they offer no explanation, and no fix. I believe the problem is that there is apparently a 64 character limit on the length of the datastore path to the vmx file, which for our system is not enough since we regularly will have paths longer than that. However, I've also seen that there's a way to connect with VMRC using the moID of the VM instead of using the datastore path. The .bat file would look like this:

set path=%path%;%ProgramFiles(x86)%\VMware\Infrastructure\Virtual Infrastructure Client\4.0;%ProgramFiles%\VMware\Infrastructure\Virtual Infrastructure Client\4.0;%ProgramFiles%\Common Files\VMware\VMware Remote Console Plug-in;

vmware-vmrc.exe -h <hostname> -M <MOID>

Where "MOID" is the managed object ID of the VM. My understanding is that this can be gathered from the perl API by accessing $vm_view->summary->vm->value. For our VC, that value is always something like "vm-####" (e.g. vm-551, vm-1592, etc. Unfortunately, however, I have been unsuccessful in my attempts to make these connections work.I always get an error that says:

"Error opening the remote virtual machine <name>\<MOID>: The object has already been deleted or has not been completely created".

I've verified that the MOID I'm using is correct. I get it from the SDK and then verify it using the Managed Object Browser available on the VC (by going to <vc_name>/mob). I've also verified that I'm attempting to use the correct ESX host. However I always get that error, regardless of which VM I attempt to use. Has anyone had similar problems? If so, can you please let me know how you were able to get around them? Any help would be much appreciated.

0 Kudos
3 Replies
tos2k
Expert
Expert

Hi!

Did you consider that the reference value differs between vCenter and ESX hosts?

Maybe you should fetch the MOR from the ESX instead of vCenter?

Tos2k

piuhapofuhpaosf
Contributor
Contributor

Hmmmm. No, I was not aware of that. Unfortunately all of our connections are made via the VC. I'll have to see what I can do to get at the host's ID for the VM. Thanks very much for that.

0 Kudos
piuhapofuhpaosf
Contributor
Contributor

Tos2k,

You were quite correct. The ID has to come from the ESX host itself. It can't come from the VC, which is HUGELY frustrating. Your help in answering this question is most appreciated. Thanks very much for taking the time.

0 Kudos