VMware {code} Community
mrBast
Contributor
Contributor

Error: A file was not found

I just downloaded and installed VIX. Now I would like to start and stop a vm on a server version 1.0.

I tried the powerOn.vbs: after I replaced:

Set job = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, Empty, 0, Empty, Empty, 0, Nothing, Nothing)

to

Set job = lib.Connect(1, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, "dnsNameOfServer", "902", "username", "password", 0, Nothing, Nothing)

the connection seams to work.

But I always get the message: "Error: A file was not found"

So I tried around with the path from host.Open()

Set job = host.OpenVM("C:\Virtual Machines\Bare\WinXPProDEBare01\winxppro.vmx", Nothing) does not work

Set job = host.OpenVM("C:
Virtual\ Machines
Bare
WinXPProDEBare01
winxppro.vmx", Nothing) does not work

Set job = host.OpenVM("
dnsNameOfServer\Virtual Machines\Bare\WinXPProDEBare01\winxppro.vmx", Nothing) does not work

Set job = host.OpenVM("

dnsNameOfServer
Virtual\ Machines
Bare
WinXPProDEBare01
winxppro.vmx", Nothing) does not work

please help

Bast

0 Kudos
8 Replies
admin
Immortal
Immortal

Is the virtual machine that you are trying to open already registered on the host?

0 Kudos
mrBast
Contributor
Contributor

yes, it is already registered.

I tried a name without white space, same error

So my questions:

Do I need to escape the backslash ?

Must it be an unc path or a local path with a share ?

Is VMware-vix-1.1.2-59824.exe compatible with vmware-sever 1.0

Bastian

0 Kudos
egn
Contributor
Contributor

I don't really know vbs, but in C# the code to open a vm could look like this:

IJob job = MyHost.OpenVM(this.VMPath, null);

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

In your code I cannot see the Wait part... After each you should wait for completion, check the error code, maybe get a handle for the next operation. There are couple very good examples in the documentation.

Eugen

0 Kudos
mrBast
Contributor
Contributor

thanks for the replies. Vix 1.1 did not function with server 1.03.

I got it now to work with the C example.

0 Kudos
Mike24
Contributor
Contributor

Can you post your configuration and solution? I am having the same issue with vmrun, which uses the VIX interface. I have no problem writing in C, but I was attempting to use just the Windows cmd.exe command language and don't have problems changing to C if I need to.

Mike Ober.

0 Kudos
mrBast
Contributor
Contributor

VMWare Server V1.03

Vix Version: VMware-VixSDK-1.0.4-56528.exe

make a new Win32 Console Project ( I used MS Visual C++ 2003 )

copy libeay32.dll, ssleay32.dll, vix.dll, vix.lib, vix.h, vm_basic_types.h in the project dir.

make "Add" -> "Add Existing Item" and select vix.lib

use the code from powerOn.c from the Samples Directory.

0 Kudos
admin
Immortal
Immortal

Mike,

Which version of vmrun are you using? From where did you get the binary?

0 Kudos
Mike24
Contributor
Contributor

It's the VMRUN that installs as part of VMWare Server 1.04.

Mike.

0 Kudos