Page 1 of 1

[SOLVED] Duplicate UUID issue with vhd images

Posted: 2. Mar 2009, 16:43
by shapeshed
Firstly VirtualBox is simply fantastic. I've been using Parallels on OSX and it beats it hands down, even with less RAM.

I have a small issue. I'm using VirtualBox on Ubuntu and virtualising the VPC images made available by Microsoft here for browser testing purposes. http://www.microsoft.com/Downloads/deta ... laylang=en

Everything works really well but if I try to add more than one of the XP images to the virtual media manager I get the following error.
Cannot register the hard disk '/home/george/.VirtualBox/HardDisks/XP SP3 with IE6 2008-Dec.vhd' with UUID {b6202eec-1791-b921-4c0c-4306e34cc487} because a hard disk '/home/george/.VirtualBox/HardDisks/XP SP3 with IE6 2008-Dec.vhd' with UUID {b6202eec-1791-b921-4c0c-4306e34cc487} already exists in the media registry ('/home/george/.VirtualBox/VirtualBox.xml').
I have attempted to change the UUID using the command line

Code: Select all

george@george-ubuntu:~/.VirtualBox/HardDisks$ VBoxManage internalcommands sethduuid XP\ SP3\ with\ IE6\ 2008-Dec.vhd 
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

UUID changed to: 46a453bd-4d03-4988-a066-6ecfc6ced308
But the same error persists when trying to add the hard drive.

Here's the auto-generated config

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!-- Sun xVM VirtualBox Global Configuration -->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.6-linux">
  <Global>
    <ExtraData>
      <ExtraDataItem name="GUI/LicenseAgreed" value="7"/>
      <ExtraDataItem name="GUI/UpdateCheckCount" value="2"/>
      <ExtraDataItem name="GUI/UpdateDate" value="1 d, 2009-03-03"/>
      <ExtraDataItem name="GUI/RegistrationData" value="triesLeft=0"/>
      <ExtraDataItem name="GUI/SuppressMessages" value=",confirmInputCapture"/>
      <ExtraDataItem name="GUI/LastWindowPostion" value="614,190,755,506"/>
      <ExtraDataItem name="GUI/LastVMSelected" value="{dff39fc8-84b9-45f9-908c-825e82950955}"/>
    </ExtraData>
    <MachineRegistry>
      <MachineEntry uuid="{612fe944-278c-4018-8785-bf2424e3b0e9}" src="Machines/XP SP3 IE6/XP SP3 IE6.xml"/>
      <MachineEntry uuid="{cc87b70c-537d-4fa3-a78c-d435d005887b}" src="Machines/XP SP3 IE7/XP SP3 IE7.xml"/>
      <MachineEntry uuid="{608e3882-5b2a-4c4b-aafd-591319d78dbe}" src="Machines/XP SP3 IE8/XP SP3 IE8.xml"/>
      <MachineEntry uuid="{dff39fc8-84b9-45f9-908c-825e82950955}" src="Machines/Vista Business IE7/Vista Business IE7.xml"/>
    </MachineRegistry>
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{9102a1bc-a0e0-dc11-827f-9ab851f2bb30}" location="/home/george/.VirtualBox/HardDisks/Vista Business with IE7.vhd" format="VHD" type="Normal"/>
        <HardDisk uuid="{b6202eec-1791-b921-4c0c-4306e34cc487}" location="/home/george/.VirtualBox/HardDisks/XP SP3 with IE6 2008-Dec.vhd" format="VHD" type="Normal"/>
      </HardDisks>
      <DVDImages>
        <Image uuid="{0b1f4b5b-25f8-4e95-9aa6-2c9714f964b8}" location="/usr/share/virtualbox/VBoxGuestAdditions.iso"/>
      </DVDImages>
      <FloppyImages/>
    </MediaRegistry>
    <USBDeviceFilters/>
    <SystemProperties defaultMachineFolder="Machines" defaultHardDiskFolder="HardDisks" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VRDPAuth" webServiceAuthLibrary="VRDPAuth" HWVirtExEnabled="false" LogHistoryCount="3"/>
  </Global>
</VirtualBox>

I have tried manually entering the newly generated UUID but it is seen but shown as not available

