Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2024 01:46:09 +0100
From:      Mario Marietto <marietto2008@gmail.com>
To:        Jo Durchholz <jo@durchholz.org>
Cc:        "freebsd-virtualization@FreeBSD.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: Best way to have a FreeBSD VM for automated testing?
Message-ID:  <CA%2B1FSigWWGriyPSB4UGTv9x02ADPnEkLsZq4fQTv7XUi=OKtzw@mail.gmail.com>
In-Reply-To: <4073dc47-528e-493b-a28e-a21aff733225@durchholz.org>
References:  <163e57a9-0b61-414c-a8f7-109f5ac90f69@durchholz.org> <CA%2B1FSijjCLn8sxrjMxT_1j2qW3mk4pjvqMBSytCBBpi0tixNkQ@mail.gmail.com> <4073dc47-528e-493b-a28e-a21aff733225@durchholz.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000ccba570612160246
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I forgot to say that I want to create a different FreeBSD flavour that will
have a lot of virtual machines already embedded and ready to work and that
work transparently.

On Fri, Feb 23, 2024 at 10:37=E2=80=AFPM Jo Durchholz <jo@durchholz.org> wr=
ote:

> On 23.02.24 19:41, Mario Marietto wrote:
> > To speed up the booting of a bhyve VM I'm using this method :
> >
> > nohup /usr/sbin/bhyve -S -c sockets=3D2,cores=3D2,threads=3D2 -m 8G -w =
-H -A \
> > -s 0,hostbridge \
> > -s
> >
> 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.img,bootindex=
=3D1 \
> > -s 11,hda,play=3D/dev/dsp,rec=3D/dev/dsp \
> > -s 13,virtio-net,tap19 \
> > -s 14,virtio-9p,sharename=3D/ \
> > -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
>
> Hmmm... my knee-jerk reaction was that bhyve runs on FreeBSD and I want
> to use a Linux host, but to my surprise, yeah you can run byhve on Linux.
>
> However, it's an additional layer, which means more potential failure
> modes, and it requires extra configuration on the system level which
> means it's another small entry barrier for new contributors.
>
> So... no bhyve for me.
> (Note that this does not mean that there's no merit in the approach!
> Just that it does not fit my project's priorities.)
>
> Do you know how to translate all these bhyve options to a KVM or Vagrant
> incantation? I know too little about either to be confident in what I'd
> produce.
> Maybe a short explanation of each parameter would help? Why is it there,
> what problem does it solve, that kind of information, just to get me
> started so I can focus on those options that are actually relevant to
> the applicance I'm trying to set up.
>
> > 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.
>
> Heh. Yet another rabbit hole. Good luck with that!
> I have to say I'm lucky that my project is just a web server so I don't
> need that.
>
> Anyway: Thanks for the info! Knowing what you're doing tells everybody a
> lot about what's routine and what isn't, and that's valuable.
>
> Regards,
> Jo
>
> > On Fri, Feb 23, 2024 at 8:17=E2=80=AFPM Jo Durchholz <jo@durchholz.org
> > <mailto: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 tes=
t
> >     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 multipl=
e
> >     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.
>
>
>

--=20
Mario.

--000000000000ccba570612160246
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I forgot to say that I want to create a different FreeBSD =
flavour that will have a lot of virtual machines already embedded and ready=
 to work and that work transparently. <br></div><br><div class=3D"gmail_quo=
te"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Feb 23, 2024 at 10:37=E2=
=80=AFPM Jo Durchholz &lt;<a href=3D"mailto:jo@durchholz.org">jo@durchholz.=
org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x">On 23.02.24 19:41, Mario Marietto wrote:<br>
&gt; To speed up the booting of a bhyve VM I&#39;m using this method :<br>
&gt; <br>
&gt; nohup /usr/sbin/bhyve -S -c sockets=3D2,cores=3D2,threads=3D2 -m 8G -w=
 -H -A \<br>
&gt; -s 0,hostbridge \<br>
&gt; -s <br>
&gt; 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.img,bootind=
ex=3D1 \<br>
&gt; -s 11,hda,play=3D/dev/dsp,rec=3D/dev/dsp \<br>
&gt; -s 13,virtio-net,tap19 \<br>
&gt; -s 14,virtio-9p,sharename=3D/ \<br>
&gt; -s 30,xhci,tablet \<br>
&gt; -s 31,lpc \<br>
&gt; -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \<br>
&gt; vm0:19&lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;<br>
&gt; if test -f nohup.out; then rm -r nohup.out<br>
&gt; fi<br>
<br>
Hmmm... my knee-jerk reaction was that bhyve runs on FreeBSD and I want <br=
>
to use a Linux host, but to my surprise, yeah you can run byhve on Linux.<b=
r>
<br>
However, it&#39;s an additional layer, which means more potential failure <=
br>
modes, and it requires extra configuration on the system level which <br>
means it&#39;s another small entry barrier for new contributors.<br>
<br>
So... no bhyve for me.<br>
(Note that this does not mean that there&#39;s no merit in the approach! <b=
r>
Just that it does not fit my project&#39;s priorities.)<br>
<br>
Do you know how to translate all these bhyve options to a KVM or Vagrant <b=
r>
incantation? I know too little about either to be confident in what I&#39;d=
 <br>
produce.<br>
Maybe a short explanation of each parameter would help? Why is it there, <b=
r>
what problem does it solve, that kind of information, just to get me <br>
started so I can focus on those options that are actually relevant to <br>
the applicance I&#39;m trying to set up.<br>
<br>
&gt; I&#39;ve installed a ssh server within the vm and I connect to it from=
 <br>
&gt; FreeBSD using ssh -Y user@IP ; it&#39;s faster. But the project is not=
 <br>
&gt; completed. I want to install VirGL to have the graphic acceleration <b=
r>
&gt; without using the real GPU of the host inside the VM.<br>
<br>
Heh. Yet another rabbit hole. Good luck with that!<br>
I have to say I&#39;m lucky that my project is just a web server so I don&#=
39;t <br>
need that.<br>
<br>
Anyway: Thanks for the info! Knowing what you&#39;re doing tells everybody =
a <br>
lot about what&#39;s routine and what isn&#39;t, and that&#39;s valuable.<b=
r>
<br>
Regards,<br>
Jo<br>
<br>
&gt; On Fri, Feb 23, 2024 at 8:17=E2=80=AFPM Jo Durchholz &lt;<a href=3D"ma=
ilto:jo@durchholz.org" target=3D"_blank">jo@durchholz.org</a> <br>
&gt; &lt;mailto:<a href=3D"mailto:jo@durchholz.org" target=3D"_blank">jo@du=
rchholz.org</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Hi all,<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0I&#39;m in repeatable build land, working in Linux =
and developing a FreeBSD<br>
&gt;=C2=A0 =C2=A0 =C2=A0appliance.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0For tests, I need to run a FreeBSD VM, put some Pyt=
hon code and test<br>
&gt;=C2=A0 =C2=A0 =C2=A0data into it, run the script, and get the test resu=
lts back.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Repeatability means: Everything done with the VM ne=
eds to be scriptable<br>
&gt;=C2=A0 =C2=A0 =C2=A0(using a GUI for exploring is okay but things have =
to translate).<br>
&gt;=C2=A0 =C2=A0 =C2=A0Which in turn means that every setup step for a Fre=
eBSD image comes<br>
&gt;=C2=A0 =C2=A0 =C2=A0with<br>
&gt;=C2=A0 =C2=A0 =C2=A0a pretty high coding and maintenance cost.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0So my question is:<br>
&gt;=C2=A0 =C2=A0 =C2=A0What&#39;s the FreeBSD image that has the least num=
ber of steps to get the<br>
&gt;=C2=A0 =C2=A0 =C2=A0base system up and running? I suppose it&#39;s the =
VM-IMAGES section,<br>
&gt;=C2=A0 =C2=A0 =C2=A0but is<br>
&gt;=C2=A0 =C2=A0 =C2=A0this correct?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Follow-up question:<br>
&gt;=C2=A0 =C2=A0 =C2=A0The startup time needs to be as fast as possible. S=
ub-second would be<br>
&gt;=C2=A0 =C2=A0 =C2=A0great (&quot;don&#39;t disrupt the developer&#39;s =
thought stream&quot;).<br>
&gt;=C2=A0 =C2=A0 =C2=A0I see the boot process from a vanilla VM-IMAGES ima=
ge takes multiple<br>
&gt;=C2=A0 =C2=A0 =C2=A0seconds; can this be sped up to just a few seconds,=
 or do I need to run<br>
&gt;=C2=A0 =C2=A0 =C2=A0the setup and create a VM snapshot at which the VM =
starts for each<br>
&gt;=C2=A0 =C2=A0 =C2=A0test run?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Regards,<br>
&gt;=C2=A0 =C2=A0 =C2=A0Jo<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; -- <br>
&gt; Mario.<br>
<br>
<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Mario.<br></d=
iv>

--000000000000ccba570612160246--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSigWWGriyPSB4UGTv9x02ADPnEkLsZq4fQTv7XUi=OKtzw>