I can't join linux virtual machine on port 80

668 Views Asked by At

I'm trying to make a public server on a Debian that I'm running on VirtualBox. I tried on windows and it works fine. Actually, I'm just trying to join port 80. I've setup my modem.

And I did sudo ufw allow 80/tcp.

But when I test with canyouseeme.org I get an error message and it can't see the service on port 80.

I must say that I also installed apache2 on this debian, as well as made a small virtual host. I don't know if it has anything to do with the fact that port 80 is not reachable from outside my virtual machine.

Can someone have an idea?

2

There are 2 best solutions below

1
Brian Choi On BEST ANSWER

Look at the table and make sure you have created a network interface that can communicate with the host. Under the premise that a router is used, in the case of host only, set port forwarding on the host computer and virtual machine while the public IP and port forwarding of the host computer are set. In the case of bridge, set port forwarding to the public IP address and virtual machine. enter image description here

0
Dayo On

You should port forward the 80 port in virtualbox.

First, go to VM's setting -> network -> port forwarding.

Then, select host port and local port to 80, set guest ip to your vm's inner-ip(you can get this via ifconfig)