KVM虚拟机的安装

时间:2024-03-09 09:17:54

 KVM(kernel-based Virtual Machine)

[root@ok ~]# egrep \'(vmx|svm)\' --color=always /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 pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid
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 pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid
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 pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid
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 pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid

 

[root@ok ~]# yum install -y kvm kmod-kvm kvm-qemu-img libvirt Python-virtinst virt-manager virt-viewer bridge-utils virt-install
 yum install -y kvm kmod-kvm kvm-qemu-img libvirt Python-virtinst virt-manager virt-viewer bridge-utils
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Package 2:qemu-kvm-0.12.1.2-2.491.el6_8.7.x86_64 already installed and latest version
No package kmod-kvm available.
No package kvm-qemu-img available.
Package libvirt-0.10.2-60.el6.x86_64 already installed and latest version
No package Python-virtinst available.
  * Maybe you meant: python-virtinst
Package virt-manager-0.9.0-31.el6.x86_64 already installed and latest version
Package virt-viewer-2.0-14.el6.x86_64 already installed and latest version
Package bridge-utils-1.2-10.el6.x86_64 already installed and latest version
Nothing to do

上面的好象有问题,可以试试下面的这个:

[root@ok ~]# yum install -y kvm kmod-kvm qemu-img libvirt python-virtinst virt-manager virt-viewer bridge-utils

也会有个包没装:

# yum install -y kvm kmod-kvm qemu-img libvirt python-virtinst virt-manager virt-viewer bridge-utils
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Package 2:qemu-kvm-0.12.1.2-2.491.el6_8.7.x86_64 already installed and latest version
No package kmod-kvm available.
Package 2:qemu-img-0.12.1.2-2.491.el6_8.7.x86_64 already installed and latest version
Package libvirt-0.10.2-60.el6.x86_64 already installed and latest version
Package python-virtinst-0.600.0-29.el6.noarch already installed and latest version
Package virt-manager-0.9.0-31.el6.x86_64 already installed and latest version
Package virt-viewer-2.0-14.el6.x86_64 already installed and latest version
Package bridge-utils-1.2-10.el6.x86_64 already installed and latest version

但yum search kmod:

kmod-kvm-debug.x86_64 : kvm kernel module(s)
kmod-oracleasm.x86_64 : oracleasm kernel module(s)
kmod-rtsx_pci.x86_64 : rtsx_pci kernel module(s)

后来再次装的时候问题解决!!

Unable to open a connection to the libvirt management daemon.

Libvirt URI is: qemu:///system

Verify that:
 - The \'libvirtd\' daemon has been started

 

[root@bass ~]# service libvirtd status
libvirtd is stopped

 

[root@bass ~]# service libvirtd start 
Starting libvirtd daemon: 2016-05-05 09:24:11.490+0000: 7189: info : libvirt version: 0.10.2, package: 54.el6_7.6 (CentOS BuildSystem <http://bugs.centos.org>, 2016-03-22-16:55:18, c6b8.bsys.dev.centos.org)
2016-05-05 09:24:11.490+0000: 7189: warning : virGetHostname:2279 : getaddrinfo failed for \'bass\': Name or service not known
                                                           [  OK  ]

 上面的问题解决!