Currently, virtualization technology has developed and is used in various places. This is because virtualization technology can use hardware efficiently, recover easily, and have various other advantages. But sometimes, a sysadmin must be able to distinguish whether they are using a physical or a virtual server.
How to check the physical or virtual servers?
Here are the commands to find out whether a server is physical or virtual to check the physical or virtual server:
1. On Linux
There are several commands that can be used and you can use any or all of the commands below:
dmidecode | grep Product virt-what facter 2> /dev/null | grep virtual hostnamectl | grep Hardware lshw -class system systemd-detect-virt
If there are still commands that cannot be used then type the commands below:
apt install updates apt install virt-what dmidecode lshw facter
RedHat-Based (CentOS, AlmaLinux, RockyLinux)
yum install epel-release yum install virt-what dmidecode lshw facter
zypper install dmidecode virt-what lshw
2. On Windows
On Windows, there are several methods.
- Using GUI
- Click Start > Run.
- Type msinfo32 and press Enter.
- In the right pane, look for System Manufacturer
- Using Command Prompt
Systeminfo | findstr /i Manufacturer
- Using PowerShell
get-wmiobject win32_computersystem | findstr /i Manufacturer
The above commands can be run on any Linux distro or any version of windows.