0

I am planning to create a full clone on the same drive as the existing virtual machine (VM). There is a slight possibility I will run both VMs at the same time.

I have read the explanations about the MAC address options in VirtualBox Manual Chapters 1.13 and 8.39, but I am stumped as to which to choose.

Section 1.13 states that the "Generate New MAC Addresses For All Network Adapters value" in GUI dialog "is the default setting," while Chapter 8.39 states that "the default behavior is to reinitialize the MAC addresses of each virtual network card." Although these may be the same, my sense is that I want the latter but I don't have sufficient experience or knowledge to resolve this.

I would appreciate a reference that sheds more light on this issue and any advice.

3
  • 1
    A virtual machine uses the host network adapter, and here (using VMware) I cannot change the MAC address of the virtual adapter. But I do not think this affects making a copy of a machine (which I have done).
    – anon
    Commented Dec 22, 2020 at 22:11
  • 1
    @John: It's very rare that they directly use the host adapter though. Most of the time, the VM host software just relays the MAC frames back and forth, but still emulates a separate piece of hardware in each VM, complete with its own MAC address. Only on servers you'd find PCI passthrough for network interfaces (SRIOV etc). (And maybe USB passthrough for Kali users...) Commented Dec 22, 2020 at 22:18
  • I meant virtual adapter, not real adapter. Sorry for the confusion here.
    – anon
    Commented Dec 22, 2020 at 22:21

1 Answer 1

2

Yes, "network adapter" and "virtual network card" mean the same thing here, as do "reinitialize" and "generate new".

IMO, generating a new MAC address is the preferred choice – do it unless the VM contains some licensed software that would break if the address changed.

  • If the VMs will be connected to the same network in "bridge" mode or "host-only" mode, and if they ever run at the same time, then they must have different MAC addresses for those interfaces.

    (If you're careful to run only one VM at a time, then identical MACs won't cause immediate problems, but it's easy to mess it up.)

  • Interfaces which are guaranteed to be in "NAT" mode can safely have duplicate MACs, because those will be invisible to the host or to other VMs anyway.

Note that the MAC address can always be changed later in the VM settings (Network page).

5
  • Thank you for your detailed comments. After considering both the VM VirtualBox Manager dialog and command line options, I decided to use the former, selecting the Generate New MAC Addresses option and accepting all of the defaults. The clone generated successfully. Thanks again.
    – w2tq
    Commented Dec 23, 2020 at 22:03
  • Hey thanks for your answer. I have a further question: "Interfaces which are guaranteed to be in "NAT" mode can safely have duplicate MACs" -----> theoretically speaking, any idea on how would you route incoming requests to two separate virtual machines with duplicate MACs? (i can go read / write software to do it, but I have no idea on what to actually do!)
    – BenKoshy
    Commented Oct 19, 2023 at 21:42
  • 1
    @BenKoshy: If you select "NAT" in VirtualBox, it puts each VM in its own virtual subnet with VirtualBox itself acting as the router and switch (the network is entirely invisible to the host OS); within that subnet the MAC is never duplicate because there's only one VM in it anyway, isolated from the others. And the only way to route something to a "NAT"-mode VM interface in the first place is to set up "port forwarding" in VirtualBox to direct a specific TCP or UDP port to that VM('s virtual subnet). Commented Oct 20, 2023 at 4:31
  • @BenKoshy: If it were Qemu/KVM which exposes a 'tap' interface for each VM to the host (sort of like VirtualBox "host-only" mode but separate for each VM), it would also not be an issue as long as those interfaces were kept separate (i.e. not put in a shared bridge); they would need to be assigned non-duplicate IP subnets at least, but once the host system's IP routing table determined which subnet and which interface to route packets through, MAC address lookup (ARP queries) would only happen within that interface. Commented Oct 20, 2023 at 4:35
  • @BenKoshy: However, it would become an issue with "bridged" and "host-only network" modes (or even "custom NAT network" mode), or systems like Hyper-V or ESXi, where all the VMs are put on a few shared subnets. There is no general way of dealing with duplicate MACs within a subnet; you just have to avoid that situation. (Though duplicate static IPs at unique MACs can be kinda, sorta, worked around using static ARP, but most VM platforms don't expose the equivalent "static MAC/port binding" mechanism in their virtual switches at all.) Commented Oct 20, 2023 at 4:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .