KVM Setting Issue (libvirt-sock not found) on Ubuntu 18.04.1 LTS

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


Solution 1:

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