Question

Due to various constraints I've found myself in the following situation:

I have access to an API which starts a service on the loopback device of a computer (127.0.0.1). This computer is actually running on a VM being hosted by the client. The client will be using the same API to connect (which, of course, will connect via the loopback device).

The API is intended to be a service which executes on the same machine as the host and the client - it's a communication layer essentially. The two software components (ie, the endpoints), are incompatible, so we have them configured this way: the client hosting the server on a VM.

The VM is Virtualbox, with a Bridged Adaptor network setup.

They're both running Windows XP.

How do I get them to communicate?

EDIT: I cannot make changes to the communication service, but I can make whatever other changes are necessary to the VM or the host.

Was it helpful?

Solution

Expanding on @EJP's suggestion to use port forwarding, the required command is covered in User Manual, §6.3.1 Configuring port forwarding with NAT. Suppose your service on guest "VM name" is a web server listening on port 80. You can forward host port 12345 to guest port 80 like this:

VBoxManage modifyvm "VM name" --natpf1 "service,tcp,,12345,,80"

When you browse http://127.0.0.1:12345 on your host, the guest server will respond. You can delete the setting using something like this:

VBoxManage modifyvm "VM name" --natpf1 delete "service"

You can examine the setting using something like this:

VBoxManage showvminfo "VM name"

OTHER TIPS

You're going to have to change the service not to bind to 127.0.0.1 if you can. Otherwise you will have to install some kind of proxy in the VM, or organize some port forwarding if you can.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top