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

using "vmrun" to run "vmware-uninstall-tools.pl" fails to remove"/usr/lib/vmware-tools/sbin32/vmware-hgfsmounter".

$
0
0

Hi,

 

I try to automate updating vmtools for our closed applications (linux based). I use the vmrun to run the "vmware-uninstall-tools.pl" on the vm. However, I got the following error:

 

Unable to remove the file "/usr/lib/vmware-tools/sbin32/vmware-hgfsmounter".

Execution aborted.

 

Problem uninstaling VMware Tools 4.0.0-208167 from /usr/bin/vmware-uninstall-tools.pl

 

If I login the vm and run the script directly, I don't have the problem.

 

Any possible problem or suggestion on this?

 

Thanks


There was an error in communication

$
0
0

ESX version: 3.5 U4

VIX version: latest

 

Command run:

C:\Program Files (x86)\VMware\VMware VIX>vmrun -T esx -h https://172.17.235.10/sdk -u serveruser -p serverpass -gu administrator -gp guestpass runProgramInGuest "[shared2] APDNA1101/APDNA1101.vmx" c:\windows\notepad.exe
Error: Cannot open VM: [shared2] APDNA1101/APDNA1101.vmx, There was an error in communication=

 

We are having a problem connecting to an ESX 3.5 U4 server with VIX. Snapshot is reverted ok, image powers up ok, but cannot connect to the guest image with VIX. We can copy files to the image without issue however. Any ideas what could be wrong here?

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

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

$
0
0

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

 

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

 

Any help would be greatly appreciated.

 

Thanks,

 

Andy


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

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

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

