Use systemd-network over NetworkManager with Torizon OS minimal

I am working on building a custom Torizon OS minimal that I would like to utilize the systemd–network instead of NetworkManager. I have another Yocto project from a different product that does this and I would like to utilize what I already have in place.
What would I have to add to the local.conf to disable NetworkMangager?

What would I have to add to the local.conf to ensure the systemd-network is enabled.

I already have the recipes for all the systemd network files required.

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I’d be glad to help! To provide the most accurate guidance for your Torizon OS build configuration, could you let me know which version of Torizon OS you are using? You can get this information by running the tdx-info command on your device or check the tdx-info documentation for more details.

Disabling NetworkManager and Enabling systemd-networkd

Based on the Toradex documentation, here’s what you need to add to your local.conf:

To Disable NetworkManager

Add these lines to remove NetworkManager packages (1):

IMAGE_INSTALL:remove = " connman"  
IMAGE_INSTALL:remove = " connman-client"  
IMAGE_INSTALL:remove = " connman-gnome"  
IMAGE_INSTALL:remove = " connman-plugin-wifi"  
IMAGE_INSTALL:remove = " connman-plugin-ethernet"  
IMAGE_INSTALL:remove = " connman-plugin-loopback"  
# Add NetworkManager  
IMAGE_INSTALL:append = " networkmanager"  
IMAGE_INSTALL:append = " modemmanager"  

(1)

However, since you want to use systemd-networkd instead of NetworkManager, you should remove NetworkManager entirely rather than adding it.

To Enable systemd-networkd

The documentation shows that systemd-networkd can be enabled by ensuring the networkd PACKAGECONFIG is included (1). You would typically add this to your systemd bbappend file or local.conf:

PACKAGECONFIG:append = " networkd"

(1)

Additional Considerations

Since you mentioned you already have recipes for systemd network files, you’ll want to ensure they follow the integration pattern shown in the documentation (1). The network files should be installed to the appropriate systemd network directories as demonstrated in the systemd configuration examples.

Once you specify your Torizon OS version, I can provide more specific guidance tailored to your exact build configuration.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Greetings @pachanga,

Could you clarify what you want to achieve exactly when you say:

What would I have to add to the local.conf to ensure the systemd-network is enabled.

Systemd-networkd is already in Torizon OS by default as it’s a component of systemd. Do you just want to disable NetworkManager? In which case I guess you can just disable the systemd service which would stop NetworkManager from running entirely by default. Probably something like should work:

SYSTEMD_AUTO_ENABLE:networkmanager = "disable"

If you want to remove NetworkManager completely it’s a bit more work as you need to remove the networkmanager package from being installed in the final image.

Best Regards,
Jeremias

Hi Jeremias

SYSTEMD_AUTO_ENABLE:networkmanager = “disable” did not work for me.

I was able to do this.

CORE_IMAGE_BASE_INSTALL:remove = " networkmanager "

Once I got rid of the network manager, The network adapter no longer came up. I had to include a start script that called

ifconfig up

to manually get the network adapter up and running after boot. Is there another way that you know of?

to manually get the network adapter up and running after boot. Is there another way that you know of?

Well we don’t test Torizon OS at all without NetworkManager so it’s hard to say what exactly is needed, or different without it running. We’re talking about a completely different custom OS that we don’t test ourselves now. If ifconfig up works for you then I don’t see a problem with just using this however.

Best Regards,
Jeremias