我一直在关注此链接https://help.ubuntu.com/community/KVM/Installation在 Ubuntu 18.04.1 LTS 上安装 KVM。但是我无法正常启动并遇到以下错误。
$ 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
Run Code Online (Sandbox Code Playgroud)
该目录/var/run/libvirt/libvirt-sock
确实不包含libvirt-sock
$ ls /var/run/libvirt
network storage virtlockd-sock virtlogd-sock
Run Code Online (Sandbox Code Playgroud)
这个问题的解决方案是什么?以及如何正确安装 KVM?非常感谢
套接字是一种特殊类型的文件,应在 libvirt 守护程序启动时创建。我的猜测是,libvirtd 没有运行 - 要启动它,请尝试:
systemctl start libvirtd
Run Code Online (Sandbox Code Playgroud)
要检查它的状态,请尝试:
systemctl status libvirtd
Run Code Online (Sandbox Code Playgroud)
它也可能未启用,因此默认情况下不会在重新启动时运行 - 您可以通过以下方式解决此问题:
systemctl enable libvirtd
Run Code Online (Sandbox Code Playgroud)