lxc patch 3

This commit is contained in:
2026-04-11 10:02:40 -04:00
parent 18c6972b23
commit 47d7995b13
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -9,6 +9,19 @@ echo "Creating LXC container ${CONTAINER}..."
# lxc-create -n "$CONTAINER" -t download -- -d ubuntu -r noble -a amd64 # lxc-create -n "$CONTAINER" -t download -- -d ubuntu -r noble -a amd64
lxc-create -n "$CONTAINER" -f /etc/lxc/default.conf -t download -- -d ubuntu -r noble -a amd64 lxc-create -n "$CONTAINER" -f /etc/lxc/default.conf -t download -- -d ubuntu -r noble -a amd64
# configure DHCP before first boot
mkdir -p "/var/lib/lxc/${CONTAINER}/rootfs/etc/netplan"
cat > "/var/lib/lxc/${CONTAINER}/rootfs/etc/netplan/10-dhcp.yaml" <<EOF
network:
version: 2
ethernets:
eth0:
dhcp4: true
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
EOF
# start it # start it
lxc-start -n "$CONTAINER" lxc-start -n "$CONTAINER"
+2
View File
@@ -5,6 +5,8 @@
lxcfs.enable = true; lxcfs.enable = true;
}; };
networking.networkmanager.unmanaged = [ "br0" ];
virtualisation.lxc.defaultConfig = '' virtualisation.lxc.defaultConfig = ''
lxc.net.0.type = veth lxc.net.0.type = veth
lxc.net.0.link = br0 lxc.net.0.link = br0