Reputation:
I just want to known how to get BIO information in C++. I tried following option but each one has its drawback.
I need one permanent solution that gives me BIO information in c++.
Upvotes: 2
Views: 1628
Reputation: 129314
Whilst Salgar beat me to it, one of the more "safe" methods is to use the CPUID instruction, which generally works on modern VM's. I know that KVM, Microsoft and Xen uses a CPUID leaf around 0x40000000 that gives back "You are in a virtual machine". Not 100% sure if VMWare also supports the same one - on a "real" machine, these are reserved and not used.
Here's a page that discusses several options besides CPUID: http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/detecting-x86-virtual-machines.html and there are several links for further reading.
Upvotes: 1
Reputation: 7775
Trying to detect if you are in a virtual OS is done in various ways and depends on the virtualization software being used.
There are many different questions about this already on stackoverflow.
In no particular order, here are some articles, they cover a variety of the different virtualization pieces used:
Detect virtualized OS from an application?
detect if application running on virtual box
64-bit windows VMware detection
How to identify that you're running under a VM?
http://www.codeproject.com/Articles/9823/Detect-if-your-program-is-running-inside-a-Virtual
Upvotes: 1