From nobody Sat Feb 17 00:46:54 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 4Tc9BG17y1z5BBQf for ; Sat, 17 Feb 2024 00:47:34 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (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 4Tc9BF25Yvz4v3B for ; Sat, 17 Feb 2024 00:47:33 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Af9eQSws; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=marietto2008@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-563e6131140so1566101a12.2 for ; Fri, 16 Feb 2024 16:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708130851; x=1708735651; 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=58d9O57aavNMF3q/voTAptMSmNSsrA1pJADpLCtrSeg=; b=Af9eQSwsaX0jCsupxwDO7cujkd90PPU7RRWk7sZB6dl/SIEAMQc6tYM5V0KYszZOAu CA0ZD2s6aKsGxRhAFAjXRddMrN2KpZXllcAdrdp8+5OWc/PAznJ0J+8z2bryV4ff26J+ jjfVvIO4UI25iMriHqxa1TP4KdDhxNLLzvIOf16RR8jN53JhoElnA6+zJqNS1jJgU/Q8 Rt1eofoLT1sTbn6JHpXJJkMEEtH0PUiBPtWItPO975kMzlg4JztIlka389d0F/jFSBYG LZBdu2Ynty4h4ptd/9FuPim8uRZqp6vzegQ266cw+Ohmenm6AHQ3G07FsUE4/ey/TZ5E uRyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708130851; x=1708735651; 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=58d9O57aavNMF3q/voTAptMSmNSsrA1pJADpLCtrSeg=; b=QCjuBPIP4g77iccG2EEjTHvuxZF9LDkxqpIXw3tNCG3EzcMMb5tYBWzbkKUxfXESGi Zy++TPR/z5vnh368kxtxxpV627Bia39+PoS9ZAWpG7YB7vx4b1mPD/MpUAVARTvG12k9 JpmIrtBI6KAkdDkt1fixYOgdYnLxuD38xZvEx0pC6/VeK8zu/BsEooA8iOAm3ZjDGoH2 E8pwDz9CLnu4Nhvdku3mvJp4o1m3mn4Z3yED4BRQZWu1LPX4gBYm9xrn8OpQvBlccBpC laTYYUtoDCjjOU0tsxZBjpNOoIAZuvmx2eK+p9Luipoa2xXda4QCLgu6KEKuna3LfCdJ 7VWA== X-Gm-Message-State: AOJu0YzpS7ij3SQ5HbxMR19CvTKr5KNF9U1mBEkQTWfdSoijpf3H/2Lx oAeZsNOaPmv6vhhHLD7P4Ur0RGydKZoGCfGqQdmE4PBI6PqXEMHmv8h3UwV5bg4xlY5vq/cICBD aueaQCU8lWDAyfUnnsgKLKUFMVyRbifS1kk0wXw== X-Google-Smtp-Source: AGHT+IEZ1L9ua1Xrb3WgQTm9HC7YkHuGvxmDXvG7dUv+iz+qoloawNhe4IBTkSQCoVe18h3ief2wOw61fkKJbw3QHoo= X-Received: by 2002:a17:907:175b:b0:a38:537:9598 with SMTP id lf27-20020a170907175b00b00a3805379598mr4343408ejc.17.1708130851198; Fri, 16 Feb 2024 16:47:31 -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:46:54 +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="0000000000009d9c80061189347b" X-Rspamd-Queue-Id: 4Tc9BF25Yvz4v3B 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::52a:from] --0000000000009d9c80061189347b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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,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 >> the script would disappear,but,instead,it produces the following message= s >> 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. > --=20 Mario. --0000000000009d9c80061189347b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Errata corrige. The vm didn't start because my bh= yve 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 <marietto2008@gmail.= com> 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 \<= br>-s 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.img,bootin= dex=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 wo= rk : 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 &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.
--0000000000009d9c80061189347b--