Fedora based LXC containers and no network on startup

fazowy

Member
Mar 30, 2022
5
4
8
Hi.

After pve-container package upgrade from 4.4-4 to 4.4-6 LXC containers based on Fedora image do not start with systemd-networkd service enabled. Little spelunking into proxmox git repository gives this commit:

add setup_systemd_preset helper, disable networkd for debian 12+
https://git.proxmox.com/?p=pve-container.git;a=commit;h=e11806e0de064e6570d40e7c04bc4656687b2c62

and diff for Fedora.pm
Python:
--- a/src/PVE/LXC/Setup/Fedora.pm
+++ b/src/PVE/LXC/Setup/Fedora.pm
@@ -35,13 +35,12 @@ sub setup_init {
     my $version = $self->{version};
 
     if ($version >= 37) {
-       # systemd-networkd is disabled by the preset in >=37, reenable it
        # this only affects the first-boot (if no /etc/machien-id exists).
-       $self->ct_mkdir('/etc/systemd/system-preset', 0755);
-       $self->ct_file_set_contents(
-           '/etc/systemd/system-preset/00-pve.preset',
-           "enable systemd-networkd.service\n",
-       );
+       $self->setup_systemd_preset({
+           # systemd-networkd is disabled by the preset in >=37 in favor of
+           # NetworkManager, reenable it, since we make use of it.
+           'systemd-networkd.service' => 0,
+       });
     }
 }

Looks like description is ok but there is a typo in implementation:
'systemd-networkd.service' is set to 0, should be 1.
 
Lovely, thanks, was banging my head to "is my network config for the node broken"! :-D
 
It looks like that this is still broken in late April 2024.

(Just downloaded the Fedora 38 LXC template, and it still reports that the network is down on first start up.)