Jul 25, 2012

How to find a machine whether its a physical machine or a Virtual machine in linux

You can get this information by using the unix utility, dmidecode.
dmidecode  is a tool for dumping a computerâs DMI (some say SMBIOS) ta-ble contents in a human-readable format. This table contains a description  of  the  systemâs  hardware  components,  as well as other useful pieces of information such as serial numbers and BIOS revision.

Note: This command should be used as root. or you can use "sudo" to execute it.


Sample Usage

In a virtual machine

[root@server2 tmp]# /usr/sbin/dmidecode |grep -i "vm"
                Manufacturer: VMware, Inc.
                Product Name: VMware Virtual Platform
                Serial Number: VMware-24 34 c4 76 3b 1a 94 8d-99 08 5d cc 81 04                            17 25
                        VME (Virtual mode extension)
                        VME (Virtual mode extension)
                Description: VMware SVGA II
                String 1: [MS_VM_CERT/SHA1/27d66596a61c48dd323409dfd5126e33f59                           ae7]
                
                
For a physical machine it will be like below

[mohan@server2 storage]# sudo /usr/sbin/dmidecode |grep -i "vm"
                VME (Virtual mode extension)
                VME (Virtual mode extension)
                

No comments:

Post a Comment