Would you like to know if your server's OS is running on bare-metal or on a virtual machine. imvirt and virt-what are 2 Linux scripts that allow you to do so easily. Both are open source and can be downloaded from their websites and Ubuntu's Synaptic Package Manager as well.
virt-what is a shell script maintained by Red Hat that does the same thing. It prints more details about the VM than imvirt if a VM was found. Otherwise it exits with code 0 (no error) and does not print anything.
To download it visit virt-what
imvirt was developed in Perl by Thomas Liske. It does its job by looking for wellknown boot messages, directories and reading DMI (Desktop Management Interface) data. It prints one line. These are the tool's outputs and what they mean:
To download it visit imvirt's SourceForge page.