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

runProgramInGuest -interactive flag in Vista does not work

$
0
0

 

Greetings,

 

 

I'm unable to get runProgramInGuest using the -interactive flag to work properly in a Vista guest.  I've logged in as administrator and am passing in the proper credentials via vmrun:

 

 

vmrun -T ws -gu Administrator -gp password runPrgramInGuest "c:\Temp\Test.vmx" -interactive c:\boo\booi.exe

 

 

Error: Authentication failure or insufficient permissions in guest operating system

 

 

 

 

 

If I run without the -interactive flag, the app is started in session 0 and Windows Interactive Services "feature" is invoked.  Has anyone gotten runProgramInGuest to work properly in Vista (where the program is not invoked in session 0)?

 

 

 

 

 

Thank you,

 

 

 

 

 

 

 

 

-Randy

 

 


LoginInGuest() issue with VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT option

$
0
0

 

Hi,

 

I'm having problem with the LoginInGuest() function when using the VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT option. Here's the code written in C#:

 

jobHandle = vmHandle.LoginInGuest(guestUser, guestPassword, Constants.VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT, null); vixError = jobHandle.WaitWithoutResults(); if (vixLib.ErrorIndicatesFailure(vixError)) { throw new VMRobotException("Error when logging on to guest OS. Error code: " + vixError); }

 

every time this is run, it returns error code 3034 VIX_E_INTERACTIVE_SESSION_NOT_PRESENT (The specified guest user must be logged in interactively to perform this operation.) Any one help please?

 

 

BTW, I'm using VIX 1.6.

 

 

 

 

 

Thanks!

 

 

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!

 

 

Getting 'host not connected' when opening a vm on an ESXi box.

$
0
0

Hi, can anybody help me please, I think I'm missing something. I had some code working fine with Workstation, but then moved the VM I want to open onto an ESXi box.

 

I'm using

ESX Server 3i version 3.5.0 build 153875

ViX version 1.6.2.2190

 

And here's the C# code:

            const string vmxFilePath = "[ESX5 1] PmTest_WS2003_32/PmTest_WS2003_32.vmx";            String hostName = "http://192.168.25.76/sdk";            String userName = "theUserName";            String password = "thePassword";            VixCOM.VixLibClass vixLib = new VixCOM.VixLibClass();            // Connect            VixCOM.IHost hostHandle;            {                VixCOM.IJob jobHandle = vixLib.Connect(                    VixCOM.Constants.VIX_API_VERSION,                    VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,                    hostName, 0, userName, password, 0, null, null);                int[] propertyIds = new int[1] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE };                object results = new object();                ulong vixError = jobHandle.Wait(propertyIds, ref results);                if (vixError != VixCOM.Constants.VIX_OK)                    throw new ApplicationException();                object[] objectArray = (object[])results;                hostHandle = (VixCOM.IHost)objectArray[0];            }            // Register            {                ulong vixError = hostHandle.RegisterVM(vmxFilePath, null).WaitWithoutResults();                if (vixError != VixCOM.Constants.VIX_OK)                    throw new ApplicationException();            }            // OpenVM            VixCOM.IVM vmHandle;            {                VixCOM.IJob jobHandle = hostHandle.OpenVM(vmxFilePath, null);                int[] propertyIds = new int[1] { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE };                object results = new object();                ulong vixError = jobHandle.Wait(propertyIds, ref results);                if (vixError != VixCOM.Constants.VIX_OK)                    throw new ApplicationException();  // Fails here with vixError 26 which is VIX_E_HOST_NOT_CONNECTED                object[] objectArray = (object[])results;                vmHandle = (VixCOM.IVM)objectArray[0];            }

 

I get error 26 after waiting for the OpenVM job to complete. I'm pretty sure the username, password, hostName and vmxFilePath are correct because if I change any of them, then I get an appropriate error. Why does it report not connected, when clearly, only a few lines above, the connect call succeeded?

 

