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

A brief talk about the diff algorithm in Vue

Table of contents Overview Virtual Dom principle ...

Detailed deployment of docker+gitlab+gitlab-runner

environment Server: centos7 Client: window Deploy...

Two ways to implement text stroke in CSS3 (summary)

question Recently I encountered a requirement to ...

Docker removes abnormal container operations

This rookie encountered such a problem when he ju...

Detailed explanation of views in MySQL

view: Views in MySQL have many similarities with ...

Complete steps to achieve high availability with nginx combined with keepalived

Preface In order to meet the high availability of...

Mysql 5.6 adds a method to modify username and password

Log in to MySQL first shell> mysql --user=root...

Detailed explanation of the usage of the alias command under Linux

1. Use of alias The alias command is used to set ...

The pitfalls and solutions caused by the default value of sql_mode in MySQL 5.7

During normal project development, if the MySQL v...

Example of deploying Laravel application with Docker

The PHP base image used in this article is: php:7...

5 tips for writing CSS to make your style more standardized

1. Arrange CSS in alphabetical order Not in alphab...