[lxc-users] Problems with lxc-create

Jan Kowalsky jankow at datenkollektiv.net
Fri Apr 19 20:06:25 UTC 2019


Hi Sherab,

Am 19.04.19 um 21:12 schrieb wisdomlight at protonmail.com:
> Hi
> below is my attempt to create a container - mycontainer
> I don't know what it all means.
> 
> help please
> 
>> sherab at sherab-Librem-13-v2:~$ lxc-create -n mycontainer -t ubuntu

it looks like you try to create a unprivileged container as a non root
user.

This is possible, but:

you need

1.) a special template
2.) a uidmap configuration and some other prerequisites.

>> lxc-create: mycontainer: parse.c: lxc_file_for_each_line_mmap: 100 No such file or directory - Failed to open file "/home/sherab/.config/lxc/default.conf"
>> lxc-create: mycontainer: conf.c: chown_mapped_root: 3126 No uid mapping for container root
>> lxc-create: mycontainer: lxccontainer.c: do_storage_create: 1288 Error chowning "/home/sherab/.local/share/lxc/mycontainer/rootfs" to container root
>> lxc-create: mycontainer: conf.c: suggest_default_idmap: 4738 You must either run as root, or define uid mappings
>> lxc-create: mycontainer: conf.c: suggest_default_idmap: 4739 To pass uid mappings to lxc-create, you could create
>> lxc-create: mycontainer: conf.c: suggest_default_idmap: 4740 ~/.config/lxc/default.conf:
>> lxc-create: mycontainer: conf.c: suggest_default_idmap: 4741 lxc.include = /etc/lxc/default.conf
>> lxc-create: mycontainer: conf.c: suggest_default_idmap: 4742 lxc.idmap = u 0 100000 65536
>> lxc-create: mycontainer: conf.c: suggest_default_idmap: 4743 lxc.idmap = g 0 100000 65536
>> lxc-create: mycontainer: lxccontainer.c: do_lxcapi_create: 1869 Failed to create (none) storage for mycontainer
>> lxc-create: mycontainer: tools/lxc_create.c: main: 327 Failed to create container mycontainer

look here:
  https://linuxcontainers.org/lxc/getting-started/

https://www.cyberciti.biz/faq/how-to-create-unprivileged-linux-containers-on-ubuntu-linux/

Or just run

  sudo lxc-create -n mycontainer -t ubuntu

for privileged containers.

Best regards
Jan


More information about the lxc-users mailing list