VirtualBox

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18724 closed defect (fixed)

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 (7)

comment:1 by paulson, 5 years ago

Owner: set to paulson
Status: newassigned
Summary: VBoxManage copyto --target-directory now requires an ending slash for Windows guestVBox 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 by paulson, 5 years ago

Resolution: fixed
Status: assignedclosed
Summary: VBox 5.2.x: VBoxManage copyto --target-directory now requires an ending slash for guestsVBox 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 5 years ago by paulson (previous) (diff)

comment:3 by robpats, 5 years ago

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.

comment:4 by robpats, 5 years ago

Resolution: fixed
Status: closedreopened

in reply to:  3 ; comment:5 by Frank Batschulat (Oracle), 5 years ago

Replying to robpats:

This fix seems to break copyfrom --target-directory.

Then a new bug should be filed against the currently used release.

Re-opening this old one which had a source code change is not the right action.

comment:6 by Frank Batschulat (Oracle), 5 years ago

Resolution: fixed
Status: reopenedclosed

in reply to:  5 comment:7 by robpats, 5 years ago

Replying to fbatschu:

Then a new bug should be filed against the currently used release.

Re-opening this old one which had a source code change is not the right action.

Thank you for clarifying the bug reporting policy.

I have created a new ticket #19256 for this.

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette