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.)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!