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" -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
|
||||
lxc-start -n "$CONTAINER"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user