One thing I've noticed is that if I browse to the ESXi box, I get a warning about SSL certificates, but I would have thought if that was a problem, the original connect call would fail.

 

Any help would be appreciated, thanks,

   -Scott

 

PS. Are there any logs I can look at that might give some kind of hint?

VMOpen() - VMware Server 2 returns 4000 The virtual machine cannot be found

$
0
0

Hello,

 

Setup: 64bit Ubuntu 9.04 with VMware Server 2 installed (latest version).

Also installed: VIX for Perl

 

I am following one of the examples for the VIX API documentation, which I've adapted for a Linux host, and would appreciate a help with the error I get.

 

Code is straightforward, and a slight variation of the VIX VMOpen example:

 

#!/usr/bin/perl -w

 

use strict;

use warnings;

use VMware::Vix::Simple;

use VMware::Vix::API::Constants;

 

my $err = VIX_OK; my $hostHandle = VIX_INVALID_HANDLE; my $vmHandle = VIX_INVALID_HANDLE;

($err, $hostHandle) = HostConnect(VIX_API_VERSION,

VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,

"https://localhost:8333/sdk", # hostName

0, # hostPort

"myusername", # userName

"mypassword", # password

0, # options

VIX_INVALID_HANDLE); # propertyListHandle

 

die "HostConnect() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

($err, $vmHandle) = VMOpen($hostHandle, "[[standard]]/2i/UniTech-2i-SharePoint.vmx"); # THIS IS WHERE FAILURE OCCURS

die "VMOpen() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

 

HostDisconnect($hostHandle);

 

This returns an error of "VMOpen() failed, 4000 The virtual machine cannot be found". I have tried changing the VMOpen path parameter to the full path to the VMX (like in the Windows example from the VIX API reference), but this does not work either:

 

($err, $vmHandle) = VMOpen($hostHandle, "/var/lib/vmware/Virtual Machines/2i/UniTech-2i-SharePoint.vmx");

 

(same 4000 error for this too).

 

Oddly, the web interface shows "Find Virtual Machine By DataStore" had a result of "Success" for the "[standard]/2i/UniTech-2i-SharePoint.vmx" way of doing this, though the script printed an error!

 

Has anyone got an example of this working on Linux, or can tell me what I'm doing wrong?

 

Many thanks,

 

Colin

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?

Exception:System.Runtime.InteropServices.COMException (0x80010105)

$
0
0

 

Hi , guys.I'm a newbie about VM.

 

 

  I work with Vestris.VMWareLib1.4  in VS.Net2008.

 

 

I want  to  make a windows form app to control VMWare  Workstation7.0 and VMWare Server2.0.   The workstation has been installed in localhost  and the Server in the other computer(192.168.0.53) on which WinXP OS runs.  In my codes, I use ListBox control to list the workstation's name and the server's name. When user selects one item in the listbox,  the app will automaticly connect to  the according host.       Some code:

 

 

VMWareVirtualHost host=new VMWareVirtualHost();

 

 

switch (vm_product_type)

{

       case (int)(VMPRODUCTTYPE.Server2):

       #region server2.0

 

 

        string connStr = null;

        if (consolePort != null && consolePort.Length > 0)

        {

                connStr = hostIP + ":" + consolePort;

         }

         else

         {

                connStr = hostIP+ ":8333";

           }

host.ConnectToVMWareVIServer(connStr, account, password, 10);

 

 

            #endregion

            break;

           case (int)(VMPRODUCTTYPE.WorkStation):

host.ConnectToVMWareWorkstation(10);

             break;

            default:

                   breakl;

 

 

}

 

 

:Everytime when user select the other item in the listbox ,I  have  called host. Disconnect() for the previous select  and disposed  the previous host object.

 

 

Problems:

 

 

(1)After the app starts, when user select  the Workstation item ,the app will connect to workstation sucessfully.But after that, when user click the server item,An exception is thrown:

 

 

System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

 

 

at  Interop.VixCOM.VixLibClass.Connect(Int32 apiVersion,Int32 hostType,String hostName,Int32 hostPort,String userName,String password,Int32 options,IVixHandle propertyList,ICallback jobDoneCallback)       

 

 

at Vestris.VMWareLib.VMWareVirtualHost.Connect(ServiceProviderType serviceProviderType,String hostName,Int32 hostPort,String username,String password,Int32 timeout)         

 

 

at Vestris.VMWareLib.VMWareVirtualHost.ConnectToVMWareVIServer(Uri hostUri,String user)name,String password,Int32 timeoutInSeconds

 

 

...........................

 

 

(2)After the app starts,if user click Server item,the app will automaticly connect to the Server sucessfully.But  after that,if user click the Workstation item,the app will throw an exception :

 

 

The procedure entry point gvmoni_session_set_useragent could not be located in the dynamic link library gvmoni.dll.

 

 

 

 

 

so Coulde anyone help me? I have struggled with it for nearly one week.

 

 

Any help will be appreciated. Thanks in advance.

 

 

my email: 424wrl@163.com

 

 

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-<user>/vix-<pid>.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!


Errors 22002 and 22003 with VixHost_Connect()

$
0
0

I am getting started working with the vmware API's. I wrote a c++ tool that calls them.  It is working fine on my build machine with both VMware Workstation and our ESX server. However when I copy the tool to a test machine that has VMware Player installed, I can't get either player or the esx server working. Is there something additional I have to install on my test box to get this working? Is there something else that I have to change in my linker settings?

 

Build system:

Windows 7

VIX 1.8.1.10141

VMware Workstation 6.5.1.5078

 

Test system:

Windows XP SP2

Vmware Player 3.0.0.9911

 

ESX Server:

VMWare ESX Server 3i, 3.5.0, 111522

 

code:

m_ConnType = VIX_SERVICEPROVIDER_DEFAULT;

m_jobHandle = VixHost_Connect(VIX_API_VERSION, m_ConnType, W2A(lpsHostName), 0, W2A(lpsHostUser) , W2A(lpsHostPassword), 0, VIX_INVALID_HANDLE, NULL, NULL);

m_err = VixJob_Wait(m_jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &m_hostHandle, VIX_PROPERTY_NONE);

 

Runtime results:

Build machine: Both workstation and esx server work fine.

Test machine with esx server: Error 22002 – VIX_E_WRAPPER_VERSION_NOT_FOUND

    The specified version was not found.

Test machine with Player: Error 22003 – VIX_E_WRAPPER_SERVICEPROVIDER_NOT_FOUND

    The specified service provider was not found.

 

I have also tried setting the connection type to either VIX_SERVICEPROVIDER_VMWARE_VI_SERVER, VIX_SERVICEPROVIDER_VMWARE_WORKSTATION, or VIX_SERVICEPROVIDER_VMWARE_PLAYER, but the same error occurs.

 

Test machine Log File:

Feb 03 18:38:42.752: app-3892| Log for VixWrapper pid=3876 version=1 build=build-207905 option=Release

Feb 03 18:38:42.752: app-3892| The process is 32-bit.

Feb 03 18:38:42.752: app-3892| Host codepage=windows-1252 encoding=windows-1252

LOG NOT INITIALIZED | W32Util_IsDirectorySafe: Failed DACL num entries check, "..."

Feb 03 18:38:42.752: app-3892| Error: VIX wrapper config file (null)\vixwrapper-config.txt not found.

Feb 03 18:38:42.752: app-3892| Failed to load wrapper configuration file

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws_server_esx-4\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws_server_esx-4\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws_server_esx-4\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws_server_esx-4\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws-5\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws-3\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws-3\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\ws-2\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| config points to non-existent implementation library '(null)\server-1\32bit\vix.dll'

Feb 03 18:38:42.752: app-3892| Player installed version is 3.0.0

Feb 03 18:38:42.752: app-3892| No implementation found for service provider 4, apiVersion -1 installedVersion 3.0.0

Feb 03 18:38:42.752: app-3892| No Vix library found for provider 4 revision -1

Feb 03 18:38:42.752: app-3892| No implementation libraries loaded, cannot call 'VixJob_OnFinishAsynchOpWithHandle'

 

Build machine log file:

Feb 03 19:47:24.747: app-4260| Log for VixWrapper pid=4496 version=1 build=build-207905 option=Release

Feb 03 19:47:24.747: app-4260| The process is 32-bit.

Feb 03 19:47:24.747: app-4260| Host codepage=windows-1252 encoding=windows-1252

Feb 03 19:47:24.747: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.748: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.748: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.748: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.768: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.768: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.768: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.768: app-4260| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

Feb 03 19:47:24.769: app-4260| passed in VIX_SERVICEPROVIDER_DEFAULT, computed hostType as 10

Feb 03 19:47:24.769: app-4260| Loading Vix implementation library C:\Program Files (x86)\VMware\VMware VIX
VIServer-2.0.0\32bit\vix.dll

Feb 03 19:47:25.276: app-4260| unable to load func VixVM_AddRollingTier from library C:\Program Files (x86)\VMware\VMware VIX
VIServer-2.0.0\32bit\vix.dll (127)

Feb 03 19:47:25.276: app-4260| unable to load func VixVM_RemoveRollingTier from library C:\Program Files (x86)\VMware\VMware VIX
VIServer-2.0.0\32bit\vix.dll (127)

Feb 03 19:47:25.276: app-4260| unable to load func VixVM_ListRollingTier from library C:\Program Files (x86)\VMware\VMware VIX
VIServer-2.0.0\32bit\vix.dll (127)

Feb 03 19:47:25.276: app-4260| unable to load func VixHost_OpenVM from library C:\Program Files (x86)\VMware\VMware VIX
VIServer-2.0.0\32bit\vix.dll (127)

Feb 03 19:47:29.021: app-4260| No such function 'VixHost_OpenVM' for version 4

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

 

 

VIX_E_HOST_USER_PERMISSIONS and VIX_E_VM_NOT_RUNNING errors on VixVM_PowerOn and VixVM_PowerOff

$
0
0

 

I'm doing stress testing of automation of spin-up and tear-down of many virtual machines on an ESX4u1 system using the vix libraries.  I've noticed the following behaviors that I was hoping someone at VmWare might be able to shed some light on.

 

 

I occasionally get a VIX_E_HOST_USER_PERMISSIONS error on VixVM_PowerOn (although the machine does actually power on successfully).

 

 

I also occasionally get a VIX_E_VM_NOT_RUNNING error on VixVM_PowerOff [hard poweroff, not graceful shutdown) (although the machine is currently powered on and running).

 

 

I've noticed that the more machines I have running concurrently, the more exacerbated the problem is.  E.g. with 5 machines running, I may get the error once every 100 power-on/power-off cycles.  With 10 machines running, I get the error once every 20 power-on/power-off cycles.  With 20 machines running I get the error once every 10 or so.

 

 

I've also noticed that the power-off errors seems to occur when there is very little time (< 1 second) between the power-on and the power-off cycle.  VixVM_PowerOn has returned success, I've waited for VmWare Tools to come up, and then immediately shut it down.  This leads me to believe that there is possibly some lag time in the bookkeeping on the ESX system.

 

 

The power on error is still a mystery to me since that error doesn't make any sense... I would expect that kind of error with a VixHost_Connect(), but not with VixVM_PowerOn.

 

 

Any light to be shed by someone at VmWare or others in the user community that have seen things like this woud be greatly appreciated.

 

 

Cheers,

 

 

Pete

 

 

