Linux Administrator

How To Check If Linux Server Is Physical, Virtual Or Cloud ?

Physical-Server-Virtual-Server
mm
Written by Santosh Prasad

Recently one user asked me a question and he would like to know logged in server is physical server or virtual server. Most of the time, you will be accessing your server remotely. You will not always have physical access of your server and you may not actually know where is your server located.

However, you can check if your Linux server is physical or virtual server using couple of Linux utilities, and no matter where it is located. So in this tutorial I will walk you through how to check if server is physical or virtual server.

Check If A Linux Server Is Physical Or Virtual

There are lots of way to find a server is physical or virtual. Here following are the only methods that I know right now, if you know other ways please comment in comment box.

Using Dmidecode Utility

Using dmidecode utility you can find if you are working on virtaul or physical server. Dmidecode, DMI table decoder is used to find your system’s hardware components as well as other useful information such as BIOS revision and serial number etc..

By default, demidecode comes pre-installed with most of Linux distributions. If it is not installed, you can install it using yum command. For example, the following command will install dmidecode on system:

On Ubuntu/Debian based system

$ sudo apt-get install dmidecode

On RHEL/CentOS/Fedora based system

# yum install dmidecode

After installing dmidecode, run the following command to find if your server is physical or virtual:

On Ubuntu/Debian

$ sudo dmidecode -s system-manufacturer

If it is physical server, you will get an output something like below:

Dell Inc.

If it is virtual server, you will get an output something like below:

innotek GmbH

We now that innotek is a German-based software company that develops PC virtualization software called VirtualBox.

On RHEL/CentOS/Fedora

# dmidecode -t system

If it is physical server, you will get an output something like below:

# dmidecode 2.12
SMBIOS 2.4 present.

Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: Xen
        Product Name: HVM domU
        Version: 4.2.amazon
        Serial Number: ec23b3ae-3bbd-defd-a59d-74f547ef5252
        UUID: EC23B3AE-3BBD-DEFD-A59D-74F547EF5252
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Not Specified

Handle 0x2000, DMI type 32, 11 bytes
System Boot Information
        Status: No errors detected

Above output is from AWS EC2 Cloud Server, above you can see “System Information” section.

If you see Manufacturer like Xen, VMware, Red Hat etc. it is VM (Virtual Machine). Anything than these like Dell Inc, HP etc.. shows that your on physical machine means its physical server.

Now lets check output from physical server as well:

# dmidecode -t system

# dmidecode 2.11
SMBIOS 2.7 present.
 
Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Cisco Systems Inc
        Product Name: UCSB-B200-M3
        Version: 1
        Serial Number: XXXXXXXXXX
        UUID: 00000000-0000-0000-0000-000000000000
        Wake-up Type: Other
        SKU Number:
        Family:
-----output trimmed-----

In the above output Manufacturer is Cisco System Inc, and as we know it is Hardware Manufacturer. It confirm that hosted on bare metal.

Product Name is UCSB-B200-M3 whic is model name of Cisco Blade server. Now we can say it is Cisco Blade Hardware means Physical Machine.

Thanks:)

Thank you! for visiting Look Linux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment