title: How does docker's `net=host` setting work, and how can I do something similar with e.g. VirtualBox?
body: <p>Docker has a run option <code>net=host</code> <a href="https://docs.docker.com/engine/reference/run/#network-settings" rel="nofollow noreferrer">documented here</a> that allows you to run a virtual machine that shares the network stack with the host — for example, processes inside the docker container can connect to the host machine via <code>localhost</code> and vice versa.</p>
  
  <p>I want to set up a Linux VM on Mac OS X that does the same thing; I've tried using Vagrant and its various networking settings without much luck.</p>
  
  <p>Does Docker's VM rely on the host and guest OSes both being Linux, or is there some way to accomplish this OSX->Linux that I'm missing?</p>