25

When trying to add two VirtualBox virtual machines which have been originally copied (via simple file copy) from the same source, on adding the second one I get the message

Failed to open virtual machine [...]
Trying to open a VM config [...] which has the same UUID as an existing virtual machine.

(Yes, the machines should have been cloned instead of simple file copy, but it is too late at this point.)

37

You can use VBoxManage internalcommands sethduuid <VDI/VMDK file>(Run from the VBox install directory) to change the HD UUID, but this has two shortcomings: it does not update the .vbox file, and it does not change the machine UUID (I did not find any way to do this with VBoxManage), just the HD UUID.

The following worked for me (Win 7, most recent VirtualBox version):

  1. run VBoxManage internalcommands sethduuid <VDI/VMDK file> twice (the first time is just to conveniently generate an UUID, you could use any other UUID generation method instead)
  2. open the .vbox file in a text editor
  3. replace the UUID found in <Machine uuid="{...}" with the UUID you got when you ran sethduuid the first time
  4. replace the UUID found in <HardDisk uuid="{...}" and in <Image uuid="{}" (towards the end) with the UUID you got when you ran sethduuid the second time

You can add the virtual machine after that. Not a very clean solution, but does not seem to cause any problem.

  • 1
    This worked for me, but I also had a DVD "inserted" in the VM that I was manually copying. When I edited my .vbox file, I had to change <DVDImages>...</DVDImages> to just <DVDImages /> to "eject" the DVD with the duplicate UUID. – JPhi1618 Dec 1 '14 at 20:31
  • Note that if the VM has snapshots you'll also have to do the same steps on the vdi files in the "Snapshots" folder. – this.lau_ Jun 30 '15 at 8:05
5

I've found a simpler way to do it.

Clone the existing virtual machine. This creates a new version with presumably a new uuid, but in all other respects it is the same machine.

Then copy the one you want to add, to your \user(your name)\Virtual Box VMs\ (or wherever the location is for your virtual machines) and overwrite all the existing files there, to replace the existing machine.

I would back up the existing machine first just in case, before doing that, but it worked just fine here. Used it to go back to an earlier backup of a VM while keeping the existing version as a clone.

  • if you have enough disk space, this is the easiest way, thanks Robert. – sddk Sep 7 '16 at 14:05
  • If any one does this - they should make sure the vbox file has a hardware uuid tag that matches the machine uuid :: <hardware uuid="{...}" >, then they can change hard disk uuid and machine uuid with out any issues. <hardware uuid="{...}" > – StixO Jan 1 at 17:56
1

You can also clone the existing machine then go into settings and change the storage to use the .vmdk that you had copied earlier.

1

I realize this is an old post but I ran upon this error. I resolved it by:

  1. Open Virtual Box Manager
  2. Right click on the virtual machine in the Virtual Box Manager
  3. Click "Remove"
  4. A pop-up will appear. Choose "Remove only" which will simply remove all traces of the virtual box from the Virtual Box Manager
  5. Close the Virtual Box Manager
  6. Using the Linux file manager, browse to the folder containing the virtual machine
  7. Delete (or move) everything EXCEPT the .vmdk virtual hard disk file
  8. Open Virtual Box Manager
  9. Click "Machine"
  10. Click "New"
  11. Name the new machine (I used the same name as I originally used)

    NOTE: The name of the machine is will become the name of the directory that will contain the virtual machine so choose wisely and also note that if you want the .vmdk file to reside in the new directory that it will take additional steps in Virtual Box Manager

  12. Select the proper Type and Version for the virtual machine that was having the issue and click "Next"
  13. Select the memory size you want the virtual machine to have allocated and click "Next"
  14. Select "Use and existing virtual hard disk file" and select it by browsing to it's location
  15. Select "Create"

Simply follow the prompts from there and then start the virtual machine.

Everything runs fine, no re-activation of windows or etc. required.

0

If you are unable to launch due to this error, simply 'Remove...' the entry from the 'Oracle VM VirtualBox Manager'. This will clear the conflict and you will then be able to open the VM from its new location.

...At that point you can perform a clone if that is what you intend. In my case, no additional effort was required since I no had no further need for the original location of the VM.

-1

User TGR got it right, but I had to make one additional change: In the vbox XML I needed to change the Image uuid to match the HardDisk uuid (the second UUID generated on the command line)

<StorageControllers>
   <StorageController ...>
     <AttachedDevice ...>
       <Image uuid="{ [second UUID] }"/>
-1

I've found another way simpler than any other. You only have o delete the virtual machine from Virtual Box interface (if it asks you if you want to delete the files of the VM, respond NOT!, or you'll lose the VM). And then go to the .vbox file and open it (with Virtual Box). It should work because you have deleted the UUID (while deleted the VM). At least it worked for me...

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.