How to check if a Linux System is physical or Virtual Machine

As a Linux administrator, sometimes, you might be wondering whether you are working on a physical or virtual machine. Most of the time, you will be accessing and managing your servers remotely.

You will not always have physical access of your servers, and you may not even actually know where is your server located. However, it is possible to check if your Linux system is physical or virtual machine using couple of Linux utilities, no matter where it is located.

This guide explains how to check whether the Linux system you’re working on is a physical server or a virtual server.

Check If A Linux System Is Physical Or Virtual Machine

There can be many ways to find if a system is physical or virtual. I am aware of the following methods at present. I will update if I find any other ways in the days to come.

In CentOS 7:

step 1:  #sudo yum install epel-release
step 2:  #sudo yum installl facter

step 3:  #facter virtual

Result: physical(物理机) or kvm(虚拟机)
发布了198 篇原创文章 · 获赞 82 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/weixin_38134491/article/details/101122328