Error: Failed to start device "eth0": Failed to set the MAC address: Failed to run: ip link set dev mac217

Since a few weeks I get the error below on VMs on Ubuntu 20.04 LTS.

lxc start VM-DA-01
Error: Failed to start device "eth0": Failed to set the MAC address: Failed to run: ip link set dev mac217a72af address 02:00:00:EX:AM:PLE exit status 2 (RTNETLINK answers: Address already in use)

I use MACVLAN with MAC Address assignment. Nothing special. This problem has been happening for a while (1 or 2 weeks?) and then I can’t start the VMs. I have to reboot the host after this error.

Any idea?

Hi, not that this helps you, but I’m having the same issue on Ubuntu Server 22.04 x86_64 on a physical server and LXD Snap 5.7-c62733b. Using MACVLAN for instances.

Windows VM disconnects from the network, and when I restart it LXD errors with the same message and it won’t start the VM.

Just restarted the host recently for this, but will try find a way around this for now.

I notice that the dev name changes every time I try start the VM…

Failed to run: ip link set dev macd8b62eeb address 00:16:3e:87:19:1f
Failed to run: ip link set dev macef515ed2 address 00:16:3e:87:19:1f
Failed to run: ip link set dev mac99318f7d address 00:16:3e:87:19:1f
...

You can manually delete the device and start the VM:

ip link show | grep -B 1 '00:16:3e:87:19:1f'
    29: maca35b59f9@eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 500
    link/ether 00:16:3e:87:19:1f brd ff:ff:ff:ff:ff:ff

sudo ip link delete maca35b59f9
lxc start vmname

The issue is that all my VMs are having this issue, Windows and even Ubuntu Desktop image from the default repo images.linuxcontainers.org and while they are running, so not just a thing at reboot. They are dropping off the network.

Time to raise a ticket.

1 Like

Yep, this problem is new. Interesting issue.

raised issue:

1 Like

It happened again today. But I see the root cause has been found. Nice @tomp !