I'm currently creating Vagrant boxes of various Linux distros (mostly openSUSE) using KIWI. KIWI will include a Vagrantfile in the created box with the following contents:
Vagrant.configure("2") do |config|
config.vm.base_mac = "00163E010101" # <- this value is randomly generated at box build time
end
I've seen multiple base boxes with hard coded base_mac values, but haven't really found a reason for that. Also I've found reports of this causing issues, e.g. #9200.
Is this setting still required? I found #10080, which removed the need for this config for Virtualbox. But what about other providers?
Assuming I want to be compatible with older Vagrant releases, what is the recommended way to set a randomized MAC address, that differs between instances of the same box but persists over reboots?
Hi @dcermak - if I remember correctly, the base_mac setting is something VirtualBox needs for getting NAT networking working. Today Vagrant will auto-generate one if it doesn't exist inside the Vagrantfile, via https://github.com/hashicorp/vagrant/pull/10255
If you're wanting to stay compatible with older Vagrant releases, you'll probably need to include that option as I believe Vagrant was programmed to fail hard if it didn't exist in the guest. Thanks!
Thanks for the confirmation, it is then as I suspected.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Thanks for the confirmation, it is then as I suspected.