I suspect this is an issue with the vhds as this issue only occurs on the XP images and not the Vista image which has a different UUID. Any ideas greatly appreciated.

Re: Duplicate UUID issue with vhd images

Posted: 2. Mar 2009, 18:33
by lodidadee
I just did this yesterday but I used the VBoxManage tool..
http://78.46.147.154/viewtopic.php?p=9916

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 14. Apr 2009, 15:50
by shapeshed
Thanks to Andrew Odri I have solved this. Microsoft's VHDs share the same hard disk identifier so you can use qemu to convert the image to a raw file and then VBoxManage to convert it to a .vdi.

Full write up for Ubuntu and Mac OSX can be found here or check out Andrew's post

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 2. Oct 2009, 11:44
by MrKoen
I encountered the same issue as described in this topic but was unable to resolve it using the steps outlined in previous posts. I did find another way to accomplish the same though. It's quite cumbersome and will take some time, but it works. Hopefully they will fix the change UUID command soon so this will become easier. The steps I took to allow a VHD copy to be used simultaneously under VirtualBox are:
  • 1. Use VirtualBox to create a new VDI disk. This may either be a dynamic disk or a fixed size disk
    2. Get your hands on a bootable iso image with a disk clone program like Norton Ghost or Hirens Boot CD. With some Googling you should be able to either find a direct download to one or find instructions how to make one yourself.
    3. Attach the new VDI from step 1 to the virtual machine with the disk you want to clone. Set the ISO from step 2 as the CD/DVD image to boot from.
    4. Run VirtualBox and press F12 so you can select the drive to boot from. Select the CD drive.
    5. Go through the clone process and clone the VHD to the VDI. In Norton Ghost use disk to disk copy for this. It may take a couple of hours to complete.
    6. After the cloning process has been completed, remove the VHD and the ISO boot cd from the virtualmachine and try to boot from the newly created VDI.
    7. This should work and allow you to still use the original VHD with its UUID in combination with another virtual machine.
Hope these steps are clear for the people needing it. If not, feel free to send me a PM.

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 2. Oct 2009, 12:03
by Sasquatch
On Linux, when you install Wine you can use the VDI tool from mpack to convert and clone the VHD to a VDI directly. See the sticky in this forum. If you happen to have a Windows machine nearby, I recommend you use that system instead of Wine, you never know if the file gets messed up (the original should stay uncorrupted).

Easy workaround Duplicate UUID issue with vhd images

Posted: 16. Feb 2010, 19:39
by adrian15
Here there is my easy workaround, just write the full path for each one of the files.

Code: Select all

VBoxManage clonevdi one.vdi two.vdi
should give an error.

Code: Select all

VBoxManage clonevdi /my/path/to/one.vdi /my/path/to/two.vdi
should work ok.

If both images are in the same folder where you are working you can do:

Code: Select all

VBoxManage clonevdi `pwd`/one.vdi `pwd`/two.vdi
Enjoy it!

adrian15

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 13. Apr 2010, 20:48
by joseph@k2.com
Thanks Adrian, that was nice and simple. However, in the 3.1.6 version I grabbed last week, the command-line seems to have changed just a little. This worked for me:

Code: Select all

VBoxManage clonehd `pwd`/one.vhd `pwd`/two.vhd

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 15. May 2010, 22:16
by sajigeorge
If still its not working in windows XP, try this

VBoxManage clonevdi UUID targetpath\tagetfile.vdi

Eg: VBoxManage clonevdi 46a453bd-4d03-4988-a066-6ecfc6ced308 "D:\vitualbox\clone.vdi"

Re: Easy workaround Duplicate UUID issue with vhd images

Posted: 18. Jul 2010, 03:58
by whit
adrian15 wrote:

Code: Select all

VBoxManage clonevdi /my/path/to/one.vdi /my/path/to/two.vdi
should work ok.
See http://www.virtualbox.org/ticket/6367

