<p dir="ltr">> How do I set up a freebsd test build environment, preferably under a VM?</p>
<p dir="ltr">The FreeBSD project now distributes VM images for installation/testing. For example you can find some development branch snapshots here (for stable branches just go up a few levels and find 10.x):</p>
<p dir="ltr"><a href="http://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/11.0-CURRENT/amd64/20160308/">http://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/11.0-CURRENT/amd64/20160308/</a></p>
<p dir="ltr">Notice there's a qcow2 image there for easy testing with KVM. You might even be able to run a live environment and use pkgng ("pkg" command) to grab gcc/clang etc. and then use "fetch" to pull down toybox.</p>
<p dir="ltr">One issue I've run into recently with FreeBSD under KVM was virtio block devices being weirdly slow, so make sure to try and use scsi/ata emulation instead (although this may no longer be an issue, YMMV).</p>
<p dir="ltr">I'll try and follow up with some more detailed specs -- actual commands issued in Linux and such.</p>
<p dir="ltr">- Zack</p>