Page 1 of 1

Unable to remove virtual disk after detaching it from VM

Posted: 25. May 2016, 11:46
by dhkorman
Hi,

I've come across a problem removing a vdi which I have detatched from a VM in VirtualBox Manager but which still shows as in use by that VM using "VBoxManage showhdinfo" in the command line. Here's what did:

0) All VMs shutdown and VirtualBox Manager GUI closed. VBox background processes still running.

1) I cloned the original vdi using mpack's CloneVDI (Ubuntu host + WIne) expanding the disk size and partition at the same time. File name of new vdi is different from the original, and I left "create new UUID" checked.

2) I started the GUI manager and in VM->Settings -> Storage I detached the original .vdi from SATA-0 and attached the cloned .vdi in its place

3) I started the VM - which ran fine. Only the cloned virtual disk showed up in the (windows 8.1) guest, as expected.

4) I shutdown the VM.

5) I then went into Virtual Disk Manager to remove the old .vdi. Virtual Disk Manager does not show the old vdi as attached to anything, BUT the remove option is not available. However, "VBoxManage showhdinfo" still shows the old .vdi attached to the VM.

6) Shutting down VBOX VMs and GUI, deleting (renaming) the old .vdi file and then restarting the VBox GUI results in the "one of the virtual disks in not accessible" error message. However, if I click "ignore", I can start the VM from the attached, cloned .vdi perfectly well.

Thanks,

Dave

Re: Unable to remove virtual disk after detaching it from VM

Posted: 25. May 2016, 12:03
by socratis
dhkorman wrote:VBox background processes still running.
That right there might be the source of your problem. You shouldn't have any VBox related process running, because the contents of the VMs configuration is kept in memory and might somehow confuse the whole process.

Re: Unable to remove virtual disk after detaching it from VM

Posted: 25. May 2016, 12:15
by dhkorman
socratis wrote:
dhkorman wrote:VBox background processes still running.
That right there might be the source of your problem. You shouldn't have any VBox related process running, because the contents of the VMs configuration is kept in memory and might somehow confuse the whole process.
Ah - so, it sounds like after step 5, I need to shutdown Vbox completely (a host reboot should do that), and then when it starts up again I should/might be able to remove the old vdi cleanly?

Thanks,

Re: Unable to remove virtual disk after detaching it from VM

Posted: 25. May 2016, 13:53
by socratis
dhkorman wrote: like after step 5
I would do it right after step 0.