Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two VirtualBox guest VMs running Linux under a MacOS X host.

I'm using bridged networking mode but I am not in control of the DHCP server and can not give my host+guests static IPs. Any time a DHCP lease expires, or I join a different network, I have to deal with my VM IPs changing, and consequently change all my firewall rules and /etc/hosts entries, etc. which is a pain to say the least.

So I want to set up a virtual LAN on my laptop like Then make my host OS (the laptop) be .1, and the guest VMs be .2 and .3. The VMs need to be able to access the Internet through the host's connection. Sometimes that would be out the wired interface, other times out the AirPort. It would be ideal if, when the host's internet connection changes from wired to wireless, guest internet access is not interrupted.

Can I do this on OS X? What commands do I run, sysctls to set, etc.

share|improve this question

migrated from Dec 15 '11 at 22:09

This question came from our site for system and network administrators.

I haven't tried it on an OS X host but "Host-only networking" does what you want. See:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.