From nobody Fri Feb 23 18:41:27 2024 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ThL4c0nB3z5BNk4 for ; Fri, 23 Feb 2024 19:42:08 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThL4b6BgSz55rl for ; Fri, 23 Feb 2024 19:42:07 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-512db550e3fso1555594e87.2 for ; Fri, 23 Feb 2024 11:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708717324; x=1709322124; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5wo2j+YiZ+uughzTZf7K2Io3e1A0yLouYckRWdHcr0E=; b=KuyV+uAzDoEunnwHaw13BD2sltvySDnUUFYHlJCEAFrHGFAYEKa0Ms1cQNhqvIB4Na 3cjqHBV80XPdEPu5DmjG8rHOH8TglkCo4tdwjihIyubKNWqZqYPcNbC6eghUI+pehuKq 2dtZBdodsDevDdlqCmOlgETKqKMyluBqf2mtMW0J/ii5F2EbmmSV+BGMBqJ6PvaAay6r JwSz+pW6WNefr0mJrWihaXBGgBEzlbkRL1CXUVDlVRCwqzUeL82fclvkrEK5A4gmgmxQ BjnP2dyAmnC9w7iUxs+qfFkvRm/U7e1BxEwBIJccPdxDEREkfsITb9ic7LlEJZQB6mqE I6Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708717324; x=1709322124; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5wo2j+YiZ+uughzTZf7K2Io3e1A0yLouYckRWdHcr0E=; b=h6ayYvLe6hIutABMzNDG5PuhVvk7AzWArrh+aY3u3AUi16Axdb6oC2ShCXC2fitNSP TU+6Lh566p0ViQMgi5eNEEOQmlbr4S7G7Y7jn1+JLKllHRzEurTtxK8yLTOXrnriLUHc 4xPi6SV52uygGfouIFjR4oCnkieW/MTP0J5caqrODEyNE+trWQMaB/jm6KnFa1hmHKMu GWzDl7xP9t01a20eABrS0vDlYPZAXFV/iIxLQJA6PLSiIbUnSWVLDTsXgTHnnXroi+I9 pAvHfy2ZgrA/zx49JrNLqDoHL5+y7v7fkZIw91AUNyXxX4pQRYgHYweGRtYFPKU90lya og8Q== X-Gm-Message-State: AOJu0YyyxaSWexc1UVyVZf2C+ZMQNMIvuFssy4tpNgPIpEG7cWAwywag 0OtdXd2BSWwQFtnIZsa83dATw/6j8QYuvCjC7w3Ajuy6/OdabV41PPBe6jA6Up++WOuSckxSq5Y YqlXNcK2WLgtxXNgc9slCI1jwmqNhWjmvrd8x8Q== X-Google-Smtp-Source: AGHT+IERhqOrWjOIq0q1A4d79IjCnEIMjNeshyTE6rNc9oY6zoS2suA+dl6e74CZqin94f5uyMmxNNvZuWwV93OCDJ8= X-Received: by 2002:a05:6512:ba2:b0:512:bfb7:6d2c with SMTP id b34-20020a0565120ba200b00512bfb76d2cmr500849lfv.53.1708717323436; Fri, 23 Feb 2024 11:42:03 -0800 (PST) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 References: <163e57a9-0b61-414c-a8f7-109f5ac90f69@durchholz.org> In-Reply-To: <163e57a9-0b61-414c-a8f7-109f5ac90f69@durchholz.org> From: Mario Marietto Date: Fri, 23 Feb 2024 19:41:27 +0100 Message-ID: Subject: Re: Best way to have a FreeBSD VM for automated testing? To: Jo Durchholz Cc: "freebsd-virtualization@FreeBSD.org" Content-Type: multipart/alternative; boundary="00000000000015c899061211c1d2" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4ThL4b6BgSz55rl --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 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 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
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,hostbr= idge \
-s 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.img,booti= ndex=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
<= span style=3D"font-family:monospace">
I've installed a ssh server within the vm and I c= onnect to it from FreeBSD using ssh -Y user@IP ; it'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.

On Fri, Feb 23, 2024 at 8:17=E2=80=AFPM 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 i= s
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.
--00000000000015c899061211c1d2--