I decided to jump down the rabbit hole, and it lead me to something even easier.
I can create a memory disk from the ISO and pass the whole thing to Bhyve as a
virtio-blk device.
I can then mount the partition of the block device inside the guest to access
its contents:
file -sL /media/Debian-11.1.0-amd64-DVD-1.iso
[...] ISO 9660 CD-ROM filesystem data [...]
mdconfig -at vnode /media/Debian-11.1.0-amd64-DVD-1.iso
bhyve -w -H \
-s 0,hostbridge \
-s 3,virtio-blk,/dev/zvol/zroot/bhyve_vms/debianvm \
-s 4,virtio-blk,/dev/md0 \
-s 5,virtio-net,tap0 \
-s 29,fbuf,tcp=0.0.0.0:5914,w=800,h=600,wait \
-s 31,lpc \
-l com1,stdio \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd
debianvm
And inside the guest vm:
fdisk -l
# /dev/vdb1 ... Empty
# /dev/vdb2 ... EFI (FAT-12/16/32)
file -sL /dev/vdb1
# [...] ISO 9660 CD-ROM filesystem data [...]
mount /dev/vdb1 /media/
# [...] mounted read-only
ls /media/
# [ rom contents ]
Thanks for the tip.
> ----------------------------------------
> From: Sysadmin Lists via virtualization <[email protected]>
> Sent: Tue Nov 30 22:01:17 CET 2021
> To: <[email protected]>, Miroslav Lachman <[email protected]>, Mario
> Marietto <[email protected]>
> Cc: Corvin Köhne <[email protected]>
> Subject: Re: Bhyve CD-ROM
>
>
> That's a mighty-tempting looking rabbit hole you've got there ....
>
> > ----------------------------------------
> > From: Miroslav Lachman <[email protected]>
> > Sent: Tue Nov 30 13:27:32 CET 2021
> > To: <[email protected]>, Mario Marietto <[email protected]>
> > Cc: Corvin Köhne <[email protected]>
> > Subject: Re: Bhyve CD-ROM
> >
> > If memory serves me right shorting the ISO (any disk device) by some
> > sectors can be done "on the fly" with gnop utility.
> > Something like gnop create -o <offset> ...
> >
> > Miroslav Lachman
--
Sent with https://mailfence.com
Secure and private email