Severely broken bhyve console

Rodney W. Grimes freebsd-rwg at gndrsh.dnsmgr.net
Wed Aug 21 15:48:31 UTC 2019


> On 2019-08-20T14:34:02 -0700
> "Rodney W. Grimes" <freebsd-rwg at gndrsh.dnsmgr.net> wrote:
> >
> > What it looks as if is happened is you have disconnected from
> > a session while it was in grub and had sent specific control
> > sequences, possibly even expecting scroll regions and such
> > set up in the terminal.  Now when you reconnect from a newly
> > initialzed terminal that has none of this setup things go
> > very wrong.
> 
> Interesting. I don't remember this happening, but it's not
> inconceivable that it happened and I didn't notice it.

Is it possible the VM guest dropped out to grub, or is
in a failed reboot state, or in a partial boot state?
If grub started up while you had no console attached
it may of output a bunch of control sequences that now
went into the bit bucket that are need to set the scroll
regions, reverse video, etc.

Is there a way to tell grub it is using a dumb terminal
and not a PC console, or vt100, or xterm.  Just a dumb
old tty (/etc/termcap calls this "dumb".)  Using that
as the console type may resolve these issues.

> What is kind of strange is that I appear to be partly in the grub
> prompt and partly in the Debian installer; I see output and responses
> from both interleaved.

I agree that is very odd, is it possible the same nmdm device
somehow has been attached to multip vm's?  I am not even sure
if that is possible.  Traditional tty's can be open by more
than one process so I think it might be possible to do that,
and this would lead to a mess as well.

> > One solution is to use the graphics console, that does not suffer
> > from these tty type issues, its a bit sluggish if you do not have
> > a good high speed network path to the bhyve host though.
> 
> It's a 1Gbps LAN, so I assume that's fast enough.
> 
> However: Is there some way I can reset the nmdm device?

The problem is not that you need to reset the nmdm device,
the problem is what ever is running on the inside the
guest talking to the console believes the device to be in
a different state than what your device is in, and there
is no convienient way to get your device in the expected
state.

In the situation of a shell prompt you can get the 2 states
alligned by issueing a terminal reset command of some form,
I have no idea how to do that at a grub prompt.

-- 
Rod Grimes                                                 rgrimes at freebsd.org


More information about the freebsd-virtualization mailing list