如何判断服务器为虚拟机还是物理真机?
2015-06-03 10:43
411 查看
dmidecode |grep -A20 "Memory Device$"|sed -n -e'/Locator/p' -e '/Size/p'|grep -v "Bank Locator"
看内存分布
[真机]# dmidecode |grep -A20 "Memory Device$"|sed -n -e'/Locator/p' -e '/Size/p'|grep -v "Bank Locator"
Size: 4096 MB
Locator: DIMM0
Size: 4096 MB
Locator: DIMM1
Size: 4096 MB
Locator: DIMM2
Size: 4096 MB
Locator: DIMM3
[虚拟机]# dmidecode |grep -A20 "Memory Device$"|sed -n -e'/Locator/p' -e '/Size/p'|grep -v "Bank Locator"
Size: 1024 MB
Locator: RAM slot #0
Size: 512 MB
Locator: RAM slot #1
Size: 256 MB
Locator: RAM slot #2
Size: 128 MB
Locator: RAM slot #3
Size: 64 MB
Locator: RAM slot #4
Size: 16 MB
Locator: RAM slot #5
Size: No Module Installed
Locator: RAM slot #6
Size: No Module Installed
Locator: RAM slot #7
Size: No Module Installed
Locator: RAM slot #8
Size: No Module Installed
Locator: RAM slot #9
Size: No Module Installed
Locator: RAM slot #10
Size: No Module Installed
Locator: RAM slot #11
Size: No Module Installed
Locator: RAM slot #12
Size: No Module Installed
Locator: RAM slot #13
Size: No Module Installed
Locator: RAM slot #14
-------》内存分布不均匀
---直接看产品名
dmidecode |grep "Product"
[root@lixora ~]# dmidecode |grep "Product"
Product Name: VMware Virtual Platform
Product Name: 440BX Desktop Reference Platform
[root@oracle sysbench-0.4.12]# dmidecode |grep "Product"
Product Name: System Product Name
Product Name: P8Z68-V LX
------观察硬件设备,如果看到VMware 类似字符基本为虚拟机了
[虚拟机】lspci -b|grep VMware
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
看内存分布
[真机]# dmidecode |grep -A20 "Memory Device$"|sed -n -e'/Locator/p' -e '/Size/p'|grep -v "Bank Locator"
Size: 4096 MB
Locator: DIMM0
Size: 4096 MB
Locator: DIMM1
Size: 4096 MB
Locator: DIMM2
Size: 4096 MB
Locator: DIMM3
[虚拟机]# dmidecode |grep -A20 "Memory Device$"|sed -n -e'/Locator/p' -e '/Size/p'|grep -v "Bank Locator"
Size: 1024 MB
Locator: RAM slot #0
Size: 512 MB
Locator: RAM slot #1
Size: 256 MB
Locator: RAM slot #2
Size: 128 MB
Locator: RAM slot #3
Size: 64 MB
Locator: RAM slot #4
Size: 16 MB
Locator: RAM slot #5
Size: No Module Installed
Locator: RAM slot #6
Size: No Module Installed
Locator: RAM slot #7
Size: No Module Installed
Locator: RAM slot #8
Size: No Module Installed
Locator: RAM slot #9
Size: No Module Installed
Locator: RAM slot #10
Size: No Module Installed
Locator: RAM slot #11
Size: No Module Installed
Locator: RAM slot #12
Size: No Module Installed
Locator: RAM slot #13
Size: No Module Installed
Locator: RAM slot #14
-------》内存分布不均匀
---直接看产品名
dmidecode |grep "Product"
[root@lixora ~]# dmidecode |grep "Product"
Product Name: VMware Virtual Platform
Product Name: 440BX Desktop Reference Platform
[root@oracle sysbench-0.4.12]# dmidecode |grep "Product"
Product Name: System Product Name
Product Name: P8Z68-V LX
------观察硬件设备,如果看到VMware 类似字符基本为虚拟机了
[虚拟机】lspci -b|grep VMware
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
相关文章推荐
- Android ViewGroup事件分发机制(下)
- 使用libnet过滤报文
- Windows右键“新建”项不见了怎么找回?
- 网站分析指标
- 归并排序
- IoC 控制反转
- iOS:KVO的概述与使用
- cocos2dx-3.0------场景切换效果
- iOS容易造成循环引用的三种场景之Block以及对应的使用方法(二)
- go语言执行windows下命令行的方法
- NSDate,NSCalendar
- ling join 报错The specified LINQ expression contains references to queries that are associated with different cont
- warning:performSelector may cause a leak because its selector
- 黑马程序员----Java 概述
- 九度OJ-题目1386:旋转数组的最小数字
- caffe study(5) - AlexNet 之算法篇
- ADB cannot bind ‘tcp:5037′ ADB server didn’t ACK
- 点积的学习
- Android-Async-Http
- Redis 存储分片之代理服务Twemproxy 测试