When installing a VM under VirtualBox or similar systems, it would be helpful for bsdinstall to eject the ISO image before rebooting. Manually ejecting is difficult since it cannot be done until the ISO is unmounted, which occurs just before reboot, and the BIOS post time is about 1 second for a VM. The user has very little time to eject the ISO and prevent the VM from booting from the install media again after installation. Same may apply to bare metal systems, though the user has much more time to remove the media before the next boot.
Last I looked, which I admit was quite some time ago, removing the installer before reboot(8) or shutdown(8) ended up constantly spewing garbage on the console until the system (VM or not) was forcibly reset. FWIW, when using VirtualBox, I always set the first hard drive as the first boot device and fall back to CD-ROM as the last option, which does not exhibit the problem of booting back into the installer.
virt-manager, smartly, ejects the installation Medium when the VM is rebooted
During the invocation of reboot(8), or when the system is reset and is about to boot again?
(In reply to Glen Barber from comment #3) pretty sure it's the latter. I don't think qemu knows the system is rebooting until it resets, and probably takes that as cue that the installation is finished, and the installation medium can be removed
Then, IMHO, this is a feature request for the VirtualBox developers. In short, you cannot take away the root mountpoint (in this case, a CD-ROM ISO) prior to or during a system reboot. At that point, it would be up to the hypervisor to determine if the media should still be mounted.
(In reply to Glen Barber from comment #1) I had thought about making the CD secondary, but I'm mainly looking at this from the perspective of new users trying out FreeBSD for the first time. Some of the Linux systems I've installed recently eject the media without any issues, so they appear more user-friendly in that sense right off the bat. Maybe there's a way we can trigger an eject upon the next reset, or incorporate an eject as a command-line flag of reboot(8) or shutdown(8), which I presume could unmount the media first. I haven't looked into any of the code yet, so I'm just hypothesizing here.
(In reply to Glen Barber from comment #5) VirtualBox is only an example here. The same problem exists for any VM, or for bare metal if the user gets distracted.
(In reply to Jason W. Bacon from comment #7) true. my biggest problem is telling the installer from the boot actually boot screen apart
(In reply to Mina Galić from comment #8) FWIW, jtrc27 made some improvements to the loader menu recently so it's possible to tell the installer loader from the installed loader, but it's still fairly subtle (IIRC two lines differ).
If it's not obvious to anyone how to add an eject option, I can figure it out and send a suggested patch. At some point in the reboot sequence, there must be a "umount /". I think inserting an optional eject command after that and before the reset should solve the problem across the board (assuming eject is possible for the given media). How we get there from bsdinstall I don't know yet (shutdown -r, reboot, init 6?), but I can track it down and figure out a tweak.