lxc-create -n name -t debian -- -r stretch -a armhf
distro=stretch targetdir=$(pwd)/debian_stretch #arch=amd64 arch=armhf mkdir -p $targetdir sudo debootstrap --include=lxc --arch=$arch --foreign $distro $targetdir/rootfs sudo chroot $targetdir/rootfs
/etc/network/interfaces (host)
auto lxcbr0 iface lxcbr0 inet static bridge_ports none bridge_fd 0 bridge_maxwait 0 address 10.0.3.1 netmask 255.255.255.0 # broadcast 10.0.3.255
dnsmasq für DHCP-Server
/var/lib/lxc/containername/config
lxc.start.auto = 1 #lxc.start.delay = 0 (in seconds) lxc.start.delay = 5 #lxc.start.order = 0 (higher means earlier) #lxc.start.order = 0 lxc.network.type = veth lxc.network.link = lxcbr0 lxc.network.flags = up #optional bei fester IP-Adresse lxc.network.ipv4 = 10.0.3.10/24 lxc.network.ipv4.gateway = auto lxc.mount.entry = /var/www /var/lib/lxc/stretch-web/rootfs/var/www/ none bind 0 0
lxc-start -n name lxc-stop -n name
anzeigen des Status:
lxc-ls --fancy
lxc-console -n name
beenden mit Strg+A,q
lxc-attach -n name -- /usr/local/sbin/script.sh