How to determine if the Linux system is installed on VMware

How to determine if the Linux system is installed on VMware

How to determine whether the current Linux system is installed on VMware? Because most of the company's servers are located on VMware, a small number of systems are deployed on physical machines. Today, the boss asked me to count the number of servers on VMware and physical machines. I did a simple test and verification. Of course, I also tested and verified multiple servers. However, due to the limitations of the VMware version and Linux version at hand, it does not mean that all environments are correct. The following is a demonstration of the test results:

1: Command vir-what detection

[root@mylnx01 ~]# virt-what
vmware

If the Linux server is on VMware, this command will output vmware information. If it is a physical machine, there will be no output information.

2: dmesg |grep VMware command detection

[root@mylnx01 ~]# dmesg |grep VMware
scsi 0:0:0:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2
scsi 0:0:1:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2
scsi 0:0:2:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2
scsi 0:0:3:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2
scsi 0:0:4:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2
VMware vmxnet3 virtual NIC driver - version 1.4.3.0-NAPI
VMware PVSCSI driver - version 1.0.1.0-k
VMware vmxnet virtual NIC driver

Here, some devices connected to the PCI bus of the VMware virtual machine have the word VMware; the disk name has words such as VMware Virtual disk, and the driver has the word VMware, as shown above. If it is a physical machine, there will be no relevant output information. As shown below:

3: Detect VMware tools process, but this method may fail because VMware Tools may not be installed on some virtual machines

[root@mylnx01 ~]# ps -ef | grep vmtoolsd
root 3149 1 0 Jun24 ? 00:25:37 /usr/sbin/vmtoolsd
root 23943 20376 0 14:23 pts/1 00:00:00 grep vmtoolsd

4: Connect to VMware Workstation through VMware vSphere Client and confirm one by one. First of all, this is troublesome (it can only be confirmed manually and is not easy to process in batches). In addition, I do not have the relevant permissions for VMware Workstation. Therefore, the above command is more convenient and quick!

Summarize

The above is what I introduced to you on how to determine whether the Linux system is installed on VMware. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Kali Linux Vmware virtual machine installation (illustration and text)
  • VMware 14.0.0 version virtual machine installation Ubuntu 16.04 LTS version Linux system graphic tutorial
  • Tutorial on installing VMWare Tools on Linux without desktop
  • How to install VMware Tools in Linux (CentOS 7) command line mode
  • Tutorial on installing Linux under VMware Workstation (with pictures and text)
  • Graphic tutorial for installing Linux in VMware virtual machine (advanced installation)
  • Tutorial on installing CentOs7 with VMware in win7 to build a Linux environment
  • Linux Learning CentOS (I) ---- Install CentOS 7 in VMware Virtual Machine (Graphic Tutorial)

<<:  Steps to install MySQL on Windows using a compressed archive file

>>:  How to use linux commands to convert and splice audio formats

Recommend

Simple use of Vue bus

Simple use of Vue bus Scenario description: Compo...

js implements the pop-up login box by clicking the pop-up window

This article shares the specific code of js to re...

Introduction to the use of anchors (named anchors) in HTML web pages

The following information is compiled from the Int...

MySql quick insert tens of millions of large data examples

In the field of data analysis, database is our go...

Solve the cross-domain problem of Vue+SpringBoot+Shiro

Table of contents 1. Configure Vue front end 1. D...

JavaScript to show and hide images

JavaScript shows and hides pictures, for your ref...

Eight ways to implement communication in Vue

Table of contents 1. Component Communication 1. P...

Summary of four ways to loop through an array in JS

This article compares and summarizes four ways of...

Detailed graphic explanation of sqlmap injection

Table of contents 1. We found that this website m...