removing an iso from a cdrom device

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
rshaw
Posts: 15
Joined: 11. Feb 2013, 17:04

removing an iso from a cdrom device

Post by rshaw »

I see that removable mediums such as iso's can be unmounted with https://www.virtualbox.org/sdkref/inter ... f98b58515a 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/inter ... edec5ec217 will work if you pass in null but that only throws errors if an iso is currently attached (seemingly the wrong call)
rshaw
Posts: 15
Joined: 11. Feb 2013, 17:04

Re: removing an iso from a cdrom device

Post 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.
Post Reply