Skip to content

Commit 42fcc90

Browse files
committed
Replace use of ifupdown w/ systemd-network
ifupdown & cloud-init don't play well together in debian 13. cloud-init generates an `inet6` line for ipv6 dhcp and dhclient doesn't like them.
1 parent 7f9f8e8 commit 42fcc90

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

demo-vm.sh

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -171,27 +171,6 @@ EOF
171171
[[ -d /boot/efi ]] || mkdir /boot/efi
172172
mount -a
173173
174-
# cloud-init will find the network interface from metadata but we must source
175-
# the files from 'interfaces.d' to get debian to put them into effect
176-
cat <<EOF > /etc/network/interfaces
177-
source /etc/network/interfaces.d/*
178-
179-
auto lo
180-
iface lo inet loopback
181-
EOF
182-
183-
echo "vm-instance" > /etc/hostname
184-
185-
cat <<EOF > /etc/hosts
186-
127.0.0.1 localhost
187-
127.0.1.1 vm-instance
188-
189-
# The following lines are desirable for IPv6 capable hosts
190-
::1 localhost ip6-localhost ip6-loopback
191-
ff02::1 ip6-allnodes
192-
ff02::2 ip6-allrouters
193-
EOF
194-
195174
debconf-set-selections <<EOF
196175
tzdata tzdata/Areas select America
197176
tzdata tzdata/Zones/America select Los_Angeles
@@ -211,7 +190,13 @@ EOF
211190
212191
# Stop anything overriding debconf's settings
213192
rm -f /etc/default/locale /etc/locale.gen /etc/default/keyboard
214-
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes locales linux-image-amd64 grub-efi-amd64 overlayroot cloud-init
193+
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes locales linux-image-amd64 grub-efi-amd64 overlayroot cloud-init openssh-server
194+
DEBIAN_FRONTEND=noninteractive apt-get remove --assume-yes ifupdown
195+
196+
# ifupdown & cloud-init don't play well together in debian 13
197+
# cloud-init generates an `inet6` line for ipv6 dhcp and dhclient doesn't like these
198+
# https://lists.debian.org/debian-devel/2025/10/msg00201.html
199+
systemctl enable systemd-networkd
215200
216201
# Add console=ttyS0 so we get early boot messages on the serial console.
217202
sed -i -e 's/^\\(GRUB_CMDLINE_LINUX="[^"]*\\)"$/\\1 console=ttyS0"/' /etc/default/grub

0 commit comments

Comments
 (0)