Zend certified PHP/Magento developer

VirtualBox: How can I expose apps inside VirtualBox’s VM to the internet on Windows 11 (so people can visit it from a domain)?

  • I have a domain name app.example.com, pointing at my internet’s public, static IP.
  • I have a computer running Windows 11 with the internal IP of 192.168.192.168.
  • On that computer, I have a VM (VirtualBox, Ubuntu) with NAT and an internal IP of 10.10.10.10.
  • The VM has an app that is running on port 1234.

Questions: How do I expose the app to the internet, so that when people visit app.example.com, they can see the app inside the VM? I’m trying with IIS but so far no luck. Is there any better alternative to IIS?

What I have done:

  • I created a port forwarding rule for the VM that forwards any Host that is listening to :1234 to the VM 10.10.10.10:1234. At this point, I can access the app inside the VM from the Host by running localhost:1234. I can also access the app from other computers in the same network by using the Host’s internal IP, e.g. 192.168.192.168:1234.
  • I opened port 80 on my router settings so traffic from app.example.com can go through. I also opened the firewall on the Host to accept all incoming traffics (just for testing purposes).
  • In IIS on the Host, I created a binding with the domain app.example.com, IP 127.0.0.1 and
    port 1234.

I still cannot access app.example.com from outside the network and my network knowledge is limited so I don’t know what else I should do.

Thank you.