print Time(), "Logging in as $userName...";
$err = VMLoginInGuest(
      $vmHandle,      $userName, # userName      $password, # password      0); # options
CheckError("VMLoginInGuest() failed");
print "Logged in\n";  

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

Trying to use VIX coupled with BlackBerry 10 simulator

$
0
0

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

 

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

PowerOn() doesn't work if remote Windows sessions are open

$
0
0

Dear Community Members,

    

I would like to get support regarding VMWare Workstation. We are using the VMWare Workstation 9.0.1 (9.0.1 build-894247) to run tests directly on TFS build agents.

    

It means that our Team Foundation Server 2010 customized workflow executes a custom tool (as a separate process via Process.Invoke activity) that internally uses the VIX API (COM InterOp) to create, to fill and to run interactive tests on
virtual machines (8-24 VMs are going to be started parallel depending on the current build agent's performance).

The application itself is a console app written in C# (.NET Framework 4.0).

 

The virtual machines are created as linked clones in case of every new triggered build.    

The whole build process is running as a Windows service in the name of a build service account with Power User privileges.

The other possible solution “Running the build service host as an interactive process” supported by TFS build service on build agents is not used.

 

Everything works fine, if there is no open user session on the given build agent. But if accounts are logged in (remotely disconnected sessions), then the VIX-API call “IVM2.PowerOn()” throws an exception.

    

Date:
16.07.2013 13:16:57 368    VM_1 Error: Node failed, exception
received:*****.XXX.TestController.VMWare.VmWareException: There was an error in communication

at *****.XXX.TestController.VMWare.VmWareInterop.Check(UInt64 errCode)

at *****.XXX.TestController.VMWare.VmWareVirtualMachine.PowerOn(Int32 powerOnOptions, Int32 timeoutInSeconds)

at *****.XXX.TestController.BusinessLogic.VMNode.Initialize()

at *****.XXX.TestController.BusinessLogic.VMNode.Execute()

   

Based on the support site (http://www.vmware.com/support/developer/vix-api/vix16_reference/errors/errors.html) of VMWare, this error is as follows:

 

14010 – VIX_E_HOST_TCP_SOCKET_ERROR There was an error in communication.

    

Has anyone an idea why remotely disconnected, but open user sessions cause such a strange behavior at all?

 

It would be very important for us, because our build farm is very huge and for maintenance purposes it is not acceptable, if remote sessions are not allowed at all………

 

Thanks in advance!

 

Best regards,

József Vadkerti

VIX API 1.11.0 / 1.12.0 vmrun.exe Crashes

vmrun clone with vCenter and ESXi 5.x

$
0
0

My basic question is does “vmrun clone” work with vCenter 5.5 and/or ESXi 5.5?  If “vmrun clone” is supported with vCenter/ESXi, then are there any special requirements to make it work.  For example, do I need a special license or any special configuration on vCenter/ESXi?

 

When I attempt to use “vmrun clone” with either vCenter 5.5 or ESXi 5.5 I get the error below:

 

Error: The operation is not supported

 

FYI…

 

  • I know that clone was not supported on vSphere 4.x, but I have vSphere 5.5.


  • I have read some posts that suggest that clone is a feature of vCenter, but not ESXi.  I am OK with this.  I would actually prefer to do the clone through vCenter.

 

 

Additionally, except on VMware Server (discontinued), you can clone a virtual machine image to another

virtual machine.

and

(Cloning not supported on VMware Server or on VMware Fusion.)

 

To me, this implies that “vmrun clone” is supported against both vCenter and ESXi.


Am I trying to do something that is never going to work, or have I simply not found the magic combination of parameters yet?


IP Adress changing after reverting a snapshot of virtual machine

$
0
0

Hi!

 

In my scenario I use a virtual machine with installed Windows 7. Network is configurated by Bridged connection.

When I revert to my default snapshot and get an ip address of the virtual machine I begin copy files to a shared folder (which address I compute with ip address).

After few seconds virtual machine changes its ip address and path to the shared folder becomes invalid.

I suppose that it happens because virtual machine needs some time to refresh its ip address after reverting.

I tried to use commands ipconfig /release and ipconfig /renew right after virtual machine reverting, but it didn't work.

 

Is the any ways to force ip address changin, or any way to wait it programmaticaly. Unfortanly we can't use static ip addresses and bridged connection looks as the best way in our envirement.

 

 

Thaks! :)

Which API / SDK to use for creating and Configuring a VM

$
0
0

I'm looking to automate some tasks at work around VM creation and installation and was wondering which APIs / SDKs I should use?

 

I can see that VIX would allow me to automate tasks on the VM so I can use that to install the required software and copy files onto the VM I think, but is there an API / SDK that I can use to create a VM, set up HDD sizes and CPU / RAM allocation etc and possibly install windows from an ISO?

 

I would ideally like to interact with VMWare Workstation as the VMs generated would be used on workstation, but if not I could create the VM on an ESX server.

 

Apologies that this is a bit of an open / vague question but I wasn't really sure if this was even possible or where to look.

Linux Guest OS Customization not setting GATEWAY in ifcfg-ethx file

$
0
0

Hi All,

 

When i deploy a VM from Linux (CentOS 6.5) template, GATEWAY is not getting added to ifcfg-ethx file instead it is getting added to route-ethx file. Due to which i'm not able to reach the gateway from the VM. Kindly suggest, if there any fix for this.

 

I'm making soap call using java.

 

Thanks in advance.

VMrun returns "specified version not found" against ESX 5.5

$
0
0

Hi All,

 

VMrun returns "specified version not found" against ESX 5.5

Running from Linux Redhat with VIX 15.0

Are there any solutions , tried to edit file /usr/lib/vmware-vix/viwrapper-config.txt

 

I have able to figure out what is the format for ESX server.

 

Thanks In Advanced

CopyfilefromHosttoGuest is not working: Throwing Exception

$
0
0

Hi,

 

I wrote a script to Automate file copy from my base machine(win7) to vmware workstation hosting windows 7 guest. I loaded Vestris.VMWareLib.dll(Version 1.6) in into Powershell and able to perform power on, Create directory and create snapshot but couldn't copy file from host to guest. Is there anything missing to perform file copy?

 

VIX downloaded from - VMWareTasks 1.6 - VMWareTasks: C# VixCOM wrapper library & tools (MOVED TO GITHUB) - Home

Vmware workstation: 7.0.0

Powershell: 3.0

Host: Windows 7 32 bit

Guest: Windows 7 32 bit(Running on vmware workstation 7.0.0 build-203739)

 

Script:

 

Add-Type -Path "D:\Vmware\vm\Interop.VixCOM.dll"

add-type -path "D:\Vmware\vm\Vestris.VMWareLib.dll"

$newvm =  New-Object "Vestris.VMWareComLib.VMWareVirtualHost"

$newvm.ConnectToVMWareWorkstation()

$power = $newvm.Open("D:\windows7 image\Windows 7.vmx")

$power.PowerOn()

$power.logininguest("test123","123456")

$folder = "tr1254as7"

$power.RunProgramInGuest("cmd.exe","/c md $folder")

$power.copyfilefromhosttoguest2("D:\testcopy\test.log","C:\$folder\test.log",1200)

 

Exception:

Exception calling "CopyFileFromHostToGuest2" with "3" argument(s): "Failed to

copy file from guest to host: guestPathName="D:\testcopy\test.log"

hostPathName="C:\tr1254as7\test.log" timeoutInSeconds=1200"

At line:7 char:1

+ $power.copyfilefromhosttoguest2("D:\testcopy\test.log","C:\$folder\test

.lo ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : Exception

 

I tried Copyfilefromhosttoguest() and Copyfilefromhosttoguest2() none of them is working.

Could any help me out, i am almost completed automation apart from copy file. It would be really helpful is someone answer.

 

Thanks,

Pavan

VIX from PHP?

$
0
0

 

Has anybody used PHP to talk to VIX?

 

 

COM seemed the option from a windows standpoint, has anybody already done this?

 

 

 

 

 

Using the appropriate API for C#

$
0
0

Hey all smart people out there!  I am hoping to get help regarding some C# tasks. 

 

Can someone please let me know which API I should be using to get Task info out of vCenter and into my own database?  I was thinking of creating a Windows service and using it to suck out the task info and into my own data format so I can view history, etc.  I'm getting confused between VIX, Vim25Api, VMware.API, etc. 

 

I'm a Systems guy, but I like to write my tools in C#.  I am not a programmer, but I can work my way through a lot of these things.  This one, however, is just getting so confusing.  I can get a list of VMs and their status from the VMware.Vim API easily enough, but when I dig into it to get Task and Event info, I get lost.

 

Thanks!

Joe


How to switch to specified tab by hot key in vmware workstation 10 in full screen mode?

$
0
0

How to switch to specified tab by hot key in vmware workstation 10 in full screen mode?

I googled and found the below link, but it's for vmware 5.

https://www.vmware.com/support/ws5/doc/ws_special_config.html

It does not work on vmware 10.

Anyone know how to do it on vmware 10?

Host OS: Wins 7.

Is there any vmware api to do that? I would create a window app for it if api is available.

I am new to vmware world, too many sdk and api out there and it confuse me..

Can someone point me to the right sdk for this..

Thanks a lot!

VIX API - There was an error in communication

$
0
0

Hi,

 

I cannot execute any VIX API vmrun command once the Virtual Machine is powered on.

I can list all virtual machines, and power the machines on, but once the machine is powered on, every vmrun command fails with the error "There was an error in communication"

 

The VIX API is installed on a different computer of the Vmware Server (Host) .

Both firewalls are turned off.


Does anybody know what can be the problem?

Thanks.

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-perl installation

$
0
0

Hi All,

 

I wanted to take a quick poll as far as what kind of configuration people are installing vix-perl onto? I've tried many make programs, compilers, and ActivePerl versions, and I have not been able to successfully install vix-perl. Mostly there have been (apparently) problems with the makefile creation (errors when trying to make), or problems running perl after an apparent "successful" install.

 

I've tried make, nmake, cygwin, visual c++ express, ActivePerl 5.8.0 (as well as later versions).... What combination of these tools or others have worked for you guys? Any input welcome! I'd love to just start developing already!

 

Ideally I'm looking for a windows configuration, but again, any input is welcome. Please list your OS, perl version (if you compiled from source or what installer you used), compilers and make programs, and any relevant process information.

 

Thanks,

Nudi

 

Message was edited by:

        nudicles

How to simulate a keyboard event to VMWare server console?

$
0
0

 

Hi, VMWare software engineers. Firstly thanks for your geat work to bring this great product to us. Now I meet with an obstacle during doing automation on VMWare and ask for your help.

 

 

During Windows setup, how to send a keyboard message to VMWare Server Console?

 

 

I tried to use keybd_event to simulate a keyboard message and send it to VMWare server console. So that, I can write a simple script to do this tedious work.

 

 

Unfortunately, VMWare Server Console does not work well. It can't response for this keyboard message. What I should do? How to resolve this problem?

 

 

Thanks & Regards

 

 

VM Fans

 

 

Viewing all 34639 articles
Browse latest View live


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