[root@nginx ~]# virsh list
error: Failed to reconnect to the hypervisor
error: no valid connectionerror:
Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

问题解决:

libvirt服务没启动,启动就好了

[root@nginx ~]# /etc/init.d/libvirtd status
libvirtd is stopped
[root@nginx ~]#
[root@nginx ~]# /etc/init.d/libvirtd start
Starting libvirtd daemon:                                  [  OK  ]
[root@nginx ~]#

查看虚拟机运行状态:

[root@nginx ~]# virsh list

Id    Name                           State

----------------------------------------------------

1     lamp                           running