{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner

A crude way of telling if a remote machine is a VM

We were doing a bit of profiling of a data importing process we’ve been running across various environments and wanted to check whether or not one of the environments was a physical machine or a VM.

A bit of googling first led me to the following site where you can fill a MAC address and it will tell you which vendor it belongs to.

macvendorlookup.com is even better though because it’s more easily scriptable!

If I wanted to find the vendor of my MAC address on the ethernet port I could try the following:

ifconfig | grep -A1 en1 | grep ether | cut -d" " -f2 | xargs -I {} 
curl -s http://www.macvendorlookup.com/getoui.php?mac={} -o - | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'

Which gives:

Vendor: Apple Inc

Sed magic was shamelessly stolen from sed one liners.

As it turns out the machine we wanted to learn about was a VM hosted on VMWare!

From http://www.markhneedham.com/blog/2011/07/27/a-crude-way-of-telling-if-a-remote-machine-is-a-vm/

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks