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

CopyFileFromHostToGuest - INTERNAL ERROR: A file was not found

$
0
0

Hey, I am trying to Copy files into a VMWare image hosted in ESX using VIX (C# Wrapper around the COM API), but I can't quite get it right.

 

Conceptual Something like:

 

IVMWareVirtualHost host = new VMWareVirtualHost();

host.ConnectToVMWareVIServer("172.18.19.69", "ESX Admin User", "ESX Admin Password");

 

IVMWareVirtualMachine virtualMachine = host.Open("[Storage1] Image/Image.vmx");

virtualMachine.PowerOn();

virtualMachine.WaitForToolsInGuest();

virtualMachine.LoginInGuest("Administrator", "ILoveOMSIS!1234");

virtualMachine.CopyFileFromHostToGuest("C:
temp
File.txt", "C:
package
File.txt");

 

And it fails at the last line with "INTERNAL ERROR: A file was not found"...

 

The File exists Locally, Casing is corrent and the "C:\package" folder exists in the Guest.

 

Host System: ESX 4.0

Guest System: Windows XP

Client System: Windows 2003 server

 

(Client System refers to the system where I try tu run the commands and vmrun.exe

 

After trying to find some help ect on the web, I went to "vmrun" and tested a command that used to work with the "VMWare Server"

 

vmrun -T server -h https://localhost:8333/sdk -u "Local Admin User" -p "Local Admin Password" -gu "Guest Admin account" -gp "Guest Admin password" CopyFileFromHostToGuest "[Standard] Image/Image.vmx" "C:\temp\file.txt" "C:\package\file.txt"

 

changed to:

 

vmrun -T server -h https://172.18.19.69/sdk -u "ESX Admin User" -p "ESX Admin Password" -gu "Guest Admin account" -gp "Guest Admin password" CopyFileFromHostToGuest "[Storage1] Image/Image.vmx" "C:\temp\file.txt" "C:\package\file.txt"

 

Both Works just fine...

 

So what am I'm doing wrong in the code?


Viewing all articles
Browse latest Browse all 34639

Trending Articles



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