I had a c# application written that worked properly with the Pre-beta version of Server 2.0. Now, since I installed the public beta 1, my code no longer works. I can connect to the Host and call the OpenVM function. I get the same error for any functions against the VM after that, such as WaitForToolsinGuest and LoginInGuest.
Part of my c# code
VixCOM.VixLibClass lib = new VixCOM.VixLibClass();
UInt64 err;
VixCOM.IVM vm;
object results = null;
Console.WriteLine("Connecting...");
VixCOM.IJob job = lib.Connect(VixCOM.Constants.VIX_API_VERSION, 3, "", 0, "user", "pw", 0, null, null);
object[] data = { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE };
err = job.Wait(new int[] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE }, ref results);
if (lib.ErrorIndicatesFailure(err))
{
ushort errCode = lib.ErrorCode(err);
string errMsg;
errMsg = lib.GetErrorText(err, null);
Console.WriteLine("Error: " + errCode.ToString() + " : " + errMsg);
}
VixCOM.IHost host = (VixCOM.IHost)((object[])results)[0];
job = host.OpenVM(cfgFile, null);
Console.WriteLine("Opening " + cfgFile);
err = job.Wait(new int[] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE }, ref results);
if (lib.ErrorIndicatesFailure(err))
{
ushort errCode = lib.ErrorCode(err);
string errMsg;
errMsg = lib.GetErrorText(err, null);
Console.WriteLine("Error: " + errCode.ToString() + " : " + errMsg);
}
vm = (VixCOM.IVM)((object[])results)[0];
Console.WriteLine("Wait for tools");
job = vm.WaitForToolsInGuest(0, null);
err = job.WaitWithoutResults();
if (lib.ErrorIndicatesFailure(err))
{
ushort errCode = lib.ErrorCode(err);
string errMsg;
errMsg = lib.GetErrorText(err, null);
Console.WriteLine("Error: " + errCode.ToString() + " : " + errMsg);
return;
}
Here are the errors I receive in the VIX log:
Nov 16 09:55:06.351: app| Log for Vix pid=1820 version=4 build=build-63231 option=DEBUG
Nov 16 09:55:06.351: app| Foundry Init: setting up global state (0 threads)
Nov 16 09:55:06.617: app| HOSTINFO: Seeing Intel CPU, numCoresPerCPU 1 numThreadsPerCore 2.
Nov 16 09:55:06.617: app| HOSTINFO: This machine has 2 physical CPUS, 2 total cores, and 4 logical CPUs.
Nov 16 09:55:06.914: app| VMHS: Failed to load vmnetMgr.dll
Nov 16 09:55:06.914: app| Foundry Init: version 4, hostType 3, hostName , hostPort 0, options 0x80
Nov 16 09:55:06.929: app| CnxWin32_PassFD: WSADuplicateSocket failed (pid 3928 code 10022)
Nov 16 09:55:06.929: app| FoundryVMDirectlyOpenSocketToVMX: Could not pass the fd (-1).
VIX Wrapper Log:
app| Log for VixWrapper pid=1932 version=1 build=build-63231 option=BETA
app| vixWrapper config file C:\Program Files\VMware\VMware VIX\vixwrapper-config.txt not found
app| vixWrapper config file C:\Program Files\VMware\VMware VIX\vixwrapper-config.txt not found
Failed to load wrapper configuration file
app| config points to non-existant implementation dir 'ws-3'
app| config points to non-existant implementation dir 'ws-3'
app| config points to non-existant implementation dir 'ws-2'
app| Workstation installed version is 2.0.0
app| Loading Vix implementation library C:\Program Files\VMware\VMware VIX
ws_server_esx-4\32bit\vixd.dll
app| unable to load func Vix_SetPropertiesVargs from library C:\Program Files\VMware\VMware VIX
ws_server_esx-4\32bit\vixd.dll (127)
The PID in every case points to the vmware-vmx-debug.exe. It also stays in the process list after I run my application.
All of my VMs are powered on when running this application.
Here is the output from my application in the console:
Connecting...
Opening C:\Virtual Machines\XP Pro\XP Pro.vmx
Wait for tools
Error: 3006 : The virtual machine needs to be powered on
Version map:
apiVersion: 4 serviceProvider: 3 versionString: '6.1.0' impRelativeDirectory: 'ws_server_esx-4' impFullPath: 'C:\Program Files\VMware\VMware VIX
ws_server_esx-4\32bit\vixd.dll'
apiVersion: 4 serviceProvider: 3 versionString: 'e.x.p' impRelativeDirectory: 'ws_server_esx-4' impFullPath: 'C:\Program Files\VMware\VMware VIX
ws_server_esx-4\32bit\vixd.dll'
apiVersion: 4 serviceProvider: 10 versionString: '2.0.0' impRelativeDirectory: 'ws_server_esx-4' impFullPath: 'C:\Program Files\VMware\VMware VIX
ws_server_esx-4\32bit\vixd.dll'
apiVersion: 4 serviceProvider: 5 versionString: '3.1.0' impRelativeDirectory: 'ws_server_esx-4' impFullPath: 'C:\Program Files\VMware\VMware VIX
ws_server_esx-4\32bit\vixd.dll'
apiVersion: 3 serviceProvider: 3 versionString: '6.0.2' impRelativeDirectory: 'ws-3' impFullPath: 'C:\Program Files\VMware\VMware VIX
ws-3\32bit\vixd.dll'
apiVersion: 3 serviceProvider: 3 versionString: '6.0.1' impRelativeDirectory: 'ws-3' impFullPath: 'C:\Program Files\VMware\VMware VIX
ws-3\32bit\vixd.dll'
apiVersion: 2 serviceProvider: 3 versionString: '6.0.0' impRelativeDirectory: 'ws-2' impFullPath: 'C:\Program Files\VMware\VMware VIX
ws-2\32bit\vixd.dll'
apiVersion: 1 serviceProvider: 2 versionString: '1.0.3' impRelativeDirectory: 'server-1' impFullPath: 'C:\Program Files\VMware\VMware VIX
server-1\32bit\vixd.dll'
I n my previous working version I used VIX_SERVICEPROVIDER_DEFAULT(1) as the hostType and it worked. Now, that does not work and neither does VIX_SERVICEPROVIDER_VMWARE_SERVER (2). As you can see above, there is no version 4 api for the VMWare service provider. If I hard set the hostType to 10 (version 2.0.0) in the connection, I don't get the error, but it also doesn't do anything. It will say the DLL is loading and it failed to load vmnetMgr.dll and then the application exits.
Any help is appreciated
Thanks