You are not logged in.

#1 2011-11-23 13:17:25

Ajunta
Member
From: Moscow
Registered: 2009-05-31
Posts: 58

libvirt ssh tunneling problem

Hello!

I am trying to deploy libvirt using this manual. Unix File-based Permissions used to allow specially created virtman user to access libvirt:

$ groups virtman
kvm libvirt users

Everything supposed to start automatically:

$ cat /etc/rc.conf | grep DAEMONS
DAEMONS=(hwclock syslog-ng net-profiles dbus netfs crond iptables libvirtd sshd)

The local connection works fine:

$ whoami
virtman
$ virsh -c qemu+ssh://virtman@localhost/system
virtman@localhost's password:
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh #

Computer with libvirtd is an Archlinux:

$ uname -a
Linux 3.1.1-1-ARCH #1 SMP PREEMPT Fri Nov 11 22:28:29 CET 2011 x86_64 Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz GenuineIntel GNU/Linux

The other computer exists in the same LAN and runs Windows Xp, to use native virt-manager I installed VirtualBox and Ubuntu with NAT network setting on it, so the arch is available via ssh from the Ubuntu:

$ uname -a
Linux core 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

$ ssh virtman@192.168.46.5
virtman@192.168.46.5's password: 
Last login: Sun Jan 16 10:32:20 2011
$

But virsh on ubuntu won't work:

$ virsh -c qemu+ssh://virtman@192.168.46.5/system
virtman@192.168.46.5's password: 
error: server closed connection: Resource temporarily unavailable
error: failed to connect to the hypervisor

Here is ifconfig from arch:

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.46.5  netmask 255.255.248.0  broadcast 192.168.47.255
        inet6 fe80::20d:88ff:fe43:8113  prefixlen 64  scopeid 0x20<link>
        ether 00:0d:88:43:81:13  txqueuelen 1000  (Ethernet)
        RX packets 3919  bytes 327114 (319.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 169  bytes 22745 (22.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  base 0xac00

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 46  bytes 7650 (7.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 46  bytes 7650 (7.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 9a:f2:c2:5f:09:d5  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The same with test diriver:

$ virsh -c test+ssh://virtman@192.168.46.5/system
virtman@192.168.46.5's password: 
error: server closed connection: Resource temporarily unavailable
error: failed to connect to the hypervisor

What can be wrong with it? Why libvirt won't let me access via SSH from the remote host?

Last edited by Ajunta (2011-11-23 14:32:13)

Offline

#2 2012-03-18 02:09:11

mephage
Member
Registered: 2011-09-28
Posts: 6

Re: libvirt ssh tunneling problem

Sorry to necro but I have been at this for days and found this post which has an almost identical issue to me.

I'm having the same issue. My host is arch linux and my client is a VM running mint 12.

The interesting thing is I have tried setting up and using qemu+tcp which connects fine with kerberos (sasl). The only problem is that qemu+tcp doesn't support using the vnc console so I can't install new VMs without going back to my hypervisor.

I'm using the PolicyKit authentication method.

Last edited by mephage (2012-03-18 02:47:20)

Offline

#3 2012-03-18 02:46:11

mephage
Member
Registered: 2011-09-28
Posts: 6

Re: libvirt ssh tunneling problem

I am getting the following error, I have no idea what is causing it...

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1146, in _open_thread
    self.vmm = self._try_open()
  File "/usr/share/virt-manager/virtManager/connection.py", line 1130, in _try_open
    flags)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: server closed connection: Resource temporarily unavailable

Offline

#4 2012-03-19 20:19:53

mephage
Member
Registered: 2011-09-28
Posts: 6

Re: libvirt ssh tunneling problem

This is the output from auth.log:

Mar 19 17:03:13 localhost login[668]: pam_unix(login:session): session opened for user *username* by LOGIN(uid=0)
Mar 19 17:05:57 localhost sshd[871]: Accepted publickey for *username* from 192.168.2.223 port 50678 ssh2
Mar 19 17:05:57 localhost sshd[871]: pam_unix_session(sshd:session): session opened for user *username* by (uid=0)
Mar 19 17:05:57 localhost sshd[871]: pam_ck_connector(sshd:session): process already registered with ConsoleKit

I've tried to find out why ConsoleKit is invloved without any luck.

Offline

Board footer

Powered by FluxBB