Determine when running in a virtual machine

后端 未结 10 498
遇见更好的自我
遇见更好的自我 2020-12-12 11:39

Is there an official way for an application to determine if it is running in VMWare or Virtual PC (or whatever Microsoft is calling it now)? The code I have seen i

10条回答
  •  旧时难觅i
    2020-12-12 12:04

    To determine the machine is physical or VM

    dmidecode | egrep -i 'manufacturer|product'
    

    If the dmidecode command not found install the respective rpm.

    This is tested under EXSI, VMWARE and hyperv machines.

提交回复
热议问题