Skip to content

Instantly share code, notes, and snippets.

@fnichol
Created April 9, 2012 18:40
Show Gist options
  • Save fnichol/2345348 to your computer and use it in GitHub Desktop.
Save fnichol/2345348 to your computer and use it in GitHub Desktop.
Hack to set vagrant host name (better sol'n is middleware, just wait)
Vagrant::Config.run do |config|
# Make the VM host name the name of the containing folder by default
host = File.basename(Vagrant::Environment.new.root_path || __FILE__).gsub(/_/, '-')
config.vm.host_name = "#{host}.vagrantup.com"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment