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

Objective-C-friendly wrapper around VIX API

$
0
0

First of all I'd like to thank the developers for finally bringing VIX API to Mac OS X. That's a great wrok.

 

I've started a project for packing pure-C VIX API withing ObjC objects, so it can be used in Mac OS X (10.7+, 64bit) applications without cognitive overhead.

It's distributed as a framework. The homepage of the project is https://github.com/Kentzo/VIXObjC.

 

Everyone interested are welcome.


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

vmrun insufficient permissions

$
0
0

hello everyone

when i try to start a vm using the following command

vmrun -t esx -h https://myserver.com/sdk -u domain\user -p ******* start "[datastore1-mydata] vmname/vmname.vmx"

i get an error  message "Cannot open VM: [datastore1-mydata] vmname/vmname.vmx, Insufficient permissions in the host operating system"

 

however when i type vmrun -t esx -h https://myserver.com/sdk -u domain\user -p ******* list

i do get a list of all the vms

 

I have administrator permissions on the said vm and on it's datastore

also, when i try to do the same thing using powercli, it works perfectly, and the VM root user also manages to do this with no problem

i'm guessing it's a permissions thing but what other permissions could i need?

 

thanks

How to get VM path to .vmx file when you have the VM name?

$
0
0

Hi All,

I'm using the latest release of VIX API to power on VMs on an ESX server. I'm working with C# in Visual Studio 2012 and currently, I power on the VM using the following code:

 

VMWareVirtualMachine virtualClientMachine = host.Open(vmMachinePath, 2100);

 

While this works, I think it's better to instead be able to power on the VM when you know the VM name and not the path. So, how can I get the VM path to the vmx file when I know the name of the VM? For example, if my VM on the ESX server is called WIN7GERMAN, how do I then get the path and pass this to the host.Open function?

 

Thanks for any help or code.

John

Clone.Vm using Vestris.VMWareLib

Vix 1.15.1 vmrun "start" "nogui" fails with "The operation was cancelled" on non-commercial VMware Player

$
0
0

Hi,

I've been using "vmrun" for some time now to launch my VM non-interactively using VMware Player under the non-commercial license.  I normally launch my VM with:

vmrun start my-vm.vmx nogui

I recently upgraded to VMware Workstation Player 12.0.1 and VIX 1.15.1.  Now when I try to start it using VIX 1.15.1, I get the following error output:

Error: The operation was cancelled.

When I look in the VMware log, I see the following text:

2015-11-05T17:39:45.687Z| vmx| I125: [msg.License.no_valid_license_see_website] Cannot find a license key to unlock this version of VMware Workstation.
2015-11-05T17:39:45.687Z| vmx| I125+ Go to our web site at "http://vmware.com/info?id=27&build=3160714" to obtain a valid license key.
2015-11-05T17:39:45.687Z| vmx| I125: ----------------------------------------
2015-11-05T17:39:45.696Z| vmx| I125: LICENSE no valid one found
2015-11-05T17:39:45.696Z| vmx| I125: Module 'License' power on failed.

However, I have already completed the license dialog box shown when VMware Player was first launched, and provided my email address.  Launching VMware Player no longer how the license dialog and the application operates fine.

If I execute the "vmrun" command with the "gui" argument instead, it starts VMware Player propertly and my VM runs fine.   However, I don't *want* the VMware Player interface to appear - the VM is a server VM.

Is this change intentional or a bug?

TIA,

James Bray

API for condition wait

$
0
0

Hi,

 

can any one suggest me which api I used for waiting for an condition wait instead of vmk_worldWait() , because system is crashed while using this api in Interrupt handler.

 

Error :

2016-04-13T11:24:15.519Z cpu2:33075)@BlueScreen: NOT_IMPLEMENTED bora/vmkernel/sched/cpusched.c:9556

2016-04-13T11:24:15.529Z cpu2:33075)Code start: 0x418018800000 VMK uptime: 0:00:03:34.556

2016-04-13T11:24:15.538Z cpu2:33075)0x4390c999af90:[0x418018876eea]PanicvPanicInt@vmkernel#nover+0x37e stack: 0x4390c999b028

2016-04-13T11:24:15.550Z cpu2:33075)0x4390c999b020:[0x418018877205]Panic_NoSaveNoReturn@vmkernel#nover+0x4d stack: 0x4390c999b080

2016-04-13T11:24:15.562Z cpu2:33075)0x4390c999b080:[0x418018855aec]Int6_UD2Assert@vmkernel#nover+0x12c stack: 0x418018b9c8a9

2016-04-13T11:24:15.573Z cpu2:33075)0x4390c999b120:[0x4180188c6044]gate_entry_@vmkernel#nover+0x0 stack: 0x0

