Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2024 01:46:54 +0100
From:      Mario Marietto <marietto2008@gmail.com>
To:        Aryeh Friedman <aryeh.friedman@gmail.com>
Cc:        FreeBSD virtualization <freebsd-virtualization@freebsd.org>
Subject:   Re: How to send a bhyve vm totally in background,suppressing any message produced by the bhyve script that I use.
Message-ID:  <CA%2B1FSij4oO7O86EZEY_Reix0VJU=fwqe_xBho4_KOFxCNRoxeg@mail.gmail.com>
In-Reply-To: <CA%2B1FSihM=723kHEZgpMMGRCBfbAhJ8qdjmuCYouQcpZu0K=Q-Q@mail.gmail.com>
References:  <CA%2B1FSiiYEp4g-8tyUWiQ4yz-C-V1UmpndRTomNOhouqzX6kZjw@mail.gmail.com> <CAGBxaXm4Vw_tjY0K%2BBBPTHo8n=JhrtsNMb3C3tv0sfRHMg2W=w@mail.gmail.com> <CA%2B1FSihM=723kHEZgpMMGRCBfbAhJ8qdjmuCYouQcpZu0K=Q-Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <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 \
> -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 <aryeh.friedman@gm=
ail.com>
> wrote:
>
>> On Fri, Feb 16, 2024 at 7:05=E2=80=AFPM Mario Marietto <marietto2008@gma=
il.com>
>> 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

<div dir=3D"ltr"><div>Errata corrige. The vm didn&#39;t start because my bh=
yve executable is on /usr/sbin ; but you keep it on /usr/bin ;</div><div>So=
,the vm starts and it is stored in the background. Only one problem remains=
. The message &quot;<span style=3D"font-family:monospace"><span style=3D"co=
lor:rgb(0,0,0);background-color:rgb(255,255,255)">appending output to nohup=
.out</span>&quot; is displayed on the screen. Is there a method to suppress=
 it ? thanks.<br></span></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Sat, Feb 17, 2024 at 1:36=E2=80=AFAM Mario=
 Marietto &lt;<a href=3D"mailto:marietto2008@gmail.com">marietto2008@gmail.=
com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x"><div dir=3D"ltr"><div>This is how looks mine script after having applied=
 your suggestions :<br></div><div><br></div><div>nohup /usr/bin/bhyve -S -c=
 sockets=3D2,cores=3D2,threads=3D2 -m 8G -w -H -A \</div>-s 0,hostbridge \<=
br>-s 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2310.img,bootin=
dex=3D1 \<br>-s 11,hda,play=3D/dev/dsp,rec=3D/dev/dsp \<br>-s 13,virtio-net=
,tap19 \<br>-s 14,virtio-9p,sharename=3D/ \<br>-s 30,xhci,tablet \<br>-s 31=
,lpc \<br>-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \<br=
><div>vm0:19&amp;&gt;/dev/null</div><div><br></div><div>well,it does not wo=
rk : the vm does not start,I don&#39;t see its process as active<font color=
=3D"#888888">.<br clear=3D"all"></font></div><div><br></div><div>output :</=
div><div><br></div><div><span style=3D"font-family:monospace"><span style=
=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">final sleep
</span><br>appending output to nohup.out</span></div><div><span style=3D"fo=
nt-family:monospace">=C2=A0<br>root@marietto:/bhyve # ps ax | grep bhyve
<br>20220 =C2=A01 =C2=A0S+ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A00:00.00 grep=
 bhyve<br></span></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr=
