我正在尝试在旧的 Supermicro 主板上设置虚拟化服务器(主要用于进行一些实验),使用 qemu/kvm(在 Debian/jessie 上运行,带有内核3.16.0-4-amd64
)
主板配备了Intel Xeon
CPU,据我了解,它们应该支持虚拟化:
$ 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/主板上启用虚拟化吗,或者我只是运气不好?
答案1
除了在 BIOS 中打开 VT 之外,您还需要执行完整的电源循环 - 完全关闭主机,甚至拔出电源线并按住电源按钮几秒钟,然后重新启动一切。
顺便说一句,您可能在 BIOS 中错过了它,但您还希望启用 NX,而不仅仅是 VT。