Will VPN work when running on guest?

If I run VPN on a guest W10 virtual machine will the internet activity on the guest go through the VPN? Does it matter whether I use Nat or Bridge mode?

Assuming you install it correctly on the guest yes it should work fine. I have VPN over NAT working on multiple VMs on mine.

And when you run VPN on host it protects both host and guest. When you run on it guest it only encrypts guest? Is my understanding correct?

No that’s not correct.

A vpn is nothing more than an virtual ethernet adapter. It is listed in your device as another hardware that sends and receives internet. Just like wlan adapter or a usb to Ethernet adapter and what not.

Depending on the virtualization you use, for example on hyper v, When you create a vm you can specify which host adapter you want it to connect to. Instead of wlan or Ethernet you select it to use your vpn connection driver.

It depends on how you configure both devices, but yes if you setup the host to route all traffic through the vpn and the guest is using NAT then the guest’s traffic is just part of the host’s traffic.

If you bridge the guest then it will be direct to your router and will only be vpn’d if you setup a vpn on the guest

I have VMs for game servers that are bridged and see the unprotected router IP address so it can port forward. I have the VPN on on the host and it directs all its host traffic through the vpn without interfering with the bridged connection

Virtual box is not perfect but it makes this very easy to do

Note my host is linux. I assume a windows host can do the above but I have never tested that

Thanks. What if I am using NAT and I run the VPN on my guest , and just connect normally on the host?

Should be fine although I’ve not tested it.

Pretty easy to test though.

Start your vm, start the VPN, open a browser in each of host and guest and search for “what’s my IP” on both browsers. If they’re the same, it’s not working. If they’re different it’s working.