How to identify that you're running under a VM?

后端 未结 12 1964
南旧
南旧 2020-11-29 23:42

Is there a way to identify, from within a VM, that your code is running inside a VM?

I guess there are more or less easy ways to identify specific VM systems, especi

12条回答
  •  粉色の甜心
    2020-11-30 00:32

    Red Hat has a program which detects which (if any) virtualization product it's being run under: virt-what.

    Using a third-party-maintained tool such is this is a better strategy long-term than trying to roll your own detection logic: more eyes (testing against more virtualization products), etc.

提交回复
热议问题