From nobody Tue Jul 16 15:06:43 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 4WNj961YVnz5RSDb for ; Tue, 16 Jul 2024 15:07:22 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WNj956h3Kz4QM2 for ; Tue, 16 Jul 2024 15:07:21 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-75c5bdab7faso2977679a12.1 for ; Tue, 16 Jul 2024 08:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721142440; x=1721747240; 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=2Gmr4r6jDBuGf3OjWKoZxSydQlSbg69N8fdjq3WZ3D8=; b=duqDKmfRLD/KulNLH0yHnMTLqbTYHEkqvL218zRP/E85S3ErQ3tOkRPXgf/0ALSo0d tG+9ncBDZ86aUuIvaMEcWVXJcUUHqiTLpg79ZF/tuGGeq3JsD7UbT6DA30KTO6Rgv0V2 DneVzRVmlh1jq5eb5Aj4Mh0d/7jkl3wDqB+gpeifZp0GghYbkuI9f5G8SCvUrsFUJ2pY vO/FtuTKRJyEKCkElXAQt4GgoMthqk8zV4M88NMuJEdZ76j5gJPrurnpyfucyFuuINK5 Q/TJDhxgVvqIlyHXx4x7YKMLxgmZKDo8K2G2B8T4BZfcODLpIypynnDz7BjmQCVTZzS+ VFbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721142440; x=1721747240; 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=2Gmr4r6jDBuGf3OjWKoZxSydQlSbg69N8fdjq3WZ3D8=; b=vCZWD7r3nTi9/mKiFJ8wHtsw0/bEPdma6Nc8xJZD8HFFIOpGjgqxkg/PUoZOFOf28R 58JHeYULGMuiwYfYKVP8XTlWu1Rqglb6dultu99KQwkJ5Zkk328irifwsLRGhZADOs7W JiPHdMlDazLO0j12ndXAD5/+sjx2NPj0A3dLCuB/Ygj8E6O2llBqUTJqYRXP5B6X1pOv p8tcrS4mBtE242FgeJbpWJLKPIxw8Cdp/99GDz/046S3R29R+/kMa3pnN0VYrCgJNs4y I6k28UvZOCf3c+ml/YQJ6pgSsdyx6YukZgpWvV2QqWc3bcGNauqk8ucShbnnbCx9NVyS QoxQ== X-Gm-Message-State: AOJu0YwcLKdSWQaQb2XPqr9Tp4jMf8eaCXVwwxH+Mka+kUe70r2Flo5Q f1oD7jRw8C69k/IAt7hlqec7KSAdBD/FHdlIHBwI7xuZTGHFR4bO6VaUKTpaML+7AvVSeiXXO1d ciRzKielieBZj4UhVUsW2WsmHsCigyhtm X-Google-Smtp-Source: AGHT+IFlDZQNtWhWj32wdobTzGAOZklj48V3H3JCPqztqAVmtMXLvfLhLrlPhJWNV1QOcz5R50EVMat19wo+apUTXco= X-Received: by 2002:a05:6a20:4310:b0:1c2:8c8f:aa0c with SMTP id adf61e73a8af0-1c3f11f450emr3172593637.12.1721142439607; Tue, 16 Jul 2024 08:07:19 -0700 (PDT) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 References: <20240716153851.60c1ea61@PolarianBSD> In-Reply-To: <20240716153851.60c1ea61@PolarianBSD> From: Mario Marietto Date: Tue, 16 Jul 2024 17:06:43 +0200 Message-ID: Subject: Re: nmdm issues with bhyve To: Polarian Cc: freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="000000000000b885c8061d5eb315" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WNj956h3Kz4QM2 --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 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
Hello.

In short words,what&#= 39;s nmdm used for ? thanks.

=
On Tue, Jul 16, 2024 at 4:39=E2=80=AF= PM Polarian <polarian@polarian.= dev> wrote:
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 \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 0,amd_hostbridge \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 3,ahci-hd,/path/to/install.img \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 4,virtio-blk,/dev/zvol/zpool-storage/dns \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 5,virtio-net,tap0 \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -s 31,lpc -l com1,/dev/nmdm3A \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -l bootrom,/usr/local/share/uefi-firmware/BHYVE= _UEFI.fd \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 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: pol= arian@icebound.dev

[1]
https://wiki.freebsd.org/bhyve#Q:_Does_bhyve_have_an_.22o= ut-of-band.22.2F.22lights-out_management.22_serial_console.3F
[2]
htt= ps://forums.freebsd.org/threads/unable-to-initialize-backend-nmdm0a-for-lpc= -device-com1.82177/



--
Mario.
--000000000000b885c8061d5eb315--