Need a Linux application to detect if it is executing in a Virtual-Machine (s.a. VMware ESX/ESXi, Xen, Oracle Virtualbox, Microsoft Virtual server etc.) Based on the outcome of this detection, some software licensing rules need to be enforced.
I am aware that there are some commercial software libraries/frameworks meant for licensing, that can perform such detection, but we need to roll our own due to several reasons.
What are some of the ways and means to achieve such detection ?
Old answer, but I've made a VM detection library in C++ that is meant to do exactly this.
https://github.com/kernelwernel/VMAware
All the techniques mentioned in this post are included in the library.