VirtualBox

Ticket #18724 (closed defect: fixed)

Opened 6 months ago

Last modified 6 weeks ago

VBox 5.2.x: VBoxManage copyto --target-directory now requires an ending slash for guests => fixed in 5.2.x x>32

Reported by: kboortz Owned by: paulson
Component: other Version: VirtualBox 5.2.30
Keywords: VBoxManage copyto target-directory Cc:
Guest type: Windows Host type: Solaris

Description

The "VBoxManage copyto" destination directory given to "--target-directory" for a Windows guest now requires an ending slash. I assume this is not an intentional change.

The error message when leaving out the ending slash in the destination "C:/tmp" is

VBoxManage: error: File copy failed VBoxManage: error: Copying file "/tmp/foo" to guest failed: VERR_ACCESS_DENIED VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestSessionWrap, interface IGuestSession VBoxManage: error: Context: "int gctlCopyFileToDest(COPYCONTEXT*, const char*, const char*, gctlCopyFlags)" at line 2176 of file VBoxManageGuestCtrl.cpp VBoxManage: error: Copying file "/tmp/foo" to guest failed: VERR_ACCESS_DENIED. VBoxManage: error: Error processing "/tmp/foo", rc=VERR_GENERAL_FAILURE

Change History

comment:1 Changed 3 months ago by paulson

  • Owner set to paulson
  • Status changed from new to assigned
  • Summary changed from VBoxManage copyto --target-directory now requires an ending slash for Windows guest to VBox 5.2.x: VBoxManage copyto --target-directory now requires an ending slash for guests

This is a regression introduced in VirtualBox 5.2.8 and applies to any type of guest, not just Windows guests. A variety of subsequent changesets reworked this code in VirtualBox 6.0.0 so only 5.2.x is affected.

Here is the output from a MacOS host running VBox 5.2.32 attempting to copy a file to a Linux guest using '--target-directory':

$ VBoxManage guestcontrol debian --username user --password password copyto /etc/group --target-directory /tmp
Type Manifest File: /Users/paulson/Library/VirtualBox/xpti.dat
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nNCL: registering deferred (0)
VBoxManage: error: File copy failed
VBoxManage: error: Copying file "/etc/group" to guest failed: VERR_IS_A_DIRECTORY
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestSessionWrap, interface IGuestSession
VBoxManage: error: Context: "int gctlCopyFileToDest(PCOPYCONTEXT, const char *, const char *, gctlCopyFlags)" at line 2180 of file VBoxManageGuestCtrl.cpp
VBoxManage: error: Copying file "/etc/group" to guest failed: VERR_IS_A_DIRECTORY.
VBoxManage: error: Error processing "/etc/group", rc=VERR_GENERAL_FAILURE
ipcDConnectService Stats
 => number of worker threads: 1

comment:2 Changed 3 months ago by paulson

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Summary changed from VBox 5.2.x: VBoxManage copyto --target-directory now requires an ending slash for guests to VBox 5.2.x: VBoxManage copyto --target-directory now requires an ending slash for guests => fixed in 5.2.x x>32

This has been fixed in 5.2.x (x > 32) and the fix will be part of any 5.2.x Testbuilds with a revision >= r133443. As mentioned previously this doesn't apply to VirtualBox 6.0.x.

Last edited 3 months ago by paulson (previous) (diff)

comment:3 Changed 6 weeks ago by robpats

This fix seems to break copyfrom --target-directory. This command fails on Windows 7 host with Windows XP/Windows 7 guests in VirtualBox 5.2.34.

>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" guestcontrol vm_win7 copyfrom -v --username User --password 123 --target-directory D:\log C:\Users\User\Desktop\1.txt
Creating guest session as user 'User'...
Waiting for guest session to start...
Successfully started guest session (ID 1)
Copying from guest to host ...
Directory "D:\log\" already exists
Source: C:\Users\User\Desktop\1.txt
Copying "C:\Users\User\Desktop\1.txt" to "D:\log\" ...
0%...
Progress state: VBOX_E_IPRT_ERROR
VBoxManage.exe: error: Opening/creating destination file on host "D:\log\" failed: VERR_PATH_NOT_FOUND.
VBoxManage.exe: error: Error processing "C:\Users\User\Desktop\1.txt", rc=VERR_GENERAL_FAILURE
Closing guest session ...

When I try without --target-directory,

                      copyfrom [common-options]
                      [--dryrun] [--follow] [-R|--recursive]
                      <guest-src0> [guest-src1 [...]] <host-dst>

<host-dst> is written from start but not replaced. This corrupts <host-dst> if a smaller file is copied.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use