It depends on the VMM you are working on. If it is Xen or Microsoft VM, I believe that CPUID with EAX value 0x40000000 will give you a non-zero value in EAX . Not sure if this works on VMWare, VirtualBox or KVM. I expect it to work too ...
Measuring access time is unlikely to ALWAYS tell you the truth, since in a system other than VMs, they can vary greatly, and there is no real reason that you will see a huge difference in effective implementation. And, of course, you donβt know if your virtual machine works with a REAL hard drive controller passing through PCI, or if your drives connected to NFS are connected through a REAL network card transferred by VM, or if they are accessed through a virtual network card.
A good VMM should not show you the big difference while the application is behaving.
Mats petersson
source share