How to find if my OS works in a virtualized or non-virtualized environment?

I have access to a machine on which I can ssh. How do I determine if my OS is running in a fully virtualized environment (where VMM performs binary translation), a paravirtualized or non-virtualized environment? I have some idea on how to do this (some operations, such as accessing a memory / disk page, take more time in a virtualized environment), but do not know how to do this.

+7
source share
1 answer

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.

+2
source

All Articles