virsh使用qemu_ssh远程访问libvirtd

virsh -c qemu+tcp://example.com/system

vim /etc/sysconfig/libvirtd

LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
LIBVIRTD_ARGS="--listen"

vim /etc/libvirt/libvirtd.conf

listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
listen_addr = "0.0.0.0"
auth_tcp = "none"

service libvirtd restart

如果没起效果(我的就没有生效,那么使用命令行:

libvirtd --daemon --listen --config /etc/libvirt/libvirtd.conf

ps aux | grep libvirtd

netstat -apn | grep tcp

tcp        0      0 0.0.0.0:16509           0.0.0.0:*               LISTEN      13971/libvirtd

virsh -c qemu+tcp://10.1.1.10/system

成功使用tcp去访问libvirtd。

其余连接格式如下:

qemu:///session                      (local access to per-user instance)
qemu+unix:///session                 (local access to per-user instance)
qemu:///system                       (local access to system instance)
qemu+unix:///system                  (local access to system instance)
qemu://example.com/system            (remote access, TLS/x509)
qemu+tcp://example.com/system        (remote access, SASl/Kerberos)
qemu+ssh://root@example.com/system   (remote access, SSH tunnelled)
  • virtualization/kvm/virsh使用qemu_ssh远程访问libvirtd.txt
  • 最后更改: 2019/04/16 18:31
  • (外部编辑)