一聚教程网:一个值得你收藏的教程网站

热门教程

CentOS6中源码安装libvirt的问题

时间:2022-06-30 21:28:49 编辑:袖梨 来源:一聚教程网

当前主流Linux平台上默认的虚拟化管理工具virt-manager(图形化),virt-install(命令行模式)等均基于libvirt开发而成,下面我给各位介绍在centos中安装libvirt的问题与解决办法。

Q1:

在执行./configure的时候出现:You must install the libyajl library & headers to compile libvirt
提示缺少libyajl库,属于JSON库。
最开始采用rpm安装该库,出错,改为采用源码安装libyajl库,该库托管在github上
安装方法:git clone git://github.com/lloyd/yajl
cd yajl
./configure
make
make install

Q2:

注意在./configure的时候加上附加参数:./configure –prefix=/usr –localstatedir=/var –sysconfdir=/etc
执行make install的时候,出现 error ,意思就是与之前的冲突,指定目录后可以覆盖掉。

Q3:

安装完成之后执行virsh或者libvirtd都会出现:
while loading shared libraries: libXXX.so.x: cannot open shared object file: No such file or directory .说明未找到共享链接库位置,
此时修改/etc/ld.so.conf,将指定的路径加进去,比如指定的是usr,那么.so的文件在/usr/local/lib下
执行ldconfig使配置文件生效。
官网:At this point you may have to run ldconfig or a similar utility to update your list of installed shared libs.
ldconfig:
它是一个程序,通常它位于/sbin下,是root用户使用的东东。具体作用及用法可以man ldconfig查到,它的作用就是将/etc/ld.so.conf列出的路径下的库文件 缓存到/etc/ld.so.cache 以供使用

热门栏目