﻿id,summary,reporter,owner,description,type,status,component,version,resolution,keywords,cc,guest,host
17908,Optional entries in the <MediaRegistry> section may prevent VM registration,Socratis,,"The <MediaRegistry> section of the .vbox file contains a registry of active and previously used media; HDs and DVDs, a.k.a. the Most Recently Used (MRU). The MRU list is nothing but a convenience for the end user.

'''Problem''': If there's an MRU entry that conflicts with an existing registered medium, the import/registration of a VM fails.

'''Example''': __Registered__ VM1 has an entry in the MediaRegistry section for a ''__previously used__'' DVD:
{{{
<MediaRegistry>
  <DVDImages>
    <Image uuid=""{11111111-1111-1111-1111-111111111111}"" location=""Test.iso""/>
  </DVDImages>
</MediaRegistry>
}}}
A second VM2 has the following in the MediaRegistry section for a ''__previously used__'' DVD:
{{{
<MediaRegistry>
  <DVDImages>
    <Image uuid=""{22222222-2222-2222-2222-222222222222}"" location=""Test.iso""/>
  </DVDImages>
</MediaRegistry>
}}}
The names of the DVDs are the same, the UUIDs are different (it happens more often than you think). Trying to register VM2 results in the following error:
> ''Failed to open virtual machine located in /Users/Shared/Test2.vbox.''
> 
> ''Cannot register the DVD image '/Users/Shared/Test.iso' {22222222-2222-2222-2222-222222222222} because a CD/DVD image '/Users/Shared/Test.iso' with UUID {11111111-1111-1111-1111-111111111111} already exists.''
> 
> ''Result Code: NS_ERROR_INVALID_ARG (0x80070057)''[[br]]
> ''Component: VirtualBoxWrap''[[br]]
> ''Interface: IVirtualBox {9570b9d5-f1a1-448a-10c5-e12f5285adad}''
and the import fails. Not good.

'''Workaround''': The only workaround so far is to ''manually'' edit the .vbox file and remove the __''optional''__ entry for the ""offending"" medium. Remember, this entry is purely optional, the DVD is __not__ actively attached.

'''Solution''': If an entry in the MediaRegistry section is solely used so that it can be displayed in the MRU, ignore that entry upon registration and delete that entry from the MediaRegistry section, as to not cause conflicts.",defect,reopened,other,VirtualBox 5.2.16,,"MediaRegistry, duplicate entry, fail to import",,all,all
