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

WaitForToolsInGuest does not return and hangs

$
0
0

 

I'm using VIX API 1.6.2 on 32 bit Windows 2003 (SP2) to control vitrual machines running on another 64-bit machine running ESXi 4.0.0 (171294).

 

 

The Virtual machine is running 32-bit Windows 2003 (SP2)  and has VMWare tools installed.

 

 

Using the VIX API I first revert to a named snapshot (that has the machine in shutdown state), then I power it on and wait for tools in guest before I run programs inside the VM.

 

 

The problem is that WaitForToolsInGuest ( ) does not return and hangs indefinately even after the OS has booted up successfully.

 

 

The code below works fine for ESX 3.5 (update 3) and also VMWare Server 2.0.1 but does not work forESXi 4.0.0 (171294)

 

 

 

 

 

My VBScript code that uses VIX API looks like this:

 

 

 

 

 

' Create the VIX library

 

 

Dim lib

 

 

Set lib = CreateObject("VixCOM.VixLib")

 

 

 

 

 

' Connect to ESXi server

 

 

Dim jobConnect

Set jobConnect = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_VI_SERVER, "https://myesxiserver:443/sdk/", 0, "root", "mypwd", 0, Nothing, Nothing)

 

 

Set connectResults = Nothing

err = jobConnect.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), connectResults)

If lib.ErrorIndicatesFailure(err) Then

       Wscript.Echo "Connecting to host failed with error code "

       WScript.Quit(err)

End If

 

 

Dim host

 

 

Set host = connectResults(0)

 

 

 

 

 

' Open the virtual machine

 

 

Set jobOpenVM = host.OpenVM("[datastore] myvm/myvm.vmx", Nothing)

 

Set openVMResults = Nothing

err = jobOpenVM.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), openVMResults)

If lib.ErrorIndicatesFailure(err) Then

       WScript.Echo "Opening virtual machine failed with error code "

       WScript.Quit(err)

End If

 

' The vm object will be first element in the results array.   

 

 

Dim vm

Set vm = openVMResults(0)

 

 

 

 

 

' Power on the virtual machine

 

 

Dim jobPowerOn

Set jobPowerOn = vm.PowerOn(VixCOM.Constants.VIX_VMPOWEROP_NORMAL, Nothing, Nothing)

err = jobPowerOn.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

        WScript.Echo "Powering on guest failed with error code "

        WScript.Quit(err)

End If

 

 

 

' Wait until VMWare tools starts inside the guest

 

 

Dim jobWaitForTools

 

 

Set jobWaitForTools = vm.WaitForToolsInGuest(0, Nothing)

err = jobWaitForTools.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

       WScript.Echo "Waiting for tools in guest failed with error code "

       WScript.Quit(err)

 

 

End If

 

 

 

 

 

Thanks in advance.

 

 

 

 

 


Manage VMWARE by python

$
0
0

Good morning to everybody,

I'm working to write a script python to manage a virtual machine, I choose, for example, VMware. To realize this script I need vmware's API and a library, called libvirt. Anyway, at the moment I couldn't write any line of code   Who can help me?

VMware Server 2.0 Backups (VIX 1.6.2 only)

$
0
0

Vix_Virtuozo_Suite enables domain-wide cold and hot backups of your guests. Windows and Linux (SAMBA required) Server 2.0.x host OSs are supported.

 

Linked is the current build of Vix_Virtuozo_Suite x86. The installer will install a Windows Service and provide GUI to configure the service options.  Windows x86 and 64bit are supported.

 

All feedback and suggestions are welcome.

 

Service GUI

 

Guest GUI

 

Live Backup Status

 

Subscribe to this thread's email notification to receive updates on bug fixes.

 

Troubleshooting notes:

 

 

  •  

    VIX API 1.6 is required for this software to function.

     

  •  

    VIX_Virtuozo_Service Windows Service must log on as a user with permission to create a custom Event Log as well as have access to protected shares (CIFS) defined throughout the configuration of each host and guest.

     

  •  

    SAMBA is required for VMware hosts running Linux.

     

  •  

    VIX 1.7 is NOT stable to work with Server 2.0!

     

 

 

_Download January 21, 2010 Release_

