Virtualization technologies they have made physical resources much better used. Many hosting or cloud companies use virtualization to obtain benefits that would be difficult to achieve with physical systems or that would be more expensive, in addition to supplying some advantages such as creating VPS (Virtual Private Server) within a physical server to obtain a lot of independent servers to offer clients independent systems that act with total independence, being able to shut down one system without affecting the rest or managing them independently ...
Well, these technologies that provide us with so many benefits have evolved enough to make it difficult to know if we are dealing with a physical system or a virtual system. Obviously if we have created it, it is easy to know ... I did not mean that. But when we access a system remotely, without having too much knowledge about it, it would be impossible for us tosee if it is a virtualized system or is it really a physical system. So in this article we will learn how to know ...
Many administrators manage systems remotely and this can be a problem, so if we have access to systems with Linux, we can easily know if they are virtual or not using various methods that I explain below:
- Using the dmidecode tool, it is a tool that makes use of DMI or SMBIOS tables that provides information about the manufacturer, serial number, model, and other hardware data of the system. We simply have to execute the command to obtain it if we have this tool installed. For example, we can use the -t option to indicate the type of information to obtain (see the man). Depending on what we obtain from the following command, we can know if it is a virtual or physical system from the manufacturer:
sudo dmidecode -s system-manufacturer
- We can also use lshw to obtain hardware information and in this case to know the type of system:
sudo lshw -class system
- It is also possible to use the system logs for this utility:
sudo dmesg | grep "Hypervisor detected"
There are more methods such as the facter utility, scripts, virt-what, etc.