Date: Wed, 03 Jul 2019 22:40:01 +0000 From: Paul Vixie <paul@redbarn.org> To: freebsd-virtualization@freebsd.org Subject: Re: Bhyve serial terminal server Message-ID: <2659111.BS0ceVt7k5@linux-9daj> In-Reply-To: <61d16595-7327-77bb-6f96-63c1e40aa467@vangyzen.net> References: <61d16595-7327-77bb-6f96-63c1e40aa467@vangyzen.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, 3 July 2019 19:45:45 UTC Eric van Gyzen wrote: > I would like to expose bhyve serial consoles over TCP sockets, like many > terminal servers do for hardware serial ports. Is there any open-source > software to do this? as i said, "pkg install rtty" was created for this purpose and it's what i use. but then, i wrote it, in 1991 or so, while employed at d|i|g|i|t|a|l who gave me a room full of vaxes but no way to keep track of them all. a demo: > [mm1.redbarn:amd64] console > family guests pbx sleipnir util > [mm1.redbarn:amd64] console pbx > connected > (use (CR)~? for minimal help; also (CR)~q? and (CR)~s?) > [authorized] > [vixie@/dev/pts/0 connected] > FreeBSD/amd64 (pbx.redbarn.org) (ttyu0) > login: ~. > [rtty exiting] > [mm1.redbarn:amd64] ls -l /usr/local/rtty/dev > total 3 > lrwxr-xr-x 1 root wheel 11 May 18 2014 family@ -> /dev/nmdm2A > lrwxr-xr-x 1 root wheel 11 May 17 2014 guests@ -> /dev/nmdm0A > lrwxr-xr-x 1 root wheel 11 Nov 16 2014 pbx@ -> /dev/nmdm5A > lrwxr-xr-x 1 root wheel 11 Jun 1 2014 sleipnir@ -> /dev/nmdm3A > lrwxr-xr-x 1 root wheel 11 May 18 2014 util@ -> /dev/nmdm1A > [mm1.redbarn:amd64] ps auxwww|grep ttysrv|head -1 > root 1578 0.0 0.0 6440 2088 - I 17Jan19 0:00.03 > /usr/local/rtty/bin/ttysrv -b 9600 -w 8 -p none -t > /usr/local/rtty/dev/family -s /usr/local/rtty/sock/family -l > /usr/local/rtty/log/family -i /usr/local/rtty/pid/family root 1617 and: > [mm1.redbarn:amd64] tail /usr/local/rtty/log/pbx > Jul 3 22:04:01 pbx syslogd: last message repeated 1 times > FreeBSD/amd64 (pbx.redbarn.org) (ttyu0) > login: ~. > [mm1.redbarn:amd64] however, i'd like to add additional detail, below: > I found ports/comms/conserver-com, which is /almost/ what I want. I > want the client to simply connect to a TCP port and get direct, > immediate access to the guest console associated with that port. Can > conserver do this? We have lots of infrastructure and tooling built > around this model, and I'd rather avoid modifying it to support the > conserver model. as hinted by the name, rtty has a tcp listener/connection model in addition to the more common unix domain socket connection model i normally use: > [mm1.redbarn:amd64] ls -l /usr/local/rtty/sock > total 3 > srw-rw---- 1 root wheel 0 Jan 17 15:06 family= > srw-rw---- 1 root wheel 0 Jan 17 15:06 guests= > srw-rw---- 1 root wheel 0 Jan 17 15:06 pbx= > srw-rw---- 1 root sleipnir 0 Jan 17 15:06 sleipnir= > srw-rw---- 1 root wheel 0 Jan 17 15:06 util= however, the protocol is not "direct" or "immediate", and indeed cannot be so, because i have to be able to encode things like BREAK and seeing or changing the baud rate and word size and so on. i should have used telnet encoding, but that didn't have a location broker and i didn't want to have to assign or memorize port numbers, and the only authentication telnet had when i began this work was in-band or kerberos, neither of which fit my needs. my tcp listener and unix domain listener speak the same (stream) protocol. see https://github.com/gitGNU/gnu_rtty/blob/master/ttyprot.h for details. you could pretty easily use the supplied "rtty" client program for management, but, there is no authentication or encryption. when i want to give someone remote access to a guest VM, i do it with ssh, and i use rtty as their login shell. that's when unix domain sockets and their file modes and group and user ownership become important. -- Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2659111.BS0ceVt7k5>