Cannot find MSVCR71D.dll. Does VIX API 1.1.1 support VS 2005?

$
0
0

 

Hi:

 

 

I am using VIX 1.1.1 with WS 6.0.1. I compile my program as described in http://pubs.vmware.com/vix-api/ReferenceGuide/intro.html#0_53099  with wrapper library. The compiling is OK but I got an runtime error says:

 

 

This application failed to start because MSVCR71D.dll was not found.

 

 

 

 

 

From my program's console, I got this error:

 

 

failed to load library C:\Program Files\VMware\VMware VIX
ws-3\32bit\vixd.dll (126)

No Vix library found for 3 3

Panic: ASSERT C:/ob/bora-55017/bora/apps/lib/vixWrapper/vixWrapper.c:831

 

 

I am using VS 2005 with SP1. Does anyone have succeefully using VS2005 to compile a VIX program? I am almost mad now.

 

 

Thanks.

 

 

 

 

 

Where to download VIX API 1.6.1 ?

$
0
0

Hi,

 

i've read about the release of the new VIX API 1.6.0 and 1.6.1 but where to download the new release ?

I did not find the release in the usual download loaction.

 

 

 

Regards,

 

Christian Prochnow

Connect/Disconnect cdrom ?

$
0
0

Hi,

 

does anybody know a way how to connect/disconnect a CDROM when the VM is running ?

Maybe there is some variable to set using VixVM_ReadVariable and VIX_VM_CONFIG_RUNTIME_ONLY ?

 

Thanks in advance.

 

Best regards,

 

Christian Prochnow

VMDK mount automation using vixDiskMountServer

$
0
0

 

It is possible to mount a VMDK disk by right-clicking on it with VMware Workstation 6.5. It uses vixDiskMountServer.exe. Unfortunately,  there is no documentation on how to do it automatically.

 

 

My question is: Is there a way to mount a vmdk in command-line using vixDiskMountServer.exe?

 

 

I have already tried Disk Mount 5.5 and VDK.exe, but the lock system is not the same and it doesn't allow me to access a drive while a VM is on pause which vixDiskMountServer does.

 

 

 

 

 

Thank you!

 

 

Error: The specified service provider was not found

$
0
0

hi all,

 

I just installed vix 1.6.2 and ran the vmrun which gave me the error "Error: The specified service provider was not found"

 

details:

vmware workstation 6.5.1

trying to connect to workstation named "Ubuntu" using vix

 

command ran:

 

c:\Program Files\VMware\VMware VIX> vmrun -T ws  snapshot "C:\U

sers\\Documents\Virtual Machines\Ubuntu\Ubuntu.vmx" mySnapshot

Error: The specified service provider was not found

 

 

the error occurs if i run any command using vmrun

 

can anyone please help me solve this?


Session Update! VIX APIs - Managing and Automating Guest OS

$
0
0

Sessions # DE-02

 

Session Abstract:

 

The VIX APIs provide an easy-to-use, high-level

programming interface that combines virtual machine management operations with

actions in the guest operating system, such as running programs and copying

files to and from the guest. Users can leverage VIX to write scripts and

programs in C, Perl, C# or Visual Basic, and use a simple command-line tool for

writing shell scripts. This session will provide an overview of the VIX API,

along with detailed examples and demonstrations.

 

 

 

 

 

Learn about our speakers:

http://communities.vmware.com/servlet/JiveServlet/downloadImage/6356/lamantia.jpeg

Matt LaMantia is the manager of the VIX API team at VMware, focusing on enabling users and

independent software vendors to interface with VMware's platform offerings. Prior to working at VMware,

he was on the J2EE Server team at Art Technology Group and the speech recognizer team at

Dragon Systems, Inc. He received his MS in engineering management at MIT in 2006 and a BA in

computer science from Harvard in 1994.

 

http://communities.vmware.com/servlet/JiveServlet/downloadImage/6357/richards.jpeg

Matt Richards is a senior software engineer for VMware, where he is the engineering lead for the

VIX API. While at VMware, he has worked on areas including platform scalability, product security,

and API and protocol design. He received his BS in computer science from Stanford University.

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?

Issue with vmrun runProgramInGuest running 2008 Powershell commands

