是否可以从客人连接到主机管理程序(使用libvirt remote uri)?从在线的各种文档中,我推断只能在本地(即从主机)连接到管理程序uri . 这种理解是否正确?有没有其他方法可以在guest虚拟机上触发主机上的virsh命令运行?
On host:
#virsh uri
qemu:///system
#virsh -c qemu:///system list
Id Name State
----------------------------------------------------
4 guest_vm running
On guest:
# curl qemu://user1@192.168.10.1/system -vv
* Protocol qemu not supported or disabled in libcurl
* Closing connection -1
curl: (1) Protocol qemu not supported or disabled in libcurl
2 回答
Libvirt不使用HTTP / REST协议,因此您在这里使用'curl'是关键问题 . Libvirt使用私有二进制RPC协议,因此您必须始终使用基于libvirt的应用程序连接到libvirtd . 你的URI是对的 - 你只需要将它交给virsh - 例如'virsh -c qemu://user1@192.168.10.1/system' . Libvirt支持几种不同的连接方法 - 你的URI是've used will access libvirt over a TLS encrypted connection - this requires that you configure libvirtd on the host to listen on the IP address, and given it x509 certificates. If you want to avoid using TLS+x509, the simpler approach is to use the SSH tunnel with a ' qemu ssh:// .....'URI . 有关远程访问libvirtd的信息,请参阅http://libvirt.org/remote.html
这个有可能 . 命令看起来像
virsh --connect qemu+ssh://user1@192.168.10.1/system
有关详细信息,请参阅http://libvirt.org/uri.html