libvirt uses ssh remote access by default, if you want to connect to remote sever by tcp protocl
virsh -c qemu+tcp://host/system
you probably get below error:
error: unable to connect to server at 'host:16509': Connection refused
error: failed to connect to the hypervisor
To fix it and remote access libvirtd by qemu+tcp, just follow below steps:
1. change /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp=1
auth_tcp="none"
2. change /etc/default/libvirtd
libvirt_opts="-l"
3. reboot libvirtd
/etc/init.d/libvirtd restart
4. check tcp ports
netstat -lntp | grep libvirtd
ps aux | grep libvirtd
Now you will see you could connect libvirtd with tcp correctly, enjoy!

本文介绍了解决Libvirt默认使用SSH远程访问的问题,通过修改配置文件并重启服务,实现使用TCP协议进行远程连接。
3919

被折叠的 条评论
为什么被折叠?



