How to get eth0 and wlan0 back in RPi OSMC?

I just discovered that my scripts dealing with reporting networking issues are not working on OSMC RPi devices anymore…

On a RPi running Pi-OS there is a config item to switch the naming on/off inside raspi-config, but that does not exist on OSMC.

On my latest device Ethernet is named enxb827eb2cf332 for example, i.e. a name that cannot ever be used in a script intended to be run on any RPi device.

I need eth0 and wlan0 as the first Ethernet and WiFi adapters in order for my scripts to work on all devices.

How can I change this?
My Google skills are not giving me any results pertaining to OSMC, unfortunately…

Mhhh, my RPi 4 has kernel 5.15.83-2-osmc and shows ifconfig names eth0 and wlan0.

What OSMC build and RPi hw you refer to seeing predictable enx... ifnames?


This is indeed the big question.

My understanding is that this is the default on newer versions of Debian unless
net.ifnames=0 biosdevname=0 is passed in cmdline.txt for some years.

But obviously we mitigated this here:

It took a lot of time to dig up and remember the commit that retained this behaviour.

Stop fucking around with your system in weird ways and then coming here for help without any logs or description of what you’ve done.

We support OSMC, but we’re not a Linux consultancy. From your description, you’re not running an OSMC system. It takes a lot to annoy me, but you really have reached that threshold.

And a please and thank you occasionally would be nice.


I am sorry!
Please accept my thanks for the support given!

What happened was:
I made a clone of a working OSMC SDcard using the “SD Card Copier” on a regular RPi4 running Pi-OS. This was in order to get a system that would run on my summer home installation with WiFi.

The clone worked seemingly well when viewed on the TV screen.
But when I got to the summer home and started it there I never got the report the script was supposed to send with the IP address of the device. The same SSID/passphrase is used for WiFi on both locations.

Now I have checked all running OSMC instances I can connect to using SSH and found that the ONLY one exhibiting this problem is the “clone” made using the Pi-OS utility.
So the supposed copied SDcard is not really a clone, instead the copy process changes the networking settings (and what not more?)

The versions of the 3 OSMC boxes are:
19.4.0-1 (OK)
19.5.0-14 (OK)
19.5.0-14 (clone - not OK)

Both 19.5.0-14 devices run on RPI3B hardware.

On the problem device I have this in cmdline.txt:
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp2
and on the one running the same version OK this:
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp2

Which is the same on both…

Sorry for the noise, closing this thread.