What is libgvmomi.so?

$
0
0

 

What is What is libgvmomi.so? Does it belong to glib? I was wondering what license it goes with in the VIX API open source license file.

 

 

 

 

 

thanks!

 

 

holly 

 

 

vmrun runProgramInGuest with Ubuntu guest doesn't work

$
0
0

I'm new to VMWare and the VIX API in general.  As part of a project, I need to move some files to the guest os, perform some computation on them and retrieve them to the host OS. To test vmrun, I wrote a simple C program that appends the number 10 to a new line in a text file. I start the guest OS, move the file over and run the program on it, and retrieve it. But this sequence of steps does not modify the file at all. Below are the sequence of commands I use:

 

1.) vmrun -T ws start /path/to/Ubuntu/vmx/file

    (This brings up the Ubuntu Log in screen but I don't manually log in)

 

2.) vmrun -T ws -gu username -gp passwd copyFileFromHostToGuest /path/to/Ubuntu/vmx/file /home/username/test.txt /home/g_username/test.txt

 

3.) vmrun -T ws -gu username -gp passwd runProgramInGuest /path/to/Ubuntu/vmx/file /home/g_username/test.exe

(This should append to the file. The program completes, but does not display any output on host)

 

4.) vmrun -T ws -gu username -gp passwd copyFileFromHostToGuest /path/to/Ubuntu/vmx/file /home/g_username/test.txt /home/username/test.txt

 

The file I get back is completely unmodified.

 

I think the problem is with step 3.) The program is not running in the guest at all. Any feedback you guys can provide will be appreciated.

how can i clone a vmware machine on ESXi?

$
0
0

Hi

 

i have ESXi server. I am using VSphere Client to connect to VCenter Server. I can see the clone option is available in VCenter Server.

I am using VIX API to crate snapshot, copy data into guest, run program in to guest etc. But the Clone operation is not supported in VIX API. My host machine has windows, and i am using C# to call VIX API.

 

How can i create linked clone since i can not use CLone function of VIX API? I want to create the clone from the development machine, where i am running my C# code. I am not interested in running scripts in VCenter directly.

 

//Rizwan

how to handle Unicode string in vix c api?

$
0
0

 

vix c api handle all string as char*, but sometime when the path of vmx file is unicode, vix can not work. so does vix c api support wide character?

 

 


CID and Parent CID are same in *0001.vmdk files

$
0
0

Hi,

 

Im using VIX api to create snapshot. Im doing in the following way...

 

1. delete the snap if already snap is available. So it merges the data's in flat.vmdk file and the changes will added in *delta.vmdk file.

2. Now creating new snapshot.

3. downloading snapshots except *Delta.vmdk and *.vswp files and logs files.

4. copy to some ESX environment.

5. MAchine is added succssfully.

 

But when i try to power on it says unable to find the file specified. when i check the *00001.vmdk file the CID and parent CID values are same. The values are same as the CID value of vmdk file. i.e unique CID is not created for the child vmdk file. So i have to edit the vmx file and chnge the line *.00001.vmdk to *.vmdk. Now the machine is powered ON successfully.

 

It happens to different guest os. My questions are 1. Why unique CID is not created foer child vmdk and am i doing anything wrong...

 

Please need answers

 

Thanks in advance

ESX 3.5 and the VIX API

$
0
0

 

I'm getting this error when I run "vmrun" on my ESX 3.5 system.

 

 

What library am I missing specifically? Is this a linux library I need to download or is it a VIX API library? 

 

 

Dec 07 10:38:58.223: app-3076464768| Loading Vix implementation library /usr/lib/vmware-vix/VSphere-4.1/32bit/libvix.so

