[libvirt] iface-list command in virsh

Hi, I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ? Best regards, Arnaud Champion

2010/4/19 Dev.Atom <arnaud.champion@devatom.fr>:
Hi,
I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ?
The current interface driver used in combination with libvirtd is nefcf [1] based. If your libvirt is compiled without netcf then there will be no interface support for QEMU, Xen and so on. You'll also need to have a distro (e.g. Fedora) that supports netcf or is supported by netcf, because netcf handles the interface configuration files and those are in different locations of have other distro dependent differences. [1] https://fedorahosted.org/netcf/ Matthias

Hi, Yes I know that, and I use the fedora 12 distro, with netcf support and libvirt rpm are compiled with netcf support. That's why it works when I am root, but only when I am root -------------------------------------------------- From: "Matthias Bolte" <matthias.bolte@googlemail.com> Sent: Monday, April 19, 2010 11:08 PM To: "Dev.Atom" <arnaud.champion@devatom.fr> Cc: <libvir-list@redhat.com> Subject: Re: [libvirt] iface-list command in virsh
2010/4/19 Dev.Atom <arnaud.champion@devatom.fr>:
Hi,
I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ?
The current interface driver used in combination with libvirtd is nefcf [1] based. If your libvirt is compiled without netcf then there will be no interface support for QEMU, Xen and so on.
You'll also need to have a distro (e.g. Fedora) that supports netcf or is supported by netcf, because netcf handles the interface configuration files and those are in different locations of have other distro dependent differences.
[1] https://fedorahosted.org/netcf/
Matthias

2010/4/20 Dev.Atom <arnaud.champion@devatom.fr>:
Hi,
Yes I know that, and I use the fedora 12 distro, with netcf support and libvirt rpm are compiled with netcf support. That's why it works when I am root, but only when I am root
-------------------------------------------------- From: "Matthias Bolte" <matthias.bolte@googlemail.com> Sent: Monday, April 19, 2010 11:08 PM To: "Dev.Atom" <arnaud.champion@devatom.fr> Cc: <libvir-list@redhat.com> Subject: Re: [libvirt] iface-list command in virsh
2010/4/19 Dev.Atom <arnaud.champion@devatom.fr>:
Hi,
I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ?
The current interface driver used in combination with libvirtd is nefcf [1] based. If your libvirt is compiled without netcf then there will be no interface support for QEMU, Xen and so on.
You'll also need to have a distro (e.g. Fedora) that supports netcf or is supported by netcf, because netcf handles the interface configuration files and those are in different locations of have other distro dependent differences.
[1] https://fedorahosted.org/netcf/
Matthias
Ah, sorry I misread the part where you say it works locally as root. That's strange. What error message do you get in cases where it doesn't work? Do you use the same libvirt version on all hosts that are involved? Matthias

Here is the full test : -------------------------------------------------------------------------------- [root@mingwenv arnaud]# whoami root [root@mingwenv arnaud]# virsh Bienvenue dans virsh, le terminal de virtualisation interactif. Taper : « help » pour l'aide ou « help » avec la commande « quit » pour quitter virsh # iface-list Nom Ãtat MAC Address -------------------------------------------- eth0 actif 00:0c:29:28:bb:3e lo actif 00:00:00:00:00:00 virsh # quit [root@mingwenv arnaud]# exit exit [arnaud@mingwenv ~]$ whoami arnaud [arnaud@mingwenv ~]$ virsh Bienvenue dans virsh, le terminal de virtualisation interactif. Taper : « help » pour l'aide ou « help » avec la commande « quit » pour quitter virsh # iface-list erreur :Failed to list active interfaces erreur :this function is not supported by the hypervisor: virConnectNumOfInterfaces virsh # quit [arnaud@mingwenv ~]$ -------------------------------------------------------------------------------- As you can see, at first, with root it works, not with my user account. -------------------------------------------------- From: "Matthias Bolte" <matthias.bolte@googlemail.com> Sent: Tuesday, April 20, 2010 9:53 AM To: "Dev.Atom" <arnaud.champion@devatom.fr> Cc: <libvir-list@redhat.com> Subject: Re: [libvirt] iface-list command in virsh
2010/4/20 Dev.Atom <arnaud.champion@devatom.fr>:
Hi,
Yes I know that, and I use the fedora 12 distro, with netcf support and libvirt rpm are compiled with netcf support. That's why it works when I am root, but only when I am root
-------------------------------------------------- From: "Matthias Bolte" <matthias.bolte@googlemail.com> Sent: Monday, April 19, 2010 11:08 PM To: "Dev.Atom" <arnaud.champion@devatom.fr> Cc: <libvir-list@redhat.com> Subject: Re: [libvirt] iface-list command in virsh
2010/4/19 Dev.Atom <arnaud.champion@devatom.fr>:
Hi,
I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ?
The current interface driver used in combination with libvirtd is nefcf [1] based. If your libvirt is compiled without netcf then there will be no interface support for QEMU, Xen and so on.
You'll also need to have a distro (e.g. Fedora) that supports netcf or is supported by netcf, because netcf handles the interface configuration files and those are in different locations of have other distro dependent differences.
[1] https://fedorahosted.org/netcf/
Matthias
Ah, sorry I misread the part where you say it works locally as root. That's strange.
What error message do you get in cases where it doesn't work?
Do you use the same libvirt version on all hosts that are involved?
Matthias

