pense-bête de bruno sanchiz

Accueil > Virtualisation > virtualisation : lxc

virtualisation : lxc

Publié le 8 avril 2017, dernière mise-à-jour le 9 avril 2017, 0 visites, 24155 visites totales.

apt-get install lxc lxctl

https://stgraber.org/2014/01/17/lxc-1-0-unprivileged-containers/

assigned a range of unused uids and gids, ideally a whole 65536 of them. You can then use those uids and gids with two standard tools called newuidmap and newgidmap which will let you map any of those uids and gids to virtual uids and gids in a user namespace.

$ lxc-create -t debian -n test
lxc_container: No mapping for container root
lxc_container: Error chowning /home/bruno/.local/share/lxc/test/rootfs to container root
lxc_container: You must either run as root, or define uid mappings
lxc_container: To pass uid mappings to lxc-create, you could create
lxc_container: ~/.config/lxc/default.conf:
lxc_container: lxc.include = /etc/lxc/default.conf
lxc_container: lxc.id_map = u 0 1345184 65536
lxc_container: lxc.id_map = g 0 1345184 65536
lxc_container: Error creating backing store type (none) for test
lxc_container: Error creating container test
  • /etc/lxc/lxc.conf => /.config/lxc/lxc.conf
  • /etc/lxc/default.conf => /.config/lxc/default.conf
  • /var/lib/lxc => /.local/share/lxc
  • /var/lib/lxcsnaps => /.local/share/lxcsnaps
    -* /var/cache/lxc => /.cache/lxc
[bruno sanchiz]