Connect to ESXi and then to Workstation. "The operation has timed out."

Apr 20, 2010 at 2:57 PM
Edited Apr 20, 2010 at 3:41 PM

Hi,

I experience a problem in the scenario, when I need to make two tests. First at ESXi. Second at local Workstation.

Call virtualHost.ConnectToVMWareWorkstation(); from PerformTest2 causes "The operation has timed out.". (Only if executed after first PerformTest)

The code which causes a problem is below:

static void Main(string[] args)
        {
            PerformTest();
            PerformTest2();
        }

        private static void PerformTest()
        {
            // declare a virtual host
            using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())
            {
                // connect to a remove (VMWare ESX) virtual machine
                virtualHost.ConnectToVMWareVIServer("172.26.240.71", "root", "1234567890");

                // open an existing virtual machine
                //virtualHost.Open("[datastore1] Test/Test.vmx"))
                using (VMWareVirtualMachine virtualMachine = virtualHost.Open("[datastore1] Windows XP Professional/Windows XP Professional.vmx"))
                {
                    // power on this virtual machine
                    virtualMachine.PowerOn();
                    // wait for VMWare Tools

                    virtualMachine.WaitForToolsInGuest();
                    // login to the virtual machine
                    virtualMachine.LoginInGuest("Administrator", "123");/
                    // power off
                    virtualMachine.PowerOff();
                }
            }
        }

        private static void PerformTest2()
        {
            // declare a virtual host
            using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())
            {
                // connect to a local VMWare Workstation virtual host
                virtualHost.ConnectToVMWareWorkstation();
                // open an existing virtual machine
                using (VMWareVirtualMachine virtualMachine = virtualHost.Open(@"F:\VMWare\Clean Windows Machines\Windows XP Professional\Windows XP Professional.vmx"))
                {
                    // power on this virtual machine
                    virtualMachine.PowerOn();
                    // wait for VMWare Tools
                    virtualMachine.WaitForToolsInGuest(6000);
                    // login to the virtual machine
                    virtualMachine.LoginInGuest("Administrator", "123");
                    // power off
                    virtualMachine.PowerOff();
                }
            }
        }

While debugging I have seen an error "The procedure entry point gvmomi_session_set_useragent could not be located in the dynamic link library gvmomi.dll".

Coordinator
Apr 21, 2010 at 12:11 PM

You can't connect to both ESXi and Workstation in the same process. This is a known limitation of VixCOM noted in 1.8.1 release notes.

Cannot simultaneously connect to different host types.
VIX programs running on any type of host should not call <tt>VixHost_Connect</tt> multiple times in the same process with different <tt>hostType</tt> values. In other words, a VIX client process cannot simultaneously connect to both a Workstation host and to vSphere (ESX/ESXi or vCenter Server). This is because different DLLs or shared-objects are loaded for connecting to each host type, and it is a problem to load different libraries from the same process.

Apr 21, 2010 at 2:10 PM

Thank you for clarification.