我已经为创建容器安装了lxc,并且我已经完成了创建非特权容器的命令,但是当我这样做时我发现了这个错误:
[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
答案 0 :(得分:4)
lxc-create: ... Your system is not configured with subuids
根据上面的错误消息,听起来你正在尝试创建一个没有子配置的非特权容器。这些步骤适用于Ubuntu 14.04,但我怀疑它们也适用于Fedora。
$ 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
配置完成后,您应该能够创建一个ubuntu容器,如下所示:
$ lxc-create -t download -n u1 -- -d ubuntu -r trusty -a amd64
取自Ubuntu Server LXC指南: https://help.ubuntu.com/lts/serverguide/lxc.html#lxc-unpriv