Failed to Open Virtual Machine - Medium Cannot be Closed

Discussions related to using VirtualBox on Windows hosts.

Failed to Open Virtual Machine - Medium Cannot be Closed

Postby AntonyReynolds » 17. May 2011, 20:40

I just moved to a new machine and tried to add an existing VirtualBox. I got the following error.
Failed to open virtual machine located in
D:/VirtualMachines/OEL6-x64/OEL6-x64.vbox.

Medium 'D:\VirtualMachines\OEL6-x64\OEL6-
x64.vdi' cannot be closed because it is still attached to 1
virtual machines.

The Details box contains:
Result Code:
VBOX_E_OBJECT_IN_USE (0x80BB000C)
Component:
Medium
Interface:
IMedium {9edda847-1279-4b0a-9af7-9d66251ccc18}
Callee:
IVirtualBox {d2de270c-1d4b-4c9e-843f-bbb9b47269ff}
Callee RC:
E_INVALIDARG (0x80070057)


This is VirtualBox 4.0.8. Image was created under 4.0.6 but I tested it on 4.0.8 before moving it to the new machine.
AntonyReynolds
 
Posts: 8
Joined: 17. May 2011, 18:18
Primary OS: Linux other
VBox Version: OSE Fedora
Guest OSses: Linux, Windows

Re: Failed to Open Virtual Machine - Medium Cannot be Closed

Postby AntonyReynolds » 18. May 2011, 00:45

After raising this I discovered a similar thread - Using VB image/settings from Windows host on Linux host
Follow that thread if you are interested in this issue.
AntonyReynolds
 
Posts: 8
Joined: 17. May 2011, 18:18
Primary OS: Linux other
VBox Version: OSE Fedora
Guest OSses: Linux, Windows

Re: Failed to Open Virtual Machine - Medium Cannot be Closed

Postby admin@dwaves.de » 7. May 2013, 19:30

Hello AntonyReynolds,

THIS IS CLEARLY A BUG OF VIRTUALBOX!

BECAUSE YOUR HARDDISK IS NOT REALLY OPENED BY ANY VIRTUALBOX INSTANCE.

my error was a result, of having multiple instances of the virtualbox manager open… i closed them all.

then double clicked the *.vbox file… then the damn thing imported without complains.


another idea: is there a vboxmanage / vdiclone command that allows you to clone a harddisk WITH the latest snapshot into one single vdi? (Vmdk are EVIL!)

if yes... then you could clone your vdi+snapshots -> single-vdi, import single-vdi via media-manager, create a new VM from scratch, attach single-vdi and be good 2 go.

the virtualbox guys were initially from germany…. they provide a technical quiet solid product (nothing is perfect), but it's hard to handle such copy processes, especially with 1000x snapshots, in comparison to parallels e.g…. i hope they will improve on this in the future.

some people here are not very helpful.

we should fight to help each other and make this world a better place not post "you are stupid" answers. this is a arrogance and social incompetence will lead mankind to extiction. (the easter islanders consumed all their resources for taller and taller status-symbols… and then died out)

i had the same error as you.

i know how hard it is to copy a virtualbox vm from one machine to another.

as a fist-rule: always clone your vms, before copying them.

i had to restore a backup
1. removed the existing VM (kept the files, moved to another dir)
2. copied a VM from a acronis-backup to the default VirtualBox directoy
3. double clicked .vbox file -> error

first i got
Konnte die virtuelle Maschine in C:/Users/Sigel/VirtualBox VMs/AGENDA/AGENDA.vbox nicht öffnen.

Hard disk 'C:\Users\Sigel\VirtualBox VMs\AGENDA\Snapshots/{19e71f06-e28a-45a4-837f-4ac80f0816a1}.vhd' with UUID {19e71f06-e28a-45a4-837f-4ac80f0816a1} cannot be directly attached to the virtual machine 'AGENDA' ('C:\Users\Sigel\VirtualBox VMs\AGENDA\AGENDA.vbox') because it has 1 differencing child hard disks.

fixed this by using the media manager and removing all snapshots and then the associated harddiskfile. (just remove from list, not delete)

then i got

Konnte die virtuelle Maschine in C:/Users/Sigel/VirtualBox VMs/AGENDA/AGENDA.vbox nicht öffnen.

Medium 'C:\Users\Sigel\VirtualBox VMs\AGENDA\AGENDA.vmdk' cannot be closed because it is still attached to 1 virtual machines.

Fehlercode:VBOX_E_OBJECT_IN_USE (0x80BB000C)
Komponente:Medium
Interface:IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd}
Callee:IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}
Callee RC:E_FAIL (0x80004005)

which i fixed with the fix in red colors.

hope this helps somewhat.
admin@dwaves.de
 
Posts: 1
Joined: 7. May 2013, 19:28

Re: Failed to Open Virtual Machine - Medium Cannot be Closed

Postby Andy Southwell » 7. Jan 2015, 10:42

Hi,

I just came across the same error, too, after copying the files for a VirtualBox machine from a Windows host to a Linux one. The solution for me was simply to ask VirtualBox to create a fresh, new machine, but to use the existing vdi image I had copied over from the old machine (you can always use the old xml file as a reference, looking at settings in an editor, such as the MAC address etc, if you need to).

I am not sure whether or not I had any snapshots saved for the old VM, or whether this would have affected whether this solution would have worked: all I have now is the hard drive from the old Windows host, which has now gone to the land of bug-free code..

Oh...one more thing... the guest VM I moved was a Linux one. If it had been Windows, I'd imagine I'd have had much more trouble, given windows is much more sensitive to HW changing around..YMMV.

HTH anyway.
Andy
Andy Southwell
 
Posts: 1
Joined: 7. Jan 2015, 10:34


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], TedN and 23 guests