TOMÁŠ HUBÁLEK BLOG: BAVTE SE PŘIMĚŘENĚ…

How to detect that my operating system is running under VMWare?

Written By: Tomáš Hubálek - Nov• 13•08

We had trouble with some server (it had strange variations of performance but load and other metrics was OK) and got suspicion that it is no real Linux box. To prove this theory I was looking for some trick how to detect whether it is running under VM Ware.

I found one kind of detection using CPU instructions but it required to compile some C/C++ code and I not skilled enough to do it. Then I found something easier.

I found that VM Ware has registered MAC addresses range that begins with 00:50:56. Then it was pretty easy:

ici-prom@mesdev:~/Com­monInterfaceDrsq> /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:94:77:49
inet addr:172.16.102­.134 Bcast:172­.16.102.255 Mas
inet6 addr: fe80::250:56f­f:fe94:7749/64 Scope:L
UP BROADCAST RUNNING MULTICAST MTU:1500 Metri
RX packets:50945267 errors:0 dropped:0 overruns
TX packets:60687615 errors:0 dropped:0 overruns
collisions:0 txqueuelen:1000
RX bytes:17384391194 (16.1 GiB) TX bytes:63720
Base address:0×1070 Memory:f4820000-f4840000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mas­k:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:766348 errors:0 dropped:0 overruns:0
TX packets:766348 errors:0 dropped:0 overruns:0
collisions:0 txqueuelen:0
RX bytes:88850050 (84.7 MiB) TX bytes:88850050

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Your email address will not be published. Required fields are marked *