Page 1 of 1

Switching from Internal Network to Allowing Host OS to Conne

Posted: 25. Jan 2016, 17:40
by THADC
Hello,

I have a simple collection of Ubuntu guest VMs on Virtualbox (on Mac host) that share an internal network. Each VM has a fixed IP. I am not using a DNS server, so communication between them has involved connecting to the fixed IPs directly.

This has worked fine, but I now need a tool running on my Mac host to access one of the VMs, so therefore I have to change the virtualbox networking setup away from internal network.

I am looking for the simplest way to pull this off. Any help/suggestions are greatly appreciated. Thanks!

Re: Switching from Internal Network to Allowing Host OS to C

Posted: 25. Jan 2016, 17:48
by Perryg
Add a second virtual adapter set to host-only for the guest that you need to be able to access from the host.

Re: Switching from Internal Network to Allowing Host OS to C

Posted: 25. Jan 2016, 20:43
by THADC
Thank you for the response. This was very helpful. I created the default host-only adapter to the virtualbox environment, and then added that adapter to the appropriate VM. Next, from the guest I ran:

Code: Select all

ifconfig eth1 192.168.56.102 netmask 255.255.255.0 up
I was able to successfully ping the IP address I set above. Finally, I was able to successfully execute from the host, web services running on that guest VM.

However, I am having a problem where the connection spontaneously stops — ping stops getting packets from guest VM and web service calls on that VM time out. If I then run:

Code: Select all

ifconfig eth1 192.168.56.102 netmask 255.255.255.0 down
, followed by:

Code: Select all

ifconfig eth1 192.168.56.102 netmask 255.255.255.0 up
, then the connection works again, but invariably stops after a short period of time (minutes later). Is there something I am doing incorrectly from the guest to make the host-only connection persist? By the way the guest OS is Ubuntu 64 bit. Thanks for any insights!

Re: Switching from Internal Network to Allowing Host OS to C

Posted: 25. Jan 2016, 20:49
by Perryg
The normal suspects are the guest over aggressive power management. I always shut them off completely.

Re: Switching from Internal Network to Allowing Host OS to C

Posted: 25. Jan 2016, 23:35
by THADC
Thanks for the power management suggestion. However, when I go to the ubuntu power management settings, they appear to be essentially turned off anyway. May be problem lies elsewhere. If I figure it out, I will post here. If anyone else still has ideas, they would be appreciated. Thank you!

Re: Switching from Internal Network to Allowing Host OS to C

Posted: 26. Jan 2016, 02:59
by THADC
Ok, I have successfully completed all my goals here. The remaining issue was instability with the Host-Only connection between host and guest OS. I ran added the following entries in the /etc/network/interface file:

# The host-only network interface
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255

and restarted the vm. This seems to have stabilized the VM and connection between host and guest has been working fine now.