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

Introduction to MySQL Connection Control Plugin

Table of contents 1. Introduction to the connecti...

Docker installation and configuration steps for MySQL

Table of contents Preface environment Install Cre...

Vue routing returns the operation method of restoring page status

Route parameters, route navigation guards: retain...

Detailed explanation of the usage of the ESCAPE keyword in MySQL

MySQL escape Escape means the original semantics ...

How to install MySQL database on Debian 9 system

Preface Seeing the title, everyone should be thin...

MySQL example of getting today and yesterday's 0:00 timestamp

As shown below: Yesterday: UNIX_TIMESTAMP(CAST(SY...

Practical method of deleting files from Linux command line

rm Command The rm command is a command that most ...

Detailed explanation of the basic usage of SSH's ssh-keygen command

SSH public key authentication is one of the SSH a...

Using js to implement a number guessing game

Last week, the teacher gave me a small homework, ...

How to simply encapsulate axios in vue

Inject axios into Vue import axios from 'axio...

Disadvantages and reasonable use of MySQL database index

Table of contents Proper use of indexes 1. Disadv...

How to use Navicat to export and import mysql database

MySql is a data source we use frequently. It is v...

How to implement a password strength detector in react

Table of contents Preface use Component Writing D...