﻿id,summary,reporter,owner,description,type,status,component,version,resolution,keywords,cc,guest,host
16583,Disk information are not being flushed from VBoxSVC's memory to the media registry,Anderson M. Gomes,,"I have a set of VHD files from a virtual machine that was created in a Hyper-V installation. I am able to attach those files into a new virtual machine in VirtualBox, however I'm unable to use them again after closing the VirtualBox window or rebooting the host computer.

I believe the bug happens because VBoxSVC is not saving information about disks it knows to the media registry. I can reproduce the the bug by invoking a sequence of '''VBoxManage''' calls from a script:

{{{
$ bash /tmp/vboxbug.sh 
+ vmname=VHDBUG
+ rootdir='/home/vboxbug/VirtualBox VMs/VHDBUG'
+ wait=true
+ killall -0 -v VBoxSVC
VBoxSVC: no process found
+ true
+ mkdir -pv '/home/vboxbug/VirtualBox VMs/VHDBUG'
mkdir: created directory '/home/vboxbug/VirtualBox VMs'
mkdir: created directory '/home/vboxbug/VirtualBox VMs/VHDBUG'
+ VBoxManage createmedium disk --filename '/home/vboxbug/VirtualBox VMs/VHDBUG/basedisk.vhd' --size 1024 --format VHD
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: b33d9462-412b-4b14-ab1b-632831b4594b
+ test -z true
+ killall -0 -w VBoxSVC
+ VBoxManage internalcommands dumphdinfo '/home/vboxbug/VirtualBox VMs/VHDBUG/basedisk.vhd'
--- Dumping VD Disk, Images=1
Dumping VD image ""/home/vboxbug/VirtualBox VMs/VHDBUG/basedisk.vhd"" (Backend=VHD)
Header: Geometry PCHS=2080/16/63 LCHS=0/0/0 cbSector=512
Header: uuidCreation={b33d9462-412b-4b14-ab1b-632831b4594b}
Header: uuidParent={00000000-0000-0000-0000-000000000000}
+ VBoxManage createmedium disk --filename '/home/vboxbug/VirtualBox VMs/VHDBUG/diffdisk.vhd' --diffparent '/home/vboxbug/VirtualBox VMs/VHDBUG/basedisk.vhd'
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 538700eb-cd6c-4d2b-b3ee-974d183c0517
+ test -z true
+ killall -0 -w VBoxSVC
+ VBoxManage internalcommands dumphdinfo '/home/vboxbug/VirtualBox VMs/VHDBUG/diffdisk.vhd'
--- Dumping VD Disk, Images=1
Dumping VD image ""/home/vboxbug/VirtualBox VMs/VHDBUG/diffdisk.vhd"" (Backend=VHD)
Header: Geometry PCHS=2080/16/63 LCHS=0/0/0 cbSector=512
Header: uuidCreation={538700eb-cd6c-4d2b-b3ee-974d183c0517}
Header: uuidParent={b33d9462-412b-4b14-ab1b-632831b4594b}
+ VBoxManage createmedium disk --filename '/home/vboxbug/VirtualBox VMs/VHDBUG/diffdiffdisk.vhd' --diffparent '/home/vboxbug/VirtualBox VMs/VHDBUG/diffdisk.vhd'
VBoxManage: error: Parent medium with UUID {b33d9462-412b-4b14-ab1b-632831b4594b} of the medium '/home/vboxbug/VirtualBox VMs/VHDBUG/diffdisk.vhd' is not found in the media registry ('/home/vboxbug/.config/VirtualBox/VirtualBox.xml')
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: ""OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())"" at line 179 of file VBoxManageDisk.cpp
}}}
",defect,closed,virtual disk,VirtualBox 5.1.18,worksforme,,,all,Linux
