VMware Communities
nomadic1968
Contributor
Contributor

Connecting networks inside guest VM

Hi everybody,

I am a hardware engineer with good programming skills and intermediate networking knowledge in industrial environment (so it is Windows, Linux, PLC, embedded devices, virtual machines...) and came across an interesting issue which is driving me crazy since a few days.

I couldn't find info about it anywhere on the internet (this forum included), and also a lot of experimenting didn't bring any success.

I will describe my setup and the issues i have, maybe someone else has faced the same problem and can help (or maybe we can work together at it).

The host pc is a Win10 Pro machine and is quite restricted by domain policy.

One of the restrictions is that Internet Connection Sharing is disabled.

My company IT will not change it, they are really strict on that (also because it's not a work related issue).

My IoT device is Ethernet only and I can connect it to the Internet only through the laptop Ethernet (the hotel has only WiFi Internet in the rooms). WiFi for this device is not an option.

My VM is a VMware Player machine with 2 network adapters, since I already know that with multiple network connection it is necessary to avoid automatic bridging.

Therefore, I have removed my Ethernet and the WiFi adapters from VMnet0 and assigned them to VMNet3 and 2 respectively.

My VM has 2 network adapters, which I have connected to VMnet2 (direct bridging to host WiFi) and VMnet3 (direct bridging to host Eth port) respectively.

Guest operating system is Win10 Pro.

When I am able to connect the VM to Internet with direct bridging (VMNet2) I can enable ICS and everything works fine.

But when I am forced to use NAT, my device cannot connect to the Internet in any way.

I have tried to:

-disconnect, reconnect, enable, disable the connections in all possible sequences: no luck.

-use network bridging instead of ICS: no luck.

-restart VMware NAT and DHCP services: no luck.

-clear all routing / arp info: no luck.

-use of static or automatic IP addresses doesn't change anything.

AFAIK, the NAT/direct bridging of the host WiFi is 100% external to the VM, so why does it stop working when i (have to) use NAT?

IMHO this should work seamlessly also with NAT.

Conversely, when i try to use VMnet2 (direct bridging) I don't understand why the hotel router doesn't serve its connection request as it would do for a physical device.

I hope that a solution can be found. Thanks and regards,

Michael

0 Kudos
6 Replies
scott28tt
VMware Employee
VMware Employee

Moderator: Thread moved to the Workstation Player area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
bluefirestorm
Champion
Champion

When you use the VMnet3, is the VMnet2 also connected? You could try disconnecting the VM from VMnet2 when you want to use VMnet3 (and vice-versa). The bridged networking to the hotel WiFi might not be working if it requires a login as some hotel WiFi networks require a login per device (to put a limit of concurrent devices connected per guest/room).

If I understand correctly, the VMs/IoT device is not work related and you are using this setup to circumvent the IT policy on disabling ICS. Probably not a good idea to provide any reason/excuse for your employer to take disciplinary action (or worse) on you for violating such policies and just use your own laptop with this IoT/VMs.

0 Kudos
nomadic1968
Contributor
Contributor

Dear bluefirestorm​ and all,

I have posted on this forum in order to find a technical solution, not behaviour lessons.

I kindly ask you and everybody else to avoid these non-technical replies.

I have described my scenario exactly to avoid this kind of zero added value comments ("circumventing policies" / "use your private laptop").

Besides, it is quite clear that you (bluefirestorm) missed the technical point of my question, that is "connecting two networks from inside the VM" since your are suggesting to use one virtual network at a time.

That said, I will stick to the technical part:

When i am in other hotels where their WiFi require authentication there are 2 possible scenarios:

-If i have to use NAT for the VM, i just need to authenticate from the host to have Internet.

-If i can use direct bridging I need to authenticate also from inside the VM.

So, back to the original question:

Is there a way to extend the Internet connection of my VM to the Ethernet network from inside the VM while Internet connection is through NAT? Or have I found a bug in VMWare software instead?

Have a nice day,

0 Kudos
bluefirestorm
Champion
Champion

If you don't want to take advice about not violating your company policies, it is up to you.

Back to your question,

It is not a bug of VMware software. If you have two different subnets (be it in a physical machine or VM), there would be issues with routing (thus the suggestion to remove one VMnet while the other is active). So perhaps you want to look at the problem from that point of view.

0 Kudos
nomadic1968
Contributor
Contributor

Bluefirestorm, can you please explain how can you be so sure that it is not a bug of vmware?

What is your explanation for the fact that with direct bridging it works while with NAT it doesn't, then?

IMO it might be, because switching between NAT and VMNet2 (direct bridging) is an action that takes place outside the VM, but still happens in the VMware framework (VMware's virtual router).

I am not saying that i am sure it is a VMware bug, i am just considering the possibility for the aforementioned reasons

Back to the topic:

It is known that Windows' Internet Connection Sharing is not perfect but more or less it works.

And in my specific use case it is the only thing that works if i can use direct bridging.

Bridging the 2 network adapters in the VM (selecting the 2 adapters from control panel, right click on the selection and choose "bridge connections" from the menu) does not work even if i use static ip addresses (BTW, if i try to do the same on the host (this is allowed) i end up with an "unexpected error" message so it is useless).

Does anybody know a different method to connect two networks in Windows 10 rather than ICS and network adapters bridging?

Maybe some obscure shell commands can do the job?

Or maybe i need to install some additional software inside my VM?

Cheers

0 Kudos
bluefirestorm
Champion
Champion

As I said, there are two different subnets active with the VMnet2 and VMnet3 in the same VM. If you had two network cards with different subnets on a physical machine with that setup you would encounter similar routing problems. So it has nothing to do with VMware.

You may not need ICS at all in this situation. Just have two virtual NICs connected to NAT in the same VM to be in the same subnet; so that the VM has internet access, the IOT device has internet access. I think I would stop here now.

0 Kudos