Convert VM or snapshot into .iso

What is the best way to make an .iso of an OS that is configured how you want it in a virtual machine? Is there a way to make a snapshot into an iso that can then be written to USB? Can I convert a vm to an iso from /local/share/gnome-boxes/images/ ? Thanks.

I have never done that myself, but those Boxes files in ~local/share/gnome-boxes/images/ are qcow2 files. So I believe what you want to achieve should be possible with the qemu-img utility.

I found this page but as I said, I have never tried this myself.