From nobody Fri Feb 23 21:37:34 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 4ThNdt2Cv4z5BYfC for ; Fri, 23 Feb 2024 21:37:38 +0000 (UTC) (envelope-from jo@durchholz.org) Received: from www382.your-server.de (www382.your-server.de [78.46.146.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThNds3khHz44NW for ; Fri, 23 Feb 2024 21:37:37 +0000 (UTC) (envelope-from jo@durchholz.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=durchholz.org header.s=default2202 header.b=AofeCvOo; dmarc=none; spf=pass (mx1.freebsd.org: domain of jo@durchholz.org designates 78.46.146.228 as permitted sender) smtp.mailfrom=jo@durchholz.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=durchholz.org; s=default2202; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:References:To:Subject:From:MIME-Version:Date:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=YyX8rSwr+Q+LeuQCh/oYIT+Otwi0T7hukHXhrEcM+s0=; b=AofeCvOofxDrlSlrgH+OsscXnW h7AMkQLSHhAjEGrsIuD+sJyc4k49ZNh2jtXlC1Q4D1rLV0c0M0LJu/fyCSHu50jWo3wTw8ONW29aw mJFb8h2SKfr23osRE0ZflDZ6SflGahdTH0ls5mHlBIqtdoAHpIhbb04uWM1RfH3WIwiekyiKPKCTM dUT2RVc1ERrcAFL5TUKIWdwPufIWlO0UjsfsEP4hP1aM4ZFZWqdpj7r8t5ObSfSS+uDRKJ5vfCYsu M00cQh+0Vf0OVEfb9S8VR8zoUBcBrMSXo0qe9tTsxfOMIwXJfsfMuUmgTw5c5FAjXENqikAk/W0W7 0tfj3HEg==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www382.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rddEd-000CXq-3h for freebsd-virtualization@freebsd.org; Fri, 23 Feb 2024 22:37:35 +0100 Received: from [81.221.201.210] (helo=[192.168.178.48]) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rddEc-0002yr-WD for freebsd-virtualization@freebsd.org; Fri, 23 Feb 2024 22:37:35 +0100 Message-ID: <4073dc47-528e-493b-a28e-a21aff733225@durchholz.org> Date: Fri, 23 Feb 2024 22:37:34 +0100 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 User-Agent: Mozilla Thunderbird From: Jo Durchholz Subject: Re: Best way to have a FreeBSD VM for automated testing? Content-Language: en-US To: "freebsd-virtualization@FreeBSD.org" References: <163e57a9-0b61-414c-a8f7-109f5ac90f69@durchholz.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated-Sender: jo@durchholz.org X-Virus-Scanned: Clear (ClamAV 0.103.10/27194/Fri Feb 23 10:32:16 2024) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.45 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.956]; R_SPF_ALLOW(-0.20)[+a]; R_DKIM_ALLOW(-0.20)[durchholz.org:s=default2202]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:24940, ipnet:78.46.0.0/15, country:DE]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[durchholz.org]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; HAS_X_AS(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_EQ_ADDR_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[durchholz.org:+] X-Rspamd-Queue-Id: 4ThNds3khHz44NW 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=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 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 PM Jo Durchholz > 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.