Several methods to check whether the currently running LINUX is in the VM or on the physical machine
Source: Internet
Author: User
Several methods for checking whether the currently running LINUX is in the VM or in the physical machine mentioned the escape problem in the VM yesterday. to escape, first check whether the current operating system is a VM, the following provides several methods to check in LINUX: first, we recommend factervirtual with the permission of a common user, it is agreed that several methods should be used to check whether the currently running LINUX is in the VM or in the physical machine. yesterday we mentioned the escape problem in the VM. to escape, we must first check whether the current operating system is a VM, the following provides several methods to check in LINUX: first, we recommend facter virtual with the permission of a common user. as agreed, the command prompt of a common user is represented by $, and the command prompt of the root user is represented, the first group is the physical machine's return, and the second group is the virtual machine's return: $ facter virtual physical $ facter virtual vmware second, cat/proc/scsi, which needs to analyze the content in the Vendor: $ cat/proc/scsi/scsiAttached devices: Host: scsi6 Channel: 03 Id: 00 Lun: 00 Vendor: HP Model: P410 Rev: 5.14 Type: raid ansi scsi revision: 05 Host: scsi6 Channel: 00 Id: 00 Lun: 00 Vendor: HP Model: logical volume Rev: 5.14 Type: Direct-Access $ cat/proc/scsi/scsiAttached devices: Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00 Type: CD-ROM ansi scsi revision: 05 Host: scsichannel: 00 Id: 00 Lun: 00 Vendor: VMware Model: Virtual disk Rev: 1.0 Type: Direct-Access since my current test environment is vmware, the following uses it as an example: lspci | grep-I vmware: $ lspci | grep-I no result returned on the vmware physical Machine $ lspci | grep-I vmware00: 07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10) 00: 0f. 0 VGA compatible controller: VMware svga ii Adapter00: 11.0 PCI bridge: VMware PCI bridge (rev 02. 0 PCI bridge: VMware PCI Express Root Port (rev 01. 1 PCI bridge: VMware PCI Express Root Port (rev 01. 2 PCI bridge: VMware PCI Express Root Port (rev 01. 3 PCI bridge: VMware PCI Express Root Port (rev 01. 4 PCI bridge: VMware PCI Express Root Port (rev 01) 4th, grep-I vmware/proc/scsi/proc/ide/*/model $ grep-I vmware/proc/scsi/proc/ide/*/modelgrep: /proc/ide/*/model: No such file or directory $ grep-I vmware/proc/scsi/proc/ide/*/model/proc/scsi: vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00/proc/scsi: Vendor: VMware Model: Virtual disk Rev: 1.0 fifth, root permission required, dmidecode | grep-I vmware # dmidecode | grep-I no response from vmware physical machine # dmidecode | grep-I vmware Manufacturer: VMware, Inc. product Name: VMware Virtual Platform Serial Number: VMware-56 4d 29 65 6c ac 42 33-33 7f 89 2c d0 36 a3 25 Description: VMware SVGA II
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.