$
0
0

 

I am trying to run an install script in powershell on a 2008 server using vmrun from a linux server. I have had a few problems doing this and am wondering if there is a way to make it work..

 

 

The first problem was trying to pass the &, I could not figure out how to do that?

 

 

To work around this I created a .bat file, coppied it using vmrun to the guest, then try to run it (I copy and run about 5 files, .bat and msi). All of the files run as expected except the .bat with the powershell (which runs fine while logged in as administrator). When I run it remotely using vmrun it appears it is not picking up some of the path variables that are for administrator, and so the script is confused and putting files in the wrong places... I thought about using runas but it can not be interactive... so I can not pass the admin password in runas (and I would prefer not to transfer and install yet another program to get that functionality).

 

 

So the work around I have right now is to also schedule a task that runs the .bat file with the powershell script once, then kick it off... that works... but seems very glued to gether...

 

 

thanks

 

 

Keven

 

 

Visual Studio LNK4099 Warning

$
0
0

Is there any way to remove all the LNK4099 warning messages when linking with Visual Studio? There are so many that they may hide other ones in our product that we need to pay attention to. This even happens if you build the sample code for debug.

 

Here is an example (there are many more):

 

vixAllProductsd.lib(file.obj) : warning LNK4099: PDB 'file.pdb' was not found with 'C:
Program Files (x86)
VMware
VMware VIX
vixAllProductsd.lib' or at 'G:\Users\Public\Downloads\VMWare VIX API\VMWareVIXSDK (1.8)\file.pdb'; linking object as if no debug info

 

Thanks.

help with RunScriptInGuest()

$
0
0

Hi,

I'm trying to implement the function RunScriptInGuest in c#.

Here is the code:

 

public void RunScriptInGuest(string interpreter, string scriptText, int options)

{    VMWareJobCallback callback = new VMWareJobCallback();

     VMWareJob job = new VMWareJob(_handle.RunScriptInGuest(interpreter, scriptText, options, null, callback),callback);

}

 

and the code where i call it is like this:

                //Sample vbscript code copied from http://www.computerperformance.co.uk/vbscript/vbscript_file_create.htm

                //Escape characters are inserted by me.

                //The following code lies within a button_click function.

                string str = "Option Explicit\r\n";

                str += "Dim objFSO, objFSOText, objFolder, objFile\r\n";

                str += "Dim strDirectory, strFile\r\n";

                str += "strDirectory = \"C:
logs\"\r\n";

                str += "strFile = \"