" class=3D"gmail_attr">On Sat, Feb 17, 2024 at 1:18=E2=80=AFAM Aryeh Friedm=
an &lt;<a href=3D"mailto:aryeh.friedman@gmail.com" target=3D"_blank">aryeh.=
friedman@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex">On Fri, Feb 16, 2024 at 7:05=E2=80=AFPM Mario Marietto &l=
t;<a href=3D"mailto:marietto2008@gmail.com" target=3D"_blank">marietto2008@=
gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hello.<br>
&gt;<br>
&gt; 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 :<br>
&gt;<br>
&gt; bhyve -S -c sockets=3D2,cores=3D2,threads=3D2 -m 8G -w -H -A \<br>
&gt; -s 0,hostbridge \<br>
&gt; -s 1,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Linux/Ubuntu2304.img,boot=
index=3D1 \<br>
&gt; -s 11,hda,play=3D/dev/dsp,rec=3D/dev/dsp \<br>
&gt; -s 13,virtio-net,tap19 \<br>
&gt; -s 14,virtio-9p,sharename=3D/ \<br>
&gt; -s 30,xhci,tablet \<br>
&gt; -s 31,lpc \<br>
&gt; -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \<br>
&gt; vm0:19 &gt; /dev/null &amp;<br>
&gt;<br>
&gt;<br>
&gt; I&#39;ve thought that &quot;&gt; /dev/null&quot; means that every mess=
age produced by the script would disappear,but,instead,it produces the foll=
owing messages that I want to suppress :<br>
&gt;<br>
&gt; marietto@marietto:/bhyve # wrmsr to register 0x140(0) on vcpu 0<br>
&gt; wrmsr to register 0x140(0) on vcpu 2<br>
&gt; wrmsr to register 0x140(0) on vcpu 4<br>
&gt; wrmsr to register 0x140(0) on vcpu 6<br>
&gt; wrmsr to register 0x140(0) on vcpu 1<br>
&gt; wrmsr to register 0x140(0) on vcpu 3<br>
&gt; wrmsr to register 0x140(0) on vcpu 5<br>
&gt; wrmsr to register 0x140(0) on vcpu 7<br>
&gt; rdmsr to register 0x64e on vcpu 1<br>
&gt; rdmsr to register 0x34 on vcpu 1<br>
&gt; rdmsr to register 0xc0011029 on vcpu 7<br>
&gt; Unhandled ps2 mouse command 0xe1<br>
&gt; Unhandled ps2 mouse command 0x0a<br>
&gt; Unhandled ps2 mouse command 0x01<br>
&gt; Unhandled ps2 mouse command 0x41<br>
&gt; Unhandled ps2 mouse command 0x88<br>
&gt; rdmsr to register 0x64d on vcpu 5<br>
&gt; rdmsr to register 0x64d on vcpu 0<br>
&gt;<br>
&gt; at this point it hangs.<br>
&gt;<br>
&gt;<br>
&gt; I should press a key to have the ability to write again on the termina=
l. I don&#39;t want it. Someone can help me to refine the script ? thanks.<=
br>
<br>
Here is a fully tested/debugged hand made script to do what you<br>
requested (added bonus is the passthrough):<br>
<br>
#!/bin/sh<br>
#<br>
# Generated by PetiteCloud 0.2.6<br>
#<br>
<br>
# nvidia1030.rom<br>
<br>
ifconfig tap1 destroy<br>
ifconfig tap1 create<br>
ifconfig tap1 up<br>
ifconfig bridge0 addm tap1 up<br>
echo net done<br>
sleep 5<br>
bhyvectl --destroy --vm=3D6222f881ad268c17<br>
nohup /usr/sbin/bhyve -S -c cores=3D8 -m 8192 -AI -H -P -w -s<br>
0:0,hostbridge -s 1,virtio-net,tap1 -s 2,ahci-hd,/dev/ada0 -s<br>
29,fbuf,tcp=3D<a href=3D"http://0.0.0.0:6048" rel=3D"noreferrer" target=3D"=
_blank">0.0.0.0:6048</a>,w=3D800,h=3D600 -s 30,xhci,tablet -s 31,lpc -s<br>
5,passthru,37/0/0 -s 6,passthru,37/0/1 -l com1,/dev/nmdm1B -l<br>
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd<br>
6222f881ad268c17&amp;&gt;/dev/null<br>
echo final sleep<br>
sleep 10<br>
<br>
&gt;<br>
&gt; --<br>
&gt; Mario.<br>
<br>
<br>
<br>
-- <br>
Aryeh M. Friedman, Lead Developer, <a href=3D"http://www.PetiteCloud.org" r=
el=3D"noreferrer" target=3D"_blank">http://www.PetiteCloud.org</a><br>;
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Mario.<br></d=
iv>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Mario.<br></d=
iv>

--0000000000009d9c80061189347b--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSij4oO7O86EZEY_Reix0VJU=fwqe_xBho4_KOFxCNRoxeg>