I generate a VDI hdd image with a script.
As i am in tuning process, i regenerate it very often.
Each time the VDI is regenerated, VirtualBox did not recognize the disk anymore and i have to remove it, reenter the new file and associate it with my VM:
$ VBoxManage startvm iso-debian Waiting for VM "iso-debian" to power on... VBoxManage: error: Could not open the medium '/path/to/myimage.vdi'. VBoxManage: error: VD: error VERR_FILE_NOT_FOUND opening image file '/path/to/myimage.vdi' (VERR_FILE_NOT_FOUND) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MediumWrap, interface IMedium
The file exists but i presume its UUID or some metadata has changed so it is not found by VirtualBox.
Is there a more convenient way (through VBoxManage) to tell VirtualBox to refresh its VDI database ?
$ VBoxManage update-vdi-metadata /path/to/myimage.vdi
or something else i can put in a bash script to avoid having to make all theses steps manually.