Getting and Setting Incus Mac Addresses
May 30, 2026
Get the mac address for a given CONTAINER and NIC.
incus config get CONTAINER volatile.NIC.hwaddr
You can use this script to create random virtual mac addresses. This assumes you have a scripts directory in your PATH.
/usr/src/scripts.d/local-$HOSTNAME/make-mac.sh
#!/bin/bash
perl -e 'printf "00:16:3E:%02X:%02X:%02X\n", rand 0xFF, rand 0xFF, rand 0xFF'
exit 0
Make it executable and try it out.
chmod 755 /usr/src/scripts.d/local-$HOSTNAME/make-mac.sh
make-mac.sh
00:16:3E:61:3A:53
If you need to edit the mac address, try this.
incus config edit CONTAINER
...
config:
volatile.eth0.hwaddr: 00:16:3E:61:3A:53
...