Opened 11 years ago
Last modified 3 years ago
#13040 reopened defect
VBoxManage storageattach --medium additions bug
Reported by: | rluethi | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 4.3.12 |
Keywords: | Cc: | ||
Guest type: | all | Host type: | all |
Description
VBoxManage storageattach assumes an empty drive when the special case "--medium additions" (added by changeset 44131 on 2012-12-14) is used.
In VBoxManageStorageController.cpp:handleStorageAttach, the additions handling code is only executed if GetMediumAttachment was successful.
That means the drive needs to exist (as an emptydrive or with some image already attached) for this special case. If, on the other hand, the user provides the ISO file location, there is no such requirement.
# this succeeds (path given) VBoxManage storageattach base --storagectl "SATA" --medium none --port 3 VBoxManage storageattach base --storagectl "SATA" --type dvddrive --medium /path/to/VBoxGuestAdditions.iso --port 3 # this succeeds (emptydrive created before adding additions) VBoxManage storageattach base --storagectl "SATA" --medium none --port 3 VBoxManage storageattach base --storagectl "SATA" --medium emptydrive --port 3 VBoxManage storageattach base --storagectl "SATA" --medium additions --port 3 # this fails (complains about missing "--type", but that's misleading) VBoxManage storageattach base --storagectl "SATA" --medium none --port 3 VBoxManage storageattach base --storagectl "SATA" --medium additions --port 3
This behavior has been observed on Linux and Windows hosts before being tracked down in the source code (svn checkout as of 2014-05-17).
Change History (3)
comment:1 by , 8 years ago
Resolution: | → obsolete |
---|---|
Status: | new → closed |
comment:2 by , 7 years ago
Resolution: | obsolete |
---|---|
Status: | closed → reopened |
I am still seeing this with VirtualBox version 5.2.8r121009, the following commands result in an error:
vboxmanage storageattach "VM Name" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium none vboxmanage storageattach "VM Name" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium additions
The output from the second command is:
VBoxManage.exe: error: Could not find file for the medium 'D:\development\additions' (VERR_FILE_NOT_FOUND) VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUnknown VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp VBoxManage.exe: error: Invalid UUID or filename "additions"
I'm running VirtualBox on a Windows host.
comment:3 by , 3 years ago
I'm also still seeing this with VirtualBox version 6.1.32.
"emptydrive" is still required before "additions" can be used.
Please reopen if still relevant with a recent VirtualBox release.