From Fedora Project Wiki

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

http://people.redhat.com/~rjones/virt-what/

virt-what lets you detect if you are running inside a VM.

Simply install virt-what in a guest (or on the host if you like), and run it as root:

# virt-what 
kvm

Consult the virt-what man page to find out the possible values that it can print:

$ man virt-what