How to access server running in VirtualBox from the host?

The localhost:8888 URL is only a valid URL inside your VM. Outside that VM you will have to use ip.ad.dr.ess:8888 or hostname:8888. In the latter case, a dependency on hostname resolving to ip.ad.dr.ess on your network is introduced.

By default, when you create a VM in VirtualBox, network adapter 1 is set to NAT. This will give the VM an IP address of 10.0.2.15/24 and a default route of 10.0.2.2 (which should be your host). Long story short, windows will not route to an address it is providing NAT for, without jumping through more hoops first.

Shutting down the VM and changing the VM network adapter1 setting to "bridged" will allow your host (and any host on your local network) to communicate with that VM without any special routes added or hoops to jump through.

Restart the VM. Verify your connectivity to localhost:8888. Also verify your connectivity to hostname:8888 (assuming hostname was not added to the loopback/localhost address in the /etc/hosts file) and ip-address:8888. EDIT: Based on the /etc/hosts details posted, you are binding your VM and therefore the webapp to the loopback network. This configuration is not usable outside the VM at all.

If your web server and application are not dependent on the IP it was first configured/installed on, and you have a DHCP server on your LAN, the only other piece of information you should need to connect to the VM is the IP address that was assigned to it via DHCP.

To find the IP address of the VM: Open a terminal/console window from the Ubuntu desktop (ctrl-alt-T), we use hostname, ifconfig, and grep /etc/hosts commands to put the pieces together and find your address. From the open terminal, type hostname then hit enter. This is probably gc. In that same terminal, typing ifconfig eth0 | awk '/Bcast/{print $2}' will show the address. You should have a line in /etc/hosts with the address followed by the hostname. grep [hostname] /etc/hosts or grep [address] /etc/hosts should find the line you need. If you come up with anything other than your current address followed by the hostname, you need to modify the /etc/hosts file to add the correct information.

Hosts on your LAN should now be able to connect to the IP of your VM on port 8888. For those hosts/clients to access the webapp via hostname:8888 will depend on client hosts files, local DNS, or even mDNS services possibly provided on your DHCP server.