Debian

在 supermicro 板上啟用虛擬化

  • April 13, 2017

我正在嘗試使用 qemu/kvm(在 Debian/jessie 上執行,帶有3.16.0-4-amd64核心)在舊的 Supermicro 板上(主要用於試驗)上設置虛擬化伺服器

該板配備了Intel XeonCPU,據我了解,它們應該支持虛擬化:

$ egrep '^flags.*(vmx|svm)' /proc/cpuinfo
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc pebs bts nopl pni dtes64 monitor ds_cpl vmx est cid cx16 xtpr pdcm lahf_lm tpr_shadow
$

無論vmx標誌是否存在,KVM 都拒絕初始化:

$ dmesg | grep kvm
[    8.721594] kvm: disabled by bios
$

kvm-intel模組無法載入,qemu 退回到仿真模式(真的很慢…… )

所以我重新啟動了主機,進入了 BIOS 並在高級 CPU 設置中打開了虛擬化(它確實被關閉了)。

不幸的是,這並沒有改變 ι,而且 KVM 仍然抱怨在 BIOS 中被禁用。

以下是有關我的硬體(CPU/主機板)的一些詳細資訊:

root:~# dmidecode -t2
# dmidecode 2.12
SMBIOS 2.4 present.

Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
   Manufacturer: Supermicro
   Product Name: X7DB8
   Version: PCB Version
   Serial Number: 0123456789

root:~# lscpu 
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            15
Model:                 6
Model name:            Intel(R) Xeon(TM) CPU 3.00GHz
Stepping:              4
CPU MHz:               3000.146
BogoMIPS:              6000.62
Virtualization:        VT-x
L1d cache:             16K
L2 cache:              2048K
NUMA node0 CPU(s):     0-7
root:~# cpuid -1
CPU:
  vendor_id = "GenuineIntel"
  version information (1/eax):
     processor type  = primary processor (0)
     family          = Intel Pentium 4/Pentium D/Pentium Extreme Edition/Celeron/Xeon/Xeon MP/Itanium2, AMD Athlon 64/Athlon XP-M/Opteron/Sempron/Turion (15)
     model           = 0x6 (6)
     stepping id     = 0x4 (4)
     extended family = 0x0 (0)
     extended model  = 0x0 (0)
     (simple synth)  = Intel Pentium 4 Processor 6x1 (Cedar Mill C1) / Pentium Extreme Edition Processor 955 (Presler C1) / Pentium D Processor 9xx (Presler C1) / Xeon Processor 5000 (Dempsey C1) / Celeron D Processor 3xx (Cedar Mill C1), 65nm
  miscellaneous (1/ebx):
     process local APIC physical ID = 0x1 (1)
     cpu count                      = 0x4 (4)
     CLFLUSH line size              = 0x8 (8)
     brand index                    = 0x0 (0)
  brand id = 0x00 (0): unknown
  feature information (1/edx):
     x87 FPU on chip                        = true
     virtual-8086 mode enhancement          = true
     debugging extensions                   = true
     page size extensions                   = true
     time stamp counter                     = true
     RDMSR and WRMSR support                = true
     physical address extensions            = true
     machine check exception                = true
     CMPXCHG8B inst.                        = true
     APIC on chip                           = true
     SYSENTER and SYSEXIT                   = true
     memory type range registers            = true
     PTE global bit                         = true
     machine check architecture             = true
     conditional move/compare instruction   = true
     page attribute table                   = true
     page size extension                    = true
     processor serial number                = false
     CLFLUSH instruction                    = true
     debug store                            = true
     thermal monitor and clock ctrl         = true
     MMX Technology                         = true
     FXSAVE/FXRSTOR                         = true
     SSE extensions                         = true
     SSE2 extensions                        = true
     self snoop                             = true
     hyper-threading / multi-core supported = true
     therm. monitor                         = true
     IA64                                   = false
     pending break event                    = true
  feature information (1/ecx):
     PNI/SSE3: Prescott New Instructions     = true
     PCLMULDQ instruction                    = false
     64-bit debug store                      = true
     MONITOR/MWAIT                           = true
     CPL-qualified debug store               = true
     VMX: virtual machine extensions         = true
     SMX: safer mode extensions              = false
     Enhanced Intel SpeedStep Technology     = true
     thermal monitor 2                       = false
     SSSE3 extensions                        = false
     context ID: adaptive or shared L1 data  = true
     FMA instruction                         = false
     CMPXCHG16B instruction                  = true
     xTPR disable                            = true
     perfmon and debug                       = true
     process context identifiers             = false
     direct cache access                     = false
     SSE4.1 extensions                       = false
     SSE4.2 extensions                       = false
     extended xAPIC support                  = false
     MOVBE instruction                       = false
     POPCNT instruction                      = false
     time stamp counter deadline             = false
     AES instruction                         = false
     XSAVE/XSTOR states                      = false
     OS-enabled XSAVE/XSTOR                  = false
     AVX: advanced vector extensions         = false
     F16C half-precision convert instruction = false
     RDRAND instruction                      = false
     hypervisor guest status                 = false
[...]
#

所以我的問題是:有人知道如何在那個 CPU/主機板上啟用虛擬化,還是我只是運氣不好?

除了在 BIOS 中打開 VT,您還需要執行完整的電源循環——完全關閉主機,甚至可以拔出電源線並按住電源按鈕幾秒鐘,然後重新啟動一切。

順便說一句,您可能在 BIOS 中錯過了它,但您還希望啟用 NX,而不僅僅是 VT。

引用自:https://serverfault.com/questions/844129