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

encounter VIX error: Cannot read the virtual machine configuration file

$
0
0

 

I use VIX1.6.1 and encounter VIX error "Cannot read the virtual machine configuration file"

 

 

Then I try to use vmrun to run below command and get the same error

 

 

 

 

 

vmrun -T ws listSnapshots "C:\virtual machines\TMMA2\01_TMMA_Server\Windows Server 2003 Enterprise Edition Eng.vmx"

 

 

VIX error: Cannot read the virtual machine configuration file 

 

 

 

 

 

Does anyone know how to prevent this error? Thanks very much.

 

 

 

 

 

Guile

 

 


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!

 

 

VixJob_Wait API results segmentation fault after VixVM_PowerOn

$
0
0

 

All,

 

 

Trying some VM automation Code using VIX API SDK. After Loading  libvixAllProducts.so, VM registers successfully.

 

 

But when I tried to PowerOn,  VM VixJob_Wait give me segmentation fault after executing VixVM_PowerOn.

 

 

Observation:

 

 

1. Even it gives me segmentation fault, VM got powered on ESX server.

 

 

2. If i remove wait API with some sleep function, still i will get some segmentation fault.

 

 

 

 

 

Any suggestion, comments will be appriciated.

 

 

thanks

 

 

-tej

 

 

Error "Insufficient permissions in host operating system" when an Administrator on a folder try to power on a VM with VIX API

$
0
0

I have granted an user as an Administrator on the specified folder, her tried to power on a VM with calling VIX API but get the below error:

'Insufficient permissions in host operating system'.

 

 

 

 

What permission does the user need if he want to power on/off a VM with invoking VIX API?

vmrun clone: "The Operation is not supported"?

$
0
0

Hi,

 

I am trying to clone a VM using vmrun with vSphere/ESX4 using the following command line:

 

    "C:\Program Files\VMware\VMware VIX\vmrun.exe" -T esx -h https://44.1.1.122/sdk -u root -p password clone "[datastore1] Win 2003 Template/Win 2003 Template.vmx" "[datastore1] Win 2003 Template-X/Win 2003 Template-X.vmx" full

 

but I get the error:

 

    Error: The operation is not supported

 

What about the operation is not supported? I haven't seen anything that suggests that ESX4 doesn't support clone.

 

Thanks ahead of time.

 

CC

[FileExistsInGuest] Methode failing with "The operation is not supported for the specified parameters" on VMWARE Server 1.0.10

$
0
0

 

Hi Community Members,

 

 

With the methode  FileExistsinGuest I am trying to determine, whether a file exists in the guest system.

 

 

It works fine with vmware player 3.1 and a windows 7 system.

 

 

But when calling the same function on a vmware server 1.0.10 with a XP SP3 system I receive an error:  "The operation is not supported for the specified parameters"

 

 

The parameter is: VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_GUEST_OBJECT_EXISTS

 

 

Any ideas why this parameter seems not available for the wait function?

 

 

Best Regards

 

 

Frank

 

 

 

 

 

 

 

 

[VIX API 1.10.1] Problems while connecting to vmware player 3.1.1

$
0
0

 

Hello,

 

 

Some days ago a new version of VMWARE Player (3.1.1) was released.

 

 

We are using VIX API to start vmware images. The code is .

 

 

This code works fine with vmware player 3.1. But with the new version 3.1.1 we are getting a connection error saying, that the specified version was not found.

 

 

Any idea whether the new version of vmware player is not longer supported by VIX API? Or if yes: What are the changes?

 

 

Thanks for a hint.

 

 

Best Regards

 

 

Frank R.

 

 

 

 

        serviceProviderVM = VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_PLAYER

            ' Connect VMware Workstation or VMware Server.

            job = libc.Connect(VixCOM.Constants.VIX_API_VERSION, serviceProviderVM, Nothing, 0, Nothing, Nothing, 0, Nothing, Nothing)

            ' Wait for results of connecting to virtual machine host.

        vmErr = job.Wait(propertyIDS, results)

        job.WaitWithoutResults()

        If libc.ErrorIndicatesFailure(vmErr) Then

            Err.Raise(VIX_ERROR_NUM, Nothing, libc.GetErrorText(vmErr, Nothing))

        Else

 

 

 

 

Start: 08-17-2010 16:28:59

Error during connecting to C:\VirtualMachines\Win7_64Bit\NONPERSISTENT_Windows7x64.vmx

Description: The specified version was not found

Error during starting virtual machine.

 

 

 

 

 

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


Unable to connect to ESXi 4.0.0 using vmrun

