Date: Tue, 16 Jul 2024 17:06:43 +0200 From: Mario Marietto <marietto2008@gmail.com> To: Polarian <polarian@polarian.dev> Cc: freebsd-virtualization@freebsd.org Subject: Re: nmdm issues with bhyve Message-ID: <CA%2B1FSii08tf2PQ25p%2BzhEJkrnypHWqfKQ92Eo8rRBNxn2%2BLEzA@mail.gmail.com> In-Reply-To: <20240716153851.60c1ea61@PolarianBSD> References: <20240716153851.60c1ea61@PolarianBSD>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000b885c8061d5eb315 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello. In short words,what's nmdm used for ? thanks. On Tue, Jul 16, 2024 at 4:39=E2=80=AFPM Polarian <polarian@polarian.dev> wr= ote: > Hello, > > Over the last few days I have been trying to get nmdm working with > bhyve. I have discussed it within #bhyve over on libera.chat however > none of the suggestions so far have fixed the problem, therefore I am > bringing it to the mailing list for further support. > > A rundown what I have done so far, I have a shell script with the > following contents: > > #!/bin/sh > > bhyve -c 1 -m 1G -u -H \ > -s 0,amd_hostbridge \ > -s 3,ahci-hd,/path/to/install.img \ > -s 4,virtio-blk,/dev/zvol/zpool-storage/dns \ > -s 5,virtio-net,tap0 \ > -s 31,lpc -l com1,/dev/nmdm3A \ > -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ > dns > > To verify the virtual machine was in fact booting, I did test stdio, > and the install medium for OpenBSD does successfully boot. > > The problem, well there is many. Following the FAQ entry [1], the > following flag is suggested: > > -s 31,lpc -l com1,nmdm0A > > (where 0 can be substituted to prevent collisions) > > Enter problem #1, when I try this by executing the script (with doas, > doas sh dns.sh) I get the following: > > Unable to initialize backend 'nmdm3A' for LPC device com1 > Device emulation initialization error: No such file or directory > > Now, both vmm and nmdm have been loaded, checked with the following > commands: > > kldstat | grep vmm > kldstat | grep nmdm > > And these have been entered into /boot/loader.conf see below: > > vmm_load=3D"YES" > nmdm_load=3D"YES" > > So they have been loaded into the kernel. > > When looking into the problem I found an article on the FreeBSD forums > which has the same error [2], which would suggest the example in the > FAQ is either wrong, or deprecated and no longer works. > > The solution from this article is to ensure to specify the /dev path, as > seen in the full script at the beginning of the email, /dev/nmdm0A, > this DOES work and the vm does startup. > > Problem #2, the device doesn't show up, even though the vm is, in fact, > running. > > ls /dev | grep nmdm > > The above returns nothing, there is no nmdm device. I have tested it to > ensure nmdm is in fact working, using cu to open both A and B and > verifying that the data is being passes between them. So nmdm is > working! > > AllanJude on IRC suggested that I change from 0 to some other number in > case of conflicts, and so I did (as seen in the script at the beginning > of the email) changing 0 --> 3, same issue remains. > > I can find no further information on this issue, and I am out of ideas, > so if anyone has nmdm successfully working, could you give me a hand in > getting it to work on my server? > > The FAQ [1] also suggested pty can be used, or a terminal multiplexer > such as tmux, however I am yet to find any examples on how this could > be done to substitute nmdm. If anyone has some useful links to some > examples for these, that would be great! > > Thank you, > -- > Polarian > GPG signature: 0770E5312238C760 > Jabber/XMPP: polarian@icebound.dev > > [1] > > https://wiki.freebsd.org/bhyve#Q:_Does_bhyve_have_an_.22out-of-band.22.2F= .22lights-out_management.22_serial_console.3F > [2] > > https://forums.freebsd.org/threads/unable-to-initialize-backend-nmdm0a-fo= r-lpc-device-com1.82177/ > > --=20 Mario. --000000000000b885c8061d5eb315 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hello.</div><div><br></div><div>In short words,what&#= 39;s nmdm used for ? thanks.<br></div></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jul 16, 2024 at 4:39=E2=80=AF= PM Polarian <<a href=3D"mailto:polarian@polarian.dev">polarian@polarian.= dev</a>> 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">Hello,<br> <br> Over the last few days I have been trying to get nmdm working with<br> bhyve. I have discussed it within #bhyve over on libera.chat however<br> none of the suggestions so far have fixed the problem, therefore I am<br> bringing it to the mailing list for further support.<br> <br> A rundown what I have done so far, I have a shell script with the<br> following contents:<br> <br> #!/bin/sh<br> <br> bhyve -c 1 -m 1G -u -H \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 0,amd_hostbridge \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 3,ahci-hd,/path/to/install.img \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 4,virtio-blk,/dev/zvol/zpool-storage/dns \<b= r> =C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 5,virtio-net,tap0 \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 31,lpc -l com1,/dev/nmdm3A \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 -l bootrom,/usr/local/share/uefi-firmware/BHYVE= _UEFI.fd \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 dns<br> <br> To verify the virtual machine was in fact booting, I did test stdio,<br> and the install medium for OpenBSD does successfully boot.<br> <br> The problem, well there is many. Following the FAQ entry [1], the<br> following flag is suggested:<br> <br> -s 31,lpc -l com1,nmdm0A<br> <br> (where 0 can be substituted to prevent collisions)<br> <br> Enter problem #1, when I try this by executing the script (with doas,<br> doas sh dns.sh) I get the following:<br> <br> Unable to initialize backend 'nmdm3A' for LPC device com1<br> Device emulation initialization error: No such file or directory<br> <br> Now, both vmm and nmdm have been loaded, checked with the following<br> commands:<br> <br> kldstat | grep vmm<br> kldstat | grep nmdm<br> <br> And these have been entered into /boot/loader.conf see below:<br> <br> vmm_load=3D"YES"<br> nmdm_load=3D"YES"<br> <br> So they have been loaded into the kernel.<br> <br> When looking into the problem I found an article on the FreeBSD forums<br> which has the same error [2], which would suggest the example in the<br> FAQ is either wrong, or deprecated and no longer works.<br> <br> The solution from this article is to ensure to specify the /dev path, as<br= > seen in the full script at the beginning of the email, /dev/nmdm0A,<br> this DOES work and the vm does startup.<br> <br> Problem #2, the device doesn't show up, even though the vm is, in fact,= <br> running.<br> <br> ls /dev | grep nmdm<br> <br> The above returns nothing, there is no nmdm device. I have tested it to<br> ensure nmdm is in fact working, using cu to open both A and B and<br> verifying that the data is being passes between them. So nmdm is<br> working!<br> <br> AllanJude on IRC suggested that I change from 0 to some other number in<br> case of conflicts, and so I did (as seen in the script at the beginning<br> of the email) changing 0 --> 3, same issue remains.<br> <br> I can find no further information on this issue, and I am out of ideas,<br> so if anyone has nmdm successfully working, could you give me a hand in<br> getting it to work on my server?<br> <br> The FAQ [1] also suggested pty can be used, or a terminal multiplexer<br> such as tmux, however I am yet to find any examples on how this could<br> be done to substitute nmdm. If anyone has some useful links to some<br> examples for these, that would be great!<br> <br> Thank you,<br> -- <br> Polarian<br> GPG signature: 0770E5312238C760<br> Jabber/XMPP: <a href=3D"mailto:polarian@icebound.dev" target=3D"_blank">pol= arian@icebound.dev</a><br> <br> [1]<br> <a href=3D"https://wiki.freebsd.org/bhyve#Q:_Does_bhyve_have_an_.22out-of-b= and.22.2F.22lights-out_management.22_serial_console.3F" rel=3D"noreferrer" = target=3D"_blank">https://wiki.freebsd.org/bhyve#Q:_Does_bhyve_have_an_.22o= ut-of-band.22.2F.22lights-out_management.22_serial_console.3F</a><br> [2]<br> <a href=3D"https://forums.freebsd.org/threads/unable-to-initialize-backend-= nmdm0a-for-lpc-device-com1.82177/" rel=3D"noreferrer" target=3D"_blank">htt= ps://forums.freebsd.org/threads/unable-to-initialize-backend-nmdm0a-for-lpc= -device-com1.82177/</a><br> <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> --000000000000b885c8061d5eb315--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSii08tf2PQ25p%2BzhEJkrnypHWqfKQ92Eo8rRBNxn2%2BLEzA>