最近在学习kvm虚拟机,宿主机操作系统为Centos 7.1具体版本号不记得了。
安装virt工具后,使用virt-mananger工具安装系统有错误:revc connection reset by peer。看/var/log/message信息出现libvirtd.service错误,systemctl status libvirtd查看状态为运行。
以下为网络上查找的相关资料:
今天在把QEMU-KVM上的一个虚拟机Shutdown后总是无法启动,使用virt-manager管理工具启动时总是导致该工具意外终止,如果是使用virsh命令行管理工具启动时总是报错:
[root@db1 ~]# virsh start oneracvm
error: Failed to start domain oneracvm
error: Timed out during operation: cannot acquire state change lock
查了一下发现这是ibvirt在RHEL5上的Bug,需要把libvirt的后天进程libvirtd --daemon重启一下:
关闭,直接KILL即可:
[root@db1 run]# kill -9 ps -ef|grep 'libvirtd --daemon'|grep -v grep |awk '{print $2}'
这时候你还不能直接起来,否则会出错:
[root@db1 run]# libvirtd --daemon
libvirtd: error: Unable to obtain pidfile. Check /var/log/messages or run without --daemon for more info.
因为,它的启动记录文件还存在,需要先删除:
[root@db1 run]# rm /var/run/libvirtd.pid
rm: remove regular file `libvirtd.pid’? y
这时候你就可以起来了:
[root@db1 run]# libvirtd --daemon
此时就可以启动虚拟机了:
[root@db1 ~]# virsh start oneracvm
Domain oneracvm started
錯誤訊息
root@autotest0019:/etc/ld.so.conf.d# /usr/local/sbin/libvirtd -d -l
/usr/local/sbin/libvirtd: error: Unable to obtain pidfile. Check /var/log/messages or run without --daemon for more info.
root@autotest0019:/etc/ld.so.conf.d# /usr/local/sbin/libvirtd -l
2014-07-29 11:27:37.644+0000: 31256: info : libvirt version: 1.2.5
2014-07-29 11:27:37.644+0000: 31256: error : virPidFileAcquirePath:414 : Failed to acquire pid file ‘/usr/local/var/run/libvirtd.pid’: Resource temporarily unavailable
解決方式,編輯下方檔案,不修改,然后直接退出即可
/usr/local/var/run/libvirtd.pid
问题描述:在服务器上安装好虚拟机后,虚拟机可以正常使用,但是重启服务器后报如下错误:
virsh start win7_64_101_360
错误:开始域 win7_64_101_360 失败
错误:将插槽连接到 '/var/run/libvirt/virtlogd-sock' 失败: 拒绝连接
此时运行命令service libvirtd status 也可以看到上述错误
解决方案:
1、
/var/run/libvirt 给 libvirt-sock、 libvirt-sock-ro、virtlockd-sock 仨文件加权限 (据说 只加libvirt-sock 就行)
sudo chmod -R 777 libvirt-sock
sudo chmod -R 777 libvirt-sock-ro
sudo chmod -R 777 virtlockd-sock
重启libvirt: service libvirtd restart
如果还是报错
2、通过守护进程的方式运行日志进程
virtlogd -d
————————————————
版权声明:本文为CSDN博主「SheenChi」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qi2510980868/article/details/93727868
Failed to connect socket to '/var/run/libvirt/libvirt-sock’的问题解决
1、增加libvirtd用户组
groupadd libvirtd
2、设置用户到组
sudo usermod -a -G libvirtd $USER
3、设置启动libvirtd服务的用户组
vi /etc/libvirt/libvirtd.conf
4、增加权限启动配置
vi /etc/polkit-1/localauthority/50-local.d/50-org.libvirtd-group-access.pkla
[libvirtd group Management Access]
Identity=unix-group:libvirtd
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes
5、重启服务
service libvirtd restart
libvirtd服务start失败
时间:2017-03-01 15:51:38 阅读:4983 评论:0 收藏:0 [点我收藏+]
标签:ips cfm ast tsx fbx poe jcp uic pxe
服务器断电,重启虚拟机时,发现libvirtd服务起不来
[root@sz-CI ~]# service libvirtd status -l
Redirecting to /bin/systemctl status -l libvirtd.service
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit) since Wed 2017-03-01 11:12:24 CST; 2min 34s ago
Docs: man:libvirtd(8)
http://libvirt.org
Process: 7188 ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=6)
Main PID: 7188 (code=exited, status=6)
Mar 01 11:12:24 sz-CI systemd[1]: Failed to start Virtualization daemon.
Mar 01 11:12:24 sz-CI systemd[1]: Unit libvirtd.service entered failed state.
Mar 01 11:12:24 sz-CI systemd[1]: libvirtd.service failed.
Mar 01 11:12:24 sz-CI systemd[1]: libvirtd.service holdoff time over, scheduling restart.
Mar 01 11:12:24 sz-CI systemd[1]: start request repeated too quickly for libvirtd.service
Mar 01 11:12:24 sz-CI systemd[1]: Failed to start Virtualization daemon.
Mar 01 11:12:24 sz-CI systemd[1]: Unit libvirtd.service entered failed state.
Mar 01 11:12:24 sz-CI systemd[1]: libvirtd.service failed.
/var/log/messages 日志报错
Mar 1 14:35:27 localhost systemd: Starting Virtualization daemon…
Mar 1 14:35:27 localhost journal: libvirt version: 1.2.17, package: 13.el7_2.4 (CentOS BuildSystem http://bugs.centos.org, 2016-03-31-16:56:26, worker1.bsys.centos.org)
Mar 1 14:35:27 localhost journal: Module /usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so not accessible
Mar 1 14:35:27 localhost journal: Cannot read CA certificate ‘/etc/pki/CA/cacert.pem‘: No such file or directory
Mar 1 14:35:27 localhost systemd: libvirtd.service: main process exited, code=exited, status=6/NOTCONFIGURED
Mar 1 14:35:27 localhost systemd: Failed to start Virtualization daemon.
Mar 1 14:35:27 localhost systemd: Unit libvirtd.service entered failed state.
Mar 1 14:35:27 localhost systemd: libvirtd.service failed.
Mar 1 14:35:28 localhost systemd: libvirtd.service holdoff time over, scheduling restart.
Mar 1 14:35:28 localhost systemd: start request repeated too quickly for libvirtd.service
Mar 1 14:35:28 localhost systemd: Failed to start Virtualization daemon.
Mar 1 14:35:28 localhost systemd: Unit libvirtd.service entered failed state.
Mar 1 14:35:28 localhost systemd: libvirtd.service failed.
看起来像是缺少libvirt_driver_lxc.so这个库和/etc/pki/CA/cacert.pem 认证密钥。
网上找了些方法,说是更新一下包就可以
查看包版本:yum info device-mapper-libs
更新软件包:yum update device-mapper-libs
照做之后,还是起不来。
服务起不来,虚拟就不能用,先不管那么多,先直接 /usr/sbin/libvirtd -d手动试一下服务能不能用,结果能用,那就先起着给大家用先。然后再来找原因。
原因没找到,找到了个解决办法。
修改这个文件 /etc/libvirt/libvirtd.conf,去掉tls和tcp两行的注释,建立连接时走tcp通道
技术分享
服务能起来了
技术分享
多了个16509端口,正常libvirtd服务并没有端口listen。
还望路过的大神告知。。。
libvirtd服务start失败
标签:ips cfm ast tsx fbx poe jcp uic pxe
原文:http://www.cnblogs.com/zodetv/p/6484479.html
按照上述的思路操作,最终也没解决问题,后来看了一个博文,也发生类似问题,做法是更换了系统搞定了,所以我也是更换系统搞定的。