In windows OS, we can get Serial Number in BIOS by querying WMI to identify a unique machine. Do we have any way to do this in Linux OS in C++? Do we have any API to do this? Thanks in advance!
Asked
Active
Viewed 1,533 times
1
-
3What is the "UUID" of a PC? There is no such thing, AFAIK. There are things like MAC addresses for network interface controllers or UUIDs for file systems, but there is no unique identifier for entire PCs. – cadaniluk May 28 '18 at 10:30
-
What about Linux running in some virtual machine? Your question is unclear (since in general PCs don't have serial numbers). BTW, a clever enough developer could patch the Linux kernel (since it is free software) to fake some UUID good for you – Basile Starynkevitch May 28 '18 at 10:30
-
2Possible duplicate of [Getting a unique id from a unix-like system](https://stackoverflow.com/q/328936/608639). Also see Posix [`gethostid(3)`](http://man7.org/linux/man-pages/man3/gethostid.3.html) and [`machine-id (5)`](http://man7.org/linux/man-pages/man5/machine-id.5.html) man page. It looks like `gethostid` is backed by `/etc/hostid` on systems with glibc. – jww May 28 '18 at 11:16
-
1UUID means user unique ID, I am pretty sure, this is not what are you asking for :), for all other, please clarify the question with edit of the post, thanks – xxxvodnikxxx May 28 '18 at 11:25
-
1@xxxvodnikxxx: I think in the context of the question UUID stands for Universally unique identifier, not user unique id. – Veverke Sep 17 '20 at 11:33
-
@Veverke yes, but in general its simply some kind of unique ID, the specific meaning is related to specific usage – xxxvodnikxxx Sep 21 '20 at 08:29