VMware {code} Community
articblast
Contributor
Contributor
Jump to solution

DirectoryExistsInGuest and CreateDirectoryInGuest

I am getting a VIX_E_NOT_SUPPORTED error when I try calling either DirectoryExistsInGuest or CreateDirectoryInGuest with in my applications.

I basicly want to check for the existance of a directory on the guest and if it does not exist I then want to create it.

I think the problem might be the path, but it is an absolute path and I have no problems using CopyFileFromGuestToHost or+ CopyFileFromGuestToHost +

Here is my code for using +DirectoryExistsInGuest and CreateDirectoryInGuest+ :

protected override bool doesGuestDirectoryExists(string Path)

{

VixCOM.IJob jobHandle = virtualMachine.DirectoryExistsInGuest(Path, null);

int[] propertyIDs = {VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_GUEST_OBJECT_EXISTS,

VixCOM.Constants.VIX_PROPERTY_NONE};

object results = null;

UInt64 err = jobHandle.Wait(propertyIDs, ref results);

if (lib.ErrorIndicatesFailure(err))

Console.WriteLine(String.Format("Error: ", lib.GetErrorText(err, null)));+ } protected override UInt64 createGuestDirectory(string Path) { VixCOM.IJob jobHandle = virtualMachine.CreateDirectoryInGuest(Path, null, null); UInt64 err = jobHandle.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) +Console.WriteLine(String.Format("Error: ", lib.GetErrorText(err, null)));

return err;

}

Any help in figuring what I am missing would be great.

Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

VMware Server 1.0 only supports the 1.0 version of the API. If you look at the documentation (you'll have to look at the C versions of the functions, since COM was first released with Workstation 6), any function that does not say "since VMware Server 1.0" won't be available on Server 1.0.

You can either try Server 2.0, which is in beta, or splurge and get Workstation 6.0.

View solution in original post

Reply
0 Kudos
9 Replies
lemke
VMware Employee
VMware Employee
Jump to solution

You don't mention what versions you're working with. My first guess is that the tools involved could be rather old. The CopyFile APIs have been around a while, but the Directory APIs are newer.

articblast
Contributor
Contributor
Jump to solution

I wouldn't doubt that the tools are out of date. Our main focus is on our products and not on the internal tools that we use to test them on. What would be the easiest way to update the vmware tools?

Reply
0 Kudos
lemke
VMware Employee
VMware Employee
Jump to solution

You can upgrade via the UIs, or use the VixVM_InstallTools() API. For a small number of VMs, the UI is probably simpler.

Reply
0 Kudos
articblast
Contributor
Contributor
Jump to solution

The UI doesn't have to option to upgrade, and using the InstallTools( ) API doesn't have any effect.

When the docs state "Installs VMware Tools on the guest operating system. If VMware Tools is already installed, this function upgrades VMware Tools to the version that matches the Vix library. "

It is meaning the VIX library on the machine that I am running the app from right? and has nothing to do with the machine the server is on?

Reply
0 Kudos
lemke
VMware Employee
VMware Employee
Jump to solution

What product is this? There should be an Install/Upgrade Tools option in the VM menu.

As for the doc comment, I think that's misleading -- I'll see about getting it fixed. What it should do is upgrade the tools to whatever tools image it has available on its local system. What its really doing is using a tools CD-ROM image on the machine running the VM.

Reply
0 Kudos
articblast
Contributor
Contributor
Jump to solution

The VMs are running on VMware Server 1.0.1

Reply
0 Kudos
articblast
Contributor
Contributor
Jump to solution

Ok, I have upgraded the server to 1.06 and am using VIXCOM 1.1.4 and still it states that the operation is not supported for the specified parameters.

So is this still a tools issues, or am I somehow specifing the path wrong?

Reply
0 Kudos
articblast
Contributor
Contributor
Jump to solution

Ok I tried a work around for this issues, where I create a .bat file and execute the file. It works well for the base directory that I need, but it will be a big hassle for copying additional files on the fly into other directories. I am very sure the problem is not the VMWARE tools, or the API, or the Server, as I have upgraded all to the lastest and still can not get the commands to work.

What format does it want the path in?

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

VMware Server 1.0 only supports the 1.0 version of the API. If you look at the documentation (you'll have to look at the C versions of the functions, since COM was first released with Workstation 6), any function that does not say "since VMware Server 1.0" won't be available on Server 1.0.

You can either try Server 2.0, which is in beta, or splurge and get Workstation 6.0.

Reply
0 Kudos