On 2017-05-28 07:57 PM, Fajar A. Nugraha wrote:
On Mon, May 29, 2017 at 5:58 AM, Rick Leir <[email protected]
<mailto:[email protected]>> wrote:
# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.525400c7428b yes virbr0-nic
# lxc-checkconfig
<all enabled>
# lxc-create -n crowdsr -t fedora
# lxc-start -n crowdsr -F
lxc-start: conf.c: instantiate_veth: 2669 failed to attach
'vethMU7OO1'
to the bridge 'lxcbr0': Operation not permitted
brctl shows only virbr0; you are trying to attach to lxcbr0
which, apparently, doesn't exist. I thought lxc created that but
you can add it with
brctl addbr lxcbr0
Mike
Thanks so much for this. It led me to virsh and eventually to the
Fedora doco at
https://fedoraproject.org/wiki/LXC
<https://fedoraproject.org/wiki/LXC>
Hmmm ... that doc is outdated in several ways.
which is where I should have searched first. After I start
libvirtd, it tells me to:
Edit the file /etc/lxc/default.conf and change the parameter
'lxc.network.link' from 'lxcbr0' to 'virbr0':
Then I can create and start a container successfully. Woo woo
There are at least several tools that make use of linux container
capabilites:
- lxc/lxd
- libvirt
- docker
- systemd-nspawn
IMHO the easiest way to use lxc is with lxd. Unofficial packages
exists (at least it did in the past) for fedora, but the easiest way
to get started with lxd is on ubuntu (a live trial is available on
https://linuxcontainers.org/lxd/try-it/).
Fajar,
I did consider using LXD, but it did not seem to have significant
benefits compared with LXC so I went with the tried-and-true. The
welcome page could have a better comparison of LXD vs plain LXC, and I
could have been persuaded!. Oh, and I use Fedora for my servers for
various reasons which might only matter to me. And Ubuntu on my desktops
and Chromebook.
Libvirt has its own lxc driver (http://libvirt.org/drvlxc.html), and
you manage it using 'virsh'. lxc1 has its own userland tools (e.g.
lxc-create), and by default should include an init script which
creates lxcbr0 (with its appropriate NAT rules). The wiki link you
mentioned mix both, using libvirt ONLY for the bridge, while using
lxc1 userland tools to manage the container. IMHO not an ideal setup.
Another thing, the page says 'debootstrap is necessary in order to
build Debian-based containers'. That is true if you want to build a
debian/ubuntu container from scratch, but for most users the
'download' template should be enough (and MUCH faster to create) and
it doesn't need debootstrap/dpkg installed on the host.
I used 'debootstrap', for a debian container, but I might have used
'download' if I knew more about it. For a person choosing an option
without more info, a fair guess would be 'use download if no other
choice is an option'. How could the cli communicate this better? Now I
have tried 'download', it is the old cli which I am used to.
My, the debian containers are basic.
# ls -al
bash: ls: command not found
Thanks for the info
Rick
--
Fajar
_______________________________________________
lxc-users mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-users