0

I use virtualbox created a centos7 vm, and there is a nat network adapter with dhcp mode.

after I started the vm, it get the IP 10.0.2.15/24, and it can access Internet via gateway 10.0.2.2,

enter image description here

but however in my host(win10), I don't find a IP address which in CIDR 10.0.2.0/24.

enter image description here (this is a windows XP snapshot replace of my win10, I post here for hiding my PC information)

1 Answer 1

1

VirtualBox NAT is done in userspace, independently from the host OS – the VBoxNetNAT.exe process contains the entire "router" and NAT engine. Packets from the guest cause VBoxNetNAT.exe to send packets over your host's Ethernet interface.

(Actually VBoxNetNAT doesn't even send raw IP packets – when it receives e.g. TCP SYN packets from a guest, VirtualBox uses a normal TCP socket to establish a new connection to the destination. When you create a "port forward" rule in VirtualBox, that's not an actual DNAT rule – it just makes VBoxNetNAT itself listen for connections on 127.0.0.1, and when it receives a connection it generates fresh TCP SYN packets for the guest.)

3
  • Also, from the screenshots, I believe you may have accidentally installed Windows XP into your host instead of Windows 10 Commented Jun 5, 2022 at 5:25
  • so the host cannot communicate to the vm, right? Commented Jun 6, 2022 at 12:13
  • They kind of can, but the host has to go through the same "port forward" rules, and has to connect to 127.0.0.1 where VBoxNetNAT is listening – you cannot directly reach 10.0.2.x from the host. In the opposite direction, when the guest wants to reach the host, it can do so through 10.0.2.1 (which is forwarded to the host's "localhost"). Commented Jun 6, 2022 at 12:43

You must log in to answer this question.

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