A universally unique identifier (UUID) is a string of characters used to identify a specific virtual disk. The UUID of a virtual disk can be changed for various reasons, such as to avoid duplication or to keep the virtual disk separate from others with the same name. Here is a step-by-step guide on how to change the UUID of a virtual disk in Linux.

Advertisement

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:

Failed to open the hard disk D:\NewVM\myDisk1.vdi.
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 Disk

VBoxManage 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 Users can also use the VBoxManage command to change UUID of a disk.

VBoxManage internalcommands sethduuid "/var/vdisks/myDisk1.vdi"

Clone a 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

Conclusion

In conclusion, changing the UUID of a virtual disk in Linux is a straightforward process that can be done by following these simple steps. It is important to backup the data before making any changes to the virtual disk and to verify that the changes have been made successfully.

Share.

6 Comments

  1. Bogdan Florin on

    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.

  2. Bogdan Florin on

    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.

Exit mobile version