2016-04-13T11:24:15.584Z cpu2:33075)0x4390c999b1e0:[0x418018a1173e]CpuSchedWait@vmkernel#nover+0x26e stack: 0x0

2016-04-13T11:24:15.594Z cpu2:33075)0x4390c999b260:[0x418018a11a2b]CpuSchedTimedWaitInt@vmkernel#nover+0x9f stack: 0x4390c999b3a0

2016-04-13T11:24:15.607Z cpu2:33075)0x4390c999b2c0:[0x418018a11ac1]CpuSched_TimedWait@vmkernel#nover+0x19 stack: 0x4305f5667360

2016-04-13T11:24:15.619Z cpu2:33075)0x4390c999b2e0:[0x41801889afdf]vmkWorldWait@vmkernel#nover+0xa3 stack: 0x50

2016-04-13T11:24:15.629Z cpu2:33075)0x4390c999b320:[0x41801889b078]vmk_WorldWait@vmkernel#nover+0x84 stack: 0xc3

How do I interactively login to Windows?

$
0
0

 

Hello,

 

 

I'm automating a Windows XP VM.  I've had success so far doing what I need with LoginInGuest, but for some tasks I'd like to actually log in at the Windows login prompt so the UI comes up.

 

 

I realize that I can save a snapshot with the user already logged in, but I would prefer to have my snapshots with the VM powered off.

 

 

Is there a recommened technique for scripting a login at the Windows login prompt?

 

 

 

 

 

Thanks,

Ben

 

 


vmrun error?

$
0
0

 

I am new to the VIX API (and also not a developer. . .just looking for ways to automate my admin tasks).  I started experimenting with vmrun to manage guests on ESX 3.5 U3.  the vmrun version is 1.6.3 (installed with Workstation 6.5 U1).

 

 

 

 

 

When I start this command:

 

 

C:\Program Files\VMware\VMware VIX>vmrun -T esx -h http://esx03.mydomain.edu/sdk -u

root -p secretpw -gu administrator -gp mypassword runProgramInGuest "[Mylu

n0]server1/server1.vmx" c:\windows\system32\net.exe stop dhcp

 

 

 

 

 

I get:

 

 

 

 

 

Error: The specified service provider was not found

 

 

 

 

 

What am I doing wrong?

 

 

 

 

 

Thanks,

 

 

 

 

 

Jeff 

 

 

Using Vix to list all VMs in an ESX Virtual Network

$
0
0

I am trying to write a program using Vix 1.6.2 to automate some testing using VMs on ESX 3.5. I am familiar with using the Vix API with Workstation 6.5. I would like to know if there is any way to get a list of the VMs on an ESX server? It would help if I could get a list of machines in each of the Virtual Networks I have set up, but just a general list of all machines that ESX is managing would be good too. What I'm trying to do is set up a loop that will loop through all the VMs and run a program on each one. Thanks!

VIX API's Constants

$
0
0

 

Hi,

 

 

Can any body provide me the link on which i can find the documentation for VixCom Constants?

 

 

To explain my requirement, i here by quote and example:

 

 

" VixCOM.Constants.VIX_API_VERSION " is a constant used in one of the code samples given by VMWare. I saw there are lot of othe such constants. But i do not know the purpose of these constants. I am looking for documentation where i can find meaning for all constants.

 

 

Thanks in advance,

 

 

Cheers,

 

 

Shub

 

 

Using CopyFileFromHostToGuest() with ESX 3.5

$
0
0

I'm trying to copy a file from either my workstation or from a folder in one of my ESX datastores using CopyFileFromHostToGuest(). I have tried multiple ways of accessing the file that needs to be copied. To copy it from the ESX server datastore I have tried CopyFileFromHostToGuest("\[storage1\] Folder/filename.txt", "file_path_in_vm", etc...), but that wasn't working. Then I tried to copy a file from my local machine using CopyFileFromHostToGuest("C:\Folder\filename.txt", "file_path_in_vm", etc...), but that didn't work either. Is there something I'm missing? In both cases I am getting a vixError of 4, which means the file is not found. It would be ideal if I could use CopyFileFromHostToGuest() to copy a file on the ESX server to a VM that was running in ESX.

Commit a Snapshot (backup)

$
0
0

 

Hello,

 

 

 

 

 

Is there a way to commit a snapshot with VIX in VMware server 2?

 

 

I am asking because I would like to backup the VMDK as quickly as possible, create snap, release lock on vmdk, copy vmdk, commit snap.

 

 

Any other ideas for free back up solutions?

 

 

 

 

 

Chris

 

 

VMware VIX API FindItems() method never returns when querying for registered VMs