Summer.txt\"\r\n";

                str += "Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\r\n";

                str += "Set objFolder = objFSO.CreateFolder(strDirectory)\r\n";

                str += "Set objFile = objFSO.CreateTextFile(strDirectory & strFile)\r\n";

                str += "Wscript.Echo \"Just created \" & strDirectory & strFile\r\n";

                str += "Wscript.Quit\r\n";

                

                vmachine.RunScriptInGuest("C:
Windows
system32
wscript.exe", str, 0);

                textBox1.Text += ("Successful! \r\n");

 

Now when i run this code, no error is thrown and "Successful!" appears in the textBox1.

However the file summer.txt is not created in the virtual machine.

Can someone pls point out where i am going wrong??

 

Also, in C#, for the textbox i need to put "\r\n" for a clean new line as putting only "\n" yields an extra box character.

So for the code, for every line what exactly should be put?? \r or \n or \r\n??

 

Kindly help, thanks.

-Shrikant

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 for MAC VMware fusion

$
0
0

Hi,

 

I am unable to get VIX library for MAC VMware fusion.

Can anyone guide me to get VIX libraries to run vmrun utility?

 

 

Regards,

akash


VIX and ESXi 4.1 - license issue ?

$
0
0

 

Hi,

 

 

I am new with VIX and try to use it for a proto infrastructure.

When I try to start a VM with VIX (from a VM of the same host) here is what I get :

 

 

vmrun -T esx -h https://bod-qa-vmhost1.vsg3d.intra/sdk -u root -p rootPassword start "[Local Datastore HDD1 VMs] bod-qa-vmbuild2/bod-qa-vmbuild2.vmx"

 

Unable to connect to host.

Error: This operation is not supported with the current license

 

 

I have a free license ESXi, is this the issue ?

 

 

What king of license should I need to make it run ?

 

 

Thanks.

 

 

 

 

 

 

 

 

runProgramInGuest with Switch

$
0
0

Hello,

 

I am attempting to use KIX to initiate a korn shell script with a switch however I get the following error.  Please let me know if there is a way of accomplish this, my only other option is to push a new simple script that executes the script and switch.  Thanks in advance for any assistance.

 

Error: Cannot open VM: [script path], unknown file suffix

Unable to use VDDK 5.0 API and VIX 1.11 API in the same application

$
0
0

I am working on an application that requires the use of both the VDDK *and* VIX APIs in the same Linux 64-bit client application.

.

It appears that each distribution comes with its own (somewhat overlapping) set of libraries that the main API libs (libvixDiskLib.so and libvix.so) are dependent on.  And my problem is that I can't get both APIs to work using the same set of shared, dependent libs.  They work grest when paired with the libs they came with, but not when I try to combine them (which you *have* to do since they are dynamically shared).
.
Since the VIX release is more recent, I tried using those libs with the VDDK (libvixDiskLib.so).  This results in a crash when trying to open a VMDK.
.
Conversely, if I try to use the (older) VDDK libs with VIX (libvix.so), the library cannot be loaded because of an unresolved symbol in libgvmomi.
.
Is there a way to use both of these APIs from the same application?
.
It would seem to me that we need a release of the VDDK lib that will work with the dependent libs that come with the latest VIX distribution.
.
Or, is there another way?
.
The VDDK libs I am using come from the latest, 5.0, distribution:
.
-rw-r--r--  1 dev dev  1555256 Jun 10  2011 libcrypto.so.0.9.8
-rw-r--r--  1 dev dev   322272 Jun 10  2011 libcurl.so.4
-rw-r--r--  1 dev dev   986352 Jun 10  2011 libglib-2.0.so.0
-rw-r--r--  1 dev dev   273464 Jun 10  2011 libgobject-2.0.so.0
-rw-r--r--  1 dev dev    17768 Jun 10  2011 libgthread-2.0.so.0
-rw-r--r--  1 dev dev  5993808 Jun 10  2011 libgvmomi.so.0
-rw-r--r--  1 dev dev   325912 Jun 10  2011 libssl.so.0.9.8
-rw-r--r--  1 dev dev 71369496 Jun 10  2011 libtypes.so
lrwxrwxrwx  1 dev dev       18 Feb 15 12:33 libvixDiskLib.so -> libvixDiskLib.so.5
lrwxrwxrwx  1 dev dev       22 Feb 15 12:33 libvixDiskLib.so.5 -> libvixDiskLib.so.5.0.0
-rw-r--r--  1 dev dev  1719744 Jun 10  2011 libvixDiskLib.so.5.0.0
lrwxrwxrwx  1 dev dev       21 Feb 15 12:33 libvixDiskLibVim.so -> libvixDiskLibVim.so.5
lrwxrwxrwx  1 dev dev       25 Feb 15 12:33 libvixDiskLibVim.so.5 -> libvixDiskLibVim.so.5.0.0
-rw-r--r--  1 dev dev   156216 Jun 10  2011 libvixDiskLibVim.so.5.0.0
lrwxrwxrwx  1 dev dev       17 Feb 15 12:33 libvixMntapi.so -> libvixMntapi.so.1
lrwxrwxrwx  1 dev dev       21 Feb 15 12:33 libvixMntapi.so.1 -> libvixMntapi.so.1.1.0
-rw-r--r--  1 dev dev  1954064 Jun 10  2011 libvixMntapi.so.1.1.0
-rw-r--r--  1 dev dev  7051120 Jun 10  2011 libvmacore.so
-rw-r--r--  1 dev dev  5602488 Jun 10  2011 libvmomi.so
.
The VIX libs I am using come from the latest, 1.11, distribution (version for Workstation-8.0.0-and-vSphere-5.0.0):
.
-rw-r--r-- 1 root root 1767620 Feb  9 12:56 libcrypto.so.0
-rw-r--r-- 1 root root 1767620 Feb  9 12:56 libcrypto.so.0.9.8
-rw-r--r-- 1 root root  322272 Feb  9 12:56 libcurl.so.4
-rw-r--r-- 1 root root  322272 Feb  9 12:56 libcurl.so.4.1.1
-rw-r--r-- 1 root root  986352 Feb  9 12:56 libglib-2.0.so.0
-rw-r--r-- 1 root root  986352 Feb  9 12:56 libglib-2.0.so.0.2400.2
-rw-r--r-- 1 root root   12520 Feb  9 12:56 libgmodule-2.0.so.0
-rw-r--r-- 1 root root   12520 Feb  9 12:56 libgmodule-2.0.so.0.2400.2
-rw-r--r-- 1 root root  273464 Feb  9 12:56 libgobject-2.0.so.0
-rw-r--r-- 1 root root  273464 Feb  9 12:56 libgobject-2.0.so.0.2400.2
-rw-r--r-- 1 root root   17864 Feb  9 12:56 libgthread-2.0.so.0
-rw-r--r-- 1 root root   17864 Feb  9 12:56 libgthread-2.0.so.0.2400.2
-rw-r--r-- 1 root root 7478928 Feb  9 12:56 libgvmomi.so.0
-rw-r--r-- 1 root root  365066 Feb  9 12:56 libssl.so.0
-rw-r--r-- 1 root root  365066 Feb  9 12:56 libssl.so.0.9.8
-rw-r--r-- 1 root root 6007232 Feb  9 12:56 libvix.so
-rw-r--r-- 1 root root 1291560 Feb  9 12:56 libxml2.so.2
-rw-r--r-- 1 root root 1291560 Feb  9 12:56 libxml2.so.2.6.26
-rw-r--r-- 1 root root   90821 Feb  9 12:56 libz.so.1
.
THANKS!

Executing "vmrun runScriptInGuest" on FreeBSD 8.2 guest

$
0
0

Hello,

 

I would like to use VIX API to run some custom scripts on FreeBSD system.

 

For that purpose I installed VMware Player 4.0 on my Windows 7 x32 host system, and then installed FreeBSD 8.2 guest system and "VMware Tools for FreeBSD guests".

However, on attempt to "vmrun runScriptInGuest" I get the following error:

 

vmrun -gu root -gp root runScriptInGuest C:\VMs\FreeBSD_8.2_i386\FreeBSD_8.2_i386.vmx /bin/bash ls
Error: This operation is not supported on this guest

 

Could you please clirify me when this functionality is planned to be supported? If only it is actually under consideration for supporting.

 

Thank you in advance!

Sample Code to test VIX install

$
0
0

#include "vix.h"

#include <stdlib.h>

#include <stdio.h>

VixHandle hostHandle = VIX_API_VERSION;

VixHandle jobHandle = VIX_INVALID_HANDLE;
VixError err;
jobHandle = VixHost_Connect(VIX_API_VERSION,
VIX_SERVICEPROVIDER_VMWARE_SERVER,
host, // hostName
0, // hostPort
user, // userName
password, // password,
0, // options
VIX_INVALID_HANDLE, // propertyListHandle
NULL, // callbackProc
NULL); // clientData
err = VixJob_Wait(jobHandle,
VIX_PROPERTY_JOB_RESULT_HANDLE,
&hostHandle,
VIX_PROPERTY_NONE);
if (VIX_OK != err) {
// Handle the error...
Vix_ReleaseHandle(jobHandle);
VixHost_Disconnect(hostHandle);
}
printf("Connected to local host.\n");
when i compile the code
it nootify

/home/david/Development/workspace/VIXTest/Debug/../src/Connection.c:21: undefined reference to `VixHost_Connect'

/home/david/Development/workspace/VIXTest/Debug/../src/Connection.c:31: undefined reference to `VixJob_Wait'

/home/david/Development/workspace/VIXTest/Debug/../src/Connection.c:37: undefined reference to `Vix_ReleaseHandle'

/home/david/Development/workspace/VIXTest/Debug/../src/Connection.c:38: undefined reference to `VixHost_Disconnect'

I know that is mean the function is not defined.

but that should be defined as the api.......

Any can tell me how to solution the problem???

Thank

Viewing all 34639 articles
Browse latest View live


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