On 04/19/2010 04:06 PM, Dev.Atom wrote:
Hi, I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ?
When you run virsh locally as non-root, it connects to qemu://session, which doesn't have root privileges, and the iface-* commands won't work (because netcf requires root to run). If you run virsh as root, you will be connected to qemu://system, which has root, and iface-* will work. The failure to work when connecting to a remote libvirtd is puzzling, though.

Is there a way to give root privileges to the process via setcap ? From: Laine Stump Sent: Tuesday, April 20, 2010 1:38 PM To: Dev.Atom Cc: libvir-list@redhat.com Subject: Re: [libvirt] iface-list command in virsh On 04/19/2010 04:06 PM, Dev.Atom wrote: Hi, I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ? When you run virsh locally as non-root, it connects to qemu://session, which doesn't have root privileges, and the iface-* commands won't work (because netcf requires root to run). If you run virsh as root, you will be connected to qemu://system, which has root, and iface-* will work. The failure to work when connecting to a remote libvirtd is puzzling, though.

As the iface-list command doesn't work, I'm trying to get physical interface of a host via nodedev-list, but it doesn't give me bridges, like br0 for example (which exists anyway). How can I retrieve available bridges of a host ? From: Dev.Atom Sent: Tuesday, April 20, 2010 2:09 PM To: Laine Stump Cc: libvir-list@redhat.com Subject: Re: [libvirt] iface-list command in virsh Is there a way to give root privileges to the process via setcap ? From: Laine Stump Sent: Tuesday, April 20, 2010 1:38 PM To: Dev.Atom Cc: libvir-list@redhat.com Subject: Re: [libvirt] iface-list command in virsh On 04/19/2010 04:06 PM, Dev.Atom wrote: Hi, I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ? When you run virsh locally as non-root, it connects to qemu://session, which doesn't have root privileges, and the iface-* commands won't work (because netcf requires root to run). If you run virsh as root, you will be connected to qemu://system, which has root, and iface-* will work. The failure to work when connecting to a remote libvirtd is puzzling, though. -------------------------------------------------------------------------------- -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Tue, Apr 20, 2010 at 07:38:43AM -0400, Laine Stump wrote:
On 04/19/2010 04:06 PM, Dev.Atom wrote:
Hi, I'm trying to list physical interface of a remote tcp host via the C API and it fails. I have tried to use virsh iface-list in remote TCP connection and it fails also. I have trying on the libvirt host with my normal account and it fails also, but when I connect under root account on the libvirt host, iface-list works. Any clue ?
When you run virsh locally as non-root, it connects to qemu://session, which doesn't have root privileges, and the iface-* commands won't work (because netcf requires root to run). If you run virsh as root, you will be connected to qemu://system, which has root, and iface-* will work.
We can still read files in /etc/sysconfig/networking-scripts as non-root, so it'd be desirable to at least make iface-XXX stuff work read-only, allowing configs to be queried / listed. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (4)
-
Daniel P. Berrange
-
Dev.Atom
-
Laine Stump
-
Matthias Bolte