linfo icon indicating copy to clipboard operation
linfo copied to clipboard

Detect xhyve/bhyve guest

Open Hipska opened this issue 9 years ago • 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.

Hipska avatar Oct 19 '16 11:10 Hipska

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.

jrgp avatar Oct 19 '16 11:10 jrgp

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:

Hipska avatar Oct 19 '16 12:10 Hipska

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

jrgp avatar Oct 19 '16 17:10 jrgp

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)

Hipska avatar Oct 19 '16 18:10 Hipska

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

jrgp avatar Oct 19 '16 18:10 jrgp

Maybe see if xhyve is written anywhere

jrgp avatar Oct 20 '16 01:10 jrgp

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

Hipska avatar Oct 20 '16 07:10 Hipska

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

jrgp avatar Oct 21 '16 00:10 jrgp

^

jrgp avatar Dec 18 '16 23:12 jrgp

^

jrgp avatar Feb 17 '18 11:02 jrgp

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.

Hipska avatar Feb 19 '18 08:02 Hipska