0

I run an Ubuntu host and a VirtualBox Debian guest VM running Apache. I want the guest to be as thin as possible, because I'm not going to have to interact with it much (I hope).

Ultimately I want to run several websites out of the VM and set up a separate VM to run an email server using iRedMail.

I have the network adapter in the guest set up to bridged mode.

I deactivated the firewall on the guest VM AND the host (though that shouldn't be necessary in bridged mode). After I get this to work I plan to raise the firewall and just open ports 80 and 443.

I set up the VM to have a fixed IP, so it's the same IP each time I start the VM.

Though I don't think it's relevant I have my ASUS RT-AC1900P router configured to forward port 80 requests to port 80 on the VM (which is visible to the router and other machines on the network).

When I attempt to access the VM website from external machines on my LAN I use the IP of the VM as my URL though later I intend to access it with the domains names.

The website is visible to the host, but not to other machines on the LAN (or the internet).

When I try to access the website on the VM from a machine on the LAN (not the host) I get "The connection has timed out" The weird thing is that I can ping the VM, and it responds just fine, but web requests fail.

I've been working on this for a couple weeks, and I am hung up at this point. I can't find anything on running a public-facing website out of a VM. It's like I'm the first person ever to do it.

<************* Edited to add more clarity ******************>

My old server is a system I kludged together about fifteen years ago is running Debian 9 and has about 4GB RAM. I don't know what processor it's running, and it isn't involved in this experiment. It has a fixed IP, and until a recent unfortunate encounter with iRedMail it was my webserver. Now it's just a file server. It's on a wire.

I have a Windows 7 system that is a low-wattage solid state computer I built that serves as the family TV and is also on a wire. It has 8GB RAM and a Celeron processor. Again all it does is run Netflix and play multi-media from the network file server (see above).

We have a couple government-issued work laptops that don't interact with the rest of the network. One runs over a wire, and the other is wifi.

We have a Roku in the bedroom and an router wired up in the front of the house that serves as an access point.

There's a 4GB box running Ubuntu. I don't know what version it is, but since the processor is a 32-bit version Ubuntu can't be updated beyond a very old version. It connects via wifi, and I only use it for researching projects in my shop.

The box on which I do most of my testing of the web server is a Windows 10 laptop with 8GB RAM and an Intel Core i5 processor. I test using Firefox and Chrome.

The host box is an Ubuntu 18.04.4 LTS desktop with 12 GB RAM and an Intel Core i5 processor. It connects with a wire and has a fixed IP as does the guest machine.

Is that enough information to work with? I don't think any of this should have an impact on communication through port 80, but here it is anyway. Thanks in advance

1
  • Which the OS running in other machines in your LAN? (Total description, system and version, at least one in which you're trying to access the website hosted on VM.)
    – Jorge Luiz
    Commented May 22, 2020 at 20:55

1 Answer 1

0

I have my ASUS RT-AC1900P router configured to forward port 80 requests to port 80 on the VM (which is visible to the router and other machines on the network).

Since you are running the VirtualBox adapter in Bridged mode, assuming that the local IP for the VM is visible to your physical router (which you seem to indicate that it is), passing desired traffic to that local IP on the proper ports is (technically) all that is required to make the VM available to other machines (either inside or outside your local network). If this isn't working, there are likely other issues in play.

I set up the VM to have a fixed IP, so it's the same IP each time I start the VM.

As a simple troubleshooting step, you may want to try (at least temporarily) disabling this.

I can't find anything on running a public-facing website out of a VM.

For a Bridged adapter in VirtualBox, there are likely no steps that aren't covered by standard networking documentation (i.e. it should be essentially no different that working with any other physical machine on the local network).

If you are using a NAT adapter in VirtualBox, then the only "gotcha" is that you need to forward traffic to the host VM, then use the Port Forwarding settings under the adapter's Advanced menu in VirtualBox to forward traffic correctly from the host to the VM (which is effectively covered in the official VirtualBox Virtual Networking documentation).

When I try to access the website on the VM from a machine on the LAN (not the host) I get "The connection has timed out".

There could be a number of reasons for this, but for testing you may wish to try another (simple) distro for your VM, rather than something like Debian . My recommendation might be to try Damn Small Linux (which can be downloaded from one of the mirror's listed here). It is older but it comes with a web server that should require no extra configuration to test (other than starting it).

If you do decided to go this route, after booting the live version of Damn Small Linux in VirtualBox, the included web server (Monkey) should be available by right-clicking the Damn Small Linux VM's desktop and selecting System → Daemons → Monkey Web Server -> monkey start:

ex. Monkey Web Server (Damn Small Linux)

Monkey Web Server - Damn Small Linux - Screenshot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .