Is there a "standard" or clean way for a program to determine that it is running in a VM (Linux guest OS)?
Situation: We're testing KickStarting RHEL Linux VMs. So we'd like to programmatically see "You are running in a VM" and then based on that, you would do some things differently. E.g. not configuring NTP, need to install VMware Tools, etc...
Current solution is doing /sbin/lspci and looking for "VMware Inc" for the VGA controller.
Just wondering if there is a "cleaner" or more standard way? Since this program is running after the guest OS has been installed, but it is in the process of configuring services, packages, etc... VMware Tools has not been installed in the guest OS when the program runs.
Thanks for the pointer. Nice thread and the methods can be adapted for Linux.
Thanks!