lxc patch 3
This commit is contained in:
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user