Changes between Initial Version and Version 3 of Ticket #3797
- Timestamp:
- Apr 23, 2009 11:29:17 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3797 – Description
initial v3 1 1 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: 2 2 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 {{{ 5 5 VBoxManage createhd --filename /tmp/a.vdi --size 100 --format vdi --variant standard --type normal 6 6 7 7 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% 8 8 Disk image created. UUID: fc46a7ef-cf54-487e-ab18-71e65c72077a 9 }}} 9 10 10 2)To show that this is not an issue of re-attaching an already attached image, I will purge the VBox database11 11 2. To show that this is not an issue of re-attaching an already attached image, I will purge the VBox database 12 {{{ 12 13 rm ~/.VirtualBox 13 14 3)Attach the disk image:15 14 }}} 15 3. Attach the disk image: 16 {{{ 16 17 VBoxManage openmedium disk /tmp/a.vdi 17 18 }}} 18 19 The 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 {{{ 21 ERROR: 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') 25 Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, 26 callee nsISupports 27 Context: "OpenHardDisk(Bstr(Filename), AccessMode_ReadWrite, hardDisk.asOutParam())" 28 at line 1286 of file VBoxManageDisk.cpp 29 }}} 24 30 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. 25 31 {{{ 26 32 VBoxManage showhdinfo /tmp/a.vdi 27 33 … … 33 39 Storage format: VDI 34 40 Location: /tmp/a.vdi 35 41 }}} 36 42 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. 37 43 38 44 There is a workaround: we can use "VBoxManage modifyhd" to make it immutable: 39 45 {{{ 40 46 VBoxManage modifyhd /tmp/a.vdi --type immutable 41 47 … … 49 55 Storage format: VDI 50 56 Location: /tmp/a.vdi 57 }}}