1

There is a service running on port 8529 on my system (host) and I want to query its API via a PHP script from inside the XAMPP VM. How can I open the port and allow it to access the service? It would be kind of a reverse port forwarding, where a request to localhost:8529 inside the VM should be forwarded to the host:

    Host (macOS)            Guest (Debian)
 ------------------       ------------------
|  localhost:8080  | --> |  localhost:80    |  Web Server (Apache)
|  localhost:8529  | <-- |  localhost:8529  |  Other Service
 ------------------       ------------------

Alternatively, could I grant the VM access to the host LAN in order to access the host IP 192.168.178.22?
(I am unable to reach the service under http://192.168.178.22:8529 despite being bound to 0.0.0.0:8529 however, only localhost:8529 works?!)

Setup / Environment:

I installed the virtual machine version of XAMPP (xampp-osx-7.4.4-0-vm.dmg) on my MacBook Air (macOS Catalina), started the services (IP address 192.168.64.2), mounted the /opt/lampp volume, and enabled port forwarding for localhost:8080 -> 80 (Over SSH). I can reach the XAMPP dashboard in a browser at http://localhost:8080 and http://192.168.64.2:80.

Clicking Open Terminal in the XAMPP app opens a command line for the guest system. It reveals that the VM solution is by Bitnami and the OS is Linux debian 4.9.0-11-amd64. It doesn't appear to be what Bitnami calls Server Console however. How can I actually manage the VM?

CodeManX
  • 9,290
  • 3
  • 41
  • 58
  • Bitnami Engineer here. Basically, you want to query a site in the host computer from the XAMPP VM, right? You can get the gateway of the VM network and try to access your site using that IP. That IP is probably 192.168.64.1, does http://192.168.64.1:8529 work? – Jota Martos Apr 14 '20 at 10:48
  • Hi @JotaMartos, I changed the binding of the service successfully from `127.0.0.1` to `0.0.0.0` and allowed it to pass through the firewall. It is reachable on the host side under `192.168.178.22` and I can reach it from inside the VM via `192.168.64.1` now! Thanks a lot and please post your comment as answer! – CodeManX Apr 14 '20 at 23:29

0 Answers0