From nobody Fri Feb 14 22:46:04 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 4YvnGP3FVRz5nmlH for ; Fri, 14 Feb 2025 22:46:21 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (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 4YvnGP20Khz4HfY for ; Fri, 14 Feb 2025 22:46:21 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6e65d6e1f12so30051046d6.0 for ; Fri, 14 Feb 2025 14:46:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ambient-md-com.20230601.gappssmtp.com; s=20230601; t=1739573175; x=1740177975; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ebw7qOmuZKujV+hwEuY6x4N7RVoZ7PMzFK9eKkpHwMc=; b=MEapIH1sm3ePjrCCEY1Br8jacIus6SpGnMozTXWan1q2ci2d/7G2MD81pccIUJJNWS 2KH+LN5ASrqb3pb7aznQI/9Pt5f2rouOSzkOfrtD15BOPmYe0aHK60HOVrM+IxIUqPMZ X9flwSYDCbj0H9/KS1i2JKu4fnIL+JdkUP+g2aGUTX0vMYQUAHAFYcjFP23O/5UJul0T C7S/2i6z5aLyo9KH+E7Ux7xxtwjJ3RHGy1kfHwKU6BkGaYeOEDaVxfMGOFUAACpPeC/c cTvNoamJ3pEgIj76lXMhn1TUrQHmSB9oQfPBdpN2f76kyXgO7NPJkKdVgM4WZ3p1UhLk 1UDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739573175; x=1740177975; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ebw7qOmuZKujV+hwEuY6x4N7RVoZ7PMzFK9eKkpHwMc=; b=TuitRzDIvNyUapGXfbORT5LvA0z3nym5rYmx/hpJ52Msm5XkwVm0/7mQjw1y2W5YpS MtclWp+vCN3OwyYjsCLSr6Ln0ulFQUaPaaCjgJaQ5gLN07UzSXwLwybk/YIrQpyslVg+ P8EMP9wpNRV4fvsIgrAGHG/n0hZoxTx656QerBLMY2w3sQD3NFolrG/gp5zeq1oDMwwX ukIYef1qyDnXQzo08+8GSZjrwb1VIy7zRDJLR0RLrgg/YBqkKm6uMl7B2zOd1BanHsZM 3HBO4sWKKVllFrWo54mKumHQaw9zeFekSXZqPmuzjTIBTRR0QCHZTJNmp0hhb5wQ2JOQ +eAA== X-Forwarded-Encrypted: i=1; AJvYcCWOclsNlaB+uh8W0Ogq5XLK7H2inzj6zY4Zfz20GxOxZMIVuOLjf7WI2TkgKOjxoWa/qdyCyLuTR/swM19xEA==@freebsd.org X-Gm-Message-State: AOJu0YznuLPWWG414xN13ZiaBk8COSNeQ8lT1VoBXTFZXyCEPsG31crU sYBdXOnbMzFBiHvnRgwI4k3v/qyeE5ocxBW5wucCAHJ1wyJwLPU3dBTS+oLIdxk= X-Gm-Gg: ASbGncstvIKyQOP1SDfRO6VY6Kdxbcg0XFn2rlQpqMtLv/s5FQst/AxCTWSMBiKjGxw vzDCVLvn8bhdaujLcNzg7cKzDooSznGt1JeC06IT/+jcgppvhZOhuDWaBgMUzU8WJVctyBDdTP1 7xKCuBiBXpqfGUzhpfzdL+4EQQdC7HU5QTn3dd95ew9Nw/a3mYltV8ELwxvFTDTuhbcFA1mqBmS dtoFcp3JQx+sfkQ/wQ0aD8qqqA1+Ge9aYloT06jdY3hXCyrNDz/Up5BGjIrBvnmOFZfBpgNnZZ6 c0obdL/6rWBRqoYWVScMn3vO/r4= X-Google-Smtp-Source: AGHT+IEpRaEYl2RU2gC9QD78KPCi8prpzpBAjjvYURCZgW8KneMtYiNWaYD/xtcR8D2ploOL5YtdRw== X-Received: by 2002:a05:6214:5085:b0:6e4:4484:f358 with SMTP id 6a1803df08f44-6e66cd0b70fmr17574366d6.33.1739573175413; Fri, 14 Feb 2025 14:46:15 -0800 (PST) Received: from [10.0.0.83] ([209.226.127.177]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e65d7a3faasm25820766d6.57.2025.02.14.14.46.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Feb 2025 14:46:15 -0800 (PST) Message-ID: <9865e8dd-7af9-4cc6-97c7-2e3197c62e62@ambient-md.com> Date: Fri, 14 Feb 2025 17:46:04 -0500 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 User-Agent: Mozilla Thunderbird Subject: Re: bhyve vm and virtio-console To: Paul Vixie , Michael Gmelin , virtualization@freebsd.org Cc: freebsd-virtualization@freebsd.org References: <2a0e1b92-4d63-4061-bc37-c5e72b8ef0ed@ambient-md.com> <20250214205752.6a12dbb4.grembo@freebsd.org> <5e1c08ca-4175-4a85-bc07-3ca73406454a@ambient-md.com> <3802339.MHq7AAxBmi@localhost> Content-Language: en-US From: Petru Garstea In-Reply-To: <3802339.MHq7AAxBmi@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4YvnGP20Khz4HfY 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] Spinning up the vm with /dev/nmdm* and connecting with cu -l is not an issue on my end. I am trying to create a vm using freebsd cloud image and connect to guest OS terminal with virtio-console and socat(no X11). When spawning the vm the unix socket indeed is created, however when I connect to it with socat nothing is being shown(not actions on any terminal commands as well). Also, I noticed there is a kernel module(virtio_console.ko) and apparently I believe it has to be loaded it, not sure here. Please advise, On 2/14/25 17:23, Paul Vixie wrote: > if you want to use cu, you have to use -l to map guest com1 to some host nmdm > device. if you want to use virtio-console, it will create unix domain sockets > not pseudo tty endpoints. from bhyve(8) we see: > >> Virtio console device backends: >> >> • >> port1=/path/to/port1.sock[,portN=/path/to/port2.sock ...] >> >> 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. >> >> Limitations: >> >> • Due to lack of destructors in bhyve, sockets on the >> filesystem must be cleaned up manually after bhyve >> exits. >> >> • There is no way to use the “console port” feature, nor >> the console port resize at present. >> >> • Emergency write is advertised, but no-op at present. > i know of no host-side client which will connect to these unix domain sockets > and offer a cu-like user interface. "unidirectional" may be the experience > you'll get from "socat". > > if what you're trying to accomplish is a graphical console, virtio-console is > not the way to do it. rather, you'll want "fbuf" to create a guest VGA/similar > 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. >> >> */usr/sbin/bhyve -H -P -A -c 1 -m 1500M \ >> -s 0,hostbridge \ >> -s 6,virtio-console,0=/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* >> >> >> I also able to connect but the bidirectional connection is not happening >> >> *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. >> >> any ideas ? >> >> Thanks >> >> On 2/14/25 14:57, Michael Gmelin wrote: >>> On Fri, 14 Feb 2025 14:21:07 -0500 >>> >>> 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 >>>> >>>> *-s 3,virtio-console,port1=/test/console.sock >>>> >>>> *However when trying to connect to socket with socat trere are no >>>> input/ouptut is observed. >>>> >>>> Has virtio-console ever worked ? >>> Yes it works, I just tried it using sysutils/vm-bhyve (just add >>> virt_console0="Yes" to the configuration file). >>> >>> 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=58:9c:fc:aa:aa:aa \ >>> -s 6:0,virtio-console,0=/vms/freebsd14-test/vtcon.0 >>> >>> I could connect to /vms/freebsd14-test/vtcon.0 using socat: >>> socat - UNIX-CONNECT:/vms/freebsd14-test/vtcon.0 >>> >>> Inside the vm it's /dev/vtcon/0. >>> >>> -m >