Re: Best way to have a FreeBSD VM for automated testing?

From: Mario Marietto <marietto2008_at_gmail.com>
Date: Fri, 23 Feb 2024 18:41:27 UTC
To speed up the booting of a bhyve VM I'm using this method :

nohup /usr/sbin/bhyve -S -c sockets=2,cores=2,threads=2 -m 8G -w -H -A \
-s 0,hostbridge \
-s
1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.img,bootindex=1
\
-s 11,hda,play=/dev/dsp,rec=/dev/dsp \
-s 13,virtio-net,tap19 \
-s 14,virtio-9p,sharename=/ \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:19</dev/null >/dev/null 2>&1 &
if test -f nohup.out; then rm -r nohup.out
fi

I've installed a ssh server within the vm and I connect to it from FreeBSD
using ssh -Y user@IP ; it's faster. But the project is not completed. I
want to install VirGL to have the graphic acceleration without using the
real GPU of the host inside the VM.

On Fri, Feb 23, 2024 at 8:17 PM Jo Durchholz <jo@durchholz.org> wrote:

> Hi all,
>
> I'm in repeatable build land, working in Linux and developing a FreeBSD
> appliance.
>
> For tests, I need to run a FreeBSD VM, put some Python code and test
> data into it, run the script, and get the test results back.
>
> Repeatability means: Everything done with the VM needs to be scriptable
> (using a GUI for exploring is okay but things have to translate).
> Which in turn means that every setup step for a FreeBSD image comes with
> a pretty high coding and maintenance cost.
>
> So my question is:
> What's the FreeBSD image that has the least number of steps to get the
> base system up and running? I suppose it's the VM-IMAGES section, but is
> this correct?
>
> Follow-up question:
> The startup time needs to be as fast as possible. Sub-second would be
> great ("don't disrupt the developer's thought stream").
> I see the boot process from a vanilla VM-IMAGES image takes multiple
> seconds; can this be sped up to just a few seconds, or do I need to run
> the setup and create a VM snapshot at which the VM starts for each test
> run?
>
> Regards,
> Jo
>
>

-- 
Mario.