Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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 10.20.30.0/24. 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 serverfault.com Dec 15 '11 at 22:09

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

1 Answer 1

I haven't tried it on an OS X host but "Host-only networking" does what you want. See: http://www.virtualbox.org/manual/ch06.html

share|improve this answer

Your Answer

 
discard

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