How To Check If A Linux System Is Physical Or Virtual Machine

Check If A Linux System Is Physical Or Virtual Machine

2 Responses

  1. DannyB2 says:

    Here are a few results on Microsoft Hyper-V.

    $ sudo dmidecode -s system-manufacturer
    Microsoft Corporation

    $ sudo dmidecode | grep Product
    Product Name: Virtual Machine
    Product Name: Virtual Machine

    $ sudo dmidecode -s system-product-name
    Virtual Machine

    $ sudo dmidecode | egrep -i ‘manufacturer|product’
    Manufacturer: Microsoft Corporation
    Product Name: Virtual Machine
    Manufacturer: Microsoft Corporation
    Product Name: Virtual Machine
    Manufacturer: Microsoft Corporation
    Manufacturer: Intel(R) Corporation
    Manufacturer: Intel(R) Corporation
    Manufacturer: Intel(R) Corporation
    Manufacturer: Intel(R) Corporation
    Manufacturer: None
    Manufacturer: None
    . . . . many more omitted . . . .
    Manufacturer: None
    Manufacturer: Microsoft
    Manufacturer: Microsoft
    . . . . many more omitted . . . .
    Manufacturer: Microsoft
    Manufacturer: Microsoft

    $ sudo dmidecode | egrep -i ‘vendor’
    Vendor: American Megatrends Inc.
    Vendor Syndrome: Unknown

    $ sudo lshw -class system
    danny-lm18
    description: Desktop Computer
    product: Virtual Machine
    vendor: Microsoft Corporation
    version: 7.0
    serial: 3503-1139-3762-7885-5468-5100-00
    width: 64 bits
    capabilities: smbios-2.3 dmi-2.3 vsyscall32
    configuration: boot=normal chassis=desktop uuid=087CC8B8-04E7-8647-85C7-F79E74FA4A5F

    $ sudo dmesg | grep “Hypervisor detected”
    [ 0.000000] Hypervisor detected: Microsoft HyperV

  2. Warren Goodwin says:

    I prefer just to query the disk myself..

    # parted /dev/sda print
    Model: VMware Virtual disk (scsi)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.