How do you check Linux machine is Physical or Virtual remotely?

There is no hard and fast rule to check whether the machine is physical or virtual but still we do have some commands which can be used for the some purpose.
NOTE: There might be other commands as well but these are the few of my knowledge.
#1
The command used to view all the required hardware related information for any Linux machine is
# dmidecode
But the output would be very long and hard to find out the specific details looking for. So, lets narrow it down

Physical Servers

# dmidecode -s system-product-name
System x3550 M2 -[7284AC1]-

As you can see in one of my servers I see the above information which says the machine I am using is IBM System X

Now to get more details about the system
# dmidecode | less (And search for "System Information")
System Information
Manufacturer: IBM
Product Name: System x3550 M2 -[7284AC1]-
Version: 00
Wake-up Type: Other
SKU Number: XxXxXxX
Family: System x

Some more examples for different product
# dmidecode  -s system-product-name
ProLiant BL460c G6

# dmidecode | less
System Information
Manufacturer: HP
Product Name: ProLiant BL460c G6
Version: Not Specified
Wake-up Type: Power Switch
Family: ProLiant

For a IBM blade chasis
# dmidecode -s system-product-name
BladeCenter HS22 -[5940PRX]-

# dmidecode | less
System Information
Manufacturer: IBM
Product Name: BladeCenter HS22 -[5940PRX]-
Version: 06
Wake-up Type: Other
SKU Number: XxXxXxX
Family: System x

Virtual Servers

# dmidecode -s system-product-name
VMware Virtual Platform

# dmidecode | less
System Information
Manufacturer: VMware, Inc.
Product Name: VMware Virtual Platform
Version: None
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: Not Specified

On a virtual server running VMware you can run the below command to verify
# lspci | grep -i vmware
00:0f.0 VGA compatible controller: VMware SVGA II Adapter

I would appreciate if you can enlighten me with any more commands which you know in the comment section.
Source

#2
[root@myhost]# virt-what
vmware

#3
[root@myhost]# cat /sys/block/sda/device/model
Virtual disk

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s