$
0
0

 

Hello dear experts,

 

 

 

 

 

I have a Linux machine where VIX API 1.10.1 is installed. I'm trying to list the available VMs of an ESXi 4.0.0 machine, using the command below:

 

 

vmrun -T esx -h https://10.x.x.x/sdk -u xxxx -p xxxx list

 

 

 

 

 

The result is:

 

 

Unable to connect to host.

Error: Failure sending/receiving network data

 

 

 

 

 

Here are the logs:

 

 

 

 

 

>> vixWrapper-6207.log

Sep 22 20:51:44.098: app-140105407071984| Log for VixWrapper pid=6207 version=1 build=build-266898 option=Release

Sep 22 20:51:44.098: app-140105407071984| The process is 64-bit.

Sep 22 20:51:44.098: app-140105407071984| Host codepage=UTF-8 encoding=UTF-8

Sep 22 20:51:44.098: app-140105407071984| config points to non-existent implementation library '/usr/lib/vmware-vix/server-1.0.9/64bit/libvix.so'

Sep 22 20:51:44.098: app-140105407071984| config points to non-existent implementation library '/usr/lib/vmware-vix/ws_server_esx-4/64bit/libvix.so'

Sep 22 20:51:44.098: app-140105407071984| config points to non-existent implementation library '/usr/lib/vmware-vix/ws_server_esx-4/64bit/libvix.so'

Sep 22 20:51:44.098: app-140105407071984| config points to non-existent implementation library '/usr/lib/vmware-vix/ws_server_esx-4/64bit/libvix.so'

Sep 22 20:51:44.098: app-140105407071984| config points to non-existent implementation library '/usr/lib/vmware-vix/ws_server_esx-4/64bit/libvix.so'

Sep 22 20:51:44.098: app-140105407071984| config points to non-existent implementation library '/usr/lib/vmware-vix/server-1/64bit/libvix.so'

Sep 22 20:51:44.098: app-140105407071984| Loading Vix implementation library /usr/lib/vmware-vix/VSphere-4.1/64bit/libvix.so

 

 

 

>> vix-6207.log

Sep 22 20:51:44.116: app-140105407071984| Log for Vix pid=6207 version=-1 build=build-266898 option=Release

Sep 22 20:51:44.116: app-140105407071984| The process is 64-bit.

Sep 22 20:51:44.116: app-140105407071984| Host codepage=UTF-8 encoding=UTF-8

Sep 22 20:51:44.116: app-140105407071984| Foundry Init: setting up global state (0 threads)

Sep 22 20:51:44.117: app-140105407071984| Vix_InitializeGlobalState: vixLogLevel = 0

Sep 22 20:51:44.117: app-140105407071984| Vix_InitializeGlobalState: vixApiTraceLevel = 0

Sep 22 20:51:44.117: app-140105407071984| Vix_InitializeGlobalState: vixDebugPanicOnVixAssert = 0

Sep 22 20:51:44.117: app-140105407071984| Vix_InitializeGlobalState: vixLogRefcountOnFinalRelease = 0

Sep 22 20:51:44.117: app-140105407071984| Vix_InitializeGlobalState: asyncOpWarningThreshold = 1000000

Sep 22 20:51:44.117: app-140105407071984| Vix_InitializeGlobalState: enableSyncOpSelection = FALSE

Sep 22 20:51:44.117: app-140105407071984| Vix_InitializeGlobalState: enableExternalThreadInterface = TRUE

Sep 22 20:51:44.117: app-140105407071984| VixHost_ConnectEx: version -1, hostType 5, hostName https://10.x.x.x/sdk, hostPort 0, options 528

Sep 22 20:52:59.372: app-140105405720848| Vix: : VixTranslateVimException: Received an invalid response fault.

Sep 22 20:52:59.373: app-140105405720848| Vix: : VixTranslateVimException: basicHttp/libcurl error code is 48, translated to VixError VIX_E_NET_HTTP_TRANSFER (30200).

Sep 22 20:52:59.373: app-140105405720848| Vix: : VixTranslateVimException: response message is "".

 

 

 

 

 

Have you experienced this basicHttp/libcurl error code is 48, translated to VixError VIX_E_NET_HTTP_TRANSFER (30200). error before?

 

 

Can you please give me a hint on how to overcome that?

 

 

Thank you in advance for your answer!

 

 

Can we use VIX to get VMNet info from Workstation

$
0
0

Hi,

 

