VirtualBox

Ticket #3797 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

VBoxManage openmedium reports failure on connecting disk images but does it, however fails setting type as immutable => Fixed in SVN

Reported by: oldwoman Owned by:
Priority: minor Component: virtual disk
Version: VirtualBox 2.2.0 Keywords:
Cc: Guest type: other
Host type: Linux

Description (last modified by frank) (diff)

I'm modifying a script which I have used for VirtualBox 1.6.x to setup a virtual machine for an educational lab. In migrating to 2.2.0 I've noticed some problems. Although I have a work around, it still should be addressed. To show how this error is reproduced I will show a series of simple VBoxManage commands:

  1. Create a VDI disk image (/tmp/a.vdi) - guest OS independent:
    VBoxManage createhd --filename /tmp/a.vdi --size 100 --format vdi --variant standard --type normal
    
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Disk image created. UUID: fc46a7ef-cf54-487e-ab18-71e65c72077a
    
  1. To show that this is not an issue of re-attaching an already attached image, I will purge the VBox database
    rm ~/.VirtualBox
    
  2. Attach the disk image:
    VBoxManage openmedium disk /tmp/a.vdi
    

The following is the output from the command:

ERROR: Cannot register the hard disk '/tmp/a.vdi'
   with UUID {4c8fb9c9-5300-4d14-a9e5-c28c08cc347c} because a hard disk '/tmp/a.vdi'
   with UUID {4c8fb9c9-5300-4d14-a9e5-c28c08cc347c} already exists in the media registry
   ('/root/.VirtualBox/VirtualBox.xml')
Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox,
   callee nsISupports
Context: "OpenHardDisk(Bstr(Filename), AccessMode_ReadWrite, hardDisk.asOutParam())"
   at line 1286 of file VBoxManageDisk.cpp

As you can see the system is stating the image is already in the database, but the database is not there to begin with. Fortunately, the image is registered as it appears in the ~/.VirtualBox/VirtualBox.xml file.

VBoxManage showhdinfo /tmp/a.vdi

UUID:                 fc46a7ef-cf54-487e-ab18-71e65c72077a
Accessible:           yes
Logical size:         100 MBytes
Current size on disk: 0 MBytes
Type:                 normal (base)
Storage format:       VDI
Location:             /tmp/a.vdi

However, if I try to use the option "--type immutable" with the "openmedium" command, the image does not become immutable and the error is still reported.

There is a workaround: we can use "VBoxManage modifyhd" to make it immutable:

VBoxManage modifyhd /tmp/a.vdi --type immutable

VBoxManage showhdinfo /tmp/a.vdi

UUID:                 fc46a7ef-cf54-487e-ab18-71e65c72077a
Accessible:           yes
Logical size:         100 MBytes
Current size on disk: 0 MBytes
Type:                 immutable
Storage format:       VDI
Location:             /tmp/a.vdi

Change History

comment:1 Changed 5 years ago by tpak

I can confirm the same behavior on an Ubuntu 8.10 host. I receive the same error messages as the original poster and the same result - the image is in fact in the database and can be pulled up or seen via the GUI. Adding it to the Library using the GUI Media Manager reports no error. Either way, the vdi is usable.

comment:2 Changed 5 years ago by tpak

Upon further experimenting this bug seems like it may be 2 different bugs. I get the same error when issuing the openmedium command with or without the -type immutable parameter. Issuing the modifyhd command works with either version of the openmedium command.

comment:3 Changed 5 years ago by frank

  • Description modified (diff)

comment:4 Changed 5 years ago by frank

  • Summary changed from VBoxManage openmedium reports failure on connecting disk images but does it, however fails setting type as immutable to VBoxManage openmedium reports failure on connecting disk images but does it, however fails setting type as immutable => Fixed in SVN

Thanks for the report, all this is fixed in SVN.

comment:5 Changed 5 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use