Oracle VirtualBox

VirtualBox error – UUID already exists

I wanted to utilise the following setup:
1. Base VM (Eg. Base) that is used as a template
2. Copies of that VM (eg. JayVM, JayVM2)

Since Base VM was not registered in VirtualBox, I was successfully able to create JayVM by copying the vmdk files (Windows_XP.vmdk) from Base VM to a new folder C:\hosted images\JayVM. However, I soon encountered the following error when copying the vmdk files of Base VM into new folder c:\hosted images\JayVM2 in order to create JayVM2:

Failed to open the hard disk C:\hosted images\JayVM2\Windows_XP.vmdk.

Cannot register the hard disk 'C:\hosted images\JayVM2\Windows_XP.vmdk' {00c11b02-c807-443d-b10d-dfffe0ae1b96} because a hard disk 'C:\hosted images\JayVM2\Windows_XP.vmdk' with UUID {00c11b02-c807-443d-b10d-dfffe0ae1b96} already exists.

Result Code: E_INVALIDARG (0x80070057)
Component: VirtualBox
Interface: IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}

I’m guessing I encountered this because I didn’t use the clone functionality in VirtualBox. But I didn’t really want to use the clone functionality because it would require me to always keep a copy of Base VM on my hard drive, and my VMs take up a lot of disk space (sometimes 45 GB). Instead I zip up Base VM and keep it on a separate server.

I managed to resolve this issue by navigating to my VirtualBox install directory (C:\Program Files\Oracle\VirtualBox) and running the following command to change the UUID:
vboxmanage internalcommands sethduuid “C:\hosted images\JayVM2\Windows_XP.vmdk”
This command changed the UUID for the VM, allowing me to be able to run both VMs (JayVM and JayVM2) on the same host.

Here’s a bat file I created to help me do this:

6 thoughts on “VirtualBox error – UUID already exists”

  1. I had resized the vm ,and changing it from VMDK TO VDI .. apparently lost all data ..where it only reset itself to a few months back …with my worry that my two months java development was down the river i went searching for all options …the only help was a snapshot i had based just a few hours back
    …loading it was an error UUID already exists …and there u saved me and Baby am back rocking the java world …salute u .

  2. Sometimes this solution isn’t enough, you’ll have to edit the *.vbox file corresponding to your vm, et replace the old hduuid with the new one, at least with the latest version of virtualbox (2 lines to modify)

    Thanks for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *