Hi,
I can''t seem to get libvirtd to accept remote connections. Both
systems are built using genunix''s b130.
It seems that connections originating from the xvm0 server itself are fine but
as soon as I go on to the other box and run the same python script (or simply
virsh) the connection gets dropped immediately. Telnetting to port 16509
confirms that it drops the connection when it originates from outside of the
box, but telnetting from xvm0 it does work, connection doesn''t get
dropped. Both systems are on the same subnet.
Looks like it''s got something to do with credentials but I''ve
not been able to figure out what, or maybe I''m just doing something
wrong.
xvm 8974 1 0 15:13:03 ? 0:00 /usr/lib/libvirtd -d -l
xvm0# cat /etc/libvirt/libvirtd.conf
listen_tls=0
listen_tcp=1
tls_no_verify_certificate=0
tls_no_verify_certificate=0
xvm0# python test.py xen+tcp://xvm0
Dom Domain-0, state: 1, maxMemory: -1, memory: 2097152, nbVirtCPU: 4, cpuTime:
4160258030391
xvm0# virsh -c xen+tcp://xvm0 list
Id Name State
----------------------------------
0 Domain-0 running
remote$ virsh -c "xen+tcp://xvm0" list
error: server closed connection
error: failed to connect to the hypervisor
remote$ python test.py xen+tcp://xvm0
libvir: QEMU error : server closed connection
Traceback (most recent call last):
File "test.py", line 5, in ?
conn=libvirt.openReadOnly(uri)
File "/usr/lib/python2.4/vendor-packages/libvirt.py", line 174, in
openReadOnly
if ret is None:raise libvirtError(''virConnectOpenReadOnly()
failed'')
libvirt.libvirtError: server closed connection
remote$ telnet xvm0 16509
9010/1: pollsys(0x00450570, 6, 0x00000000, 0x00000000) = 1
9010/1: accept(10, 0x7FFFFFDFE8A0, 0x7FFFFFDFE888, SOV_DEFAULT) = 11
9010/1: getpeerucred(11, 0x00450290) Err#22 EINVAL
9010/1: close(11) = 0
xvm0# telnet xvm0 16509
9069/1: pollsys(0x00450570, 6, 0x00000000, 0x00000000) = 1
9069/1: accept(10, 0x7FFFFFDFE8A0, 0x7FFFFFDFE888, SOV_DEFAULT) = 11
9069/1: getpeerucred(11, 0x00450290) = 0
9069/1: setsockopt(11, tcp, TCP_NODELAY, 0x7FFFFFDFE88C, 4, SOV_DEFAULT) = 0
9069/1: fcntl(11, F_GETFD, 0xFFFFFF014C118180) = 0
9069/1: fcntl(11, F_SETFD, 0x00000001) = 0
9069/1: fcntl(11, F_GETFL) = 130
9069/1: fcntl(11, F_SETFL, FWRITE|FNONBLOCK) = 0
9069/1: brk(0x00452720) = 0
9069/1: brk(0x00492720) = 0
9069/1: pollsys(0x0044ADB0, 7, 0x00000000, 0x00000000) (sleeping...)
9069/1: pollsys(0x0044ADB0, 7, 0x00000000, 0x00000000) = 1
9069/1: read(11, " Q U I T", 4) = 4
9069/1: close(11) = 0
Best regards,
Lasse Osterild