How To Identify If a Linux System is Physical or Virtual Machine

Most of the time we access and manage servers remotely. We will not always have physical access of our server. As a Linux Administrator, sometimes you need to know whether the machine you’re accessing is physical or virtual if you need to fix anything on system. There are may ways to identify if your system is physical or virtual. Here are some simpler ways to do that:

 

METHOD 1: Using lshw command

# yum install epel-release

# yum install lshw

# lshw -class system

 

The output would be like:

[root@test ~]# lshw -class system

test

   description: Computer

   product: KVM

   vendor: Red Hat

   version: RHEL 6.6.0 PC

   width: 64 bits

(This is the result from virtual machine)

 

OR

[root@dedi ~]# lshw -class system

dedi

   description: Rack Mount Chassis

   product: ProLiant DL320e Gen8 (675597-B21)

   vendor: HP

   serial: CZ33098S20

   width: 64 bits

(This is the result from Physical Machine)

 

METHOD 2: Using virt-what

# yum install virt-what

# virt-what

 

The output would be:

[root@test ~]# virt-what

kvm

NOTE: If there is no result after running this command, the machine is physical.

  • 0 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

How to remove files & directories in linux terminals

How to Remove Files   Use either the rm (remove) or unlink command to remove (or delete) a...

How to Install GeoIP on Linux Server?

GeoIP helps you to locate a computer’s geographic location by identifying that computer...

How to configuring additional IP addresses ?

To add/remove additional IP manually   1. Run the ip command to display the current ip address...

How To Update yum Repositories On Your Server

YUM Repositories are the warehouses of Linux software (RPM package files). RPM package file is a...

How to Change MySQL user password in Linux

Both MySQL and MariaDB are the most popular open source database systems meant for Linux based...