Dec 07 10:38:58.229: app-3076464768| failed to load library /usr/lib/vmware-vix/VSphere-4.1/32bit/libvix.so (/lib/tls/libc.so.6: version `GLIBC_2.3.4' not found (required by /usr/lib/vmware-vix/VSphere-4.1/32bit/libvix.so))

Dec 07 10:38:58.229: app-3076464768| No Vix library found for provider 5 revision -1

Dec 07 10:38:58.229: app-3076464768| No implementation libraries loaded, cannot call 'VixJob_OnFinishAsynchOpWithHandle'

Dec 07 10:38:58.229: app-3076464768| No implementation libraries loaded, cannot call 'Vix_GetErrorText'

 

 

 

thanks

 

 

- h

 

 

How to check for directory existence with vmrun?

$
0
0

Hello,

 

I'm porting an existing VIX interface to use vmrun and I cannot find the way to use the DirectoryExistsInGuest with vmrun. Could be that VMware developers forgot it? Is there a workaround?

 

Thanks in advance.

Memory leak when using the wrapper library?

$
0
0

When compiling the following code against the windows wrapper library, I seem to have an memory leak. After ~1500 reverts is has consumed about 170 MB of RAM. It starts as about ~7MB. After ~50 the memory use has increased to about 12 MB.

 

When trying the same code staticly linked against the VIServer-2.0.0 vix.lib.  The VixJob_Wait call after VixVM_RevertToSnapshot never returns so I do not know if the same problem persist when linking directly. Anyone know what is wrong?

 

 

Compiler:

Microsoft Visual Studio 2008

Version 9.0.30729.1 SP

Microsoft .NET Framework

Version 3.5 SP1

 

Compiler options:

/OUT:"C:\Users\Tyriel\Documents\Visual Studio 2008\Projects\RevertTest\Release\RevertTest.exe" /NOLOGO /MANIFEST /MANIFESTFILE:"Release\RevertTest.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"libcmt.lib" /DEBUG /PDB:"c:\Users\Tyriel\Documents\Visual Studio 2008\Projects\RevertTest\Release\RevertTest.pdb" /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT VixAllProducts.lib kernel32.lib user32.lib advapi32.lib ole32.lib oleaut32.lib ws2_32.lib shell32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

 

VIX API:

VMware-vix-1.11.0-471780

 

 

Code:

 

#include <vix.h>
#include <iostream>

#define NULL 0


void main()
{
  VixError err = VIX_OK;  VixHandle hostHandle = VIX_INVALID_HANDLE;  VixHandle jobHandle = VIX_INVALID_HANDLE;  VixHandle vmHandle = VIX_INVALID_HANDLE;  VixHandle snapshotHandle = VIX_INVALID_HANDLE;  int i = 0;  jobHandle = VixHost_Connect(VIX_API_VERSION,                              VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,                              "https://192.168.0.140/sdk", // 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) { goto abort; }  Vix_ReleaseHandle(jobHandle);  jobHandle = VixVM_Open(hostHandle,                         "[datastore1] vm/vm.vmx",                         NULL, // callbackProc                         NULL); // clientData  err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &vmHandle, VIX_PROPERTY_NONE);  if (VIX_OK != err) { goto abort; }  Vix_ReleaseHandle(jobHandle);  err = VixVM_GetNamedSnapshot(vmHandle, "snapshot", &snapshotHandle);  if(err != 0)  {    std::cout << Vix_GetErrorText(err, 0) << std::endl;  }  else  {    while(true)    {      jobHandle = VixVM_RevertToSnapshot(vmHandle,                                         snapshotHandle,                                         VIX_VMPOWEROP_LAUNCH_GUI, // options                                         VIX_INVALID_HANDLE, // propertyListHandle                                         NULL, // callbackProc                                         NULL); // clientData      err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);      if (VIX_OK != err) { goto abort; }      Vix_ReleaseHandle(jobHandle);      std::cout << ++i << std::endl;    }  }


abort:
  Vix_ReleaseHandle(jobHandle);  Vix_ReleaseHandle(snapshotHandle);  Vix_ReleaseHandle(vmHandle);  VixHost_Disconnect(hostHandle);
}

ListProcessesInGuest doesn't display command line in 64bit VM

$
0
0

Hello all,

 

I don't know if there's a reason or it's a bug, but If I run

 

   > vmrun -T ws -gu guestUser -gp guestPassword listProcessesInGuest VM.vmx
32bit VM will display the command line and 64bit VM will only display the name of the executable.

 

Example:

 

> vmrun -T ws -gu guestUser -gp guestPassword listProcessesInGuest 32bitVM.vmx

 

Process list: 24

pid=0, owner=N\S, cmd=[System Process]

pid=4, owner=N\S, cmd=System

pid=552, owner=NT AUTHORITY\SYSTEM, cmd=\SystemRoot\System32\smss.exe

pid=616, owner=N\S, cmd=csrss.exe

pid=640, owner=NT AUTHORITY\SYSTEM, cmd=winlogon.exe

pid=684, owner=NT AUTHORITY\SYSTEM, cmd=C:\WINDOWS\system32\services.exe

pid=696, owner=NT AUTHORITY\SYSTEM, cmd=C:\WINDOWS\system32\lsass.exe

pid=872, owner=NT AUTHORITY\SYSTEM, cmd="C:\Program Files\VMware\VMware Tools\vmacthlp.exe"

pid=888, owner=NT AUTHORITY\SYSTEM, cmd=C:\WINDOWS\system32\svchost -k DcomLaunch

pid=960, owner=N\N, cmd=svchost.exe

pid=1056, owner=NT AUTHORITY\SYSTEM, cmd=C:\WINDOWS\System32\svchost.exe -k netsvcs

pid=1172, owner=N\N, cmd=svchost.exe

pid=1252, owner=N\L, cmd=svchost.exe

pid=1396, owner=NT AUTHORITY\SYSTEM, cmd=C:\WINDOWS\system32\spoolsv.exe

pid=1536, owner=N\L, cmd=svchost.exe

pid=1692, owner=NT AUTHORITY\SYSTEM, cmd="C:\Program Files\VMware\VMware Tools\vmtoolsd.exe"

pid=1852, owner=NT AUTHORITY\SYSTEM, cmd="C:\Program Files\VMware\VMware Tools\VMUpgradeHelper.exe" /service

[...]

 

> vmrun -T ws -gu guestUser -gp guestPassword listProcessesInGuest 64bitVM.vmx

 

Process list: 178
pid=0, owner=, cmd=[System Process]
pid=4, owner=N\S, cmd=System
pid=276, owner=N\S, cmd=smss.exe
pid=376, owner=N\S, cmd=csrss.exe
pid=408, owner=N\S, cmd=wininit.exe
pid=436, owner=N\S, cmd=csrss.exe
pid=480, owner=N\S, cmd=winlogon.exe
pid=528, owner=N\S, cmd=services.exe
pid=536, owner=N\S, cmd=lsass.exe
pid=544, owner=N\S, cmd=lsm.exe
pid=640, owner=N\S, cmd=svchost.exe
pid=720, owner=N\N, cmd=svchost.exe
pid=812, owner=N\L, cmd=svchost.exe
pid=848, owner=N\S, cmd=svchost.exe
pid=884, owner=N\S, cmd=svchost.exe
pid=256, owner=N\L, cmd=svchost.exe
pid=540, owner=N\N, cmd=svchost.exe
pid=1176, owner=N\S, cmd=spoolsv.exe
pid=1204, owner=N\L, cmd=svchost.exe
pid=1340, owner=N\L, cmd=svchost.exe
pid=1452, owner=N\S, cmd=vmtoolsd.exe
pid=1544, owner=N\S, cmd=VMUpgradeHelper.exe
pid=920, owner=N\S, cmd=svchost.exe

[...]

 

 

Thanks in advance for your help,

 

Sebastien

Viewing all 34639 articles
Browse latest View live


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