[libvirt] Cannot get network to work with LXC

Hi all, I tried to use the first xml config in http://libvirt.org/drvlxc.html to setup my first light weight container. However, I was unable to get the container's network to work. When I tried to give the interface an IP, I got the following error message: sh-4.0# /sbin/ifconfig veth1 192.168.0.1/24 SIOCSIFADDR: Permission denied SIOCSIFNETMASK: Permission denied SIOCGIFADDR: Cannot assign requested address SIOCSIFBROADCAST: Permission denied SIOCSIFFLAGS: Permission denied sh-4.0# Any advise ? This is a UTF-8 formatted mail ----------------------------------------------- James C.-C.Yu

Quoting James Yu (cyu021@gmail.com):
Hi all,
I tried to use the first xml config in http://libvirt.org/drvlxc.html to
Which version of libvirt were you using? Was it the one which came with your distro, and, if so, which distro? You might try installing the version from git clone git://libvirt.org/libvirt.git
setup my first light weight container. However, I was unable to get the container's network to work. When I tried to give the interface an IP, I got the following error message:
sh-4.0# /sbin/ifconfig veth1 192.168.0.1/24 SIOCSIFADDR: Permission denied SIOCSIFNETMASK: Permission denied SIOCGIFADDR: Cannot assign requested address SIOCSIFBROADCAST: Permission denied SIOCSIFFLAGS: Permission denied sh-4.0# Any advise ?
This is a UTF-8 formatted mail ----------------------------------------------- James C.-C.Yu
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Tue, Jul 07, 2009 at 10:39:42PM +0800, James Yu wrote:
Hi all,
I tried to use the first xml config in http://libvirt.org/drvlxc.html to setup my first light weight container. However, I was unable to get the container's network to work. When I tried to give the interface an IP, I got the following error message:
sh-4.0# /sbin/ifconfig veth1 192.168.0.1/24 SIOCSIFADDR: Permission denied SIOCSIFNETMASK: Permission denied SIOCGIFADDR: Cannot assign requested address SIOCSIFBROADCAST: Permission denied SIOCSIFFLAGS: Permission denied sh-4.0# Any advise ?
A stupid bug I introduced :-( See patch I've just posted Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
James Yu
-
Serge E. Hallyn