-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathLinux和virt-manager里怎么检测和启用Intel VT-x或AMD-V.txt
99 lines (58 loc) · 3.34 KB
/
Linux和virt-manager里怎么检测和启用Intel VT-x或AMD-V.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Linux 和 virt-manager 里怎么检测和启用 Intel VT-x 或 AMD-V ?
================================================================
# 一、virt-manager 里怎么打开 Intel VT-x 或 AMD-V ? #
-----------------------------------------------------------------------------
How do I know that my virtual guest is using VT-x?
http://unix.stackexchange.com/questions/117115/how-do-i-know-that-my-virtual-guest-is-using-vt-x
Previously codenamed "Vanderpool", VT-x represents Intel's technology for virtualization on the x86 platform. On November 13, 2005, Intel released two models of Pentium 4 (Model 662 and 672) as the first Intel processors to support VT-x. The CPU flag for VT-x is "vmx"; in Linux, this may be checked via /proc/cpuinfo, or in Mac OS X via sysctl machdep.cpu.features.[19]
How to enable nested virtualization in KVM
https://fedoraproject.org/wiki/How_to_enable_nested_virtualization_in_KVM
点击, virt-manager 的 processor 选择里, Copy Host CPU configuration, 并查看 vmx 是否是 on 或 require 的状态, 如果不是, 可以手动切换到一个更有可能的 CPU 类型.
-----------------------------------------------------------------------------
# 二、如何检测宿主机的 BIOS 是否打开了 Intel VT-x / AMD-V ? #
------------------------------------------------------------------
1. 检测 CPU 是否支持 vmx, vmx 就是 Intel VT-x / AMD-V.
$ cat /proc/cpuinfo | egrep "vmx|svm"
如果开启了 vmx, vmx 也就是 Intel VT-x / AMD-V, 会看到列出来的信息里有红色的 "vmx" 字样.
2. 如果安装了 kvm, 可以执行:
先检查是否安装了 cpu-checker:
$ sudo apt-get update # 可以先执行下面这句检查是否安装了 cpu-checker, 如果没安装再执行这一句进行更新和安装.
$ sudo apt-get install cpu-checker
然后再执行:
$ sudo kvm-ok
如果开启了 Intel VT-x / AMD-V, 则会显示:
INFO: /dev/kvm exists
KVM acceleration can be used
否则, 则会看到:
INFO: /dev/kvm does not exist
HINT: sudo modprobe kvm_intel
INFO: Your CPU supports KVM extensions
INFO: KVM (vmx) is disabled by your BIOS
HINT: Enter your BIOS setup and enable Virtualization Technology (VT),
and then hard poweroff/poweron your system
KVM acceleration can NOT be used
3. 查看是否加载了 kvm-intel 或 kvm-amd 模块:
$ sudo lsmod | grep kvm
如果加载了, 会显示:
kvm-intel 59822 0
kvm 234323 1 kvm-intel
如果没有加载, 可以执行下列命令加载:
$ sudo modprobe kvm
$ sudo modprobe kvm-intel
$ sudo modprobe kvm-amd
See:
Check if VT-x is activated without having to reboot in Linux?
http://stackoverflow.com/questions/11116704/check-if-vt-x-is-activated-without-having-to-reboot-in-linux
kvm 虚拟化概述及 virt-manager 安装虚拟机
http://blog.csdn.net/wanglei_storage/article/details/51100506
-----------------------------------------------------------------------------
4. 还有一种方法检测是否开启了 Intel VT-x / AMD-V :
$ sudo apt-get update
$ sudo apt-get install msr-tools
$ sudo modprobe msr
$ sudo rdmsr 0x3A
如果返回 3 或 5 表示打开了, 返回 1 表示未打开.
See:
How to determine if CPU VT extensions are enabled in bios?
http://askubuntu.com/questions/103965/how-to-determine-if-cpu-vt-extensions-are-enabled-in-bios
-----------------------------------------------------------------------------