Skip to content

Instantly share code, notes, and snippets.

@iankronquist
Last active August 29, 2015 14:27
Show Gist options
  • Save iankronquist/fc4970d8bcc1dac6bde6 to your computer and use it in GitHub Desktop.
Save iankronquist/fc4970d8bcc1dac6bde6 to your computer and use it in GitHub Desktop.
notes on lxc

Install lxc:

$ sudo yum install lxc lxc-templates lxc-extras

Build container:

$ sudo lxc-create -n test -t fedora

Change root password:

$ chroot /var/lib/lxc/test/rootfs passwd
$ sudo lxc-start --name test
lxc-start: conf.c: instantiate_veth: 2978 failed to attach 'veth4GJ2LK' to the bridge 'virbr0': No such device
lxc-start: conf.c: lxc_create_network: 3261 failed to create netdev
lxc-start: start.c: lxc_spawn: 826 failed to create the network
lxc-start: start.c: __lxc_start: 1080 failed to spawn 'test'
lxc-start: lxc_start.c: main: 342 The container failed to start.
lxc-start: lxc_start.c: main: 346 Additional information can be obtained by setting the --logfile and --logpriority options.

http://febru.soluvas.com/2015/03/solved-failed-to-attach-bridge-virbr0.html Oops, need to add the network bridge:

$ brctl addbr virbr0
# FIXME: can we use a different ip? I just got this from a blog post.
$ sudo ifconfig virbr0 10.0.5.1 netmask 255.255.255.0 up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment