From owner-freebsd-virtualization@freebsd.org Mon Mar 11 17:58:59 2019 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6230E1527FDD for ; Mon, 11 Mar 2019 17:58:59 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2E4372872 for ; Mon, 11 Mar 2019 17:58:58 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x2BHwtKh010699; Mon, 11 Mar 2019 10:58:55 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x2BHwttd010698; Mon, 11 Mar 2019 10:58:55 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201903111758.x2BHwttd010698@ gndrsh.dnsmgr.net> Subject: Re: bhyve: Detecting that a guest kernel has booted In-Reply-To: <20190311172158.1c06b5d9@almond.int.arc7.info> To: Mark Raynsford Date: Mon, 11 Mar 2019 10:58:55 -0700 (PDT) CC: Shawn Webb , freebsd-virtualization@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C2E4372872 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[org.freebsd.virtualization]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,0] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 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, 11 Mar 2019 17:58:59 -0000 -- Start of PGP signed section. > On 2019-03-11T13:08:53 -0400 > Shawn Webb wrote: > > > > If your guest OS supports it, you could probably write two scripts that > > uses virtio_console(4), one for the guest to tell the host "HELLO" and > > one for the host to say "NICE TO SEE YOU!" once the guest's "HELLO" is > > received. > > > > They're a mix of FreeBSD, OpenBSD, and Debian guests. So I'm guessing > one out of three of those supports it... > > I suppose my other option would be to add (another) NFS mount in each > guest, and have them touch a file early in the init script (and > possibly touch a different file early in the shutdown script). Well ICMP is in the kernel, and should be working as soon as the interface is up, long before you could do anything with NFS, so rather than the complexity above a simple ping would suffice. There is also the phase of vmm(8) startup that when you are running bhyveload vs bhyve and iirc grubload vs bhyve, that can be detected. vmbhyve does so and says you are in state looader when you do a vm list. -- Rod Grimes rgrimes@freebsd.org