If you’ve tried changing the MAC address on a recent Ubuntu VM running under KVM/QEMU, you may have noticed that changing the address in the VM configuration on the host (or in Cockpit) yields no result in the guest machine. Also, a MAC address change done using either Virtualmin’s configuration or the command line on the guest doesn’t survive a reboot.
That happens because Ubuntu 20.04 LTS uses Netplan to manage networking, which also means that none of the old /etc/sysconfig/network or network-scripts/ifup-... methods would work here.
Netplan writes an interface-specific configuration file under /etc/netplan/[interface-name].yaml that is read on every boot and needs to be edited to correct the currently assigned virtual machine MAC address:
A system restart might be required after the change (netplan apply had no effect in my tests).