VirtualBox

Changes between Initial Version and Version 3 of Ticket #3797


Ignore:
Timestamp:
Apr 23, 2009 11:29:17 AM (15 years ago)
Author:
Frank Mehnert
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3797 – Description

    initial v3  
    11I'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:
    22
    3 1) Create a VDI disk image (/tmp/a.vdi) - guest OS independent:
    4 
     3 1. Create a VDI disk image (/tmp/a.vdi) - guest OS independent:
     4{{{
    55VBoxManage createhd --filename /tmp/a.vdi --size 100 --format vdi --variant standard --type normal
    66
    770%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    88Disk image created. UUID: fc46a7ef-cf54-487e-ab18-71e65c72077a
     9}}}
    910
    10 2) To show that this is not an issue of re-attaching an already attached image, I will purge the VBox database
    11 
     11 2. To show that this is not an issue of re-attaching an already attached image, I will purge the VBox database
     12{{{
    1213rm ~/.VirtualBox
    13 
    14 3) Attach the disk image:
    15 
     14}}}
     15 3. Attach the disk image:
     16{{{
    1617VBoxManage openmedium disk /tmp/a.vdi
    17 
     18}}}
    1819The following is the output from the command:
    19 
    20 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')
    21 Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
    22 Context: "OpenHardDisk(Bstr(Filename), AccessMode_ReadWrite, hardDisk.asOutParam())" at line 1286 of file VBoxManageDisk.cpp
    23 
     20{{{
     21ERROR: Cannot register the hard disk '/tmp/a.vdi'
     22   with UUID {4c8fb9c9-5300-4d14-a9e5-c28c08cc347c} because a hard disk '/tmp/a.vdi'
     23   with UUID {4c8fb9c9-5300-4d14-a9e5-c28c08cc347c} already exists in the media registry
     24   ('/root/.VirtualBox/VirtualBox.xml')
     25Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox,
     26   callee nsISupports
     27Context: "OpenHardDisk(Bstr(Filename), AccessMode_ReadWrite, hardDisk.asOutParam())"
     28   at line 1286 of file VBoxManageDisk.cpp
     29}}}
    2430As 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.
    25 
     31{{{
    2632VBoxManage showhdinfo /tmp/a.vdi
    2733
     
    3339Storage format:       VDI
    3440Location:             /tmp/a.vdi
    35 
     41}}}
    3642However, 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.
    3743
    3844There is a workaround: we can use "VBoxManage modifyhd" to make it immutable:
    39 
     45{{{
    4046VBoxManage modifyhd /tmp/a.vdi --type immutable
    4147
     
    4955Storage format:       VDI
    5056Location:             /tmp/a.vdi
     57}}}

© 2023 Oracle
ContactPrivacy policyTerms of Use