How to open tomcat project from virtualbox guest?

1

I have a tomcat (Liferay) project, up and running on my Ubuntu laptop. So, I wanted to be able to run it on virutualbox guest.

I created the virtual machine,deployed the files and now it's up and running. (Or at least the ant command for starting the project finishes successfully.)

So, how should I open the project from the virtual machine?

=======================

I. The Host:

  1. The project opens on "portal.local" (it has record in the database for it), so I have record in my /etc/hosts file: 127.0.0.1 portal.local

II. The virtual machine:

  1. It uses NAT adapter/settings.
  2. It has it's IP - 10.0.2.15.
  3. I've made port forwarding, in order to be able to SSH to it: 127.0.0.1:22222 -> 10.0.2.15:22 ... and this way I can use ssh -p 22222 {username}@127.0.0.1 - to SSH to the virtual machine.

=======================

So, what changes should I do to the host and/or the virtual machine, so I open the project from the virtual guest?

Thanks in advance :)

pesho hristov

Posted 2015-10-07T11:49:54.843

Reputation: 275

Answers

0

I managed to succeed (Y) :D ... thanks to Perryg from virtualbox forums :)

So, in order to do this:

  1. Created the additional host-only network adapter.

  2. Disabled the first adapter. (Probably it could happen with both ones enabled, but I just don't know how to bring up another network interface, so I was seeing only the first IP (10.0.2.15) under "eth0". And when I disabled it - then I could see "192.168.56.101" under "eth0" - the second, host-only, adapter.)

So - could access the VM under 192.168.56.101.

  1. Created a record for "portal.local" to 192.168.56.101 in /etc/hosts on the host machine.

  2. Created a record for "portal.local" to 127.0.0.1 in /etc/hosts on the guest/virtual machine. (Don't know if this one is necessary ...)

And then voila - I was able to access it :)

pesho hristov

Posted 2015-10-07T11:49:54.843

Reputation: 275