Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 17 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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