1. 程式人生 > >在Linux和Windows下檢視CPU是否支援虛擬化的方法

在Linux和Windows下檢視CPU是否支援虛擬化的方法

當我們要在一臺已經安裝了作業系統的伺服器上部署虛擬化環境,為了確保後面虛擬化安裝部署的成功,如何確認當前伺服器的CPU是否支援虛擬化呢?

針對Linux和Windows,下面各自介紹一個檢視的方法:

1. Windows平臺:

搜尋下載小工具:securable

securable

使用者需要檢視的也就是截圖中的Hardware Virtualization選項。前面3種情況很簡單:
NO:CPU不支援
Yes:CPU支援,趕快去將BIOS裡的VT開關設為Enabled吧
Locked ON:CPU支援,且BIOS已經開啟該功能
Locked OFF:BIOS當前禁用了虛擬化技術,但是不確定CPU本身是否支援。遇上這種情況,先去找找BIOS裡面是否有Virtualization Technology並設定為Enabled,然後重新測試,若結果沒變,那也還是沒用。

2. Linux平臺:

在終端執行cat /proc/cpuinfo命令,找到flags部分,如果其中輸出有VMX或SVM,即表明支援虛擬化技術。

》如果是Intel CPU:
cat /proc/cpuinfo | grep vmx

》如果是AMD CPU
cat /proc/cpuinfo | grep svm ##(for AMD CPU)

補充說明:Linux顯示的flags部分解釋如下

fpu – Onboard FPU
vme – Virtual Mode Extensions
de – Debugging Extensions
pse – Page Size Extensions
tsc – Time Stamp Counter
msr – Model-Specific Registers
pae – Physical Address Extensions
mce – Machine Check Architecture
cx8 – CMPXCHG8 instruction
apic – Onboard APIC
sep – SYSENTER/SYSEXIT
mtrr – Memory Type Range Registers
pge – Page Global Enable
mca – Machine Check Architecture
cmov – CMOV instructions (plus FCMOVcc, FCOMI with FPU)
pat – Page Attribute Table
pse36 – 36-bit PSEs
pn – Processor serial number
clflush – CLFLUSH instruction
dts – Debug Store
acpi – ACPI via MSR
mmx – Multimedia Extensions
fxsr – FXSAVE/FXRSTOR, CR4.OSFXSR
sse – SSE
sse2 – SSE2
ss – CPU self snoop
ht – Hyper-Threading
tm – Automatic clock control
ia64 – IA-64 processor
pbe – Pending Break Enable
syscall – SYSCALL/SYSRET
mp – MP Capable
nx – Execute Disable
mmxext – AMD MMX extensions
fxsr_opt – FXSAVE/FXRSTOR optimizations
pdpe1gb – GB pages
rdtscp – RDTSCP
lm – Long Mode (x86-64)
3dnowext – AMD 3DNow! extensions
3dnow – 3DNow!
k8 – Opteron, Athlon64
k7 – Athlon
constant_tsc – TSC ticks at a constant rate
up – smp kernel running on up
pebs – Precise-Event Based Sampling
bts – Branch Trace Store
nonstop_tsc – TSC does not stop in C states
pni – SSE-3
pclmulqdq – PCLMULQDQ instruction
dtes64 – 64-bit Debug Store
monitor – Monitor/Mwait support
ds_cpl – CPL Qual. Debug Store
vmx – Hardware virtualization //intel的虛擬化技術VT技術


smx – Safer mode
est – Enhanced SpeedStep
tm2 – Thermal Monitor 2
ssse3 – Supplemental SSE-3
cid – Context ID
fma – Fused multiply-add
cx16 – CMPXCHG16B
xptr – Send Task Priority Messages
pdcm – Performance Capabilities
dca – Direct Cache Access
sse4_1 – SSE-4.1
sse4_2 – SSE-4.2
x2apic – x2APIC
aes – AES instructions
xsave – XSAVE/XRSTOR/XSETBV/XGETBV
avx – Advanced Vector Extensions
hypervisor – Running on a hypervisor
lahf_lm – LAHF/SAHF in long mode
cmp_legacy – If yes HyperThreading not valid
svm – Secure virtual machine //AMD的虛擬化技術AMD-V

extapic – Extended APIC space
cr8legacy – CR8 in 32-bit mode
abm – Advanced bit manipulation
sse4a – SSE-4A
ibs – Instruction Based Sampling
sse5 – SSE-5
skinit – SKINIT/STGI instructions
wdt – Watchdog timer