VMware {code} Community
piyocat
Contributor
Contributor

Fail to open VM

Hi,

I am very new to VIX and I was trying some of the sample on my machine.

However, I am always seeing the hostHandle return as 0 after the VixHost_connect/VixJob_Wait call . As the result, the next line when it calls VixVM_Open, it returned the invalid handle error.  Can you help?

Below is the snippet from the powerOn.c.

#define USE_WORKSTATION

#ifdef USE_WORKSTATION

#define  CONNTYPE    VIX_SERVICEPROVIDER_VMWARE_WORKSTATION

#define  HOSTNAME ""
#define  HOSTPORT 0
#define  USERNAME ""
#define  PASSWORD ""

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

jobHandle = VixHost_Connect(VIX_API_VERSION,
                                CONNTYPE,
                                HOSTNAME, // *hostName,
                                HOSTPORT, // hostPort,
                                USERNAME, // *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_FAILED(err)) {
        goto abort;
    }

    Vix_ReleaseHandle(jobHandle);
    jobHandle = VixVM_Open(hostHandle,
                           vmxPath,
                           NULL, // VixEventProc *callbackProc,
                           NULL); // void *clientData);
    err = VixJob_Wait(jobHandle,
                      VIX_PROPERTY_JOB_RESULT_HANDLE,
                      &vmHandle,
                      VIX_PROPERTY_NONE);
    if (VIX_FAILED(err)) {
        goto abort;

Reply
0 Kudos
2 Replies
admin
Immortal
Immortal

Are you trying to use VIX with VMware Workstation? If so, which version of Workstation, and which version of VIX (the version that come with Workstation or did you download a different version)?

Is VixHost_Connect() returning an error?

Reply
0 Kudos
piyocat
Contributor
Contributor

Yes, I am using VIX with VMWare Workstation. The workstation version is 7.0.0 build-203739.

I download and try VMWare-vix-1.10.3-368992.exe and VMWare-v0x-1.11.0-471780.exe but both of them don't work.

No, VixHost_Connect() didn't return error.

The error return in VixJob_Wait after VixVM_Open.

jobHandle = VixVM_Open(hostHandle,
                           vmxPath,
                           NULL, // VixEventProc *callbackProc,
                           NULL); // void *clientData);
    err = VixJob_Wait(jobHandle,
                      VIX_PROPERTY_JOB_RESULT_HANDLE,
                      &vmHandle,
                      VIX_PROPERTY_NONE);
    if (VIX_FAILED(err)) {
        goto abort;
    }

Reply
0 Kudos