From Fedora Project Wiki

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 

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

$ man virt-what