All Posts

I have an exact need to get a listing of registered virtual machines. I am not going to be programmatically registering VMs; I am going to be manipulating VMs that are already registered. -... See more...
I have an exact need to get a listing of registered virtual machines. I am not going to be programmatically registering VMs; I am going to be manipulating VMs that are already registered. -austin
Do you have an exact need to know whats been registered? If you pass a register_vm to a vmx that is already registered, it appears to just ignore the message on server.
Thank you. It's not the answer I wanted[/i], but it's the answer that is. Is there a way with VIX 1.0 and Server 1.0 to determine the machines that have been registered? Thanks, -austin
Disabling SSL may give you a small gain, but probably not a significant decrease. In general, Host_Connect() will be an expensive operation, since it performs a lot of initialization. As a bes... See more...
Disabling SSL may give you a small gain, but probably not a significant decrease. In general, Host_Connect() will be an expensive operation, since it performs a lot of initialization. As a best practice, we recommend that you save and reuse host handles whenever possible. For example, if your program is going to only connect to one host, you should have the program connect to that host up front, and then perform whatever operations you wish on the host, and then call Host_Disconnect() during clean up when the program is shutting down.
Vix API 1.1 does not add any new functionality for use with VMware Server. Currently, we recommend that you do not upgrade to Vix 1.1 if you are using VMware Server. The wrapper is intended a... See more...
Vix API 1.1 does not add any new functionality for use with VMware Server. Currently, we recommend that you do not upgrade to Vix 1.1 if you are using VMware Server. The wrapper is intended allow you to write code that works against either Workstation or Server. But as you point out, the 32bit Linux wrapper was built for old versions of glibc (known bug). On Windows and 64bit Linux, the wrapper will work, but you need to use the value '1' for the apiVersion argument to VixHost_Connect(). VIX_FIND_REGISTERED_VMS is not supported in server 1.0, and does not apply to Workstation. We understand this has created real frustration, and apologize for any inconvience and confusion. We are working to fix these issues as quickly as possible.
Ok. I'm really not sure what to think with all of this, but it's incredibly infuriating. 1. A VIX client won't compile using the wrapper because it's looking for __ctype_b which isn't on my Ub... See more...
Ok. I'm really not sure what to think with all of this, but it's incredibly infuriating. 1. A VIX client won't compile using the wrapper because it's looking for __ctype_b which isn't on my Ubuntu system. Bad. Worse because of #2. 2. There's two libvix.so files, depending on whether I'm connecting to Workstation or Server -- which means that I can't have a single program that connects to either Workstation or Server -- I have to link twice (once for Workstation, once for Server). Bad. 3. VixHost_FindItems works ONLY if I specify VIX_FIND_RUNNING_ITEMS even if I'm connecting to Server. I get the ever-so-helpful "One of the parameters was invalid" if I use VIX_FIND_REGISTERED_ITEMS instead. Statically linking with libvix.so for workstation puts me in an infinite loop on connect, so I can't tell if it's just a problem with the libvix.so for Server. Very Bad. I need to collect the list of VMs that are currently registered to a VMware Server. I can't do this when following the instructions in the documentation. I smell a whole raft of bugs, because the local-link API should be smart enough to handle this. Why oh why can't this be easy ... you know, like the SOAP API for ESX? (And yes, compared to the sort of problems that I'm seeing with VIX, the ESX SOAP API is easy.)
I'm trying to assess my options for using the VIX API for an upcoming project. I'd really like to use C#, however my application must be able to run on windows/linux/solaris. I know that Mono s... See more...
I'm trying to assess my options for using the VIX API for an upcoming project. I'd really like to use C#, however my application must be able to run on windows/linux/solaris. I know that Mono supports all of these platforms, however it only has limited support for using COM. Has anybody used VIX with C# under a non-Windows platform? If so how did you go about it? Thanks!
Is there any way to decrease the amount of time it takes to connect to the host? Disable SSL, etc.
I'll start with what's happening with the Linux environment. First it might help if I explain what I'm trying to do. I am building a Rexx wrapper for the VMWare Vix API to enable VMWare Ser... See more...
I'll start with what's happening with the Linux environment. First it might help if I explain what I'm trying to do. I am building a Rexx wrapper for the VMWare Vix API to enable VMWare Server to be controlled via a Rexx program. I am generating the wrapper code from the vix.h header file. Linking against the libvmware-vix.so that comes with VMWare Server 1.0.3, and a number of undefined references result; I assume that these are functions in the 1.1 Vix API that are only available when using Workstation. This is not a real problem, but annoying that there are incompatibilities between the two products. As far as linking with the libVixAllProducts.a static library and having to install an old version of gcc is not an ideal situation when you are distributing a wrapper library for other to use and providing installation instructions: "You will need to download the Vix API SDK, and install an old version of gcc." This is not going to encourage people to use it; I'm not even prepared to install an old version of gcc just to try and make this work. Using code that used to work with the 1.0 Vix SDK, I now get the error: "One of the parameters was invalid" on Vix_HostConnect(). Now with an API function that takes 9 parameters, this is a useless error message; at least WHICH parameter is in error would help. I tried using 1 as the ApiVersion as suggested in another thread. Details of the problems I'm having with the Windows version of the Vix 1.1 SDK will be posted in another post. Seriously considering moving back to the 1.0 SDK. Cheers, Mark
Just to clarify: VixVM_LogoutFromGuest is \*not* supported for Server 1.0.x.
Yes, VixVM_LogoutFromGuest() was added after server 1.0.x. Though it looks like the per-function docs have that wrong, and I'll fix them.
I have everything working properly but one question I have is LogoutFromGuest a valid function for VIX 1.0 and Server 1.0.3?[/b] It returns the same protected memory problem that is thrown whe... See more...
I have everything working properly but one question I have is LogoutFromGuest a valid function for VIX 1.0 and Server 1.0.3?[/b] It returns the same protected memory problem that is thrown when trying to connect to VMwareServer with VIX 1.1/2 API Version being passed instead of 1.0. I just find it kinda odd that you can login to the guest tools but not remove authentication of it, even though this step seems unnecessary. For reference I am using VIXcom 1.1 API and sending the connection string as Version 1 for VMware Server 1.0.3. When calling job = vm.LogoutFromGuest(Nothing) Error Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
This also solved my problem with Visual C+, unfortunately not DevC+ The C code connect example[/b] #include "stdafx.h" #include <vix.h> int _tmain(int argc, _TCHAR* argv[]) { VixHan... See more...
This also solved my problem with Visual C+, unfortunately not DevC+ The C code connect example[/b] #include "stdafx.h" #include <vix.h> int _tmain(int argc, _TCHAR* argv[]) { VixHandle jobHandle = VIX_INVALID_HANDLE; VixHandle hostHandle = VIX_INVALID_HANDLE; VixError err = VIX_OK; jobHandle = VixHost_Connect(1,VIX_SERVICEPROVIDER_VMWARE_SERVER,NULL,0,NULL,NULL,0,VIX_INVALID_HANDLE,NULL,NULL); err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &hostHandle, VIX_PROPERTY_NONE); if (VIX_OK != err) { printf("\nError: %i",err); printf("\n%s\n",Vix_GetErrorText(err,NULL)); goto abort; } else { printf("connection success!\n"); } Vix_ReleaseHandle(jobHandle); abort: return 0; }
Wonderful thanks... For anyone using the code above... Set the version to 1 and be sure to assign the propertyIDs as an array. eg (VB). job = VixLibA.Connect(1, VixCOM.Constants.VIX_... See more...
Wonderful thanks... For anyone using the code above... Set the version to 1 and be sure to assign the propertyIDs as an array. eg (VB). job = VixLibA.Connect(1, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, Nothing, Nothing, Nothing, Nothing, 0, Nothing, Nothing) Dim propertyIDS() As Object = \{VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE} Dim err = job.Wait(propertyIDS, results)
Similar to the response that my colleague gave in the thread "VixHost_Connect Problem", the issue that there is a version mismatch issue. Error code 6 is 'not supported'. You're having an ... See more...
Similar to the response that my colleague gave in the thread "VixHost_Connect Problem", the issue that there is a version mismatch issue. Error code 6 is 'not supported'. You're having an exception when you call GetErrorText() because when Connect() failed, not all of the required libraries were loaded, so VIX is having difficulties looking up the error string. We're looking into ways to make sure that this doesn't happen in future releases. You should be able to get this to work by explicitly passing 1 as the first argument to Connect(). Just to be clear, only functions from the version 1.0 of the VIX API are supported with VMware Server.
Some of the issues are probably caused by using the 1.1 API with the 1.0 server. The constant VIX_API_VERSION has been bumped, and server doesn't deal well with the '2' from 1.1 instead of the '... See more...
Some of the issues are probably caused by using the 1.1 API with the 1.0 server. The constant VIX_API_VERSION has been bumped, and server doesn't deal well with the '2' from 1.1 instead of the '1' it expects. Passing in a '1' might solve many of your problems. However, that doesn't make a lot of sense that the different compilers have different results, so the other possibility is a C runt-time mismatch. The Vix library expects a mutil-threaded, non-debug CRT. If you're letting Visual Studio set up the project, it may be setting you to use a debug CRT, and the threading model could also be incorrect. Unfortunately, if you mix CRT versions, you tend to get ugly crashes. And errcode 6 is 'not supported'. This is probably because you're trying to use the version 2 API with a version 1 back end. If you're working with server 1.03, you can stay with the Vix 1.0 that shipped with it.
I would like to also mention this is a 32bit environment. This forum needs an edit post function.
This post has a few questions. What is error code 6 when trying to connect?[/b] I get this error returned in everything C, C#, VB, VBScript/WSH, Perl Why am I having these excepti... See more...
This post has a few questions. What is error code 6 when trying to connect?[/b] I get this error returned in everything C, C#, VB, VBScript/WSH, Perl Why am I having these exceptions in VixCom for GetErrorText?[/b] Why do my programs crash when compiled with DevC++ and VC+2005 but run fine with VC+6[/b] (except error 6 returned)[b]?[/b] Is this a bug in VixCom/Vix?[/b] Has anyone had any luck with VixCom or Vix on VMWare Server?[/b] If yes, can you please post your code or a link to a project source?[/b] Language is not a problem as long as it uses VIX. The other APIs do not support some of the functionality I am seeking. Environment:[/b] WinXPSP2 VMWare Server 1.0.3 (even though it has been tried on older versions and different machines) Vix API 1.1 Tried in various languages (C#, VB, VBScript, C) [u]Visual C Sharp (C#)[/u][/b] C Sharp (C#) Code[/b] Source at http://www.buriproject.info/vix/c%20sharp%20GetErrorText.7z using System; using System.Collections.Generic; using System.Text; using VixCOM; namespace VIXTest { class Program { static void Main(string[] args) { VixCOM.VixLib lib = new VixCOM.VixLib(); Console.WriteLine("Connecting..."); VixCOM.IJob job = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, "", 0, "", "", 0, null, null); object[] data = \{ VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE }; object results = null; ulong err = job.Wait((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); } exit(true); } static void exit() { exit(false); } static void exit(bool prompt) { if (prompt) { Console.Write("Press Any Key To Exit"); Console.ReadKey(); } System.Environment.Exit(-1); } } } C Sharp(C#) Error ScreenShot[/b] http://www.buriproject.info/vix/c%20sharp%20GetErrorText.png Error Text[/b] System.Runtime.InteropServices.COMException was unhandled Message="The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))" Source="Interop.VixCOM" ErrorCode=-2147417851 StackTrace: at VixCOM.VixLibClass.GetErrorText(UInt64 err, String locale) at VIXTest.Program.Main(String[] args) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\VIXTest\VIXTest\Program.cs:line 23 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() [u]Visual Basic (VB)[/u][/b] VB Code[/b] Source at http://www.buriproject.info/vix/vb%20GetErrorText.7z Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim VixLibA As New VixCOM.VixLib Dim job = VixLibA.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, Nothing, Nothing, Nothing, Nothing, 0, Nothing, Nothing) Dim results = Nothing Dim err = job.Wait((VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results) If VixLibA.ErrorIndicatesFailure(err) Then Dim errMsg = VixLibA.GetErrorText(err, Nothing) MsgBox("Error: " & err.ToString() & " : " & errMsg) End If End Sub End Class VB Error ScreenShot[/b] http://www.buriproject.info/vix/vb%20GetErrorText.png VB Error Text[/b] System.AccessViolationException was unhandled Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Source="Interop.VixCOM" StackTrace: at VixCOM.VixLibClass.GetErrorText(UInt64 err, String locale) at VixCom_Test.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\VixCom Test\VixCom Test\Form1.vb:line 10 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow) at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.Form.SetVisibleCore(Boolean value) at System.Windows.Forms.Control.set_Visible(Boolean value) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at VixCom_Test.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
it does appear to work fine with VC+6 but not VC+ 2005 or DevC++
I have this exact problem with any api. I am running the latest VMWare Server 1.0.3 and the VIX 1.1 API. Using DEV-C++, the Perl interface and the Com interface all crash on me. On Com and P... See more...
I have this exact problem with any api. I am running the latest VMWare Server 1.0.3 and the VIX 1.1 API. Using DEV-C++, the Perl interface and the Com interface all crash on me. On Com and Perl it crashes when getting the error codes. The error returned after connect is 6 (cant translate to err msg because the API crashes) It does not matter the connection strings used or ports The sample codes all compile fine but crash on execution after the connect. /* \---- BEGIN CODE SNIPPET \---- */ #include <stdio.h> #include <stdlib.h> #include "vix.h" #define CONNTYPE VIX_SERVICEPROVIDER_VMWARE_SERVER #define HOSTNAME "" #define HOSTPORT 0 #define USERNAME "" #define PASSWORD "" #define VMPOWEROPTIONS VIX_VMPOWEROP_NORMAL /* Global variables. */ static char *progName; //////////////////////////////////////////////////////////////////////////////// static void usage() { fprintf(stderr, "Usage: %s 1) { vmxPath = argv[1]; fprintf(stderr, "received: %s \n", argv[1]); } else { usage(); exit(EXIT_FAILURE); } jobHandle = VixHost_Connect(VIX_API_VERSION, CONNTYPE, HOSTNAME, // *hostName, HOSTPORT, // hostPort, USERNAME, // *userName, PASSWORD, // *password, 0, // options, VIX_INVALID_HANDLE, // propertyListHandle, NULL, // *callbackProc, NULL); // *clientData); return 0; } /* \---- END CODE SNIPPET \---- */ This crashes in the same manner