i have got hardware id for physic machine by CPU info
but when code run on virtual machine , result is same hardware id .
My solution by combine UUID and CPU info ,but UUID may be same .
because in virtual machines is easy change MAC address and UUID .
How do you get hardware ID ?
There is no such thing as a reliable and "etched in stone" computer ID. Any attempts to use the means there are in that direction are easily circumvented by a number of ways. if you are building a copy protection scheme around it, then know that there are automated "cracks" that will break/remove/disable your software's protection within seconds.
There is a thing called a TPM (trusted platform module) which is supported as of Windows Vista and up, that may or may not suit your needs.
Not all countries allow it's use
Not all computers have a TPM
Some users have a computer with a TPM but choose to disable it.
It is possible to virtualize a TPM so again, it may not entirely do what you want it to do.
People will be annoyed, to say the least, that they can run their legaly purchased software only one one of their PCs, while their friends happily install their cracked version wherever they like.
Some people then start using cracked version, even though they own a legal license...and that`s probably not what you intended.