From 2d68b284d199041ff60f4183a83b0f3e8bc27e8f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 3 Jun 2010 11:29:17 -0700 Subject: [PATCH] Some fixes with defining new interfaces on Ubuntu --- lib/vagrant/actions/vm/shared_folders.rb | 4 ---- lib/vagrant/systems/linux.rb | 4 +++- vagrant.gemspec | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/vagrant/actions/vm/shared_folders.rb b/lib/vagrant/actions/vm/shared_folders.rb index 084669d1e..e6bcd1e7d 100644 --- a/lib/vagrant/actions/vm/shared_folders.rb +++ b/lib/vagrant/actions/vm/shared_folders.rb @@ -38,10 +38,6 @@ module Vagrant end @runner.reload! - - # Sleep to allow VirtualBox to clean things up. There seems - # to be no clean API call to do this. - sleep 1 end def create_metadata diff --git a/lib/vagrant/systems/linux.rb b/lib/vagrant/systems/linux.rb index 03867577c..84b3c4092 100644 --- a/lib/vagrant/systems/linux.rb +++ b/lib/vagrant/systems/linux.rb @@ -76,7 +76,8 @@ module Vagrant # Remove any previous host only network additions to the # interface file. vm.ssh.execute do |ssh| - ssh.exec!("sudo su -c \"sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /etc/network/interfaces\"") + ssh.exec!("sudo sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces") + ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-interfaces > /etc/network/interfaces'") end end @@ -86,6 +87,7 @@ module Vagrant vm.ssh.execute do |ssh| ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-entry >> /etc/network/interfaces'") + ssh.exec!("sudo /etc/init.d/networking restart") end end diff --git a/vagrant.gemspec b/vagrant.gemspec index 887ba4054..3044a3267 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -107,6 +107,7 @@ Gem::Specification.new do |s| "templates/chef_server_client.erb", "templates/chef_solo_solo.erb", "templates/crontab_entry.erb", + "templates/network_entry.erb", "templates/package_Vagrantfile.erb", "templates/rsync.erb", "templates/ssh_config.erb",