How-To

How to Fix VirtualBox UUID already exists Errors

create-hyper-v-virtual-machine

VirtualBox runs well enough under normal circumstances, but once you start moving VHDs around, it might spit out errors. Here’s how to fix a common problem after moving a VHD.

If you’re running VirtualBox on a Windows computer, you’ll probably run into errors from time to time. When I migrated my virtual hard drives from one physical disk to another, I ran into a permissions error. Apparently, when Virtualbox creates a .vhd (or another format virtual hard drive), it bakes in a universally unique identifier that it uses to recognize VHDs. Usually it doesn’t cause problems, but in this case, it prevents duplicates or moved virtual disks from running from an unknown location.

Fix VirtualBox UUID Errors

The error looks like this:

virtualbox error - failed to open hard disk uuid

“Failed to open the hard disk E:\VirtualBox VMs\Windows 8 \Windows 8 Enterprise2.vhd.

Cannot register the hard disk ‘E:\VirtualBox VMs\Windows 8 \Windows 8 Enterprise2.vhd’ {ca2bdc6a-a487-4e57-9fcd-509d0c31d86d} because a hard disk ‘E:\VirtualBox VMs\Windows 8 Enterprise\Windows 8 Enterprise2.vhd’ with UUID {ca2bdc6a-a487-4e57-9fcd-509d0c31d86d} already exists.

Result Code:
E_INVALIDARG (0x80070057)

Component:
VirtualBox

Interface:
IVirtualBox {3b2f08eb-b810-4715-bee0-bb06b9880ad2}

Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)”

Oracle has a chapter in the VirtualBox manual that covers UUID problems, which may reveal how to fix this. Or you can just follow the steps below.

How to Reset the UUID

To fix this, you’ll need to run some text commands. Open up the Command Prompt. In both Windows 8 and Windows 7, it can be found by typing “cmd” into the Start Menu search box.

launch cmd prompt windows 7windows 8 command prompt

Now change the cmd prompt’s directory to the folder you installed VirtualBox in. If you put it in the default the command is this:

cd C:\Program Files\Oracle\VirtualBox\

cd to the virtualbox directory

Now type in the following command (or copy/paste using right click):

VBOXMANAGE.EXE internalcommands sethduuid “pathtovhdfile”

uuid changed

If everything worked, you should see a message saying “UUID change to: …” and then the VirtualBox should work. All fixed!

45 Comments

