How to remove or detach dvd from VirtualBox machine using VBoxManage command line 5

This took a while to solve, its not exactly user-friendly.  I have a FreeBSD server running VirtualBox virtual machines in headless mode, and I need to do everything using VBoxManage command line. (CLI)  In one case I wanted to remove the attached DVD ISO image from my machine. They don’t have a “storagedetach” or “removehd” command, you have to use the “storageattach” command, with some extra info.

List the VM info to see the port and device attached.
VBoxManage showvminfo vmMaridia
(My VM name is vmMaridia)

You will see stuff like so:

Storage Controller Name (0): maridiasata
Storage Controller Type (0): IntelAhci
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 30
Storage Controller Port Count (0): 30
Storage Controller Name (1): maridiaide
Storage Controller Type (1): PIIX4
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1): 2
Storage Controller Port Count (1): 2
maridiasata (0, 0): /vm/sys/maridia/mir1.vdi (UUID: fd813be8-dd38-4784-a374-d96263aae1ba)
maridiasata (1, 0): /vm/sys/maridia/mir2.vdi (UUID: dab57578-4de5-4bef-91ee-232c56eea671)
maridiasata (3, 0): /vm/sys/maridia/mardia-bu.vdi (UUID: 6ac3c6aa-ae5b-4d57-8f30-24e59d2ef381)
maridiasata (4, 0): /vm/sys/maridia/share-sata.vdi (UUID: d16a4847-95fb-43bd-b8b4-c7d9e38d9946)
maridiaide (0, 0): /vm/iso/sysresc156.iso (UUID: 10cbebd7-e058-4c8e-9487-52e7776d9935)

So, in my system, I wanted to remove from maridiaide controller, the port 0, device 0. Which is the sysresc156.iso.
To remove the DVD:

VBoxManage storageattach vmMaridia --storagectl maridiaide --port 0 --device 0 --medium none

The trick was, you just specify “none” as the medium when you want to remove it. Now when you run “showvminfo” on that VM, you’ll see no drive attached, in fact no maridiaide controller listed. (although, I do think it is registered still?)