在CentOS 6.4(系统是32位)中安装libvirt,安装步骤具体如下:
1.在官网中下载libvirt,我安装的是libvirt-1.0.0.tar.gz,下载网址为:http://libvirt.org/sources/
2.解压压缩包:[spa@localhost]$ sudo tar –zxvf libvirt-1.0.0.tar.gz
3.安装:[spa@localhost libvirt-1.0.0]$ sudo./configure会提示如下错误
checking libxml2 xml2-config >= 2.6.0... configure: error: Could not find libxml2 anywhere (see config.log fordetails).
这里需要安装libxml2:[spa@localhost libvirt-1.0.0]$ sudo yuminstall libxml2
[spa@localhost libvirt-1.0.0]$ sudo yuminstall libxml2-devel
在此用[spa@localhost libvirt-1.0.0]$ sudo./configure又提示:
You must install the GnuTLS library inorder to compile and run libvirt
需要安装gnutls:[spa@localhost libvirt-1.0.0]$ sudo yuminstall gnutls-devel
继续[spa@localhost libvirt-1.0.0]$ sudo./configure提示:configure: error: You must installdevice-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt
继续安装[spa@localhost libvirt-1.0.0]$ sudo yuminstall device-mapper-devel
后执行[spa@localhost libvirt-1.0.0]$ sudo./configure
提示:configure: error: You must installpython-devel to build Python bindings
安装python-devel:[spa@localhost libvirt-1.0.0]$ sudo yuminstall python-devel再次执行[spa@localhost libvirt-1.0.0]$ sudo./configure居然还有提示:
configure: error: libnl-devel >= 1.1 isrequired for macvtap support
安装libnl-devel:
[spa@localhost libvirt-1.0.0]$ sudo yuminstall libnl-devel
再通过[spa@localhost libvirt-1.0.0]$ sudo./configure没有提示了
紧接着,执行
[spa@localhost libvirt-1.0.0]$ sudo make无错误提示
最后执行
[spa@localhost libvirt-1.0.0]$ sudo makeinstall
没有错误提示,则libvirt安装成功通过命令 libvrit --version验证:
[spa@localhost libvirt-1.0.0]$ libvirtd--version
libvirtd (libvirt) 1.0.0
其中红色部分为错误信息提示,黑体加粗部分为执行命令!!!