Page 1 of 1

removing an iso from a cdrom device

PostPosted: 27. Mar 2013, 16:37
by rshaw
I see that removable mediums such as iso's can be unmounted with https://www.virtualbox.org/sdkref/interface_i_machine.html#a1f3da9c7f26b4c630f3989f98b58515a when the machine is live, but I can't quite figure out how to remove an iso (such that the drive is empty) when the machine is off. It almost looks like https://www.virtualbox.org/sdkref/interface_i_machine.html#a8e51fafec7442a48a86a59edec5ec217 will work if you pass in null but that only throws errors if an iso is currently attached (seemingly the wrong call)

Re: removing an iso from a cdrom device

PostPosted: 27. Mar 2013, 16:53
by rshaw
I read through the source code of VBoxManageStorageController to find how VBoxManage is doing this with the "emptydrive" flag (which does what I wanted)

They DetachDevice which removes the device entirely and then AttachDeviceWithoutMedium.