Windows 10 How is the Networking regulated in Virtual Machines?

aadesh123

New Member
Joined
Feb 28, 2021
Originally, I thought that all of the network traffic in a guest OS directly goes through the host OS and whatever firewall regulation is on the host OS, will also be applied onto the guest OS. But it turns out that this is completely false. As far as I understand it, the network-relationship between the host and guest OS is like sharing mobile data connection via hotspot tethering, as in even though the guest is reliant on the host, the guest totally ignores the network rules and setup on the host machine. This came as a massive shock to me. I've looked this up but haven't found any useful information.
Can someone explain why does it function in this way and how does the process really work?
My aim is to make the guest machines also follow the firewall rules on the host machine and optionally monitor their network usage.
Thanks
 
It functions this way because the virtual machine exists on the host machine, and the host machine's firewall rules are typically tied to operations, software, and events taking place on the host machine itself. Because the guest operating system is virtualized, it has its own software firewall rules and virtualized network adapter that are segmented/isolated from the host.

The VM software you are using most likely has several network adapter options including Bridge Mode, NAT, and Host-only. If you use NAT your guest VM will share the same IP as the host. If you use bridge, the host's router will assign it as a local device on the same network as the host (unique IP on the LAN). Host-only will let you route through a token ring or non-Ethernet network. In a host-only setup, the VM software itself acts as a sort of DHCP server and software router.

Typically the VM appliance, if it is software like Hyper-V, VMware Workstation, or VirtualBox, has unrestricted access to the same router the host machine is connected to. There are ways to create a virtual firewall or switch, but that depends on what you are using. One easy solution might be to export the firewall rules on the host machine and import them to the VM's guest OS (presumably Windows), making whatever changes you may see necessary.

You should be able to define firewall rules on your physical router that affect both the host machine and the virtual machine(s).
 
Back
Top Bottom