[BALUG-Talk] is it virtual (host)?: Re: /proc and /sys filessytems
Michael Paoli
Michael.Paoli@cal.berkeley.edu
Thu Sep 20 17:38:23 PDT 2018
Depending upon vintage of /sys filesystem ...
/sys/class/dmi/id/product_name
and/or:
/sys/devices/virtual/dmi/id/product_name
However, note:
$ ls -i /sys/class/dmi/id/product_name
/sys/devices/virtual/dmi/id/product_name
526 /sys/class/dmi/id/product_name
526 /sys/devices/virtual/dmi/id/product_name
$ readlink /sys/class/dmi/id
../../devices/virtual/dmi/id
> From: "Michael Paoli" <Michael.Paoli@cal.berkeley.edu>
> Subject: /proc and /sys filessytems
> Date: Wed, 19 Sep 2018 05:37:14 -0700
> Is it virtual? Don't have dmidecode(8) or similar?
> $ cat /sys/devices/virtual/dmi/id/product_name
> Can even work that into use in a script, e.g.
> #!/bin/sh
> #... case ...
> 'Bochs'|'HVM domU'|'VMware'*|'VirtualBox')
> The above would respectively match virtual machines of (at least some
> of) the varieties:
> QEMU/KVM
> Xen
> VMware
> VirtualBox
More information about the BALUG-Talk
mailing list