If Oracle's not going to fix this so it works without specifying the full path, at least they might add this to the documentation of the function. That bug was filed for 3.0.12, and remains unfixed in 3.2.6.

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 18. Jul 2010, 04:31
by Perryg
If you set the environmental variables in Windows you would not need to use the absolute path.
Just add the folder that has the VirtualBox main files to the path statement. If you use a different location for the VDI files you would need that in the statement as well. I see this as Windows not being able to find the location. It works for me.

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 18. Jul 2010, 05:49
by whit
Perryg wrote:If you set the environmental variables in Windows you would not need to use the absolute path.
Just add the folder that has the VirtualBox main files to the path statement. If you use a different location for the VDI files you would need that in the statement as well. I see this as Windows not being able to find the location. It works for me.
Let me be clear. This is about running it in Linux, not Windows. There's no Windows involved in this report. That's why it's in the "VirtualBox on Linux Hosts" forum.

Getting off topic, but back to what we were properly discussing in the Windows host forum, Perry: Using the paths, I did clone the VM, and copy the clone back to the Windows 7 box that has been having trouble running it. Despite that it ran perfectly on a Linux host, including a dist-upgrade to the latest of the Ubuntu 10.04 components, the clone fails to start under Windows 7 just the same as before. And fails to start if I upgrade VB to 3.2.6 on Windows 7 - just in case it needs a matching version to the Linux host. I went through the entire process of setting up the clone as New in the Windows 7 host too. So it's not just some cruft that got in the XML file; it built itself a new one.

Back to topic here: There's plainly a lot of very broken stuff in VirtualBox. It's standard in *nix that if you're specifying a file that's in the directory, and to write to a file in that directory, and it's your present working directory, you don't need to specify the full path. This is Sun after all, they know *nix conventions. And VB's error isn't about not finding the file. It's about the file already being "registered" in the XML file, as if that should be a reason not to clone it. So there's an error even in what error message it gives!

The news here isn't that complex, ongoing software projects have bugs. The news is that Oracle has this out licensed for evaluation, and they're ignoring feedback from the evaluators. Not you, Perry. You're not Oracle, as you point out. But the bug report on this was filed 4 months ago. Fixing at least the documentation on this to get the workaround there would take someone all of 5 minutes to commit, for someone at Oracle. Cloning a VM is absolutely a central operation in a professional context - this isn't just something obscure broken nobody should much care about. Yet they leave it broken and undocumented so that people have to search out a workaround. Even your method of setting envars is a workaround.

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 18. Jul 2010, 16:07
by Perryg

Code: Select all

perry@perry-u1004:~$ VBoxManage clonehd Xubuntu.vdi Xubuntu2.vdi
Oracle VM VirtualBox Command Line Management Interface Version 3.2.6
(C) 2005-2010 Oracle Corporation
All rights reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: bcabb1a5-b8e4-410f-a4f9-9a5c130a6b54
perry@perry-u1004:~$ 
I don't have this problem either. I am sure that you and others do. There has to be a difference and when that is found then a solution would present itself.
Regarding the ticket in bugtracker. I do not see a guest log file listed in the ticket. The Devs are fairly strict about that.

Question: I see in the ticket that you run the VBoxManage command as root/SU. Were you logged in as root and do you always login as root?
Supposing that you did not install this as root but as su/sudo, try it as a normal user and see if the command can be run without the full path.

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 18. Sep 2011, 18:42
by jago25_98
On linux I had to do

vboxmanage clonevdi uid-without-brackets out.vdi

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 21. Dec 2012, 22:00
by Om
Hi there,

I had the same UUID problem and a very easy fix worked for me. I went File>virtual media manager. I found the vdi file that was giving me issues. Selected it and removed (though it was showing up as inaccessible). Then started the VM again and selected the file from my local hard-disk. That was it!
Hope this works for you too. :)

Om

Re: [SOLVED] Duplicate UUID issue with vhd images

Posted: 22. Dec 2012, 12:16
by mpack
Most of the above is ancient history and/obsolete, e.g. VHD support was added a long time ago.

The way to avoid duplicate UUIDs in VHD/VDI/VMDK is to not use the host OS to copy the disk image file. Use a proper cloning tool instead, e.g. use "VBoxManage clonehd", or use the "Copy" feature of File|Virtual Media Manager.. You can also use CloneVDI (on Linux this this would require Wine).

Topic locked to prevent further discussion of obsolete issues.