0

I have installed VirtualBox on Windows 11. Then I have installed virtual machine (ubuntu) in bridged mode so ubuntu could get an IP address from dhcp server. Windows 11 gets ip address 10.0.1.113 and ubuntu virtual machine gets 10.0.1.111. When i'm pinging from another computer within the same subnet ( 10.0.1.158 ) i'm getting proper ping response but both IP addressess (10.0.1.113 nad 10.0.1.158) have the same MAC address. Is there any option in VirtualBox or whatever else to have different MAC address for computer and vm installed on this computer ?

2
  • 1
    How are you determining they are the same MAC address?
    – Ramhound
    Commented Oct 11, 2023 at 12:52
  • Ramhound, I'm pinging from 10.0.1.157 and then i'm doing arp -a | find "10.0.1.113" and arp -a | find "10.0.1.111" - both IP's have the same mac address
    – admfotad
    Commented Oct 11, 2023 at 12:55

1 Answer 1

2

I'm guessing your computer is connected using Wi-Fi. The issue with that is it's impossible for a typical Wi-Fi client device to send packets from a MAC address that's different from its "associated" MAC. Ordinary bridging would be impossible with a Wi-Fi interface; VirtualBox only makes it work by rewriting the VMs' packets to have the host's MAC address before they're sent out (essentially doing MAC-level NAT).

(DHCP still works and issues different addresses to the VMs because the DHCP requests have their own "client MAC address" field, as well as having a whole separate "DHCP client ID" on top of that – the DHCP server thinks that your host is obtaining a lease on behalf of some other device.)

The only realistic option to get unique MAC addresses (if that's something that is necessary in your case) is to use an Ethernet connection for your VM host.


(It is also possible to have VirtualBox tunnel the VMs' traffic inside UDP and have some other Ethernet-connected device decapsulate them, but that of course only works if you actually have another Ethernet-connected device to act as your relay... preferably one that runs Linux.)

1
  • Thnx for answer and yes, you're right - I was connected via WiFi. Thanks for explanantion.
    – admfotad
    Commented Oct 12, 2023 at 6:29

You must log in to answer this question.

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