幾個檢查當前啟動並執行LINUX是在VM還是在實體機中的方法

來源:互聯網
上載者:User

$facter virtual 

physical

$facter virtual 
vmware

$cat /proc/scsi/scsi
Attached devices:
Host: scsi6 Channel: 03 Id: 00 Lun: 00
  Vendor: HP       Model: P410             Rev: 5.14
  Type:   RAID                             ANSI  SCSI revision: 05
Host: scsi6 Channel: 00 Id: 00 Lun: 00
  Vendor: HP       Model: LOGICAL VOLUME   Rev: 5.14
  Type:   Direct-Access    

$cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00
  Type:   CD-ROM                           ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access   




$ lspci | grep -i vmware

實體機上無返回結果

$ lspci | grep -i 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)



$grep -i vmware /proc/scsi/scsi /proc/ide/*/model
grep: /proc/ide/*/model: No such file or directory

$ grep -i vmware /proc/scsi/scsi /proc/ide/*/model
/proc/scsi/scsi:  Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00
/proc/scsi/scsi:  Vendor: VMware   Model: Virtual disk     Rev: 1.0



實體機無返回

# dmidecode | grep -i vmware

        Manufacturer: VMware, Inc.
        Product Name: VMware Virtual Platform
        Serial Number: VMware-56 4d 29 65 6c ac 42 33-33 7f 89 2c d0 36 a3 25
        Description: VMware SVGA II


  



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.