Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form

Linux Machine: Is it Virtual or a Physical server

Posted on 11/10/202003/09/2026 Christian By Christian No Comments on Linux Machine: Is it Virtual or a Physical server
  1. Home
  2. Linux
  3. Linux Machine: Is it Virtual or a Physical server
Virtualization technology

Sometimes, as a Linux Administrator, you want to know if a server you are working on remotely is a Physical device or a Virtual machine. This tutorial explains some simple command which will help you determine the nature of the machine you are working on. Please see the difference between testing and debugging, and how to debug a PowerShell script.

SAMPLE 1  The dmidecode tool

This is the Desktop Management Interface table decoder and it retrieves comprehensive system information of your systems hardware components and presents it in a readable format.

Below are two images from the command: sudo dmidecode | more

Server hardware
Hypervisor

You can download the dmidecode package from: https://centos.pkgs.org/6/centos-x86_64/dmidecode-2.12-7.el6.x86_64.rpm.html
– Other derivatives of the dmidecode command are:

Sudo dmidecode –s system-manufacturer
Cloud computing

My machine is a Virtual Machine. If it were a physical device, the output will be the name of the company that developed the device e.g. Dell Inc, Lenovo, Asus Inc.

Other virtualization tools exist such as innotek , which is German based company that develops Virtualbox.

sudo dmidecode –t system
Virtualization technology
sudo dmidecode | egrep -i 'manufacturer|product'
Hypervisor
sudo dmidecode -s system-product-name
Cloud computing

Their outputs will differ in format but they will tell the Physical or Virtual nature of the Linux machine.

SAMPLE 2 : hostnamectl

If you have system installed, hostnamectl is a very good good command to determine if the machine is physical or virtual.

Hotsnamectl status
Virtualization technology

SAMPLE 3

Viewing the /sys/class/dmi/id/product_name using the cat command

cat /sys/class/dmi/id/product_name
Server hardware

However, this particular command has a certain peculiarity: a libvirt-kvm-VM will be displayed as Standard PC (i440fx +/PIIX) which is a common fingerprint for QEMU/KVM VITUAL virtual machines.

Another derivative of this command is;

pr –t /sys/class/dmi/id/sys-vendor/sys/class/dmi//id/product_name
Cloud computing

SAMPLE 4

Using the dmesg tool with the following command;

 Sudo dmesg | grep “Hypervisor detected” 

What this dmesg does is to control the kernel buffer. If the machine is virtual, the output will be something like the image below. If it is a physical device, the command will return nothing

Command line output indicating that a hypervisor, specifically VMware, is detected.

SAMPLE 5: virt-what

You will need to install this utility. And the command is just that. If the machine is virtual, the output will look like the image below:

Terminal display showing the command 'sudo virt-what' with 'vmware' highlighted.

If the machine is physical, it will return nothing or exit the script with code0.

SAMPLE 6: lshw

This utility is included in the epel-release. if you don’t have it already, you need to install it and then install the lshw utility.

Terminal output displaying system information including description, product, vendor, version, and serial number of a VMware Virtual Platform computer.

If this were a physical device, the output under the product tag will be the model of the device.

SAMPLE 7: systemd-detect-virt

This command is unique in a way in that it can tell the difference in the virtualization tehnology if the system is on a virtual machine

If this were a physical device, the output to the command will be none. However, if it is a virtual machine on VirtualBox, the output will be “Is it Virtual or a Physical server.

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
Linux Tags:Virtual Machine, VirtualBox, virtualization

Post navigation

Previous Post: How to pause a PowerShell script
Next Post: Keepalive Settings: Understanding keepalive configuration

Related Posts

  • apache ubuntu 20 04
    How to Install Apache HTTP Server on Ubuntu 20.04 LTS Linux
  • Slide1 1
    Create Multiple Users with Passwords in Ubuntu Linux Linux
  • linux w640 h400
    How to install and configure Ubuntu Linux on VirtualBox Linux
  • S3 Bucket 1
    How to delete AWS S3 Bucket and Objects via  AWS CLI from Linux AWS/Azure/OpenShift
  • Groovy
    How to install Groovy on Linux and Windows Configuration Management Tool
  • Screenshot 2021 02 14 at 00.35.50
    How to manage automatic login on Ubuntu Linux Linux

More Related Articles

ssh How to disable RC4 Cipher Algorithms support in SSH Server Linux
fba7f screenshot 2019 04 15 at 18.33.30 File System Overview: How to decide on the right File System to use for your USB Linux
Screenshot 2022 03 21 at 18.06.30 How to Configure Virtual Host for Apache HTTP Web Server to Host Several Domains on Ubuntu 20.04 LTS Linux
APACHECASS FEATURE How to Install and Configure Apache Cassandra on Linux Server Linux
PlayF How to Install PlayonLinux on a Linux System Linux
Screenshot 2022 03 15 at 10.05.53 VMware Workstation states: What are the differences between Suspend, Power Off, and Run in Background Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

vexpert-badge-stars-5

Virtual Background

VEEAMLEGEND

Categories

Top 30 Sysadmin blog

veeaam100

Veeam Vanguard

  • safari 1
    How to clear cookies history and cache in Safari Mac
  • finalelastic
    How to Install and Configure Elasticsearch on Linux  Linux
  • dropbox
    Couldn’t start Dropbox: How to fix and reinstall Dropbox Mac
  • unnamed
    Add or delete users and set permissions in Azure AD AWS/Azure/OpenShift
  • ADV Banner 5 1 e1782734675746
    Azure Virtual Desktop: Autoscaling Implementing and Monitoring Session Hosts [Part 05] AWS/Azure/OpenShift
  • Webp.net resizeimage 7
    Create a new Azure Disk: How to create and attach an extra Disk to Azure Virtual Machine AWS/Azure/OpenShift
  • linkyourandriodtoyourpc
    Microsoft Phone Link: Connect Android to Windows 11 Windows
  • Implement Split Brain DNS Policies in Active Directory
    Implement Split-Brain DNS Policies in Active Directory Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,745 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Contact
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon
  • Bsky

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.