I am focusing on Windows first, as that is expected to be more complicated. The application is a C++ GUI application, with a typical GUI and such.
Since we work in C++, I spent some time looking at the Windows Management Instrumentation (WMI) COM interfaces, but suspect that method can be fooled quite easily. And that method only identifies using the built-in Windows virtualization, and not other virtualization methods as used by VMWare or VirtualBox.
I've also seen statements that a timing test is the only reliable method, but with processor speed increases, is that method unstable as well?
[1] - https://unix.stackexchange.com/questions/89714/easy-way-to-d...
[2] - https://reverseengineering.stackexchange.com/questions/1686/...
Be very, very sure you are not impinging such legitimate use; people get angry when their paid-for software decides they're unworthy.