jrgp/linfo

Detect xhyve/bhyve guest

Hipska opened this issue · 11 comments

Linfo detects guest of xhyve and bhyve as being QEMU/KVM.

This seems to be a generic problem as I have found tickets for Salt and Puppet/facter that state the same also.

jrgp commented

This makes sense as these two new hypervisors use libvirt like qemu does. It'd be easiest of they loaded a custom kernel module that I could look for but I don't think they do.

I'm open to suggestions. Maybe there's a secret file in /sys or /proc that could be informative here.

Does this makes some sense?

root@ee2f73bc1f20:/# grep -ri hyve /sys/devices/virtual/dmi/id
/sys/devices/virtual/dmi/id/product_name:BHYVE
/sys/devices/virtual/dmi/id/modalias:dmi:bvnBHYVE:bvr1.00:bd03/14/2014:svn:pnBHYVE:pvr1.0:cvn:ct2:cvr1.0:
/sys/devices/virtual/dmi/id/bios_vendor:BHYVE
/sys/devices/virtual/dmi/id/uevent:MODALIAS=dmi:bvnBHYVE:bvr1.00:bd03/14/2014:svn:pnBHYVE:pvr1.0:cvn:ct2:cvr1.0:
jrgp commented

Yes, checking if that one of those files exists and has the name of the hypervisor in it would definitely make sense.

Yeah, but it doesn't seem good enough as this is taken from an xhyve Guest. (actually it is on a container from Docker for mac)

jrgp commented

Yeah I recall a PR on the xhyve project to make it identify itself as xhyve not bhyve

jrgp commented

Maybe see if xhyve is written anywhere

At least not in /sys, but you could identify them as bhyve/xhyve guest and use this logo for example: bhyve logo http://bhyve.org/static/bhyve.png

jrgp commented

That makes sense. Would you be able to make a PR for this?

jrgp commented

^

jrgp commented

^

Hi sorry for late comment, but I think you could guess that yourself already that I currently have no time to spend on this. Could you please do it yourself? It doesn't seem a lot of work.