removing an iso from a cdrom device

Discussion about using the VirtualBox API, Tutorials, Samples.

removing an iso from a cdrom device

Postby rshaw » 27. Mar 2013, 16:37

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)
rshaw
 
Posts: 15
Joined: 11. Feb 2013, 17:04

Re: removing an iso from a cdrom device

Postby rshaw » 27. Mar 2013, 16:53

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.
rshaw
 
Posts: 15
Joined: 11. Feb 2013, 17:04


Return to The VirtualBox API

Who is online

Users browsing this forum: No registered users and 1 guest