Cf. bug report: https://www.virtualbox.org/ticket/11700. The suggested solution 
doesn't work if the vdi
file is read only (on the file system).

After running the commands

NAME=test1

VBoxManage createvm --name "${NAME}" --ostype Ubuntu --register

VBoxManage modifyvm "${NAME}" --memory 1024

VBoxManage storagectl "${NAME}" --name "sata1" --add sata

VBoxManage storageattach "${NAME}" --storagectl "sata1" --port 0 --device 0 \
    --type hdd --medium /path/to/my.vdi --mtype multiattach

to create a new vm (with an existing multiattach virtual disk), I start up the 
vm. While it's running,
I create a new vm with similar commands, but I get the following error:

VBoxManage: error: Medium '/home/charlesj/vm/2100vm.vdi' is locked for reading 
by another task
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), 
component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "COMSETTER(Type)(mediumType)" at line 678 of file 
VBoxManageStorageController.cpp
VBoxManage: error: Failed to set the medium type

It looks like it's trying to set the medium type prematurely (in case it isn't 
multiattach).

Setting up a new vm with multiattach works when all attached vms are powered 
down / suspended, even when the vdi file is read only.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
VBox-users-community mailing list
VBox-users-community@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vbox-users-community
_______________________________________________
Unsubscribe:  
mailto:vbox-users-community-requ...@lists.sourceforge.net?subject=unsubscribe

Reply via email to