Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2019 13:08:53 -0400
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        Mark Raynsford <list+org.freebsd.virtualization@io7m.com>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: bhyve: Detecting that a guest kernel has booted
Message-ID:  <20190311170853.cwjclznvsyd2wksu@mutt-hbsd>
In-Reply-To: <20190311170420.61bd34c6@almond.int.arc7.info>
References:  <20190311170420.61bd34c6@almond.int.arc7.info>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190311170853.cwjclznvsyd2wksu>