10

I have been following this link https://help.ubuntu.com/community/KVM/Installation to install KVM on Ubuntu 18.04.1 LTS. But I cannot start it properly and encounter the following errors.

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

The directory /var/run/libvirt/libvirt-sock indeed does not contain libvirt-sock

$ ls /var/run/libvirt
network  storage  virtlockd-sock  virtlogd-sock

What are the solutions to this issue? and how can I install KVM properly? Many Thanks

1 Answer 1

8

The sockets are a special type of file that should get created when the libvirt daemon starts. My guess is, libvirtd is not running - to start it, try:

systemctl start libvirtd

To check it's status, try:

systemctl status libvirtd

It may also not be enabled, therefore would not run by default on reboot - you can fix this with:

systemctl enable libvirtd
7
  • Thanks. Checking the status systemctl status libvirtd gives three errors. 1. Failed to parse user 'libvirt-qemu' 2. Initialization of QEMU state driver failed 3. Driver state initialization failed. The errors are still here even after enable
    – K_inverse
    Commented Sep 6, 2018 at 8:35
  • 2
    Ok, so there's a bit of info on your error in this bug report: bugs.debian.org/cgi-bin/bugreport.cgi?bug=768000 - the washup, make sure the libvirt-daemon-system pkg is installed. It should have installed automatically, but it is not explicitly a dependency (just a recommends). You can check that with apt depends virt-manager
    – cleary
    Commented Sep 6, 2018 at 23:42
  • I have libvirt-daemon-system installed. But still don't know what is the issue
    – K_inverse
    Commented Sep 7, 2018 at 3:43
  • I guess at this point you're just going to need to create the user yourself, and apply membership appropriately. It's covered in this post in the bug I linked earlier: bugs.debian.org/cgi-bin/bugreport.cgi?bug=768000#10
    – cleary
    Commented Sep 7, 2018 at 4:50
  • I tried to follow the link to create users and add groups, but the errors are still here.
    – K_inverse
    Commented Sep 10, 2018 at 9:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .