1

Under VBOX i ve a ubuntu based VM working under NAT

I'm used to do my port forward config unbder vbox like the following

Name     Protocol  IP host  Port host  IP Guest  Port Guest
myrule   TCP                3000                 3000

But when running my web app on the port 3000 ; i can't open it within browser in my host machine. (and it uns well inside my guest vm)

ifconfig shows the following in my guest vm :

ifconfig
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.3.15  netmask 255.255.255.0  broadcast 10.0.3.255
        inet6 fe80::b612:8769:ba28:6e2e  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:42:89:7b  txqueuelen 1000  (Ethernet)
        RX packets 3354  bytes 2134154 (2.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2669  bytes 373394 (373.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Boucle locale)
        RX packets 229607  bytes 231076789 (231.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 229607  bytes 231076789 (231.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And my /etc/network/interfaces file looks like this :

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

Suggestions ??

6
  • 1
    Which host machine addresses did you try?
    – Seth
    Commented Feb 4, 2020 at 14:02
  • @Seth : i want to serve webb apps to localhost in Guest and just repoen them in host via (localhost / 127.0.0.1) Commented Feb 4, 2020 at 14:25
  • If you're only serving the content on localhost (on your guest) you won't be able to do this.
    – Seth
    Commented Feb 5, 2020 at 6:15
  • @Seth and what you may suggest ? Commented Feb 5, 2020 at 10:35
  • Is there any particular reason you need ti to be accessible on localhost? If not just make it available on a regular network interface. If you have security concerns setup a secondary interface with a different network mode.
    – Seth
    Commented Feb 5, 2020 at 10:39

0

You must log in to answer this question.