vCenter

 View Only
  • 1.  load file in virtual machine

    Posted Nov 20, 2014 08:14 AM

    how can i load any file to virtual machine using java api



  • 2.  RE: load file in virtual machine
    Best Answer

    Broadcom Employee
    Posted Nov 20, 2014 08:25 AM

    How to upload file into Guest OS on VMware:How to Upload File to Guest Operating System on VMware | DoubleCloud => Private Cloud + Public Cloud

    How to download file from GOS on VMware:How to Download File from Guest Operating System on VMware | DoubleCloud => Private Cloud + Public Cloud

    If you have any doubt/issue related to this, please post on above blog posts



  • 3.  RE: load file in virtual machine

    Posted Nov 20, 2014 04:57 PM

    i used this program but i got this error

    Exception in thread "main" java.lang.IllegalArgumentException: Local file path points to a directory: C:\temp1\guest\

        at org.doublecloud.vi.vmware.guest.GuestFileDirector.uploadFile(GuestFileDirector.java:183)

        at org.doublecloud.vi.vmware.guest.samples.GuestDownloadFile.main(GuestDownloadFile.java:38)

    i create this folder C:\temp1\guest\ in my  laptop and create c:\\temp in vm

    any idea about this problem



  • 4.  RE: load file in virtual machine

    Broadcom Employee
    Posted Nov 20, 2014 05:33 PM

    are you sure you are specifying directory paths the way shown in code? double backward slash is required.

    fd.uploadFile("C:\\temp\\guest\\steveproxy.jar", "c:\\temp\\steveproxy.jar");

        fd.uploadFile("C:\\temp1\\guest\\", "c:\\temp\\");

    Also please check what is the uploadFile() method signature i.e. What is source path & what is destination path.

    If you resolve above 2 stuffs, code should go through.



  • 5.  RE: load file in virtual machine

    Posted Nov 20, 2014 06:02 PM

    thank u very much it work

    but is there any way to determine the source and destination file at the time of programming work or not



  • 6.  RE: load file in virtual machine

    Broadcom Employee
    Posted Nov 20, 2014 06:10 PM

    When we are uploading file from one location to other,

        >we should have source location (i.e. the file location that you want to upload)

       >destination location (i.e. what is the location where you want to upload in VM)

    I wanted you to check the uploadFile() method argument sequence so that you can specify appropriate file location while calling this method. I wanted you to make sure you specify correct argument sequence. 



  • 7.  RE: load file in virtual machine

    Posted Nov 20, 2014 06:21 PM

    Is there any example can u give for understanding this idea



  • 8.  RE: load file in virtual machine

    Broadcom Employee
    Posted Nov 21, 2014 05:56 AM

    com.vmware.vim25.mo.ServiceInstance.ServiceInstance(URL url, String username, String password, boolean ignoreCert)

    Above method (ServiceInstance) we call in order to login. What is the argument sequence from left to right ::: 1. URL   2.  String username 3. String password 4. boolean ignoreCert

    Now if we pass 2nd argument as "password" then call is going to fail as password is 3rd argument & username is 2nd.

    In the same way I wanted you to check the argument sequence for "uploadFile()" method so that you will not go wrong while calling this method.