Home >Operation and Maintenance >Linux Operation and Maintenance >How to check if linux is a virtual machine

How to check if linux is a virtual machine

青灯夜游
青灯夜游Original
2022-03-02 15:35:1512639browse

View method: 1. Execute the "dmidecode -s system-product-name" command. If "VMware Virtual Platform" is output, it is a virtual machine; 2. Execute the "lscpu" command. If there is " VMware" is a virtual machine.

How to check if linux is a virtual machine

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

To check whether the Linux server is a virtual machine, you can use the following two methods

1. dmidecode -s system-product-name

Physical machine:

[root@swnode1]# dmidecode -s system-product-name
I840-GS

Virtual machine:

[root@gnntdb DbBackup]# dmidecode -s system-product-name
VMware Virtual Platform

2. lscpu

If you forget the host IP of the virtual machine, how to retrieve it? If there is a switch, locate it by viewing the interface information and arp list under the switch.

The above is the detailed content of How to check if linux is a virtual machine. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn