From owner-freebsd-virtualization@FreeBSD.ORG Mon Jan 6 23:12:22 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56FA7E06; Mon, 6 Jan 2014 23:12:22 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 161AB14AD; Mon, 6 Jan 2014 23:12:21 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id A5D19122B2; Tue, 7 Jan 2014 09:12:13 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local ([64.245.0.210]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BRA66834 (AUTH peterg@ptree32.com.au); Tue, 7 Jan 2014 09:12:12 +1000 Message-ID: <52CB384A.7050405@freebsd.org> Date: Mon, 06 Jan 2014 15:12:10 -0800 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Craig Rodrigues Subject: Re: Remote serial console for BHyve VM? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Peter Wemm , "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2014 23:12:22 -0000 Hi Craig, > I am working with Sean Bruno to set up some BHyve VM's. Great ! > If I want to have the VM's start via an rc.d script, and > have the VM be headless, what is the best way to have > the VM console still be accessible? > > Has anyone done something like use netcat > to direct the BHyve stdio to a socket? > That way the serial console could be accessed remotely > via telnet or ssh. > > Is there a better way to do this? One way is to use the cloneable null-modem driver, nmdm(4). Others have used tmux for this, but I'll give a quick overview of the former. kldload nmdm.ko before starting VMs, e.g. at boottime or in rc.conf's kld_list variable. Use the '-c' option for bhyveload to point it at one end of an nmdm instance, and use it in place of "stdio" in the bhyve commandline. bhyveload .... -c /dev/nmdm0A ... bhyve ... -l com1,/dev/nmdm0A ... You can then attach to the other end (nmdm*B) with any tool of your choice - cu, screen, or socat to relay the device to a network connection. Some experimentation may be required :) later, Peter.