$
0
0

Hi,

 

I am using VMware Workstation 6.5 on Windows Vista x64.

I am trying to write some C# code that uses VMware Vix v1.6.1 COM API to get a list of registered virtual machines.

 

The code I am using is as follows:

 

    using System;

    using VixCOM;

     

    namespace ConsoleApplication48

    {

         internal class Program

         {

              private static void Main()

              {

                   var lib = new VixLibClass();

                   object results = null;

     

                   var job = lib.Connect(Constants.VIX_API_VERSION, Constants.VIX_SERVICEPROVIDER_VMWARE_WORKSTATION, null, 0,

    null, null, 0, null, null);

     

                   var err = job.Wait(new[] {Constants.VIX_PROPERTY_JOB_RESULT_HANDLE}, ref results);

 

               if (lib.ErrorIndicatesFailure(err))

                    Console.WriteLine("Error: " + err);

 

               var host = (IHost)((object[])results)[0];

 

               job = host.FindItems(Constants.VIX_FIND_REGISTERED_VMS, null, -1, new DiscoveryCallback(lib));

               job.WaitWithoutResults();

 

               host.Disconnect();

          }

     }

 

     internal class DiscoveryCallback : ICallback

     {

          protected VixLibClass lib;

 

          public DiscoveryCallback(VixLibClass lib)

          {

               this.lib = lib;

          }

 

          #region ICallback Members

 

          public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)

          {

               // this method is never called

          }

 

          #endregion

         }

    }

 

 

I am aware that the COM dll is 32-bit, so I made sure that the test application is compiled as 32-bit.

Also I made sure that all VMware services are running.

 

There are no exceptions thrown, no errors returned (as far as I can see) and no events written into the event log.

 

Strangely enough the above code works when I try to get a list of running VMs using constant VIX_FIND_RUNNING_VMS.

 

Any ideas on what might be causing this?

 

 

Thanks,

 

Arnie

Anyone using VB6 ?

$
0
0

 

Hi,

 

 

I'm trying to start VMWare via VixCOM and VB6, but am receiving the typical-to-vb6 error of "Method 'Wait' on object 'IJob' failed" and not a lot more information.

 

 

Has anyone else had any success with VB6?

 

 

 

 

 

Many thanks,

 

 

Jenk

 

 


vix calls Mircosoft sfu to run shell scripts

$
0
0

 

hello, i am new to vmware vix api, and i wanted to use vix api to call MS service for unix (sfu) in guest os and run a shell script. i am not sure how can i get this done.

 

 

does anyone have this kind of expeerience?

 

 

Please help

 

 

Thanks very much

 

 

 

 

 

K

 

 

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!

 

 

runprograminguest and usercontext (ubuntu)

$
0
0

 

if i run runprograminguest with -gu and -gp the usercontext is't correct

 

 

if i run

 

 

touch filename

 

 

the owner is 27 (which is the uid not the name)

 

 

running a program with sudo bringst " uid 27 does not exist in passwd file!

 

 

running runprograminguist with user root works fine (but root isn't useable on ubuntu)

 

 

 

 

 

 

 

 

Problem connecting to host with Python and VixCOM

$
0
0

Hello,

 

I'm trying to connect to the localhost using Python and VixCOM.

The server is VMWare Server 2.0.0 and VIX API 1.6 running on WinXP

 

But I always get the error 18002 VIX_E_INVALID_HOSTNAME_SPECIFICATION

As far as I know, None is the equivalent of Null, so I'm wondering what am I doing wrong...

 

Here is my code snippet:

 

lib = win32com.client.Dispatch("VixCOM.VixLib")

job = lib.Connect(VIX_API_VERSION, #apiVersion

VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,#hostType

None,#hostName

0,#hostPort

None,#userName

None,#password

0,#options

None,#propertyList

None)#jobDoneCallback

 

Thanks in advance for your help,

Patrick

Multithreading in VIX API: more crashes, any news on fixes?

$
0
0

I've been trying to extend our test automation to parallelize against multiple virtual machines. I am using VMWareTasks. I make a connection to a different VM on two threads, then use the handle(s) returned, etc. This is a collection of crash messages followed by access violations that I got recently. I'll edit with more as i see them

 

 

Most of the issues happen on connect or disconnect.

 

    • ** (RemoteInstaller.exe:5572): WARNING **: ???: object class `GVmomiSession' has no property named `state'

    • ** ERROR *: g_type_plugin_() invalidly modified type GVmomiSession' aborting (popup)

 

Is there any news on a 1.6.3 that might fix these problems? I'd be really happy to try a beta too.

 

Thx

dB.

Viewing all 34639 articles
Browse latest View live


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