From owner-freebsd-virtualization@freebsd.org Mon Mar 11 17:09:35 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 88F071526880 for ; Mon, 11 Mar 2019 17:09:35 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 221297085C for ; Mon, 11 Mar 2019 17:09:35 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82b.google.com with SMTP id s1so5913092qte.5 for ; Mon, 11 Mar 2019 10:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MuEixTC9KBJk8+8ZW00kG66DYKPwbkqL0B6vVpyCB1g=; b=S51A5ezurLl6xldD0CVgLgpzW5la2fTUbIwDWqLwKZuojMrE0L+kvrZ2BIFF2AFE4l Ub/IgZRo4UExRfZgfFHgL2RpQOwvbb7PpzICFbTD+p7UQbDImT7BOxp+oiSVXBbgbfmy x/BbRN1AVjlqzAY3n+cMRKTUrP1MdTuPo3aoq6+jR1fBdmfsIWjX6v0Q1HN9JqrXYaJO RFhVO3Dng8NcocLhMTV5AZ5HATCaBJ4gSrQyr/jFwrA4AZ5sLKUY1mRyx+zoX1v4R7d2 hcP55YDzwyKbQgt6UG/LU+Qp7sU4fd82BrIXg0cggbfAyKbF522LF+02dilapSguQ9Y5 kdkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MuEixTC9KBJk8+8ZW00kG66DYKPwbkqL0B6vVpyCB1g=; b=UCVF3UdbOJ82PYFa7sa2p0CNOc9MmIgVXBQk9vNFtKqgTEjgG/V0dnqcTfaEZawTUd VQgfnwIG5FSfD0vxWCoIDkKKspoZyfhfdFnoryjhb+Fi3lQ+Pa2Cq6gP6q8T5qGbvmtv IFBleXi6agjRt4dSzXrO4j/SVs58FPhPGgs2sIf8/LlmgHK8bqB+ty6tvpZ3FdqQVLjl sXwZmdCiTj0kypHFR1THyc+bp3aRKjoPP7wy2jIjlTnuaoQoSR4lXtBDmxcpJ6xttH2C +sVrS5tL0HuMpY9H2cggfVYIQFRTmlxpygwDM1M69k8aL31T7Aidg4Vrj57jMcXKuyg5 uF9g== X-Gm-Message-State: APjAAAX/OSEpjLvzr60AdBuvMy5RPVaqJhPqFUxMBchMH6elagZBze0o wQAAuyHLu2LkO4ZHrQv9Yc0TCQtz0Pwmpw== X-Google-Smtp-Source: APXvYqxugtQ6GeWPdB0rE9ZDmiyfZyeP5lC3ioHJS/oYgwKsVXyFuTeowFH+MD1X8SBZcPMyVPQfSA== X-Received: by 2002:a0c:d2b9:: with SMTP id q54mr26487662qvh.196.1552324174422; Mon, 11 Mar 2019 10:09:34 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id w20sm3233859qki.35.2019.03.11.10.09.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 10:09:33 -0700 (PDT) Date: Mon, 11 Mar 2019 13:08:53 -0400 From: Shawn Webb To: Mark Raynsford Cc: freebsd-virtualization@freebsd.org Subject: Re: bhyve: Detecting that a guest kernel has booted Message-ID: <20190311170853.cwjclznvsyd2wksu@mutt-hbsd> References: <20190311170420.61bd34c6@almond.int.arc7.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c6jwskjot6bhvlcb" Content-Disposition: inline In-Reply-To: <20190311170420.61bd34c6@almond.int.arc7.info> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 221297085C 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_SHORT(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[org.freebsd.virtualization]; REPLY(-4.00)[] 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:09:35 -0000 --c6jwskjot6bhvlcb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 11, 2019 at 05:04:20PM +0000, Mark Raynsford via freebsd-virtua= lization wrote: > Hello! >=20 > Leaving aside userland monitoring tools such as Prometheus[0], is there > any way to detect on the host that a guest kernel running in bhyve has > booted? I'm assuming "booted" in this sense to mean "PID 1 has probably > started". I'm guessing that there probably isn't, but I thought I'd > better ask anyway. "Not booted" would mean something like "Is sitting > at the Grub prompt doing nothing". 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. Of course, replace the "HELLO" and "NICE TO SEE YOU!" with the right logic you're looking for. ;) The "HELLO" bit could be written as an init script. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --c6jwskjot6bhvlcb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlyGliEACgkQaoRlj1JF bu7Nkw/9EjB8VmUIM19JMRZeeysuzhy1VHu4pB4NWmFYFOTUYOpgJomb/m1q3fuz xPP/GWoe9pkn3ktXImt1PnyVHJDWUn9c0pY+v4Yt8EVqlW5R6qTxcU9fIoDDcnwv xWg/WVAzXUPO+pfCDslyacXW2P4s9fQY83bBy4W7Z33sfMSNv2tUTdc7v27c7kMm iJ7rRi8Hx2ifMa7ktWZXs96XMi6NLtxeoyDbTy1Iu7pWxlL9d6tD76IWcdaFKS1N a0yOJDBt1F3UTQg25Pg2FlzBHF+wAsFfb/JCWSHQgRkWfJwgMrfuJTdJeH26HNDE p4J/JZYTSc4tCldR5vKkqQzSHcgfLR3MxAob6jjWpqIHDzFoHZx1lfld4IGezeZd Mt+4nic/M7QPB3vhL/rRMSXK0KgAgADp/vqj4X4FLiElvTIwxvWR5OuPnSyrhbwr JgGmbVMtyXJ9jxtDaXz5uiZ3d/pr2CFXBYQcg2QxbS/pC/rWHFK0cYVrWfwalqHx FT9ojNU2uVKO3YlDCotV3D8S5SzawcNi/oJbSyp32dNltMLM9Ivun+sATQfJPmpi cYUHJb3NSqh7YuIyHneP7pzJhbkvlkH8kk3xR/Xtr7Bb1H1F8FnilF+qjSYNDbtc nYxTZflu11DmEyCoTmNx/mF34SNF7sLK/mzJslvee/e/Q09lVfI= =doqX -----END PGP SIGNATURE----- --c6jwskjot6bhvlcb--