Virtual Machine - Stop the need to add and remove the CD-ROM device (Second Submission)

Problem/Justification

Whenever I create a Virtual Machine I add a CD-ROM device so I can mount the ISO and boot of it, I then setup the OS.

  • Once the OS is setup, I have to immediately shut the OS down and then remove the CD-ROM device from the Virtual Machine to prevent booting of that ISO again.
  • Adding and removing a CD-ROM device to have the presence of a CD-ROM or not is not user friendly.

My solution would be to add the following features

  • Allow ejecting the CD/ISO and keep the CD-ROM device present like a normal PC. In the device the mount will be removed and a checkbox ticked saying Ejected/Empty
  • Disable the CD-ROM device in the KVM configuration, but not remove. This would prevent a lot of lost time.
  • Ability to change the ISO of the CD-ROM device while the Virtual Machine is on (I have not tested if this is possible already), obviously this would generate an eject command to a Virtual Machine if it is running.
  • An option in the CD-ROM device to load a blank ISO if ejecting or disabling is not possible. The blank ISO would be part of TrueNAS rather than user uploaded, for convenience and security.

Impact

  • End users could use their Virtual Machines easier by not having to worrying about constantly removing a CD-ROM device just to boot a freshly installed OS.
  • Users tend to user Virtual Machines for installing and testing and this can involve using may different ISOs and currently many adding and removing of CD-ROM devices which can be time consuming.

User Story

A more friendly user experience when making Virtual Machines making it more likely that a user will come back and use this feature again.

This is one of the most annoying issues in TrueNAS :smile: and it would nice to get these additional feature(s) added.

Additional

Original posted here over 2 years ago, and nothing was done.

yeah the gui forces you to yank the whole cdrom device after install which is annoying

until they add eject/empty, do this:

  1. after the guest is installed, leave the cdrom device there
  2. edit the vm → boot order → put the hard disk above the cdrom (or uncheck cdrom boot)
  3. clear the iso path on the cdrom device if the ui lets you blank it. if not, point it at a tiny empty dummy iso so it cant boot the installer again

from a shell you can also poke the disk attach:

midclt call vm.device.query | jq

then find the cdrom device id and update the path / order that way. no need to delete the device every time.