Ask Your Question

LXC configuration

asked 2017-07-04 16:45:52 -0500

MaoTao gravatar image

I'm new to the LXC world and i'm facing an issue. I can't start an LXC container normally. Here is the error:

~ $ sudo lxc-start -d -n newcon -F

lxc-start: conf.c: instantiate_veth: 2729 failed to attach 'vethK6YJGI' to the bridge 'lxcbr0': Operation not permitted
lxc-start: conf.c: lxc_create_network: 3022 failed to create netdev
lxc-start: start.c: lxc_spawn: 1100 Failed to create the network.
lxc-start: start.c: __lxc_start: 1355 Failed to spawn container "newcon".
lxc-start: tools/lxc_start.c: main: 366 The container failed to start.
lxc-start: tools/lxc_start.c: main: 370 Additional information can be obtained by setting the --logfile and --logpriority options.

veth and lxcbr0 are supposed to created automatically by LXC

~ $ cat /etc/lxc/default.conf = veth = lxcbr0 = up = 00:16:3e:xx:xx:xx

I can't figure out what causing the

Operation not permitted

I have come up wiht a temporary solution to my problem found by accident in an old article here:

~ # brctl addbr lxcbr0
~ # brctl setfd lxcbr0 0
~ # ifconfig lxcbr0 promisc up
~ # brctl addif lxcbr0 enp2s0
~ # route add -net default gw lxcbr0

Could someone help with this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-07-04 23:26:02 -0500

aeperezt gravatar image

You need to change the file /etc/lxc/default.conf and set = virbr0 instead of lxcbr0. You also need to change that on the containers that have already been created in your case /var/lib/lxc/newcon/config after that it will work. Please verify you have installed libvirt and started it systemctl start libvirtd more information look at here

Good Luck

edit flag offensive delete link more


Thanks a lot. Works perfect. Much better than have to manually create lxcbr0 each time.

MaoTao gravatar imageMaoTao ( 2017-07-05 02:15:07 -0500 )edit

Question Tools

1 follower


Asked: 2017-07-04 16:45:52 -0500

Seen: 284 times

Last updated: Jul 04 '17