VirtualBox: How to change the UUID of Virtual Disk (vdi)

Copying the image of Virtual Disk (.vdi file) is a convenient way to duplicate the disk, in cases you want to avoid re-installing an operating system from scratch.

However, simply copying the .vdi file into another location will make a verbatim copy of the virtual disk, including the UUID of the disk. If you try to add the copy in the Virtual Media Manager, you will get an error like this:


In this case, you have to do the following:

giannis@giannis-laptop:~$ VBoxManage internalcommands setvdiuuid /path/to/virtualdisk.vdi
VirtualBox Command Line Management Interface Version 2.2.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

UUID changed to: 9e89fe14-d010-469e-a737-cd65218c4acb

Since the old UUID is replaced with a new one, you can now add and use the virtual disk.

Please note, that you wouldn’t have to follow this procedure if you had used the clonevdi function to copy the virtual disk image, in the first place. The clonevdi function makes sure that the new disk image will have its own unique UUID.

The syntax of the clonedvi goes like this:

$ VBoxManage clonevdi Master.vdi Clone.vdi

This entry was posted in Uncategorized. Bookmark the permalink.

28 Responses to VirtualBox: How to change the UUID of Virtual Disk (vdi)

  1. M.Sureshkumar says:

    Very nice stuff, it’s saving time of re-installing an operating system from scratch.

    it’s working very nice ….. superba work !!!!!!!!!

  2. Alexander says:

    Thanks! It works :-)

  3. Wilson says:

    Just what I need it.

  4. Adam says:

    Worked beautifully. Thanks

  5. Mark says:

    Thanks greatly (I’ve still not had to RTFM ;-} )

    However, the clonevdi method does not work as VB keeps an .xml record of known disks/uuids and bounces attempts to clone. You’d have thought the response would be “Cannot create a duplicate UUID – OK to create a new UUID for the clone otherwise Cancel” …it ain’t rocket salad is it!
    (can’t guess what the –remember and –existing arguments mean so maybe I will rtfm after all…)

  6. Seth Kutty says:

    Thanks! It saves us a lot of time to replicate complex environments for my clients quickly. (

  7. John says:

    Still works!

  8. Ikutsin says:

    >Thanks greatly (I’ve still not had to RTFM ;-} )
    Well, this command is actually not listed in commandline help.
    Use: VBoxManage internalcommands help

    CLONEHDis also listed there. Previously, it was a nightmare to convert vmware hard disks (vmdk) to vdi.

  9. Dormand says:

    From command prompt go to virtual box installation folder then use this command
    >vboxmanage internalcommands setvdiuuid vhddFileName.vdi

    it will change the uuid of vhddFileName.vdi

  10. Evaldo says:

    Thank you, very useful

  11. AdulRahman Attia says:

    Thanks alot, it’s save a big time.

  12. cts.private says:

    I copied my vdi to a USB stick and it took about 5 minutes, but then, naturally, it didn’t work because I didn’t clone it.

    So then I cloned it … that was about 3 hours ago and so far it’s only on 70%

    What does clone do, anyway?

  13. David says:

    Am wondering why VDI management / cloning isn’t built into UI?

  14. Jerry White says:

    For VMWare image disks
    VBoxManage internalcommands sethduuid disk.vmdk

  15. Some One says:

    Thanks! Clean solution!

  16. zyr517 says:

    change setvdiuuid to sethduuid, it’s work, thanks man!

  17. coderix says:

    very nice .and do you know how can i see my UUID file is there a special command or something on virtualbox screen option ?

  18. Load3r says:

    Windows, OVB 4.3.10
    C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands sethduuid D:\
    UUID changed to: 00549cf5-700e-45f9-b236-cb7d6b8a0223

    another syntax)

  19. asadi says:

    ‘setvdiuuid’ is changed to ‘sethduuid’ in new version.

  20. edward says:

    Tip still helpful.

  21. say thanks to so a lot for your web site it helps a lot.|

  22. Clark Kent says:

    I use Load3r syntax guide. It change my uuid. Thanks a lot for all the comments here. It takes so much time cloning vm, and I use copy vdi to install new vm :-)

  23. Rashmi says:

    Is there a problem with oracle virtual box. I had exported individual VMs which had disks of fixed size and .vdi extension.
    While I am trying to import them, it creates all as .vmdk files and all with dynamic allocation. That’s the reason I am not able to share the VMs.
    So would like to know if I do an OS copy of the vdi files and add those new disks after removing the vmdk files, will it cause any change to the UUID of the guest VM which is oracle linux. Request your immediate response.

  24. Aditya Vaiyata says:

    Is there way to have a fixed machine id for a VM in Virtual Box.
    The problem is whenever I reboot the VM, its machine id changes which causes issue with the access, since the client has whitelisted machine id of a particular machine.

  25. Anonymous says:

    Technically talking that is not changeing the UUID, it is reseting to a random value.

    Sorry to be so crude, but, how on the hell someone can set an UUID to a virtual disk?

    Let me explain the main problem, aka => WINDOWS !!!

    If you clone a Windows system drive, the UUID changes, and sometimes when you boot with such changed UUID, WINDOWS detect it (allways) and only sometimes looses the activation; oh, yes, you can reactivate it again OnLine (only a limited number of times, then a Phone call to an International number is requiered).

    Disclaim: I know about piracy activation tools, they exists, but i hate piracy.

    Why on the hell would i want to clone a Disk and mantain its UUID (since only one will be able to be used at a time)?

    1.- Windows detects it as another disk and among activation problem, there are a lot of more probles if you use NTFS mounted partitions instead of letters.
    2.- Just testing what format VDI, VHD, VMDK, etc is faster and smoother
    3.- Other reasons anyone can have

    So, please explain how to change the UUID of a disk to a specific value or change the title to “how to reset …”, thanks.

    Sorry for looking rude, it is that i am very frustrated to find a lot of forums where they talk about changing UUID but no one say how to change UUID to a specific value, it you do not believe me, try it yourself.

    I do not remember the name of the tool and i remember it sometimes corrupts the disks, but there was a third part tool (without source code) that do a binary edit of an offset of the file (where the UUID is suposed to be stored), i also remember the tool only do this: Go to offset XXXX and write there the UUID, like a human can do with an Hex editor that do not need to load the whole file on RAM.

    Now hope you can understand i am not really rude, i am expressing the frustation of VBoxManage not having the parameter to specify the new UUID you want (not a random new one, just the one i have written on a paper, etc).

    By the way, great post about how to ReSet the UUID.

  26. Anonymous says:


    All cloned disks by VBoxManage have their UUID assigned as a NEW (RANDOMLY generated) UUID, there is no ‘official’ way to MAINTAIN the UUID while cloning.

    If you use VDI format, you can use Windows tool CloneVDI, it has a checkmark to MANTAIN the UUID, but source and dest must be VDI if a did not remember bad (and not for snapshots), inmutable change status get mixed with the parent or get lost. I use it mainly to merge changes to an inmutable, so merge it onto the parent for making them permanent (only when i want that).

Leave a Reply to ravi Cancel reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>