I am using VIX for communicating with VM i.e. to start and run the apps inside VM. I am curious to know , is there any way to get the available VMNet info from Workstation. Usually VMnet0, Vmnet1 and VMNet8 for Bridge, host and NAT respectvely. I want to are rest of VMNet are free for use ?

 

The information is available in Virtual Network Editor ( i.e.Edit -> Virtual Network Editor ) but i want to access the same information through code.

 

Thanks in advance,,,,,

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.

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"; 

Run Program in Guest as an Administrator

$
0
0

I'm attempting to automate some machine set-up tasks using the VIX API with VMware Workstation v9 using VBS. I have hit a blocker when attempting to use the "RunProgramInGuest" option on Windows 8, the program is failing as it is not being run as an administrator.

 

Set job = vm.RunProgramInGuest("C:\windows\system32\cmd.exe", "/c C:\test\test.bat", 0, Nothing, Nothing)

 

Any ideas how I can force this to run as an administrator? UAC is currently turned off.

 

Thanks

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.

VMWare API: Create a Web for see my VMMachines status,info...

$
0
0

Hi all,

 

I'm new in the VMWARE API World. I wish to create a web that let users check their VMMachine Info, status and also Reboot,Start or Shutdown.

 

I've been looking for some info but I'm becoming crazy because the official documentation is from 2004 and in Perl Language. I wish use PHP or Ptyhon if can be possible.

 

Anybody can help me? I want to know how to connect to my VMWare Host and check it out the information.

 

What language I have to use? How can i find information about connect and show info?

 

Lots of Thanks

PowerON VM from remote via PSEXEC and API doesn't work

$
0
0

Frame:

VMware Workstation 10.0

VS-Studio 2012

.NET 4.0

Windows 7 64bit

Vestris.VMwareLib.Dll [version 1.7] <-- wrapper for VIX API

Installed VMware-VIX-1.13.1-1379776.exe

-----------------------------------------------------------------------------------------------------------------------

 

I have a small C#-program to "shutdown" and "poweron" VM's. If I start my console-pgm with parameters from local in a BAT-file, all works fine.

 

Now i tried to start my pgm from a remote pc via psexec. The poweroff option works fine, the poweron option fails with the following error:

 

Failed to power on virtual machine: powerOnOption=512 timeoutInSeconds=120

 

Does anyone have an idea why?

 

psexec command> psexec \\xxx.xxx.xxx.xxx -u "{domain}\{user}" -p "{password}"  -s "D:\Programme\VMoperations\VMstart_XXNNV.bat

 

ADDON {05.03.2014 15:59}: I  tried it with PAEXEC and REEXEC, they failed too. And I changed my BATCH-file to call the VMrun.exe, but failed too. I think, it's a bug of VMware ?!?!?!

 

----------------------------------------------------------------------------------------------------------------------

 

BAT-File VMstart_XXNNV.bat:

SET fwpath="D:\Programme\VMoperations"

%fwpath%\VMoperations.exe -location:{vmpath} -vmname:XXNNV -o:poweron

----------------------------------------------------------------------------------------------------------------------

 

C# source VMoperations.exe:

reference to Vestris.VMWareLIb

refernce to Interop.VixCOM

--------------------------------------------------------------------------------------------


using Vestris.VMWareLib;  <-- version 1.7

...

 

private static void VMwork(string location, string vmName, string operationType)

        {

            try

            {

                using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())

                {

                    virtualHost.ConnectToVMWareWorkstation();

                    vmxName = location + vmName + @"\" + vmName + @".vmx";

                    using (VMWareVirtualMachine virtualMachine = virtualHost.Open(vmxName))

                    {

                        vmPowerState = virtualMachine.PowerState;

 

                        switch (operationType)

                        {

                            case "shutdown":

                                if (vmPowerState == 1096)

                                {

                                    virtualMachine.ShutdownGuest();

                                }

                                break;

                            case "poweroff":

                                if (vmPowerState == 1096)

                                {

                                    virtualMachine.PowerOff();

                                }

                                break;

                            case "poweron":

                                if (vmPowerState == 2)

                                {

                                    virtualMachine.PowerOn(120);

                                }

                                break;

                        }

                        virtualMachine.Dispose();

                    }

                    virtualHost.Disconnect();

                    virtualHost.Dispose();

                }

                retCode = 0;

            }

            catch (Exception ex)

            {

                retCode = 1;

            }

        }

 

I tried everything, read dozends of internet pages, but found no info. Ever user on local and remote pc have full admin rights.

 

Best regards Hipp1010

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

 

 

Viewing all 34639 articles
Browse latest View live




Latest Images