From nobody Sat Feb 17 01:19:57 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 4Tc9wQ4tc4z5BGB1 for ; Sat, 17 Feb 2024 01:20:38 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 4Tc9wP51dTz40R7 for ; Sat, 17 Feb 2024 01:20:37 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=eRwNcpzB; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2a00:1450:4864:20::633 as permitted sender) smtp.mailfrom=marietto2008@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a3122b70439so307707666b.3 for ; Fri, 16 Feb 2024 17:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708132834; x=1708737634; 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=5vTdbDK66ks1pk0XJ/5FhW3q8s7BDRepCnUDIrSIQXo=; b=eRwNcpzBhP4uLYkny3/wkiRHr0IZkncJYhsQ5wUWltBPRvXQPxz3uiA4OYkuki9dov kQSZbHsjdReMfbcnnYH6XzMLQ6XSCnLMGUg4XyeBJT+h5YDChGkgOO4xabD+T04Y2vqT tDGZU1jB7WipqfKfPAFRDQCWytDyz3k1yFQDA1dWZm6CNEmi6HVa9iGnRqZuh1rjRs2W PKKJ0QfBlcudy3MR9D+9+OK0n4HWXR5kwAdLko+CVsWsVFnzA6WdM7fyv9Rc/22DdInV mof4Vu1/nnpoHGDRRagYXnb8kcZBG/VjALVVBUjS8GdCDX5xDUKiBfr7a8BJEcFYaKce nKIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708132834; x=1708737634; 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=5vTdbDK66ks1pk0XJ/5FhW3q8s7BDRepCnUDIrSIQXo=; b=mTb8NJ0Wsbc0h2QC5/bzUXVk3dRv064Td0a+3w6coFGnPMnX/nYUmbDdzSVqu/EOCF nMNweOttxaIyOR5wsswYDPXZfnxOFwtXOfEYk06pWkcMPBJ/YYEQX9cq43WVzC4RFfuk hICNmFy0OlLQju9sAfsX8Q9cyq0u2GBZryzQ0EL+OKEu9aYTJsp0BKJs3fKCxQgdK/lh +l+OUpyJSM772JHVC7iTU0BI7+84bTwlBuqAtgeTxsS6pLi6i8lhuZKAdqzbT4cLXxmI 1L7hW8GP9cyeFFLHy3TzdJlhKvWehs9svpY/59/iMj1ZcU/QSLoUIInjn6nQNiIKZ7a1 TKUg== X-Gm-Message-State: AOJu0Ywn/XcVY+n/fcOf+MEqDXBZmy1E7jENBvW9BystS+jYtE0fyZD2 qGaFfmkqDUZE8J7Hn1xPa3/mKJvOuJ0an2oliQ8JJQpRwQAKL7kV88jFgWf4F6hH2alFygpCeGY 3Xr0uMfIPE51vqxm8twoqR6PRD5dfCXklJNt85w== X-Google-Smtp-Source: AGHT+IHAV/jDQSJ0sKpq2s7jYcfRHa69IDUqW2omYYJz1kEYQCwbfbInxs8ldXHcZBHwdc0UuoISHJAGWkbWyDRg31U= X-Received: by 2002:a17:906:3757:b0:a3d:9e6b:2776 with SMTP id e23-20020a170906375700b00a3d9e6b2776mr4310143ejc.17.1708132834236; Fri, 16 Feb 2024 17:20:34 -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 02:19:57 +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="000000000000d05f91061189aa42" X-Rspamd-Queue-Id: 4Tc9wP51dTz40R7 X-Spamd-Bar: - X-Spamd-Result: default: False [-2.00 / 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(-1.00)[-0.999]; 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)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::633:from]; RCVD_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] --000000000000d05f91061189aa42 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I fixed the script and now it works exactly as I want : 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 very thanks for your help. On Sat, Feb 17, 2024 at 1:46=E2=80=AFAM Mario Marietto wrote: > Errata corrige. The vm didn't start because my bhyve executable is on > /usr/sbin ; but you keep it on /usr/bin ; > So,the vm starts and it is stored in the background. Only one problem > remains. The message "appending output to nohup.out" is displayed on the > screen. Is there a method to suppress it ? thanks. > > On Sat, Feb 17, 2024 at 1:36=E2=80=AFAM Mario Marietto > wrote: > >> 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= =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 >> >> 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,bootinde= x=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 >>> the script would disappear,but,instead,it produces the following messag= es >>> 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 >>> 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 >>> >> >> >> -- >> Mario. >> > > > -- > Mario. > --=20 Mario. --000000000000d05f91061189aa42 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I fixed the script and now it works exactly as I want= :

nohup /usr/sbin/b= hyve -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,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

very thanks for your help.

On Sat, Feb 17, 2024 at 1:46=E2=80=AFAM Mario Marietto <= marietto2008@gmail.com> wr= ote:
Errata corrige. The vm didn't start because my bhyve executa= ble is on /usr/sbin ; but you keep it on /usr/bin ;
So,the vm sta= rts and it is stored in the background. Only one problem remains. The messa= ge "appending output to nohup.out= " is displayed on the screen. Is there a method to suppress it ? thank= s.

On Sat, Feb 17, 2024 at 1:36=E2=80=AFAM Mario Marietto &= lt;marietto2008= @gmail.com> wrote:
This is how looks mine script after having= applied your suggestions :

nohup /usr/bin/bhy= ve -S -c sockets=3D2,cores=3D2,threads=3D2 -m 8G -w -H -A \
-s 0,hostb= ridge \
-s 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.im= g,bootindex=3D1 \
-s 11,hda,play=3D/dev/dsp,rec=3D/dev/dsp \
-s 13,vi= rtio-net,tap19 \
-s 14,virtio-9p,sharename=3D/ \
-s 30,xhci,tablet \<= br>-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE= .fd \
vm0:19&>/dev/null

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

ou= tput :

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 &l= t;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.


--
Mario.


--
Mario.
--000000000000d05f91061189aa42--