Hi dude, are we aware if the server we manage is running on a physical or virtual server? If it runs on a physical server, we know the brand and physical bare metal of the server. Then what if the server is running on virtualization? What virtualization technology do you use? Is it KVM, Hypervisor, Vmware, Docker Engine or something else? In this article, we will briefly describe how check virtualization technology linux is used on the virtual server.
Lets do it, easy way to check linux server running on virtual machine technology.
Method 1 – Use dmesg
Use native dmesg
to find out log kernel when booting and starting up server. This is very simple with grep
command to find type virtualization.
dmesg |grep -i hypervisor
For example in my case, i am running server on vmware dekstop for my laptop.
root@server-db:~# dmesg |grep -i hypervisor
[ 0.000000] Hypervisor detected: VMware
Method 2 – Install virt-what
install virt-what
. virt-what
is a shell script which can be used to detect if the program is running in a virtual machine.
Supports a very large number of different hypervisor types, including common open source hypervisors (KVM, Xen, QEMU, VirtualBox), mainframe systems like IBM Systemz, LPAR, z/VM, hardware partitioning schemes like Hitachi Virtage, proprietary hypervisors like VMWare, Microsoft Hyper-V.
root@server-db:~# apt install virt-what
After finish installation, we can run command and get the result like below.
root@server-db:~# virt-what
vmware
If nothing is printed and the script exits with code 0 (no error), then it can mean either that the program is running on bare-metal or the program is running inside a type of virtual machine which we don’t know about or cannot detect.
So easy, right? That is simply way check virtualization technology linux. Whether it’s Elastic Compute EC2 AWS, Compute Engine Google GCP, Azure even linode, vultr, or other cloud providers.
Let's Buy Me Coffee. https://saweria.co/habibzain https://ko-fi.com/habibzain