| 138 | |
| 139 | = KVM = |
| 140 | * KVMはH/W仮想化支援が必須 |
| 141 | |
| 142 | == KVM on KVM == |
| 143 | * Intel EPT / AMD RVI 対応のCPUが必須 |
| 144 | |
| 145 | * [http://aikotobaha.blogspot.jp/2012/02/kvm-on-kvmnested-kvm.html OSSはアルミニウムの翼で飛ぶ: KVM on KVM(nested KVM)] |
| 146 | * [http://baalzephon.dyndns.org/tech/index.php?Linux%2FKVM Linux/KVM - PukiWiki Plus!] |
| 147 | * [http://d.hatena.ne.jp/pochio_pochiyama/20110228/p1 Ubuntu 10.10 で KVM on KVM (nested svm) - それなりに適当にやってます] |
| 148 | |
| 149 | === Debian 6.0 with kernel backports === |
| 150 | * 3.x系(3.1以降?)のkernelで無いと、Intel CPUには対応出来ないらしい |
| 151 | * virt-managerが古いせいか、ゲストの設定ファイル(xml)を直接編集した後、ゲストが起動しなくなった |
| 152 | |
| 153 | * mitty@walken:~$ lsb_release -a |
| 154 | {{{ |
| 155 | No LSB modules are available. |
| 156 | Distributor ID: Debian |
| 157 | Description: Debian GNU/Linux 6.0.4 (squeeze) |
| 158 | Release: 6.0.4 |
| 159 | Codename: squeeze |
| 160 | }}} |
| 161 | * mitty@walken:~$ uname -a |
| 162 | {{{ |
| 163 | Linux walken 3.2.0-0.bpo.2-amd64 #1 SMP Sun Mar 25 10:33:35 UTC 2012 x86_64 GNU/Linux |
| 164 | }}} |
| 165 | |
| 166 | * mitty@walken:~$ vmware -v |
| 167 | {{{ |
| 168 | VMware Workstation 8.0.2 build-591240 |
| 169 | }}} |
| 170 | * VMwareとのゲスト同時稼働も問題ない模様 |
| 171 | |
| 172 | * mitty@walken:~$ kvm --version |
| 173 | {{{ |
| 174 | QEMU PC emulator version 0.12.5 (qemu-kvm-0.12.5), Copyright (c) 2003-2008 Fabrice Bellard |
| 175 | }}} |
| 176 | |
| 177 | * mitty@walken:~$ virt-manager --version |
| 178 | {{{ |
| 179 | 0.8.4 |
| 180 | }}} |
| 181 | |
| 182 | * mitty@walken:~$ cat /proc/cpuinfo |
| 183 | {{{ |
| 184 | processor : 0 |
| 185 | vendor_id : GenuineIntel |
| 186 | cpu family : 6 |
| 187 | model : 30 |
| 188 | model name : Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz |
| 189 | stepping : 5 |
| 190 | microcode : 0x3 |
| 191 | cpu MHz : 1197.000 |
| 192 | cache size : 8192 KB |
| 193 | physical id : 0 |
| 194 | siblings : 4 |
| 195 | core id : 0 |
| 196 | cpu cores : 4 |
| 197 | apicid : 0 |
| 198 | initial apicid : 0 |
| 199 | fpu : yes |
| 200 | fpu_exception : yes |
| 201 | cpuid level : 11 |
| 202 | wp : yes |
| 203 | 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 rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida dts tpr_shadow vnmi flexpriority ept vpid |
| 204 | bogomips : 5319.48 |
| 205 | clflush size : 64 |
| 206 | cache_alignment : 64 |
| 207 | address sizes : 36 bits physical, 48 bits virtual |
| 208 | power management: |
| 209 | |
| 210 | (snip) |
| 211 | }}} |
| 212 | |
| 213 | === nested=1 === |
| 214 | * mitty@walken:~$ modinfo kvm_intel |grep nested |
| 215 | {{{ |
| 216 | parm: nested:bool |
| 217 | }}} |
| 218 | * mitty@walken:~$ cat /sys/module/kvm_intel/parameters/nested |
| 219 | {{{ |
| 220 | N |
| 221 | }}} |
| 222 | |
| 223 | * mitty@walken:~$ sudo vim /etc/modprobe.d/kvm-nested.conf |
| 224 | {{{ |
| 225 | options kvm_intel nested=1 |
| 226 | }}} |
| 227 | |
| 228 | * mitty@walken:~$ sudo modprobe -r kvm_intel |
| 229 | * mitty@walken:~$ sudo modprobe kvm_intel |
| 230 | * mitty@walken:~$ cat /sys/module/kvm_intel/parameters/nested |
| 231 | {{{ |
| 232 | Y |
| 233 | }}} |
| 234 | |
| 235 | * mitty@walken:~$ sudo vim /etc/libvirt/qemu/test.xml |
| 236 | {{{#!diff |
| 237 | --- test.xml 2012-04-17 12:36:32.464246092 +0900 |
| 238 | +++ /etc/libvirt/qemu/test.xml 2012-04-17 14:11:45.439356087 +0900 |
| 239 | @@ -14,6 +14,17 @@ |
| 240 | <apic/> |
| 241 | <pae/> |
| 242 | </features> |
| 243 | + <cpu match='exact'> |
| 244 | + <model>Nehalem</model> |
| 245 | + <vendor>Intel</vendor> |
| 246 | + <feature policy='require' name='rdtscp'/> |
| 247 | + <feature policy='require' name='ss'/> |
| 248 | + <feature policy='require' name='hypervisor'/> |
| 249 | + <feature policy='require' name='vme'/> |
| 250 | + <feature policy='require' name='ds'/> |
| 251 | + <feature policy='require' name='vmx'/> |
| 252 | + <feature policy='require' name='acpi'/> |
| 253 | + </cpu> |
| 254 | <clock offset='utc'/> |
| 255 | <on_poweroff>destroy</on_poweroff> |
| 256 | <on_reboot>restart</on_reboot> |
| 257 | }}} |
| 258 | * Fedora16のLiveCDでvirt-managerを起動し、下記サイトを参考にGUI上から設定を行った場合に、xmlに書き込まれる差分をそのまま適用してみた |
| 259 | * うまく起動しない |