Determine VMWare ESX version from Linux as guest OS
Recently I was asked to look at a virtual (linux) system which needed to be moved to a new datacenter. If you want to determine if you are on VM Ware, you can use either lspci or dmidecode. A little searching on the internet revealed it’s reasonably easy to determine the version of VMWare ESX using the BIOS Information:
case $( dmidecode | grep -A4 "BIOS Information" | grep Address | awk '{ print $2 }' ) in
"0xE8480" ) echo "ESX 2.5" ;;
"0xE7C70" ) echo "ESX 3.0" ;;
"0xE7910" ) echo "ESX 3.5" ;;
"0xE7910" ) echo "ESX 4" ;;
"0xEA550" ) echo "ESX 4U1" ;;
"0xEA2E0" ) echo "ESX 4.1" ;;
"0xE72C0" ) echo "ESX 5" ;;
"0xEA0C0" ) echo "ESX 5.1" ;;
* ) echo "Unknown version: "
dmidecode | grep -A4 "BIOS Information"
;;
esac
Sources:
http://virtwo.blogspot.com/2010/10/which-esx-version-am-i-running-on.html
http://dag.wieers.com/blog/detecting-vmware-esx-from-the-guest-os
Thank you, very useful. You can complete it with 0xEA0C0 for ESX 5.1.
Thank you Laurent! I’ve added your comment to the script in the article.
dmidecode requires root access. If you don’t have root access, an alternative would be to search for VMWare MAC addresses in ifconfig output. VMWare MACs start with 00:05:69, 00:0C:29, 00:1C:14 or 00:50:56.
This doesn’t give you the ESX version however.