Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Feb 2024 19:41:27 +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%2B1FSijjCLn8sxrjMxT_1j2qW3mk4pjvqMBSytCBBpi0tixNkQ@mail.gmail.com>
In-Reply-To: <163e57a9-0b61-414c-a8f7-109f5ac90f69@durchholz.org>
References:  <163e57a9-0b61-414c-a8f7-109f5ac90f69@durchholz.org>

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

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=3D=
1
\
-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

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=E2=80=AFPM Jo Durchholz <jo@durchholz.org> wro=
te:

> 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
>
>

--=20
Mario.

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

<div dir=3D"ltr"><div><span style=3D"font-family:monospace"><span style=3D"=
color:rgb(0,0,0);background-color:rgb(255,255,255)">To speed up the booting=
 of a bhyve VM I&#39;m using this method :</span></span></div><div><span st=
yle=3D"font-family:monospace"><span style=3D"color:rgb(0,0,0);background-co=
lor:rgb(255,255,255)"><br></span></span></div><div><span style=3D"font-fami=
ly:monospace"><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,=
255)">nohup /usr/sbin/bhyve -S -c sockets=3D2,cores=3D2,threads=3D2 -m 8G -=
w -H -A \
</span></span></div><div><span style=3D"font-family:monospace"></span></div=
><span style=3D"font-family:monospace"><span class=3D"gmail-im">-s 0,hostbr=
idge \
<br>-s 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.img,booti=
ndex=3D1 \
<br>-s 11,hda,play=3D/dev/dsp,rec=3D/dev/dsp \
<br>-s 13,virtio-net,tap19 \
<br>-s 14,virtio-9p,sharename=3D/ \
<br>-s 30,xhci,tablet \
<br>-s 31,lpc \
<br>-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
<br></span>vm0:19&lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;
<br>if test -f nohup.out; then rm -r nohup.out
<br></span><div><span style=3D"font-family:monospace">fi</span></div><div><=
span style=3D"font-family:monospace"><br></span></div><div><span style=3D"f=
ont-family:monospace">I&#39;ve installed a ssh server within the vm and I c=
onnect to it from FreeBSD using ssh -Y user@IP ; it&#39;s faster. But the p=
roject is not completed. I want to install VirGL to have the graphic accele=
ration without using the real GPU of the host inside the VM.<br></span></di=
v></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr=
">On Fri, Feb 23, 2024 at 8:17=E2=80=AFPM Jo Durchholz &lt;<a href=3D"mailt=
o:jo@durchholz.org">jo@durchholz.org</a>&gt; wrote:<br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid=
 rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
I&#39;m in repeatable build land, working in Linux and developing a FreeBSD=
 <br>
appliance.<br>
<br>
For tests, I need to run a FreeBSD VM, put some Python code and test <br>
data into it, run the script, and get the test results back.<br>
<br>
Repeatability means: Everything done with the VM needs to be scriptable <br=
>
(using a GUI for exploring is okay but things have to translate).<br>
Which in turn means that every setup step for a FreeBSD image comes with <b=
r>
a pretty high coding and maintenance cost.<br>
<br>
So my question is:<br>
What&#39;s the FreeBSD image that has the least number of steps to get the =
<br>
base system up and running? I suppose it&#39;s the VM-IMAGES section, but i=
s <br>
this correct?<br>
<br>
Follow-up question:<br>
The startup time needs to be as fast as possible. Sub-second would be <br>
great (&quot;don&#39;t disrupt the developer&#39;s thought stream&quot;).<b=
r>
I see the boot process from a vanilla VM-IMAGES image takes multiple <br>
seconds; can this be sped up to just a few seconds, or do I need to run <br=
>
the setup and create a VM snapshot at which the VM starts for each test run=
?<br>
<br>
Regards,<br>
Jo<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>

--00000000000015c899061211c1d2--



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