From nobody Sat Feb 17 00:36:41 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 4Tc8yT1LWyz5B90C for ; Sat, 17 Feb 2024 00:37:21 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 4Tc8yS0yY8z4tJ7 for ; Sat, 17 Feb 2024 00:37:20 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=hUfhaaZ6; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2a00:1450:4864:20::529 as permitted sender) smtp.mailfrom=marietto2008@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-563ed3d221aso1801516a12.0 for ; Fri, 16 Feb 2024 16:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708130238; x=1708735038; 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=VrkOTtD/K7nZKDFwtER4+lCPQ2lTUgMBnImFUslaadw=; b=hUfhaaZ6RrLHSrH2dXK+UP2L33yLUDZ7m/TjIGcU1spl/seWYkKZgjAuh5u4xV59Lq GPbvgCHAFZYwX23vORkaZN+PJM4okTfUMILiKH2X5a3orc5N7MJgYwypPJOchir7EZrv mjT5wKVS8w4sh+gapPtd9ObUDxsXIK1m5wWl8zF6ORNAH2q4J5XsklZqVMqEHOYvriVr ECKDEVeouC5kaw0zGNby/lEYiIl/XSv2f6ujxPQ5FUrk07icwmBFnuv1c2Mq9FcFyoAQ 9eXo1KU067sK0izPS3dn0H/tpdtf0/yCJMlOn9CbVPaV1AvBOp35GaJZ1FpK/+lSPhab EFBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708130238; x=1708735038; 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=VrkOTtD/K7nZKDFwtER4+lCPQ2lTUgMBnImFUslaadw=; b=dF+T4qiC+vThXYd03+PK2yVLTZBEBO9K1cCPrr88GLKYEd0V2XvV/6iA0jvS1rCeRD 7f4vuZ+1w7A1BjPRwbXCb+7rZKpJdetrcGpl2tEddLD8oXg6QLD1Lbv4Na+SWf23VPy/ VHPumdxG8/ZHHM43SenEchhgK6BJt5Qho+QGTpXkPExuIaQD/gYiQAma8raUYg3gv+0r 752mJdXz1q5YZGnpoUGBt6a8hH3fcPJYly5yQxTN+RNSM4z7kUY6S86UtPqLb89sqGFo NvXRDcIpoaa9rV4J+OMNIJYvrfJP7F0Gw0gn+9eCSrLLd4svgeEkhSFWwdl7dTSBVc5w svgA== X-Gm-Message-State: AOJu0YyfhmVKGkTTUQP7AplPgasWRI+PNPBn53TrDVGVuYh6kmCukS5E DwtGv2TVYVcHLYJOxBcJsqE2HclGvh2mA6LzUPdk2+Qc2BQFT/9OSG0PFOgg59uMLgYfNWdLTW1 vAMnJpK9m+MI2YZdn1zMPcTPk8LI= X-Google-Smtp-Source: AGHT+IHCq6DzPzt3+hkmcE9Fb3NNCIdV9eZLqKzAICF5zUqAposM0FoR0n22KTVN3TV/52KdBdhWdSh5tL15bOF7en4= X-Received: by 2002:a17:906:6617:b0:a3d:5058:50ff with SMTP id b23-20020a170906661700b00a3d505850ffmr5577723ejp.2.1708130238057; Fri, 16 Feb 2024 16:37:18 -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: In-Reply-To: From: Mario Marietto Date: Sat, 17 Feb 2024 01:36:41 +0100 Message-ID: Subject: Re: How to send a bhyve vm totally in background,suppressing any message produced by the bhyve script that I use. To: Aryeh Friedman Cc: FreeBSD virtualization Content-Type: multipart/alternative; boundary="00000000000011d37c06118910aa" X-Rspamd-Queue-Id: 4Tc8yS0yY8z4tJ7 X-Spamd-Bar: - X-Spamd-Result: default: False [-1.98 / 15.00]; URI_COUNT_ODD(1.00)[5]; HTTP_TO_IP(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.976]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; ARC_NA(0.00)[]; TO_DN_ALL(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_RCPT(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::529:from] --00000000000011d37c06118910aa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This is how looks mine script after having applied your suggestions : nohup /usr/bin/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 well,it does not work : the vm does not start,I don't see its process as active. output : final sleep appending output to nohup.out root@marietto:/bhyve # ps ax | grep bhyve 20220 1 S+ 0:00.00 grep bhyve On Sat, Feb 17, 2024 at 1:18=E2=80=AFAM Aryeh Friedman wrote: > On Fri, Feb 16, 2024 at 7:05=E2=80=AFPM Mario Marietto > wrote: > > > > Hello. > > > > I want to boot a bhyve vm that does not produce any error message or > warnings on the screen and that it stays in the background. This is how I > launch my Linux vm : > > > > 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/Ubuntu2304.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 & > > > > > > I've thought that "> /dev/null" means that every message produced by th= e > script would disappear,but,instead,it produces the following messages tha= t > I want to suppress : > > > > marietto@marietto:/bhyve # wrmsr to register 0x140(0) on vcpu 0 > > wrmsr to register 0x140(0) on vcpu 2 > > wrmsr to register 0x140(0) on vcpu 4 > > wrmsr to register 0x140(0) on vcpu 6 > > wrmsr to register 0x140(0) on vcpu 1 > > wrmsr to register 0x140(0) on vcpu 3 > > wrmsr to register 0x140(0) on vcpu 5 > > wrmsr to register 0x140(0) on vcpu 7 > > rdmsr to register 0x64e on vcpu 1 > > rdmsr to register 0x34 on vcpu 1 > > rdmsr to register 0xc0011029 on vcpu 7 > > Unhandled ps2 mouse command 0xe1 > > Unhandled ps2 mouse command 0x0a > > Unhandled ps2 mouse command 0x01 > > Unhandled ps2 mouse command 0x41 > > Unhandled ps2 mouse command 0x88 > > rdmsr to register 0x64d on vcpu 5 > > rdmsr to register 0x64d on vcpu 0 > > > > at this point it hangs. > > > > > > I should press a key to have the ability to write again on the terminal= . > I don't want it. Someone can help me to refine the script ? thanks. > > Here is a fully tested/debugged hand made script to do what you > requested (added bonus is the passthrough): > > #!/bin/sh > # > # Generated by PetiteCloud 0.2.6 > # > > # nvidia1030.rom > > ifconfig tap1 destroy > ifconfig tap1 create > ifconfig tap1 up > ifconfig bridge0 addm tap1 up > echo net done > sleep 5 > bhyvectl --destroy --vm=3D6222f881ad268c17 > nohup /usr/sbin/bhyve -S -c cores=3D8 -m 8192 -AI -H -P -w -s > 0:0,hostbridge -s 1,virtio-net,tap1 -s 2,ahci-hd,/dev/ada0 -s > 29,fbuf,tcp=3D0.0.0.0:6048,w=3D800,h=3D600 -s 30,xhci,tablet -s 31,lpc -s > 5,passthru,37/0/0 -s 6,passthru,37/0/1 -l com1,/dev/nmdm1B -l > bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd > 6222f881ad268c17&>/dev/null > echo final sleep > sleep 10 > > > > > -- > > Mario. > > > > -- > Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org > --=20 Mario. --00000000000011d37c06118910aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This is how looks mine script after having applied yo= ur suggestions :

nohup /usr/bin/bhyve -S -c so= ckets=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,ta= p19 \
-s 14,virtio-9p,sharename=3D/ \
-s 30,xhci,tablet \
-s 31,lp= c \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:19&>/dev/null

well,it does not work = : the vm does not start,I don't see its process as active.

output :

final sleep
appending output to nohup.out
=C2=A0
root@marietto:/bhyve # ps ax | grep bhyve
20220 =C2=A01 =C2=A0S+ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A00:00.00 grep= bhyve

On Sat, Feb 17, 2024 at 1:18=E2=80=AFAM Aryeh Friedm= an <aryeh.friedman@gmail.com= > wrote:
= On Fri, Feb 16, 2024 at 7:05=E2=80=AFPM Mario Marietto <marietto2008@gmail.com> = wrote:
>
> Hello.
>
> I want to boot a bhyve vm that does not produce any error message or w= arnings on the screen and that it stays in the background. This is how I la= unch my Linux vm :
>
> 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/Ubuntu2304.img,boot= index=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 &
>
>
> I've thought that "> /dev/null" means that every mess= age produced by the script would disappear,but,instead,it produces the foll= owing messages that I want to suppress :
>
> marietto@marietto:/bhyve # wrmsr to register 0x140(0) on vcpu 0
> wrmsr to register 0x140(0) on vcpu 2
> wrmsr to register 0x140(0) on vcpu 4
> wrmsr to register 0x140(0) on vcpu 6
> wrmsr to register 0x140(0) on vcpu 1
> wrmsr to register 0x140(0) on vcpu 3
> wrmsr to register 0x140(0) on vcpu 5
> wrmsr to register 0x140(0) on vcpu 7
> rdmsr to register 0x64e on vcpu 1
> rdmsr to register 0x34 on vcpu 1
> rdmsr to register 0xc0011029 on vcpu 7
> Unhandled ps2 mouse command 0xe1
> Unhandled ps2 mouse command 0x0a
> Unhandled ps2 mouse command 0x01
> Unhandled ps2 mouse command 0x41
> Unhandled ps2 mouse command 0x88
> rdmsr to register 0x64d on vcpu 5
> rdmsr to register 0x64d on vcpu 0
>
> at this point it hangs.
>
>
> I should press a key to have the ability to write again on the termina= l. I don't want it. Someone can help me to refine the script ? thanks.<= br>
Here is a fully tested/debugged hand made script to do what you
requested (added bonus is the passthrough):

#!/bin/sh
#
# Generated by PetiteCloud 0.2.6
#

# nvidia1030.rom

ifconfig tap1 destroy
ifconfig tap1 create
ifconfig tap1 up
ifconfig bridge0 addm tap1 up
echo net done
sleep 5
bhyvectl --destroy --vm=3D6222f881ad268c17
nohup /usr/sbin/bhyve -S -c cores=3D8 -m 8192 -AI -H -P -w -s
0:0,hostbridge -s 1,virtio-net,tap1 -s 2,ahci-hd,/dev/ada0 -s
29,fbuf,tcp=3D0.0.0.0:6048,w=3D800,h=3D600 -s 30,xhci,tablet -s 31,lpc -s
5,passthru,37/0/0 -s 6,passthru,37/0/1 -l com1,/dev/nmdm1B -l
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd
6222f881ad268c17&>/dev/null
echo final sleep
sleep 10

>
> --
> Mario.



--
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org


--
Mario.
--00000000000011d37c06118910aa--