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

26

15

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.)

Tgr

Posted 2012-08-30T10:30:26.693

Reputation: 2 363

Answers

42

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.

Tgr

Posted 2012-08-30T10:30:26.693

Reputation: 2 363

1This 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 – 2014-12-01T20:31:08.933

Note that if the VM has snapshots you'll also have to do the same steps on the vdi files in the "Snapshots" folder. – laurent – 2015-06-30T08:05:14.853

6

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.

Robert Walker

Posted 2012-08-30T10:30:26.693

Reputation: 231

if you have enough disk space, this is the easiest way, thanks Robert. – sddk – 2016-09-07T14:05:52.973

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 – 2019-01-01T17:56:19.787

2

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.

Dale Reynolds

Posted 2012-08-30T10:30:26.693

Reputation: 21

1

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.

nobar

Posted 2012-08-30T10:30:26.693

Reputation: 530

This is by far the simplest solution, and not only that, it works. – shmu – 2019-07-08T06:45:49.523

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.

Toby

Posted 2012-08-30T10:30:26.693

Reputation: 11

-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] }"/>

DakotaHoosier

Posted 2012-08-30T10:30:26.693

Reputation: 1

-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...

Marouan Kouitra

Posted 2012-08-30T10:30:26.693

Reputation: 1