QEMU+Tcp remote access libvirtd

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!

posted @ 2019-01-21 02:38  lyan_tech  阅读(206)  评论(0编辑  收藏  举报