1

Please correct me if I am wrong in saying that network adapters(not considering virtual network adapters) represent a particular interface of a machine having a unique MAC address which can establish connectivity to the internet.

Considering that above is correct, I want to know the role of the virtual network adapters which crop up when we set up a guest OS inside VirtualBox. Do these represent the physical interface of the machine running the guest OS-i.e. the machine that we set up inside VirtualBox. If yes, then when I change the virtual adapter's IP by visiting its settings inside the host OS(say Windows), why doesn't the IP of the guest OS(say Ubuntu) become equal to the changed value.

Also, I would be grateful if the function of the virtual adapters in reference to NAT, bridged, internal and Host-only networking is explained. Also, is Virtual Network Adapter not required in NAT mode? Thanks in advance.

3

Please correct me if I am wrong in saying that network adapters(not considering virtual network adapters) represent a particular interface of a machine having a unique MAC address which can establish connectivity to the internet.

Mostly correct.

I want to know the role of the virtual network adapters which crop up when we set up a guest OS inside VirtualBox.

The following is a bit simplified to explain things.

One of the things a virtualization application does is to emulate or "paravirtualize" all the hardware that the guest OS sees. VirtualBox lets you create or select a large file to be the virtual system's hard drive, and part of VirtualBox's job is to intercept the guest OS's attempt to access a hard drive and instead redirect it to reading/writing the appropriate bits of the file you selected. It's the same concept with the virtual network adapter - VirtualBox intercepts the guest OS's attempt to send packets to a hardware NIC and does other things with it.

With networking, typically you want to be able to use your Internet normally outside of the guest, at the same time as the guest is using the Internet. Furthermore most operating systems allow the creation of virtual network adapters - for VPNs and such - such adapters have nothing to do with virtualization in and of themselves, but can be used to assist in virtualization. Leveraging this facility, VirtualBox can create a virtual network adapter on the host side and then assume some functions of a router and/or DHCP server, unbeknownst to the guest OS, of course. So this is why there isn't a strict "1:1" correspondence between your real system's hardware and the virtual hardware - you have things like NAT and bridged mode. "Bridged mode" is going to be closest to having your real hardware NIC inside the VM.

So you need to think of the VirtualBox NIC on your host and the virtual NIC inside the VM as two separate and distinct NICs on their own small, virtual network.

Thus, When you change the host side NIC, it won't affect the guest side NIC since logically, they are two different NICs.

Having this gives you a lot of control, and I'm not sure you can set it up another way unless VirtualBox allows it (confession: I use VMWare). From what I remember Virtual PC doesn't set up virtual NICs, but you have a lot less control of where TCP/IP traffic from VMs are going; this may have changed since the last time I messed with it.

1

network adapters(not considering virtual network adapters) represent a particular interface of a machine having a unique MAC address which can establish connectivity to the internet.

or not.

Considering that above is correct, I want to know the role of the virtual network adapters which crop up when we set up a guest OS inside VirtualBox. Do these represent the physical interface of the machine running the guest OS-i.e. the machine that we set up inside VirtualBox.

Yes, although strictly speaking there are no physical interface with a guest OS as everything is virtualized.

If yes, then when I change the virtual adapter's IP by visiting its settings inside the host OS(say Windows), why doesn't the IP of the guest OS(say Ubuntu) become equal to the changed value.

For the same reason a router IP address doesn't pick the ones of packets travelling through it. IP address(es) and MAC address are bounded for the host. Packets from the VM might have a different MAC address and a different IP address, depending on you you configure the VM networking.

Also, I would be grateful if the function of the virtual adapters in reference to NAT, bridged, internal and Host-only networking is explained. Also, is Virtual Network Adapter not required in NAT mode?

  • NAT won't change the host MAC and IP addresses when VM traffic occur.
  • Bridged will change both.
  • Internal and Host only won't reach the physical NIC.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.