VMware Communities
andrew567
Contributor
Contributor
Jump to solution

How to connect to an udp server on the guest os from the host os?

Hi Ppl!

New to the community. If I missed up-to-date knowledge base, please, point me to the right direction.

Have VMware Workstation 16 Player on host OS Windows 10.The host OS is connected to the internet via wifi adapter (only one hardware to reach internet). There is a created virtual machine, Windows XP guest OS, vm settings / "Network Adapter": "NAT" with default settings (I can change that) . The guest OS runs an udp server on port 5678. I need to send messages to that port from the host OS (I do not need to reach that port from the internet). The guest OS runs other programs, they need to reach the internet.

Question is: how to setup the network adapter of the VM, then how to address that udp port from the host OS? Application development is not a problem, but I need to know ip:port to send udp package.

All the documentation I found on the internet (even on vmware domain) seems a bit out-dated / not practical / not helpful. Looking for any useful material. Thank you in advance.

0 Kudos
1 Solution

Accepted Solutions
bluefirestorm
Champion
Champion
Jump to solution

You did indicate in the original post that the guest OS runs other programs that need to reach the internet; unless you missed putting the word "not" in there. But I agree that it is considered unsafe to expose an old OS like XP to internet traffic.

But come to think of it, you should be able to ping from guest to host (via NAT) and vice versa (assuming ICMP is allowed by firewalls on the guest and host OS). So it might be a just firewall issue. Either XP firewall or host firewall or both blocking UDP traffic on port 5678. IIRC, XP Professional SP3 does have a firewall (it's coming to 10 years since I used an XP OS on a daily basis).

For example if the NAT subnet is 192.168.86.0/24 you would need to open the firewall for UDP traffic port 5678 (both on XP and host firewalls). The IP address of the host on the NAT (VMNet8) would be 192.168.86.1. The gateway is 192.168.86.2.

View solution in original post

7 Replies
fabio1975
Commander
Commander
Jump to solution

Ciao 

in summary, to check if the scenario is clear to me, you would like to port forward the UDP traffic arriving on a port of the HOST (on which the VMware Workstation is installed) to a port of the VM (hosted on the same HOST) Correct?

 

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

0 Kudos
bluefirestorm
Champion
Champion
Jump to solution


For this situation, use Bridged Networking for the VM. That way the host machine and the VM are on the same subnet as the WiFi adapter (and share all the other stuff like gateway, default routes, etc).

0 Kudos
andrew567
Contributor
Contributor
Jump to solution

in summary, to check if the scenario is clear to me, you would like to port forward the UDP traffic arriving on a port of the HOST (on which the VMware Workstation is installed) to a port of the VM (hosted on the same HOST) Correct?

 

Not exactly. There are legacy programs, running on the guest OS. They still need 32 bit XP and that OS environment (and application policies), they do not run on windows 10. So I am running them on the VM. The udp server on the guest OS is to support some connectivity between applications on the guest OS and an application runs on the host OS. Think of it as a remote controller application. Situation is not a port forwarding but a simple communication line between applications.

0 Kudos
andrew567
Contributor
Contributor
Jump to solution

For this situation, use Bridged Networking for the VM. That way the host machine and the VM are on the same subnet as the WiFi adapter (and share all the other stuff like gateway, default routes, etc).

 

Is there no chance to make it work via NAT? I can switch it to bridged network, it just not safe nowadays to open up an XP to the internet.

0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

You did indicate in the original post that the guest OS runs other programs that need to reach the internet; unless you missed putting the word "not" in there. But I agree that it is considered unsafe to expose an old OS like XP to internet traffic.

But come to think of it, you should be able to ping from guest to host (via NAT) and vice versa (assuming ICMP is allowed by firewalls on the guest and host OS). So it might be a just firewall issue. Either XP firewall or host firewall or both blocking UDP traffic on port 5678. IIRC, XP Professional SP3 does have a firewall (it's coming to 10 years since I used an XP OS on a daily basis).

For example if the NAT subnet is 192.168.86.0/24 you would need to open the firewall for UDP traffic port 5678 (both on XP and host firewalls). The IP address of the host on the NAT (VMNet8) would be 192.168.86.1. The gateway is 192.168.86.2.

fabio1975
Commander
Commander
Jump to solution

I confirm that indicated by @bluefirestorm 
If the guest network is configured in nat, communication between guest and host is always guaranteed using the specific ip of the nat network
On my PC it looks like this:

fabio1975_0-1638543226494.png

 


If you need the player to use the Virtual network editor here is the guide

VMWare Player missing vmnetcfg.exe utility - VMwarewolf

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

andrew567
Contributor
Contributor
Jump to solution

About the firewall... mea culpa, there is a firewall. And I forgot to turn it off. Now I have working ping. From here, I can make it. Forever thanks 😀

0 Kudos