0
votes

I have installed Oracle VM VirtualBox and created a virtual machine running Ubuntu Server 18 LTS. Inside the virtual machine I have download and started Apache Tomcat 9. Now if I launch Firefox from within the virtual machine and type localhost:8080 in the address bar I can see the Tomcat welcome page correctly. But what if I wanted to view the Tomcat welcome page from the host machine? That is from outside the virtual machine?

1
This isn't really a question about Tomcat but about networking. Are you using NAT or Bridged networking? Bridged networking makes this easy: just use the IP address of the host and not the hostname "localhost". It can be done with NAT but it's more complicated because you need to make sure that a route exists between the guest machine and the host machine that sends the data outside of the NET networking.Christopher Schultz
Initially I had one NAT adapter. Then I read a guide suggesting that I add a host only adapternix86
Host-only networking means that the VM is a theoretically inescapable box, network-wise. If you want to get from the VM out to the host, you'll need to use another kind of network adapter.Christopher Schultz
You're right. The bridge network is needed.nix86

1 Answers

0
votes

The virtual box must have only one adapter. Its type must be "Bridged Adapter". In order to understand the ip address of the virtual machine you must type ifconfig (on the virtual machine).