Monthly Archives: October 2011

Vagrant and VPN

If you use Vagrant and need VPN access, then you’ll need to configure vagrant:

Vagrant::Config.run do |config|
  # ...
  config.vm.customize do |vm|
    # Use the host resolver for DNS so that VPN continues
    # to work within the VM
    vm.network_adapters.each do |na|
      if na.enabled? && na.nat_driver
        na.nat_driver.dns_use_host_resolver = true
      end
    end
  end
end
Taken from here and copied here for posterity (aka for my own reference.)