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! You may also be interested in:
|
<<: Steps to install MySQL on Windows using a compressed archive file
>>: How to use linux commands to convert and splice audio formats
As a front-end novice, I tinkered with the front-e...
Table of contents 1. Introduction to the connecti...
Table of contents Preface environment Install Cre...
Route parameters, route navigation guards: retain...
MySQL escape Escape means the original semantics ...
Preface Seeing the title, everyone should be thin...
As shown below: Yesterday: UNIX_TIMESTAMP(CAST(SY...
rm Command The rm command is a command that most ...
SSH public key authentication is one of the SSH a...
Last week, the teacher gave me a small homework, ...
Inject axios into Vue import axios from 'axio...
Table of contents Proper use of indexes 1. Disadv...
MySql is a data source we use frequently. It is v...
Table of contents transition hook function Custom...
Table of contents Preface use Component Writing D...