Vagrant: [question] Is config.vm.base_mac still required in a base box?

Created on 2 Jul 2019  ยท  3Comments  ยท  Source: hashicorp/vagrant

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?

References

  • #10080
  • #9200
question

Most helpful comment

Thanks for the confirmation, it is then as I suspected.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gwagner picture gwagner  ยท  3Comments

dorinlazar picture dorinlazar  ยท  3Comments

hesco picture hesco  ยท  3Comments

OtezVikentiy picture OtezVikentiy  ยท  3Comments

RobertSwirsky picture RobertSwirsky  ยท  3Comments