How to know if a machine is an Google Compute Engine instance

前端 未结 4 1491
感动是毒
感动是毒 2021-02-13 09:59

Is there a way to know from a command line shell if I am currently on a Google Compute Engine machine or somewhere else (development machine)?

4条回答
  •  借酒劲吻你
    2021-02-13 10:38

    You can also use the dmidecode utility to probe the virtual hardware if you don't want to make a network call:

    my@myinst:~$ sudo dmidecode -s bios-vendor | grep Google
    Google
    

提交回复
热议问题