I have a VMWARE ESX server. I have Redhat VMs running on that server. I need a way of programatically testing if I'm running in a VM. Ideally, I'd like to know how to do this from Perl.
You can use The showvminfo command for show information about a particular virtual machine. This is the same information as VBoxManage list vms would show for all virtual machines.
VMware Workstation runs on standard x86-based hardware with 64-bit Intel and AMD processors, and on 64-bit Windows or Linux host operating systems.
See the answer to "Detect virtualized OS from an application?".
You shouldn't 100% depend on any method, as they are undocumented features/bugs - they work on some host OSes and some virtualization solutions, but there is no guarantee that they will continue working; indeed, the whole point of virtualization is to be as undistinguishable from real metal as possible. With this in mind, the blue pill red pill (which is mentioned in the accepted answer to this similar question) seems to work ... for now.
VMWare has a couple of SDK's, including an SDK for Perl.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With