How to Change the UUID of Virtual Disk (.VDI)
Abstract: Linux Usersc an also use the VBoxManage command to change UUID of a disk. VBoxManage internalcommands sethduuid "/var/vdisks/myDisk1.vdi"\NewVM\myDisk
VirtualBox provides an utility named VBoxManage
to create the clone of existing disk. In case you already created a copy of the disk and try to create the VM using this. You will face an issue of UUID already registered like below:
Cannot register the hard disk ‘D:\NewVM\myDisk1.vdi’ {9ad88130-26ce-45e1-b415-b1b3a42d749a} because a hard disk ‘D:\myOldVM\oldDisk1.vdi’ with UUID {9ad88130-26ce-45e1-b415-b1b3a42d749a} already exists.
To solve this issue, Use the VBoxManage utility to change the UUID of the VDI disk using the command line.
Change the UUID of Virtual DiskVBoxManage
command is installed with VirtualBox installation on your system. So, its available for all operating systems having VirtualBox installed.
Windows Users can use the following command to change UUID of D:\NewVM\myDisk1.vdi disk.
c:\> cd "C:\Program Files\Oracle\VirtualBox\" c:\> VBoxManage.exe internalcommands sethduuid "D:\NewVM\myDisk1.vdi"
Linux Usersc an also use the VBoxManage
command to change UUID of a disk.
VBoxManage internalcommands sethduuid "/var/vdisks/myDisk1.vdi"Best Way to Clone VDI Disk:
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