Here is my problem;
I have virtual-box running on Ubuntu 64 bit (17.04) and I have multiple virtual machines (all Ubuntu 64 bit).
I want to forward port 80, 25, 143 and 22 to all of the virtual machines, dns name specific.
For example;
ssh username@domain-1 --> domain-1-virtual_machine port 22
ssh username@domain-2 --> domain-2_virtual_machine port 22
etc.
I want that a request from domain-1 on a specific port will go to vm1 and a request from domain-2 on the same port will go to vm2.
thanks in advance
Port forwarding is so easy when you select NAT network in Virtualbox.
Host and Guest IP are assigned as base machine and VirtualBox IP respectively, so as in ports.
Try Host only network and install dnsmasq in your base machine to assign specific IP for each VM. Now you can easily append IP and host name of VMs in /etc/hosts file of base machine to connect to.