[Solved] Cannot re-add existing VM to VBox

Discussions related to using VirtualBox on Windows hosts.
NA!
Posts: 63
Joined: 29. Jun 2012, 10:02
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows (XP, 7, 10), Linux

Re: [SOLVED] Cannot re-add existing VM to VBox

Post by NA! »

Ah. Well, after i unregistered the clone, it had one entry, which apparently was why re-registering the clone did not work.

Personally, i consider this a bug.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [SOLVED] Cannot re-add existing VM to VBox

Post by mpack »

NA! wrote:Personally, i consider this a bug.
If you can describe steps to reproduce a faulty state, steps that don't involve doing anything odd, then we can raise a bug ticket for it.
NA!
Posts: 63
Joined: 29. Jun 2012, 10:02
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows (XP, 7, 10), Linux

Re: [SOLVED] Cannot re-add existing VM to VBox

Post by NA! »

Great. I would appreciate it if you could do so. Here's a description on how can the problem be reproduced:

----------------------------------------

Some of the following may not be necessary to reproduce this issue but anyway, those are the steps i followed:

Assumptions:
  • Using VBox 5.2.6
  • Windows 7 host
How to reproduce the issue:
  • Either create a VM or use an existing one as base for cloning (this will be named" MasterVM" from now on).
  • In VirtualBox UI, rightclick on the Master VM and select "Clone".
  • In the "Clone Virtual Machine" dialog, select "Linked clone", check "Reinitialize MAC addresses" and press OK. A clone of the vm will be created (named "CloneVM" from now on).
  • PowerOn the CloneVM. Verify it works OK.
  • Shutdown the CloneVM.
  • After it shuts down, in VirtualBox UI, rightclick on it and select "Remove". Click on "Remove Only" in the next dialog so that the VM is removed from the UI but its files are not deleted from disk.
  • After it has been removed, go to menu Machine/Add and select the CloneVM.vbox file. At this step, normally the vm should be added to the UI. Instead of that, the following message appears:
"Failed to open virtual machine located it <vm path>/CloneVM.vbox".

The details section of the message shows the following info:

Code: Select all

Could not find an open hard disk with UUID {3f0c7151-0f8c-4a60-92b8-b63f7c42cb35}.

Result Code: 
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
Component: 
VirtualBoxWrap
Interface: 
IVirtualBox {9570b9d5-f1a1-448a-10c5-e12f5285adad}
Please note that {3f0c7151-0f8c-4a60-92b8-b63f7c42cb35} is the name (and probably also the UUID) of CloneVM's HDD file which is saved under folder CloneVM/Snapshots.

After some research, i realized that the cloning process inserted the {3f0c7151-0f8c-4a60-92b8-b63f7c42cb35} UUID in MasterVM.vbox, in the <HardDisks> section. When CloneVM was removed from VirtualBox, this entry was deleted from MasterVM.vbox. While trying to re-register it, for some reason VirtualBox checks to see if the disk with the CloneVM UUID ({3f0c7151-0f8c-4a60-92b8-b63f7c42cb35}) exists and if not, it aborts with the error described above. It seems logical that this UUID does not exist though, since it had (correctly) been removed when CloneVM was un-registered.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [SOLVED] Cannot re-add existing VM to VBox

Post by mpack »

Thanks for that. I'll try to find time later today to verify this behaviour. It does however seem to me to be unexpected that the difference image registry info for "CloneVM" is inserted into the "MasterVM" media register. I believe that is probably a bug. Of course the bug wouldn't be evident to most people, it would only show when you unregister and reregister the clone VM.
NA!
Posts: 63
Joined: 29. Jun 2012, 10:02
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows (XP, 7, 10), Linux

Re: [SOLVED] Cannot re-add existing VM to VBox

Post by NA! »

mpack wrote:It does however seem to me to be unexpected that the difference image registry info for "CloneVM" is inserted into the "MasterVM" media register. I believe that is probably a bug.
Well, maybe. The way it is now, does make some sense though. CloneVM's HDD is actually a snapshot of the base VM's HDD, so it would be logical for it to be registered within MasterVM as a snapshot (after all, when you link-clone a vm, vbox creates a snapshot of the MasterVM). The only strange thing i see is that for an unregistered VM, there's no easy way to know to which Master VM it was linked to. There's no reference in CloneVM.vbox to its Master VM.

In any case, it all depends on how the developers intended it to work.

Thanks for all the help.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [SOLVED] Cannot re-add existing VM to VBox

Post by mpack »

I have reproduced the problem. Ticket #17487 created.
NA!
Posts: 63
Joined: 29. Jun 2012, 10:02
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows (XP, 7, 10), Linux

Re: [SOLVED] Cannot re-add existing VM to VBox

Post by NA! »

Great. Thank you.
Post Reply