Ubuntu guest SSH without fixed network

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
GrizzlyFish
Posts: 2
Joined: 27. Oct 2014, 12:24

Ubuntu guest SSH without fixed network

Post by GrizzlyFish »

Hi all,

Currently at the bottom of a steep learning curve, new to Mac OS, Linux and VirtualBox...please be patient :-)

I am trying to setup my ubuntu server guest to act as a small web server running rails to test out some POC code that I am writing.

My problem is with my network setup (I am based in Egypt where this is pretty restrictive). My Macbook Pro has no wired internet though it has Thunderbolt ports. WiFi connectivity is sporadic and I tend to alternate between a poorly performing WiFi connection and iPhone tethering for external traffic.

Even though my external connectivity is therefore constantly up/down and I have no other fixed networking hardware, I would like to configure my setup so that my host/guest systems and continuously talk to each other via SSH and web browser.

When I have a given connection up and running (either the WiFi or the iphone tether) then I can run the server and interact no problem. However, if my WiFi network changes, or I switch to the tether my ssh dies and I have to reinitialise the guest networking, identify IP and restart the connections.

Is there a way around this? Can I use the bridged/host-only setups to circumvent this at all? To complicate things further I would like my guest OS to have internet connectivity when my host OS has it to be able to install new packages and for my web server to make outgoing comms.

Thank you in advance and I hope for some good suggestions for my somewhat restricted setup.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Ubuntu guest SSH without fixed network

Post by Perryg »

Yes. Use the host-only for access between host <> guest and add 2nd adapter set to NAT or Bridged for Internet access.
GrizzlyFish
Posts: 2
Joined: 27. Oct 2014, 12:24

Re: Ubuntu guest SSH without fixed network

Post by GrizzlyFish »

Ok great thanks for the confirmation :-)

For any others that might find this useful - to get host-only working you need to add a host-only network in the virtualbox preferences (not the per VM one) so that you can then select this specific named network in the per-VM settings.

Then I found that NAT was not working after this...eth1 wasn't being setup correctly so added the following to my /etc/network/interfaces file

auth eth1
iface eth1 inet dhcp

Hope that helps!
Post Reply