From nobody Fri Feb 14 22:23:36 2025 X-Original-To: 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 4YvmmQ0jpHz5nlVY; Fri, 14 Feb 2025 22:23:50 +0000 (UTC) (envelope-from paul@redbarn.org) Received: from util.redbarn.org (util.redbarn.org [IPv6:2001:559:8000:cd::222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.redbarn.org", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YvmmP3lw6z41xR; Fri, 14 Feb 2025 22:23:49 +0000 (UTC) (envelope-from paul@redbarn.org) Authentication-Results: mx1.freebsd.org; none Received: from family.redbarn.org (family.redbarn.org [IPv6:2001:559:8000:cd::5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.redbarn.org", Issuer "RapidSSL TLS RSA CA G1" (not verified)) by util.redbarn.org (Postfix) with ESMTPS id D7D36160C27; Fri, 14 Feb 2025 22:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=redbarn.org; s=util; t=1739571816; bh=wQxCySylL1sGTamayxBbhS272Ck+WZgMqBfkAICBVbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZBkTwOeL/iZAQIjNKqoornlqcwALyHCujTvrTUC4AjvkH9Q/f3un8CZ6UxCIwH+wy /cQ0+mAhzYGysgpL2caV92yq9byCsP5e2GJwfVWh03yWKgfwn0G23+aK/rsSalcUe5 abuFeaque5uuWJOYZSYTsUt/wnZDsxW6lL8b74lw= Received: from localhost.localnet (dhcp-168.access.rits.tisf.net [24.104.150.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by family.redbarn.org (Postfix) with ESMTPSA id B1345C3F22; Fri, 14 Feb 2025 22:23:36 +0000 (UTC) From: Paul Vixie To: Michael Gmelin , virtualization@freebsd.org Cc: freebsd-virtualization@freebsd.org, Petru Garstea Subject: Re: bhyve vm and virtio-console Date: Fri, 14 Feb 2025 22:23:36 +0000 Message-ID: <3802339.MHq7AAxBmi@localhost> Organization: FW In-Reply-To: <5e1c08ca-4175-4a85-bc07-3ca73406454a@ambient-md.com> References: <2a0e1b92-4d63-4061-bc37-c5e72b8ef0ed@ambient-md.com> <20250214205752.6a12dbb4.grembo@freebsd.org> <5e1c08ca-4175-4a85-bc07-3ca73406454a@ambient-md.com> 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4YvmmP3lw6z41xR 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:33651, ipnet:2001:559:8000::/48, country:US] if you want to use cu, you have to use -l to map guest com1 to some host nm= dm=20 device. if you want to use virtio-console, it will create unix domain socke= ts=20 not pseudo tty endpoints. from bhyve(8) we see: > Virtio console device backends: > =20 > =E2=80=A2 =20 > port1=3D/path/to/port1.sock[,portN=3D/path/to/port2.sock= ...] > =20 > A maximum of 16 ports per device can be created. Every > port > is named and corresponds to a Unix domain socket created= by > bhyve. bhyve accepts at most one connection per port at= a > time. > =20 > Limitations: > =20 > =E2=80=A2 Due to lack of destructors in bhyve, sockets= on the > filesystem must be cleaned up manually after bhyve > exits. > =20 > =E2=80=A2 There is no way to use the =E2=80=9Cconsole = port=E2=80=9D feature, nor > the console port resize at present. > =20 > =E2=80=A2 Emergency write is advertised, but no-op at = present. i know of no host-side client which will connect to these unix domain socke= ts=20 and offer a cu-like user interface. "unidirectional" may be the experience= =20 you'll get from "socat". if what you're trying to accomplish is a graphical console, virtio-console = is=20 not the way to do it. rather, you'll want "fbuf" to create a guest VGA/simi= lar=20 that gateways to a host VNC. re: On Friday, February 14, 2025 9:55:23 PM UTC Petru Garstea wrote: > I tried with the following command, and got the same result. >=20 > */usr/sbin/bhyve -H -P -A -c 1 -m 1500M \ > -s 0,hostbridge \ > -s 6,virtio-console,0=3D/tmp/vtcon.0 \ > -s 31,lpc \ > -l bootrom,/tmp/BHYVE_UEFI.fd \ > -s 1,virtio-blk,/tmp/fbsd.img \ > -s 2,virtio-net,tap0 \ > tmp* >=20 >=20 > I also able to connect but the bidirectional connection is not happening >=20 > *socat - UNIX-CONNECT:/tmp/vtcon.0 > ls > * > PS: if I use null modem emulation instead virtio-console, then > connecting with cu is not an issue. >=20 > any ideas ? >=20 > Thanks >=20 > On 2/14/25 14:57, Michael Gmelin wrote: > > On Fri, 14 Feb 2025 14:21:07 -0500 > >=20 > > Petru Garstea wrote: > >> Hi, > >> I am trying to configure bhyve vm with support of virtio-console, the > >> following option is added to bhyve command line > >>=20 > >> *-s 3,virtio-console,port1=3D/test/console.sock > >>=20 > >> *However when trying to connect to socket with socat trere are no > >> input/ouptut is observed. > >>=20 > >> Has virtio-console ever worked ? > >=20 > > Yes it works, I just tried it using sysutils/vm-bhyve (just add > > virt_console0=3D"Yes" to the configuration file). > >=20 > > Based on the logs, these device settings are used by it: > > bhyve devices: > > -s 0,hostbridge \ > > -s 31,lpc \ > > -s 4:0,virtio-blk,/dev/zvol/zroot/vms/freebsd14-test/disk0 \ > > -s 5:0,virtio-net,tap0,mac=3D58:9c:fc:aa:aa:aa \ > > -s 6:0,virtio-console,0=3D/vms/freebsd14-test/vtcon.0 > >=20 > > I could connect to /vms/freebsd14-test/vtcon.0 using socat: > > socat - UNIX-CONNECT:/vms/freebsd14-test/vtcon.0 > >=20 > > Inside the vm it's /dev/vtcon/0. > >=20 > > -m =2D-=20 Paul Vixie