仮想化ソフトウェア - KVM - CentOS 6.8 へのインストール - 使用可能かを確認
- 1. 概要
- 2. 仮想化の可/不可を確認
- 3. 64ビット稼働可能かを確認
1. 概要
そもそも、ハードウェアが、KMV を使用できるかどうかを先に確認します。
使用不可であれば、インストールしても意味がありませんので・・・。
本項は「仮想マシン構築(KVM) - CentOSで自宅サーバー構築」を参考にさせていただきました。
2. 仮想化の可/不可を確認
grep -E 'svm|vmx' /proc/cpuinfo > /dev/null && echo OK
とやって
> grep -E 'svm|vmx' /proc/cpuinfo > /dev/null && echo OK
OK
てな具合に、「OK」が表示されれば、KVM が使用可能という判定になります。
/proc/cpuinfo 内に、svm もしくは vmx というキーワードが存在するかを見ているわけですな。
/proc/cpuinfo
ちゅうのは、不思議なファイルで
> file /proc/cpuinfo
/proc/cpuinfo: empty
> ls -la /proc/cpuinfo
-r--r--r--. 1 root root 0 3月 26 22:11 2019 /proc/cpuinfo
と空っぽに見えるのに
> cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 78
model name : Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
stepping : 3
microcode : 194
cpu MHz : 2592.002
cache size : 4096 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon xtopology tsc_reliable nonstop_tsc unfair_spinlock pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat xsaveopt tpr_shadow vnmi ept vpid fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx
bogomips : 5184.00
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 78
model name : Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
stepping : 3
microcode : 194
cpu MHz : 2592.002
cache size : 4096 KB
physical id : 2
siblings : 1
core id : 0
cpu cores : 1
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon xtopology tsc_reliable nonstop_tsc unfair_spinlock pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat xsaveopt tpr_shadow vnmi ept vpid fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx
bogomips : 5184.00
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:
と、cat で見ると中身がぎっしり(!?)詰まっている。
なんだろうなぁ、これ。中身の説明は相当数のサイトが記述していますが、そもそもこのファイルが物理的にどうなっているかは、まだよく理解していません(2019年3月26日)。
3. 64ビット稼働可能かを確認
grep flags /proc/cpuinfo|grep lm > /dev/null && echo OK
これも、前項と同じで、「OK」が表示されれば、仮想環境も 64ビットで動かすことができるというわけです。
まぁ、grep コマンドを工夫しているのですが、考えた人を尊敬しちゃいますね。
わたしの場合、目的がわかっていたら、grep をかけるより、エディタで中身をサーチかけちゃいそうです。
|
|