commit 398886bb3910375dcb762ba2510e6428a35a002b parent 0d6472fdd0307f03893d0347d435d25204b49326 Author: Andreas Gruhler <agruhl@gmx.ch> Date: Mon, 24 Nov 2025 07:50:03 +0100 feat: improve lxc config file Diffstat:
| M | config/lxc-config | | | 25 | +++++++++++++++++++++---- |
| M | deploy-output.sh | | | 1 | + |
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/config/lxc-config b/config/lxc-config @@ -5,7 +5,24 @@ lxc.arch = amd64 lxc.include = /usr/share/lxc/config/common.conf # Network configuration -lxc.net.0.type = veth -lxc.net.0.link = br0 -lxc.net.0.flags = up -lxc.net.0.name = eth0 +lxc.net.0.type = veth +lxc.net.0.link = br0 +lxc.net.0.flags = up +lxc.net.0.name = eth0 +lxc.net.0.hwaddr = 00:00:00:00:00:00 # ADJUST +lxc.net.0.ipv4.address = 10.0.0.113/24 # ADJUST + +# Autostart +lxc.start.auto = 1 +lxc.group = onboot + +# /etc/fstab mount entry +#lxc.mount.entry = /var/run/collectd collectd none bind,create=dir 0 0 + +# Run with specific apparmor profile +# https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html +#lxc.apparmor.profile = lxc-gatus + +# Host specific via deploy-output.sh +#lxc.uts.name = hostname +#lxc.rootfs.path = dir:/var/lib/lxc/hostname/rootfs diff --git a/deploy-output.sh b/deploy-output.sh @@ -47,5 +47,6 @@ cp "$output/lxc-config" $target_config echo -e "\nlxc.rootfs.path = dir:/var/lib/lxc/$name/rootfs" >> $target_config # set hostname +echo -e "\nlxc.uts.name = $name" >> $target_config echo "${name}.local" > "/var/lib/lxc/$name/rootfs/etc/hostname" sed -i "s/LXC_NAME/${name}.local/g" "/var/lib/lxc/$name/rootfs/etc/hosts"