How to detect that my operating system is running under VMWare?
Written By: Tomáš Hubálek
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:
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:56ff: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
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 Mask: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
RX bytes:88850050 (84.7 MiB) TX bytes:88850050
Mohlo by vás také zajímat