Quantcast
Channel: VMware Communities : Popular Discussions - VIX API
Viewing all 34639 articles
Browse latest View live

Unable to install bundle for VIX 1.10.2...

$
0
0

Hi,

I downloaded this on to my linux box. But it does nto install and givens me an error message.

Are there any documented steps for this installation? Am I doing something incorrect?

...kt

 

 

[root@ktdev1]:=> sh VMware-VIX-1.10.2-331862.i386.bundle
VMware-VIX-1.10.2-331862.i386.bundle: line 108: syntax error near unexpected token `newline'
VMware-VIX-1.10.2-331862.i386.bundle: line 108: `<html>'


RunProgramInGuest Hangs

$
0
0

Hi,

 

I need help...I have a problem using RunProgramInGuest I run the program inside the VMWare and it works however the problem is if the program runs too long (more 20 minutes) inside the VMWare, my program keeps on waiting (until it timeouts) even if the program I executed is finished already. Is this a bug?

 

Here's the snippet of my code:

 

VMWareVirtualMachine.Process pCTCCAuto = vmwvmWorkingVirtualMachine.RunProgramInGuest(sProgram, sArguments, iTimeout);

 

if ((pCTCCAuto.ExitCode & 8) == 8) // check if bit is flagged
{
...
}
else
{
...
}

 

Thanks.

Vestris.VMWareLib.VMWareException: Insufficient permissions in host operating system

$
0
0

Hello,

 

I am unable to execute the host.open(..) command to return a machine object using the VIX API.

Code is like this:

 

 

           string pathToVM = "[csmrauto1a] " + name + "/" + name + ".vmx";
            Console.WriteLine(pathToVM);
            try
            {
                machine = host.Open(@pathToVM);
                return true;
            }

 

I get this stacktrace:

 

Vestris.VMWareLib.VMWareException: Insufficient permissions in host operating system

   at Vestris.VMWareLib.VMWareInterop.Check(UInt64 errCode)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties, Int32 index, Int32 timeoutInSeconds)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Int32 propertyId, Int32 timeoutInSeconds)

   at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName, Int32 timeoutInSeconds)

   at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName)

   at VMESX.VMESX.openMachine(String name) in C:\VMESX\VMESXControl\VMESX\VMESX\VMESX.cs:line 55

Successfully disconnected from host!!

 

I've verified that the connection is active by testing it during execution.

The VM admin gave my user administrator privileges.

 

Any idea what is causing this permissions problem?

 

Thanks,

Mark Meninger

PowerOn VM failse with error 3008-Cannot connect to the virtual machine

$
0
0

Hello,

 

(I am sorry about my English) I am using VIX1.11 to start VM on ESXi5.0 host. The PowerOn() has always been failing for me with error "3008 Cannot connect to the virtual machine".However the VM still Power On. I also looked up some discussions already on this site but it just wont work for me. Could you please help me get it working?.

 

My code as bellow:

 

               //connec to esxi5.0 - work well

               UInt64 err;
                VixCOM.VixLibClass lib = new VixCOM.VixLibClass();
                job = lib.Connect(
                    Constants.VIX_API_VERSION,
                    VixCom.Constants.VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,
                    hostName,
                    hostPort,
                    userName,
                    password,
                    0,
                    null,
                    null
                    );
                err = job.Wait(new int[] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE },
                           ref Results);
                if (lib.ErrorIndicatesFailure(err))
                {
                         ;
                }
                IHost host = (VixCOM.IHost)((object[])Results)[0];

 

               //open vm - work well

               job = host.RegisterVM(vmPath, null);

                err = job.WaitWithoutResults();

                if (lib.ErrorIndicatesFailure(err))

                {

                    ;

                }

                job = host.OpenVM(vmPath, null);

                err = job.Wait(new int[] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE },

                               ref Results);

                if (lib.ErrorIndicatesFailure(err))

                {

                    ;

                }

 

                IVM2 vm = (VixCOM.IVM2)((object[])Results)[0];

 

               //start vm - work with error 3008

               job = vm.PowerOn(VixCOM.Constants.VIX_VMPOWEROP_LAUNCH_GUI, null, null);

                err = job.WaitWithoutResults();

                if (lib.ErrorIndicatesFailure(err))

                {

                    ;

                }

Getting "VMware Tools are not running in the guest" from VIX, but tools are running

$
0
0

I'm having an issue with a Perl VIX script that I am writing. I am connecting to a VM, I wait for the VMWare tools using VMWaitForToolsInGuest, and then I execute a VBScript. After about 15 minutes, I get an 3016 error code "VMWare Tools are not running in the guest", but if I check the VM manually, the tools are running. Does anyone have any clue as to why I might get this error if the tools are running?

 

Below is the code that I am using. I am able to connect to the VM before this in the same script without error. The error occurs during the last VMRunProgramInGuest.

 

Any help would be greatly appreciated.

 

Thanks,

 

Andy


print Time(), "Connecting to host...";
$err, $hostHandle) = HostConnect(      VIX_API_VERSION,      VIX_SERVICEPROVIDER_VMWARE_WORKSTATION,      $hostName, # hostName      0, # hostPort      $userName, # userName      $password, # password      0, # options      VIX_INVALID_HANDLE); # propertyListHandle
CheckError("HostConnect() failed");
print "Connected\n";
print Time(), "Opening VM...";
($err, $vmHandle) = VMOpen(      $hostHandle,      "$vmName");
CheckError("VMOpen() failed");
print "Opened\n";

print Time(), "Powering on VM...";
$err = VMPowerOn(
      $vmHandle,      VIX_VMPOWEROP_LAUNCH_GUI, # powerOnOptions      VIX_INVALID_HANDLE);  # propertyListHandle
CheckError("VMPowerOn() failed");
print "Powered on\n";

print Time(), "Waiting for tools...";
$err = VMWaitForToolsInGuest(
      $vmHandle,      3600); # timeoutInSeconds
CheckError("VMWaitForToolsInGuest() failed");
print "Ready\n";  

print Time(), "Logging in as $userName...";
$err = VMLoginInGuest(
      $vmHandle,      $userName, # userName      $password, # password      0); # options
CheckError("VMLoginInGuest() failed");
print "Logged in\n";  
$err =  VMRunProgramInGuest(      $vmHandle,      $cscript, #executable      "$vmTestsDir\\runAnt.vbs $vmTestsDir\\build.xml $buildTarget", #arguments      0, # options      VIX_INVALID_HANDLE);
CheckError("VMRunProgramInGuest(JUnit tests) failed");
print "Finished\n"; 

Trying to use VIX coupled with BlackBerry 10 simulator

$
0
0

I've got the basics down, I am using .NET managed wrappers around VIX to boot my BlackBerry 10 emulator. However, there's no 'Guest Tools', so I'm very limited in what I can do. Basically, I need to find out when the emulator is launched and ready (was thinking to attempt to telnet, which means discovering the IP of the simulator, ), and also be able to screen capture (which requires a login, which I can't figure out how to do).

 

Any help finding the IP and screen capturing for BB10 programmatically? Thanks!

vix-perl installation problems

$
0
0

Hi all,

 

I'm having problems installing the vix-perl packages on Windows XP. The first thing i did was installing the ActivePerl-5.8.8.820-MSWin32-x86-274739.msi. Then I started the command prompt of VS2005 (also tried VS2003) and entered "perl Makefile.pl". The output was the following:

 

Unable to find a perl 5 (by these names: C:\Program Files\Perl\bin\perl.exe perl.exe perl5.exe perl5.8.8.exe miniperl.exe, in these dirs: . C:\Program Files\Microsoft Visual Studio 8\Common7\IDE C:\Program Files\Microsoft Visual Studio 8\VC\BIN C:\Program Files\Microsoft Visual Studio 8\Common7\Tools C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages C:\Program Files\Perl\site\bin C:\Program Files\Perl\bin C:\WINDOWS\SYSTEM32 C:\WINDOWS C:\WINDOWS\SYSTEM32\WBEM C:\PROGRAM FILES\MICROS

OFT SQL SERVER\90\TOOLS\BINN\ C:\WINDOWS\MICROSOFT.NET\FRAMEWORK\V1.1.4322 C:\PR

OGRAM FILES\COMMON FILES\GTK\2.0\BIN C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 8\COMMON7\IDE C:\Program Files\Varian\Sybase\OCS-12_5\bin C:\Program Files\Varian\

Sybase\OCS-12_5\dll C:\Program Files\Varian\Sybase\OCS-12_5\lib3p C:\Program Files\Microsoft Team Foundation Server Power Toys C:\WINDOWS\system32\WindowsPowerShell\v1.0 C:\Program Files\TortoiseSVN\bin C:\Program Files\Sandcastle\ProductionTools\ C:\Program Files\Perl\bin) Writing Makefile for VMware::VixBinding

 

I don't get it, no idea what happens here. I have tried different versions of perl but I always get that message.

 

Executing the makefile then results in:

 

NMAKE : fatal error U1073: don't know how to make 'C:\Program'

Stop.

 

Executing a perl script results in:

 

Can't locate auto/VMware/VixBinding/autosplit.ix in @INC (@INC contains: blib/lib blib/auto C:/Program Files/Perl/site/lib C:/Program Files/Perl/lib .) at C:/Program Files/Perl/lib/AutoLoader.pm line 160. at VMware/VixBinding.pm line 20

Can't locate loadable object for module VMware::VixBinding in @INC (@INC contains: blib/lib blib/auto C:/Program Files/Perl/site/lib C:/Program Files/Perl/lib .) at VMware/Vix/API/API.pm line 13 Compilation failed in require at VMware/Vix/API/API.pm line 13.

BEGIN failed--compilation aborted at VMware/Vix/API/API.pm line 13.

Compilation failed in require at VMWare/Vix/Simple.pm line 25.

BEGIN failed--compilation aborted at VMWare/Vix/Simple.pm line 25.

Compilation failed in require at RunBuild.pl line 1.

BEGIN failed--compilation aborted at RunBuild.pl line 1.

 

What am I doing wrong? And why the heck do I have to compile that stuff myself? Isn't there a binary version available?

Why is it such a problem to install the API?? All I want is start a VM via script!

 

Thanks!

Throwing vmodl.fault.RequestCanceled without actually having cancelled a request

$
0
0

I'm running VMware Server 2.0.0, Build 122956, and Vix 1.6.2, Build 127388, on an Ubuntu 8.04.03-LTS system. The setup works reasonably well most of the time - I've been able to do VM management via the Perl portion of the API, and generally speaking, it's good to go.

 

The reason I'm here is that I'm having an intermittent failure of the system that makes no sense (as best I can tell). The system is primarily used to manage a pair of virtual machines that I'm using to run a virus testing sandbox, with my Perl script running a process that boils down to:

 

  • Grab infected file, copy it over to clean virtual machine A

  • Start tcpdump on the host OS (which requires me to fork off a child process so it doesn't block)

  • Run the infected file on virtual machine A (clean virtual machine B is just sitting there so that it can be infected, and I can capture the traffic going over the network)

  • Wait 5 minutes

  • Kill the tcpdump process (no further fork, just a syscall)

  • Revert both virtual machines to their clean, pre-infected state

  • Loop back to the start with another file.

 

It works well for about 2-3 days, before my Perl script hangs during the process of reverting the second virtual machine. At that point, my hostd.log shows the following:

 

Activation : Invoke done on

Throw vmodl.fault.RequestCanceled

Result:

(vmodl.fault.RequestCanceled) {

   dynamicType = ,

   msg = ""

}

Activation : Invoke done on

Throw vmodl.fault.RequestCanceled

Result:

(vmodl.fault.RequestCanceled) {

   dynamicType = ,

   msg = ""

}

Activation : Invoke done on

Throw vmodl.fault.RequestCanceled

Result:

(vmodl.fault.RequestCanceled) {

   dynamicType = ,

   msg = ""

}

RecordOp REMOVE: sessionList, ha-sessionmgr

Event 3653 : User akirk logged out

RecordOp ASSIGN: latestEvent, ha-eventmgr

 

Obviously, I'm not manually issuing a cancellation request of any kind, since the goal is to just let my script run as long as it has files to process (which is essentially infinitely, given the amount of data I'm trying to look at). Is there any other reason such a request might be issued? Do I need to do a host disconnect and reconnect on each iteration of my loop? Or can VMware Server and/or VIX just not handle a long-running loop like that well?


copy file from vco to guest failure?

$
0
0

Hi

 

I am running VCO 5.1 appliance in a vsphere 5.1 environment.

 

I am attempting to write a file to a guest machine. I have tried using both Local Administrator and Domain Administrator credentials but in both instances I receive the following:

 

No permissions on the file for the attempted operation (Workflow:test workflow / Scriptable task (item1)#15)

 

I have tested that I can indeed logon.

I have tested that I can check for a directory.

I have tested that I can create a directory.

 

All work fine. I just can't appear to create the file.

 

I ran proccess mon on the guest when I ran the workflow (outputprocmon.txt)

 

So I can see it is trying look at the directory and the file but for some reason is getting a permission denied??

 

I can log onto the guest as either a domain admin or local admin and create a file in this directory.

 

Is the file being created as the user passed through or as the account running the vmtools?

 

Test script is:

 

parameters [string]userName, [secureString]password, [VC:VirtualMachine]vm

 

var host = vm.sdkConnection;
var guestOperationsManager = host.guestOperationsManager;
var guestAuth = new VcNamePasswordAuthentication();
guestAuth.username = userName;
guestAuth.password = password;
var fileManager = guestOperationsManager.fileManager;
myResult = false;
overwrite = false;
var attr = new VcGuestFileAttributes();
//var srcFile = new File(vcoPath);
var srcFile = "/scripts/blah.txt";
var guestFilePath = "C:/bin/blah.txt";
var uri = fileManager.initiateFileTransferToGuest(vm , guestAuth ,guestFilePath, attr, srcFile.length, overwrite);
myResult = fileManager.putFile(srcFile, uri);
System.log("Result is: " + myResult);

 

 

Oh and the path /scripts on the vco appliance is a ntfs mount rw,hard,intr

 

Any assistance greatly appreciated.

 

Sam

VixError 22002: The specified version was not found.

$
0
0

Greetings,

 

I'm trying to use the latest VMWare Player and VIX tools to build an automated testing framework. However, when I call VixHost_Connect, all I get is:

 

VixError 22002: The specified version was not found.

 

I'm not sure what exactly it is referring to?

 

Here is what I have installed:

 

$ vmware-installer -l

Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory

Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory

Product Name         Product Version    

==================== ====================

vmware-player        6.0.0.1295980      

vmware-vix           1.12.2.1031769

 

Cheers,

 

Peter.

Problem about using JNI to call Vix API?

$
0
0

Hi All,

 

I used JNI to call Vix API base on Fedora 7 OS. Bug I have a problem when running the program. Here is the exception message:

"Exception in thread "main" java.lang.UnsatisfiedLinkError: vixHostConnect

        at VixNative.vixHostConnect(Native Method)

        at VixNative.main(VixNative.java:79)"[/b]. It seems the java code can't wrap to the c function Java_VixNative_vixHostConnect[/b].

 

here is the code:

//VixNative.java

public class VixNative {

      

     public native static int vixHostConnect(

               String hostName,

               String userName,

               String password,

               int portNumber

     );

      

     public native static void vixHostDisconnect(

               int handle

     );

      

     public native static void vixHostRegisterVM(

               int hostHandle,

               String configFile

     );

      

     public native static void vixHostUnregisterVM(

               int hostHandle,

               String configFile

     );

      

     public native static int vixVMOpen(

               int hostHandle,

               String configFile

     );

      

     public native static void vixVMPowerOn(

               int vmHandle

     );

      

     public native static void vixVMPowerOff(

               int vmHandle

     );

      

     public native static void vixVMSuspend(

               int vmHandle

     );

      

     public native static void vixVMReset(

               int vmHandle

     );

      

     public native static void vixVMWaitForToolsInGuest(

               int vmHandle

     );

      

     public native static int vixGetProperties(

               int vmHandle

     );

      

     public native static String vixGetErrorText(

               int err,

               String locale

     );

      

     public native static void vixVMLoginGuest(

               int vmHandle,

               String userName,

               String password

     );

      

     static{

          System.loadLibrary("VixNative");

     }

      

      

     public static void main(String[] args) {

          try{

               int hostHandle = 0;

               int vmHandle = 0;

               hostHandle = VixNative.vixHostConnect("192.168.1.10", "root", "jcmuser", 904);

               vmHandle = VixNative.vixVMOpen(hostHandle, "/root/Documents/Test/VirtualMachines/SupportCases/WinXP Professional/CaseDir_60/SCase_50004/CurrentImage/Windows XP Professional.vmx");

               VixNative.vixVMPowerOn(vmHandle);

               VixNative.vixVMWaitForToolsInGuest(vmHandle);

               VixNative.vixVMLoginGuest(vmHandle, "user", "123");

               //VixNative.VixVMPowerOff(vmHandle);     

          }

          catch(Exception e){

               System.out.println(e.getMessage());

          }

           

     }

      

}

 

//VixNative.c

 

#include "vix.h"

#include "VixNative.h"

 

#include <stdio.h>

 

#ifndef __VixNative__

#define __VixNative__

 

#ifdef __cplusplus

extern "C"

{

#endif

 

JNIEXPORT jint JNICALL Java_VixNative_vixHostConnect (JNIEnv * env, jclass cl, jstring hostName, jstring userName, jstring password, jint portNumber){

     VixHandle hostHandle = VIX_INVALID_HANDLE;

 

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     const char *cHostName = env->GetStringUTFChars(hostName, 0);

 

     const char *cUserName = env->GetStringUTFChars(userName, 0);

 

     const char *cPassword = env->GetStringUTFChars(password, 0);

     jobHandle = VixHost_Connect(

 

          VIX_API_VERSION,

 

          VIX_SERVICEPROVIDER_VMWARE_SERVER,

 

          cHostName, // *hostName,

 

          portNumber, // hostPort,

 

          cUserName, // *userName,

 

          cPassword, // *password,

 

          0, // options,

 

          VIX_INVALID_HANDLE, // propertyListHandle,

 

          NULL, // *callbackProc,

 

          NULL);

 

     err = VixJob_Wait(

 

          jobHandle,

 

          VIX_PROPERTY_JOB_RESULT_HANDLE,

 

          &hostHandle,

 

          VIX_PROPERTY_NONE);

 

     Vix_ReleaseHandle(jobHandle);

 

     if(VIX_OK != err){

 

          hostHandle = 0;

 

     }

 

      

 

     return hostHandle;

}

 

JNIEXPORT void JNICALL Java_VixNative_vixHostDisconnect (JNIEnv* env, jclass cl, jint hostHandle){

     VixHost_Disconnect(hostHandle);

}

 

JNIEXPORT void JNICALL Java_VixNative_vixHostRegisterVM (JNIEnv* env, jclass cl, jint hostHandle, jstring configFile){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     const char *cConfigFile = env->GetStringUTFChars(configFile, 0);

 

     jobHandle = VixHost_RegisterVM(

 

          hostHandle,

 

          cConfigFile,

 

          NULL,

 

          NULL);

 

     err = VixJob_Wait(

 

          jobHandle,

 

          VIX_PROPERTY_NONE);

 

     Vix_ReleaseHandle(jobHandle);

}

 

JNIEXPORT void JNICALL Java_VixNative_vixHostUnregisterVM (JNIEnv* env, jclass cl, jint hostHandle, jstring configFile){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     const char *cConfigFile = env->GetStringUTFChars(configFile, 0);

 

     jobHandle = VixHost_UnregisterVM(

 

          hostHandle,

 

          cConfigFile,

 

          NULL,

 

          NULL);

 

     err = VixJob_Wait(

 

          jobHandle,

 

          VIX_PROPERTY_NONE);

 

     Vix_ReleaseHandle(jobHandle);

}

 

JNIEXPORT jint JNICALL Java_VixNative_vixVMOpen (JNIEnv* env, jclass cl, jint hostHandle, jstring configFile){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixHandle vmHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     const char *cConfigFile = env->GetStringUTFChars(configFile, 0);

 

     jobHandle = VixVM_Open(

 

          hostHandle,

 

          cConfigFile,

 

          NULL,

 

          NULL);

 

     err = VixJob_Wait(

 

          jobHandle,

 

          VIX_PROPERTY_JOB_RESULT_HANDLE,

 

          &vmHandle,

 

          VIX_PROPERTY_NONE);

 

     Vix_ReleaseHandle(jobHandle);

 

     if(VIX_OK != err){

 

          vmHandle = 0;

 

     }

 

     return vmHandle;

}

 

JNIEXPORT void JNICALL Java_VixNative_vixVMPowerOn (JNIEnv* env, jclass cl, jint vmHandle){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     jobHandle = VixVM_PowerOn(vmHandle,VIX_HOSTOPTION_USE_EVENT_PUMP,VIX_INVALID_HANDLE,NULL,NULL);

 

        err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

 

        Vix_ReleaseHandle(jobHandle);

}

 

JNIEXPORT void JNICALL Java_VixNative_vixVMPowerOff (JNIEnv* env, jclass cl, jint vmHandle){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     jobHandle = VixVM_PowerOff(

 

          vmHandle,

 

          VIX_VMPOWEROP_NORMAL,

 

          NULL, // *callbackProc,

 

          NULL);

 

        err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

 

        Vix_ReleaseHandle(jobHandle);

}

 

JNIEXPORT void JNICALL Java_VixNative_vixVMSuspend (JNIEnv* env, jclass cl, jint vmHandle){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     jobHandle = VixVM_Suspend(

 

          vmHandle,

 

          VIX_VMPOWEROP_NORMAL,

 

          NULL, // *callbackProc,

 

          NULL);

 

        err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

 

        Vix_ReleaseHandle(jobHandle);

}

 

JNIEXPORT void JNICALL Java_VixNative_vixVMReset (JNIEnv* env, jclass cl, jint vmHandle){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     jobHandle = VixVM_Reset(

 

          vmHandle,

 

          VIX_VMPOWEROP_NORMAL,

 

          NULL, // *callbackProc,

 

          NULL);

 

        err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

 

        Vix_ReleaseHandle(jobHandle);

}

 

JNIEXPORT void JNICALL Java_VixNative_vixVMWaitForToolsInGuest (JNIEnv* env, jclass cl, jint vmHandle){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     jobHandle = VixVM_WaitForToolsInGuest(

 

          vmHandle,

 

          300,

 

          NULL,

 

          NULL);

 

     err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

 

     Vix_ReleaseHandle(jobHandle);

}

 

JNIEXPORT jint JNICALL Java_VixNative_vixGetProperties (JNIEnv* env, jclass cl, jint vmHandle){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

 

     VixHandle vmState = VIX_INVALID_HANDLE;

 

     jobHandle = Vix_GetProperties(

 

          vmHandle,

 

          VIX_PROPERTY_JOB_RESULT_HANDLE,

 

          &vmState,

 

          VIX_PROPERTY_NONE);

 

        Vix_ReleaseHandle(jobHandle);

 

     return vmState;

}

 

JNIEXPORT jstring JNICALL Java_VixNative_vixGetErrorText (JNIEnv* env, jclass cl, jint err, jstring cLocale){

     const char * cLocale = env->GetStringUTFChars(locale, 0);

 

     jstring errText = env->NewStringUTF(Vix_GetErrorText(err, cLocale));

 

     return errText;

}

 

JNIEXPORT void JNICALL Java_VixNative_vixVMLoginGuest (JNIEnv* env, jclass cl, jint vmHandle, jstring userName, jstring password){

     VixHandle jobHandle = VIX_INVALID_HANDLE;

 

     VixError err = VIX_OK;

     const char *cUserName = env->GetStringUTFChars(userName, 0);

 

     const char *cPassword = env->GetStringUTFChars(password, 0);

     jobHandle = VixVM_LoginInGuest(vmHandle, cUserName, cPassword, 0, NULL, NULL);

     err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

     Vix_ReleaseHandle(jobHandle);

}

 

#ifdef __cplusplus

}

#endif

 

#endif /* __VixNative__ */

 

I used the following command to compile the c code. I copied all files which are needed  to current directory.

gcc -shared -o libVixNative.so VixNative.c /usr/lib/libvmware-vix.so.0[/b]

 

I thought it may be the compile command problem. Because the java code can load the VixNative library, but can't find the c functions.

 

Could any body help me?

 

Thanks.

Intermittent crashes the Vix API

$
0
0

 

 

 

 

We had been experiencing intermittent crashes the Vix API. We recently switched to launching vmrun.exe in a subprocess instead so the Vix API crashes would not kill our application. We have found that vmrun.exe also crashes intermittently. It displays a fatal error popup and hangs. It is very inconvenient since we are trying to control VM operations automatically and unattended. The crashes occur most often when we're reverting to snapshots or starting VMs. The crashes are more frequent when we launch multiple instances of vmrun.exe on the same computer at the same time, each to control a different VM.

 

 

The popup looks like this:

 

 

http://communities.vmware.com/servlet/JiveServlet/downloadImage/10476/vixcrash.png

 

 

 

 

 

Here is the full problem signature:

 

 

Problem signature:

 

 

  Problem Event Name:                      APPCRASH

  Application Name:                             vmrun.exe

  Application Version:                          1.10.1.12915

  Application Timestamp:                   4c1310f0

  Fault Module Name:                          glib-2.0.dll

  Fault Module Version:                       2.16.4.0

  Fault Module Timestamp:                48801db1

  Exception Code:                                 c0000005

  Exception Offset:                                0005a870

  OS Version:                                         6.1.7600.2.0.0.274.10

  Locale ID:                                            1033

  Additional Information 1:                  0a9e

  Additional Information 2:                  0a9e372d3b4ad19135b953a78882e789

  Additional Information 3:                  0a9e

  Additional Information 4:                  0a9e372d3b4ad19135b953a78882e789

 

 

 

 

 

VIX_SERVICEPROVIDER_VMWARE_WORKSTATION error

$
0
0

 

Hi,

 

 

I'm trying to run a script in a 64-bit Windows 7 VM usingthe vmrun command line tool (1.6.0.2073) and the following options:

 

 

vmrun -T ws -gu user -gp passwordrunProgramInHost "C:\vms\W7.vmx" -interactive "C:\test\test.cmd"

 

 

and i get the following error:

 

 

Error: Service type VIX_SERVICEPROVIDER_VMWARE_WORKSTATION was specified, but not installed

 

 

Can anyone help me with this error, it would be most appreciated!

 

 

Thanks

 

 

 

 

 

VMware server 2.0 - Insufficient permissions in host operating system

$
0
0

Hi all.

 

I have been struggling with this issue for weeks now. It seems apparent that I'm having file permissions issue, but can't seem to pinpoint it. Any help would be greatly appreciated!

 

The issue is that I can reset a VM on my linux host from the webapp, but not using the vmrun command:

 

vmrun -T server -h https://localhost:8333/sdk -u vmuser -p 'vmuser' reset "[standard] lab/lab-01/Windows XP Professional.vmx"
Error: Insufficient permissions in host operating system

 

 

I have double checked my permissions and it seems the vmuser has access to all files under the lab directory. I have also looked at the log files in /tmp/vmware-&lt;user&gt;/vix-&lt;pid&gt;.log and they seem to be the same whether the command succeeds (using super user account) or fails (with this limited account). Are there any more detailed logs I can check where my specific file permissions issues are?

 

Thanks in advance for your help!

Cloning vith VIX API

$
0
0

Hi all,

 

with VMware Workstation and the VIX API, I was able to clone a VM.

On clone method, I miss a parameter zu enter the VM name. After cloning, the property "VIX.Enums.VIX_PROPERTY.VM_NAME" shows "Clone of <SourceVmName>".

 

If i clone manually on VMware Workstation, in the wizzard I can specify the input field "Virtual machine name". That way, the result is correct.

 

I have no idea, how to solve the problem.

Thanks in advance for your help.

 

Manfred.


vim-cmd vmsvc/snapshot.removeall command took about 20 mins to finish

$
0
0

Experts,

 

I am using command line tool vim-cmd to control my Vsphere clients' snapshots.

Because I can not use vim-cmd to identify one snapshot by name, need to provide Index and Level, which I dont have. But I can always use 0 0 pair for the root snapshot.

So, I am using only one snapshot and using snapshot.removeall to remove the root snapshot.

But sometimes vmsvc/snapshot.removeall command took too much time to execute, I dont know why, anyone who can direct me? Or I should choose remove but not remove all?

 

 

 

 

Thanks!

Tyler

vix-perl installation problems

$
0
0

Hi all,

 

I'm having problems installing the vix-perl packages on Windows XP. The first thing i did was installing the ActivePerl-5.8.8.820-MSWin32-x86-274739.msi. Then I started the command prompt of VS2005 (also tried VS2003) and entered "perl Makefile.pl". The output was the following:

 

Unable to find a perl 5 (by these names: C:\Program Files\Perl\bin\perl.exe perl.exe perl5.exe perl5.8.8.exe miniperl.exe, in these dirs: . C:\Program Files\Microsoft Visual Studio 8\Common7\IDE C:\Program Files\Microsoft Visual Studio 8\VC\BIN C:\Program Files\Microsoft Visual Studio 8\Common7\Tools C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages C:\Program Files\Perl\site\bin C:\Program Files\Perl\bin C:\WINDOWS\SYSTEM32 C:\WINDOWS C:\WINDOWS\SYSTEM32\WBEM C:\PROGRAM FILES\MICROS

OFT SQL SERVER\90\TOOLS\BINN\ C:\WINDOWS\MICROSOFT.NET\FRAMEWORK\V1.1.4322 C:\PR

OGRAM FILES\COMMON FILES\GTK\2.0\BIN C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 8\COMMON7\IDE C:\Program Files\Varian\Sybase\OCS-12_5\bin C:\Program Files\Varian\

Sybase\OCS-12_5\dll C:\Program Files\Varian\Sybase\OCS-12_5\lib3p C:\Program Files\Microsoft Team Foundation Server Power Toys C:\WINDOWS\system32\WindowsPowerShell\v1.0 C:\Program Files\TortoiseSVN\bin C:\Program Files\Sandcastle\ProductionTools\ C:\Program Files\Perl\bin) Writing Makefile for VMware::VixBinding

 

I don't get it, no idea what happens here. I have tried different versions of perl but I always get that message.

 

Executing the makefile then results in:

 

NMAKE : fatal error U1073: don't know how to make 'C:\Program'

Stop.

 

Executing a perl script results in:

 

Can't locate auto/VMware/VixBinding/autosplit.ix in @INC (@INC contains: blib/lib blib/auto C:/Program Files/Perl/site/lib C:/Program Files/Perl/lib .) at C:/Program Files/Perl/lib/AutoLoader.pm line 160. at VMware/VixBinding.pm line 20

Can't locate loadable object for module VMware::VixBinding in @INC (@INC contains: blib/lib blib/auto C:/Program Files/Perl/site/lib C:/Program Files/Perl/lib .) at VMware/Vix/API/API.pm line 13 Compilation failed in require at VMware/Vix/API/API.pm line 13.

BEGIN failed--compilation aborted at VMware/Vix/API/API.pm line 13.

Compilation failed in require at VMWare/Vix/Simple.pm line 25.

BEGIN failed--compilation aborted at VMWare/Vix/Simple.pm line 25.

Compilation failed in require at RunBuild.pl line 1.

BEGIN failed--compilation aborted at RunBuild.pl line 1.

 

What am I doing wrong? And why the heck do I have to compile that stuff myself? Isn't there a binary version available?

Why is it such a problem to install the API?? All I want is start a VM via script!

 

Thanks!

VIX Com on 64 bits

$
0
0

 

It looks to me that Vix Com doesn't work on 64 bits or I'm doing something wrong. What's happening is that the call:

 

 

VixLibClass myVixLib = new VixLibClass();

 

 

job = myVixLib.Connect(1, Constants.VIX_SERVICEPROVIDER_DEFAULT, null, 0, null, null, 0, null, null);

 

 

fails with:

 

 

Unhandled Exception: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for comp

onent with CLSID {6874E949-7186-4308-A1B9-D55A91F60728} failed due to the following error: 80040154.

 

 

Same code works on 32 bit platform.

 

 

Anybody any idea? Anybody made it work on 64bits?

 

 

Thanks!

 

 

RuntimeFault: Database temporarily unavailable or has network problems.

$
0
0

 

RuntimeFault: Database temporarily unavailable or has network problems.

 

 

 

 

 

I always received that message when creating new Administrator from local users in Linux or

 

 

adding user permission on a specific Virtual Machine.

 

 

 

 

 

how can I fix this??

 

 

 

 

 

http://communities.vmware.com/servlet/JiveServlet/downloadImage/3955/snapshot23.png

 

 

VMWareTasks: A VIX API C# Library (let's reinvent less wheels)

$
0
0

I posted a CodeProject Article this morning with a VMWareTasks C# library on top of the VIX API. It exposes a better programming model for the 99% of those synchronous VMWare scenarios where you don't want to deal with jobs or other more complex constructs. I think we can all benefit from reimplementing the same thing less often!

 

http://www.codeproject.com/KB/library/VMWareTasks.aspx

 

 

http://code.dblock.org/ShowPost.aspx?id=25

 

 

I'd love to get more features/patches for the library, feel free to (re)use and contribute.

 

 

cheers

dB.

 

 

Update: I posted a new build 1.0.1604.0: http://code.dblock.org/ShowPost.aspx?id=29

Viewing all 34639 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>