我要评分
获取效率
正确性
完整性
易理解

KVM Failed to Connect to Hypervisor

Symptom

After Hypervisor is connected, when you run the virsh version command to view the libvirt library version and related information, the following information is displayed:

error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or
directory

Key Process and Cause Analysis

The libvirtd service is not started, and libvirt-sock cannot be found.

Conclusion and Solution

  1. Restart the libvirtd service.
    service libvirtd restart
  2. View the libvirt library version and other related information.
    virsh version
    Compiled against library: libvirt 4.7.0
    Using library: libvirt 4.7.0
    Using API: QEMU 4.7.0
    Running hypervisor: QEMU 4.0.0