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

File operations not succeeding

$
0
0

Hey folks,

 

I've been stumped for a few hours with file operations.

 

I am using the vix-perl bindings. I'm using Workstation 7.1 on Windows 7, and have a Windows XP guest.

 

I am opening the vm, powering it on and logging in:

 

($err, $vmHandle) = VMOpen($hostHandle, $vmxPath);
check_for_error($err, "vmopen");

$err = VMPowerOn($vmHandle, $powerOptions, $propertyListHandle);
check_for_error($err, "vmpoweron");

$err = VMLoginInGuest($vmHandle, $username, $password, $options);
check_for_error($err, "vmloginguest");

 

I verified that this is working correctly by listing the running processes inside a guest:

 

my @processProperties;
($err, @processProperties) = VMListProcessesInGuest($vmHandle, $options);
check_for_error($err, "vmlistprocessesinguest");

foreach my $process (0..$#processProperties)
{
     print $processProperties[$process]{'PROCESS_NAME'} . "\n";
}

 

and I get a list back that looks fine. However, attempting to perform a file operation is failing. I can try to query a file for its information:

 

my %fileInfo;

($err, %fileInfo) = VMGetFileInfoInGuest($vmHandle, $guestFilePath);

 

or try to copy a file from the guest:

VMCopyFileFromGuestToHost($vmHandle, $guestFilePath, $hostFilePath,  $options, $propertyListHandle);

 

and both fail with the error "A file was not found". I have verified that the file I am trying to query exists on the guest at C:\something.txt,

I first thought it might be a backslash issue, so I tried both: C:/something.txt and C:\something.txt

 

I wondered if it might be a permissions issue, so I put something.txt in my My Documents folder and tried with it there: still no luck.

 

Any ideas?


Viewing all articles
Browse latest Browse all 34639

Trending Articles



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