45 Comments

  1. E1000i

    June 13, 2013 at 6:31 am

    This will work also for linux (ubuntu-debian) atleast:

    just can directly execute wherever your located a slightly different command:

    vboxmanage internalcommands sethduuid “newPathto.vdi”

    thanks for the post, it saved me a lot of reserach and reading!

  2. Victor

    July 18, 2013 at 7:57 pm

    Thank you very much. :D

  3. Hamid

    August 12, 2013 at 10:19 pm

    Thx
    It works fine
    :-)

  4. Adrian Constantin

    August 20, 2013 at 3:55 am

    Thank you, Austin!
    You saved me a lot time!

  5. saif

    March 12, 2014 at 9:43 am

    thinks man realy thinks you realy helpe me

  6. Alguien

    July 23, 2014 at 9:35 am

    Thank you! It works!!

  7. remih

    August 20, 2014 at 11:52 pm

    Thanks !!!
    Solution works great on Windows 8 and
    saved me a lot of time !:)

  8. KP

    September 19, 2014 at 12:56 am

    Thanks for your blog.
    But i am stuck at another error that my vmdk file already exists …..

    actually i am importing the virtual alliance to VM box … so the moment i change the uuid and start importing again it gives the error cannot create because vmdk already exists.. Then i delete machine and start importing same UUID error occurs then again after fixing vmdk exists … So i am kind of looping in it …

  9. AbdreyS

    February 4, 2015 at 4:31 am

    Excellent!!! Thank you very much! Best regards, Andrey from Russia

  10. Jazzy

    April 28, 2015 at 6:42 am

    I had moved a *.vmdk over to a network drive and everything got the above error. Tried this and it worked, brilliant.

  11. Amro

    August 17, 2015 at 4:58 pm

    Thanks a lot it worked.

  12. Sandro

    October 1, 2015 at 5:10 am

    TKS

  13. Alex Heresmann

    October 15, 2015 at 6:53 pm

    It worked perfectly!!!

  14. Koez

    October 16, 2015 at 8:30 am

    Hi, guys. Need help here. I did occur the same problem, but when i enter the following command, it returns this-> VBoxManage.exe : error : Format autodetect failed: VERR_FILE_NOT_FOUND

    • FRTV

      December 2, 2015 at 5:07 am

      How did you solve the problem?

    • Experian

      April 2, 2017 at 9:15 am

      Odds are you left the ” ” on each side of the filename. Do not put
      VBOXMANAGE.EXE internalcommands sethduuid “c:\vms\myvm.vdi”
      Put
      VBOXMANAGE.EXE internalcommands sethduuid c:\vms\myvm.vdi

      I tried with the “” and it gave me the same issue. Not sure what to do if your path has spaces in it. I’d say just move the file to a top level directory with no spaces. That will work for sure.

    • Juan Olivier

      September 1, 2017 at 12:03 am

      I got the same error when I used the following:
      VBOXMANAGE.EXE internalcommands sethduuid D:\Virtuele Rekenaars\Oracle VM VirtualBox\Windows 7.vdi”

      Then I cut the file to the top directory and removed the space in the name like the following:
      VBoxManage internalcommands sethduuid D:\Windows7.vdi

      Then it worked

      c:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands sethduuid D:\Windows7.vdi
      UUID changed to: 9257de09-2a9c-4c13-ac6d-00d9fea8dcea

      • Francis

        June 25, 2019 at 6:38 pm

        I remove the folder in my C:/Users/Francis/.VirtualBox then re-install.

  15. Laura

    October 23, 2015 at 8:40 am

    Nice! works perfectly! thanks

  16. Mohit

    November 8, 2015 at 1:40 am

    Worked like a charm, Thank you!

  17. Ahmed

    January 7, 2016 at 5:07 pm

    a lot of thanks to you sir

  18. D Lee

    February 10, 2016 at 7:18 pm

    much appreciated!!! Worked like a charm!

  19. Cristian

    February 13, 2016 at 2:52 am

    How to type if the file is on the dextop and there name is Serverfilelist Mt2WordOnline.vdi

  20. Ricardo

    March 30, 2016 at 8:58 am

    Thank you.

  21. JORGE B

    April 9, 2016 at 1:23 pm

    Gracias…me salvó

  22. Yang Hang

    April 13, 2016 at 4:16 am

    Thanks. Saved my day!

  23. Peter

    June 17, 2016 at 6:00 pm

    Dude thank you! This was exactly what I was looking for!
    (Windows 10.0.10586 Home, VirtualBox 5.0.10)

  24. KAMAL KUMAR

    July 17, 2016 at 10:41 am

    Thanks.. it saved my time.

  25. Helmut

    October 12, 2016 at 4:11 am

    In the Virtualbox version 5.1.6 there is unfortunately no VBOXMANAGE.EXE what now?

    • Foden

      October 16, 2016 at 6:06 pm

      Hi Helmut

      (Win 10 64bit Pro)

      VBoxManage.exe does still exist in Virtualbox v 5.1.6. You need to run the commandlline from the install location of Virtualbox (default is C:\Program files\Oracle\Virtualbox – I believe) or you can add the Virtualbox path to the path environment variable

  26. rleonard

    May 19, 2017 at 8:41 am

    Austin,

    This was a real life-saver.

    Thanks for saving my sanity!

    • lokifrog

      April 11, 2021 at 8:06 pm

      MY GOD! Thank you so much for this! Your comment is so underrated.

  27. Grant

    June 12, 2017 at 7:22 pm

    There’s an easier way to deal with this. In the main Virtual Box window, go to File -> Virtual Media Manager and you’ll see a list of disks.

    The disk that you moved should appear with a yellow warning symbol (since VirtualBox can’t find it at its previous location). Click the disk, click “Remove”, and confirm. You can now add the disk back to your virtual machine and VirtualBox won’t complain about conflicting UUIDs.

    • RED SHEEP

      October 24, 2019 at 7:12 pm

      thank you so much

  28. kahn

    October 20, 2017 at 10:45 pm

    It’s work.
    Thank you very much.

  29. peter

    March 13, 2018 at 2:22 pm

    THANKS!

  30. Leonardo Ramos

    April 17, 2018 at 7:32 am

    Thank you very much

  31. Arati

    October 25, 2018 at 12:29 am

    Thank You. It saved my time.

  32. Justin

    March 25, 2019 at 10:15 am

    Awesome, it worked!

  33. Ahmad Hazazi Zakaria

    March 2, 2020 at 6:44 pm

    If you use this commands >> VBOXMANAGE.EXE internalcommands sethduuid “pathtovhdfile”
    and get error like this >> VBoxManage.exe : error : Format autodetect failed: VERR_FILE_NOT_FOUND
    you probably put wrong path.

    VBOXMANAGE.EXE change to your installation path folder eg: “C:\Program Files\Oracle\VirtualBox\VBoxManage.exe”
    “pathtovhdfile” put your image path (which folder and which file) eg: C:\Users\VirtualBox VMs\C_OS1908-VB-64bit\CentOS7-1908(64bit).vdi

    your command should look like this >>
    “C:\Program Files\Oracle\VirtualBox\VBoxManage.exe” internalcommands sethduuid “C:\Users\VirtualBox VMs\C_OS1908-VB-64bit\CentOS7-1908(64bit).vdi”

    hope it works for you

  34. lol

    March 28, 2020 at 8:43 am

    Very helpful! Thank you!

  35. Dmitry

    July 8, 2020 at 6:36 am

    It did not help, as the next error I get is:
    UUID {4b76a83c-6a63-40fc-8e86-b74721950ba0} of the medium ‘E:\WIN7\WIN7.vdi’ does not match the value {1eee8e25-b459-4d38-a4a3-b59e8f8ff1e3} stored in the media registry (‘C:\Users\user\.VirtualBox\VirtualBox.xml’).

  36. Hannao

    July 20, 2021 at 7:37 am

    Thanks solved my issue :)

  37. kapomony

    November 23, 2022 at 5:32 am

    thanks a lot, it works

  38. Smrdimubijam

    March 9, 2023 at 11:08 pm

    It works bro thanksss!!

Leave a Reply

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

 

To Top