===================================== LXC ===================================== Appunti :Author: Andrea Manni :Copyright: GFDL :Version: 0.1 Questi appunti sono ad uso privato. .. sectnum:: .. contents:: Indice degli argomenti .. |date| date:: Generato il |date| con: http://docutils.sourceforge.net/rst.html Links ========== * https://wiki.debian.org/LXC#Supported_versions_of_LXC * https://linuxcontainers.org/lxc/getting-started/ Usage ======= :: lxc-create -t download -n stretch // Creare un LXC lxc-start -n stable -d lxc-attach -n stretch lxc-stop -n stable -d lxc-destroy -n stable Networking =============== Fin tanto che e' disponibile lxc-net e' tutto abbastanza automatico, l'host gestisce un bridge e il client parte con un dhcp-client. /etc/default/lxc-net :: USE_LXC_BRIDGE="true" /etc/lxc/default.conf :: lxc.network.type = veth lxc.network.link = lxcbr0 lxc.network.flags = up lxc.network.hwaddr = 00:16:3e:xx:xx:xx service lxc-net restart Path dei containers: /var/lib/lxc/stretch/rootfs OverlayFS =============== Main guide: https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt Esempio con un chroot:: ls merged stretch upper work mount -t overlay -o lowerdir=stretch/,upperdir=upper,workdir=work none merged .. NOTE:: workdir has to exist and be empty, colud be a hidden file :: mount -t overlay -o lowerdir=stretch/,upperdir=nrupper,workdir=.work none newroot