Reputation: 3
I've installed lxc for create containers and I've done the commands for create unprivileged containers but I've this errors when I do:
[andrea@andrea lxc]$ lxc-create -t download -n prova0
lxc-create: conf.c: chown_mapped_root: 3406 No mapping for container root
lxc-create: lxccontainer.c: do_bdev_create: 943 Error chowning /home/andrea/.local/share/lxc/prova0/rootfs to container root
lxc-create: conf.c: suggest_default_idmap: 4444 Your system is not configured with subuids
lxc-create: lxccontainer.c: do_lxcapi_create: 1408 Error creating backing store type (none) for prova0
lxc-create: lxc_create.c: main: 274 Error creating container prova0
Upvotes: 0
Views: 4702
Reputation: 699
lxc-create: ... Your system is not configured with subuids
As per the above error message, it sounds like you're trying to create an unprivileged container without subuids configured. These steps are for Ubuntu 14.04, but I suspect they will work on Fedora as well.
$ mkdir -p ~/.config/lxc
$ echo "lxc.id_map = u 0 100000 65536" > ~/.config/lxc/default.conf
$ echo "lxc.id_map = g 0 100000 65536" >> ~/.config/lxc/default.conf
$ echo "lxc.network.type = veth" >> ~/.config/lxc/default.conf
$ echo "lxc.network.link = lxcbr0" >> ~/.config/lxc/default.conf
$ echo "$USER veth lxcbr0 2" | sudo tee -a /etc/lxc/lxc-usernet
Once these are configured, you should be able to create an ubuntu container, as follows:
$ lxc-create -t download -n u1 -- -d ubuntu -r trusty -a amd64
Taken from the Ubuntu Server LXC guide: https://help.ubuntu.com/lts/serverguide/lxc.html#lxc-unpriv
Upvotes: 4