None of the solutions above worked for me because I was trying to import a VDI file created under VirtualBox 3.1.6 into VirtualBox 4.32 running on a different machine. This is a self contained file and there is no linkage to another VDI. I kept getting the error:
Parent medium with UUID {a9dccef3-45f8-45ff-835e-a2b6e7279bac} of the medium
'c:\Disks\Windows.2003.R2.Enterprise.SQL.Express.192.168.56.222.Trusted.vdi'
is not found in the media registry
I even imported the same vdi under VirtualBox 3.1.6 and then tried to use VBoxManage clonehd again to see if I can get rid of the error but that did not work either.
In the end I simply edited .VirtualBox/VirtualBox.xml manually by adding
<HardDisk uuid="{43ea34ba-6d72-413e-8b37-32f475927ace}" location="C:/Disks/Windows.2003.R2.Enterprise.SQL.Express.192.168.56.222.Trusted.vdi" format="VDI" type="Normal"/>
(The uuid was obtained using VBoxManage showvhinfo under VirtualBox 3.1.6.)
And that finally solved the problem, i.e., I was able to create a new VirtualBox session using the vdi.
Hope this note will help those who runs into the same problem.
Just be aware that you will have to name your machines different from the original or delete the VM folder before you do, otherwise Oracle in their motherly care about your will not allow you to proceed as in their opinion "the folder already exist and might belong to another VM". – ajeh – 2016-09-24T20:58:40.747
This worked without having to rename the original folder in VirtualBox 5.2 – Georg Schölly – 2017-10-25T15:11:44.833