Ticket #11329 (reopened defect)

Opened 5 years ago

Last modified 3 years ago

SDK - IGuestSession - (conceptual) bug with CopyTo/From()

Reported by: smihaila Owned by:
Priority: major Component: other
Version: VirtualBox 4.2.4 Keywords: sdk, IGuestSession
Cc: Guest type: Windows
Host type: Windows


There seems to be a (conceptual) bug with the IGuestSession::CopyTo() and CopyFrom(). The internal code is relying on a 30 seconds timeout for the whole copy operation to finish (because it's counting on some vbox_cat internal process spawn within the Guest). Obviously that fixed timeout is not realistic for large files such as 500MB-1GB long. Not to mention that the host file may not be really on the physical host itself, but located somewhere on the network.

I get into the same issue when I'm using the equivalent VBoxManage command.

Change History

comment:1 Changed 4 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Please reopen if still relevant with VBox 4.3.2.

comment:2 Changed 4 years ago by NM

  • Status changed from closed to reopened
  • Resolution fixed deleted

I ran in to this timeout issue using VBoxManage. I need to copy some large files (~2 or 3 GB each) to my VM via command line. It is failing every time at about the 30 second mark. I am working with version 4.3.4.

11:10:04.929 PM - Executing VBoxManage Command: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe guestcontrol "Windows 7 Ultimate x86" copyto "C:\Temp\" "C:\Temp\" --username "user" --password "pass" --recursive
11:10:35.596 PM - STDERR: VBoxManage.exe: error: File copy failed
11:10:35.597 PM - STDERR: VBoxManage.exe: error: Copying file "C:\Temp\" failed (334561280/2405485177 bytes transfered)
11:10:35.597 PM - STDERR: VBoxManage.exe: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestSession, interface IGuestSession
11:10:35.598 PM - STDERR: VBoxManage.exe: error: Context: "int __cdecl ctrlCopyFileToDest(struct COPYCONTEXT *,const char *,const char *,unsigned int)" at line 1945 of file VBoxManageGuestCtrl.cpp
11:10:35.598 PM - STDERR: VBoxManage.exe: error: Copying file "C:\Temp\" failed (334561280/2405485177 bytes transfered).
11:10:35.598 PM - STDERR: VBoxManage.exe: error: Error processing "C:\Temp\", rc=VERR_GENERAL_FAILURE

comment:3 Changed 4 years ago by RuntimeError

I am experiencing the same problem. This makes it impossible to use the "copyTo" or "copyFrom" command for files larger than 500 MB.

I have tracked this down in the source code. In "GuestSessionImplTasks.cpp" the copy process is started with a 30s timeout:

rc = pProcess->startProcess(30 * 1000 /* 30s timeout */, &guestRc);

I think we might need a larger value here (maybe 300 s). Also I do not think that the "--execute-image" command (used to start processes on the VM) times out after 30s.

Last edited 4 years ago by RuntimeError (previous) (diff)

comment:4 Changed 3 years ago by Rnnr

Much better would be to extend the API and allow to set the timeout from the caller's side -- adding new command line option for guestcontrol in this case, and maybe some other similar ones.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use