If you are using VirtualBox to manage virtual machines, you might encounter an error when trying to add a new virtual disk. One common error message you might see is:
Cannot register the hard disk ‘C:\path\to\your.vdi’ {9ad88130-26ce-45e1-b415-b1b3a42d749a} because a hard disk ‘C:\path\to\old.vdi’ with UUID {9ad88130-26ce-45e1-b415-b1b3a42d749a} already exists.
This means that VirtualBox found another virtual disk with the same unique identifier (UUID) as the one you are trying to add. VirtualBox requires each disk to have a unique UUID. To fix this issue, you need to change the UUID of the new disk.
In this guide, we will show you how to change the UUID of a VDI file using the VBoxManage tool included with VirtualBox. Follow the steps below to resolve this error.
Steps to Change UUID of a VDI file in VirtualBox
To change the UUID of a VDI file in VirtualBox on a Windows system, you can use the VBoxManage command-line tool provided with VirtualBox. Here are the steps:
- Open Command Prompt as Administrator:
Press Win + X and select “Command Prompt (Admin)” or “Windows PowerShell (Admin)”.
- Navigate to the VirtualBox installation directory:
By default, VirtualBox is installed in C:\Program Files\Oracle\VirtualBox. Use the cd command to navigate to this directory:
cd "C:\Program Files\Oracle\VirtualBox"
- Run the VBoxManage command to change the UUID:
Use the following command to change the UUID of the VDI file:VBoxManage.exe internalcommands sethduuid "C:\path\to\your.vdi"
Replace “C:\path\to\your.vdi” with the actual path to your VDI file.
For example:
VBoxManage.exe internalcommands sethduuid "D:\NewVM\myDisk1.vdi"
Optionally, If you want to specify a particular UUID, you can do so by adding it to the command:
VBoxManage.exe internalcommands sethduuid "C:\path\to\your.vdi" 12345678-1234-1234-1234-123456789012
- Verify the UUID change:
To verify that the UUID has been changed, you can use the VBoxManage showhdinfo command:VBoxManage.exe showhdinfo "C:\path\to\your.vdi"
This command will display the information of the VDI file, including the new UUID.
Clone a VDI Disk (Optional)
VBoxManage provides an option to make a clone of the existing disk. Where the utility creates a copy of the disk with different UUID and you will not face the above issue.
VBoxManage clonevdi myDisk1.vdi cloneDisk.vdi
Conclusion
By following these steps, you can easily change the UUID of a VDI file and avoid conflicts in VirtualBox. This will allow you to add new virtual disks without encountering the error message about duplicate UUIDs. Managing your virtual machines will become smoother, and you can focus on other important tasks.
6 Comments
I Export Apliance operation from Host01 and Import Apliance to Host02 and .. suprise … however Host01 and Host02 are Hardware/Software IDENTICALY .. After Import and Start Virtual Machine … I can not ping over network …
I begin to belive that THERE IS NOT OFFICIAL METHOD for Transfer Virtual Machine from a Host to Another using Virtual Box 🙁 Disapointing.
I try to move a Virtual Image from Host01 to Host02 both Windows 10 Up to date.
I perform the following operations:
– closing image on Host01
– removing Virtual machine from Host01
– copying Virtual Machine Folder to Host02 computer
– Open Virtual Box on Host02 and trying to ADD image > Gotting Error about UUID existing …
– Google-ing and find command to change UUID
– Run Change UUID comand to Copied Virtual Machine on Host02
– Closing Virtual Box on Host02 … wait 2 minutes … Opening Virtual Box and ADD-ing Virtual Machine … not bad ..
– Trying to Start Virtual Machine … UUID nnn of the medium ‘D:\…….vdi’ does not match the value {0f9050c6-8c2d-4353-bb81-a2cc69539e77} stored in the media registry (‘C:\Users\florinb\.VirtualBox\VirtualBox.xml’).
What to do now ? 🙁 Please advice.
In vbox 5.2.10 the command is slightly different.
VBoxManage internalcommands sethduuid “path/to/file”
Excelente información, thanks!
Il faut des guillemets autours de “D:\NewVM\myDisk1.vdi”
Thanks Olivier, I have updated article.