VMware Cloud Community
abdulhussein
Enthusiast
Enthusiast
Jump to solution

load file in virtual machine

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

0 Kudos
1 Solution

Accepted Solutions
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

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

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

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


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

View solution in original post

0 Kudos
7 Replies
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

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

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

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


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

0 Kudos
abdulhussein
Enthusiast
Enthusiast
Jump to solution

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

0 Kudos
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

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.


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

abdulhussein
Enthusiast
Enthusiast
Jump to solution

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

0 Kudos
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

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. 


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

0 Kudos
abdulhussein
Enthusiast
Enthusiast
Jump to solution

Is there any example can u give for understanding this idea

0 Kudos
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

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. 


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

0 Kudos