Homelab with multiple types of devices with different network interface names? Help

Hi all,

First of all I’d like to say thanks to the LXC/LXD team, I started learning about it a few days ago and I absolutely love it.

I wanted to run a cluster on using my home devices, but I encountered an issue that I don’t know how to solve. It’s not a bug or anything, I’m just asking for help on how to do it.

I have a desktop machine, a laptop & 1 raspberry pi all running Ubuntu 20.04. When I ran lxd init on the desktop machine, I referenced the physical interface (called enp5s0) because I want to be able to access containers accross all my devices, and I created a cluster with all the machines I have.

The issue is, when I started creating containers, it was erroring out anytime a container got created on any machine other than the desktop, because the laptop & raspberry pi don’t have an interface called “enp5s0”, they have other interface names (eg: wlp61s0 for the laptop).

Now my question is, how can I solve this? Because I have no idea where to start!

Running LXD 4.21.
Any help is very appreciated, thanks!

Ah yeah, I suspect this setup a macvlan device for you with the parent set to enp5s0.

Can you show lxc profile show default ?

I suspect you could fix that with:

  • lxc profile device remove default eth0
  • lxc network create default --type=macvlan parent=enp5s0 --target desktop
  • lxc network create default --type=macvlan parent=wlp61s0 --target laptop
  • lxc network create default --type=macvlan parent=eth0 --target rpi
  • lxc network create default
  • lxc profile device add default eth0 network=default name=eth0

Though I see another problem there, the wlp61s0 indicates your laptop is on wireless. You cannot bridge or use macvlan on Wifi as authentication is performed through the MAC addresses.

So you’ll either need to get your laptop on wired networking or you’ll need to use something else for your network. If all systems are using the Ubuntu kernel, the Fan networking may be the easiest option for such an environment.

Hi Stéphane, thanks for the help.

So I tried the solution you sent with a bit of a tweak. I created an empty profile called lab, and tried to create a network called lab and attach it to it. Here’s the commands:

Note: blackship is the desktop, blackpearl is the laptop, which I got wired now.

It fails at the last step when trying to attach it to the profile. Any ideas why?
I could go with Ubuntu Fan (I saw you video on it yesterday and it looks great) but I want try the first solution first because then I’m not bound to Ubuntu kernels, I can use anything.

Thanks again.

So I managed to fix the issue by adding “net.ifnames=0” to the kernel parameters, which effectively renames the ethernet interface to eth0, and wireless to wlan0.

Since this is a homelab I think this is a good solution (and I didn’t like the enp* names anyway).

Thank again for the help.