From 4149313e7a67e9a8fb964cafb31c83c2c1f9ce0c Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Fri, 9 Apr 2010 00:11:02 -0700 Subject: [PATCH] allow setting mode to boot into, so can boot with gui which makes debugging networking setup easier --- config/default.rb | 1 + lib/vagrant/actions/vm/boot.rb | 2 +- lib/vagrant/config.rb | 1 + test/vagrant/actions/vm/boot_test.rb | 6 ++++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/default.rb b/config/default.rb index 17b95a3a0..9c9009943 100644 --- a/config/default.rb +++ b/config/default.rb @@ -20,6 +20,7 @@ Vagrant::Config.run do |config| config.vm.provisioner = nil config.vm.shared_folder_uid = nil config.vm.shared_folder_gid = nil + config.vm.boot_mode = "vrdp" config.package.name = 'vagrant' config.package.extension = '.box' diff --git a/lib/vagrant/actions/vm/boot.rb b/lib/vagrant/actions/vm/boot.rb index 668860b81..8f7b90459 100644 --- a/lib/vagrant/actions/vm/boot.rb +++ b/lib/vagrant/actions/vm/boot.rb @@ -21,7 +21,7 @@ module Vagrant def boot logger.info "Booting VM..." - @runner.vm.start("vrdp") + @runner.vm.start(@runner.env.config.vm.boot_mode) end def wait_for_boot(sleeptime=5) diff --git a/lib/vagrant/config.rb b/lib/vagrant/config.rb index b5028e1d8..21b106c6a 100644 --- a/lib/vagrant/config.rb +++ b/lib/vagrant/config.rb @@ -77,6 +77,7 @@ module Vagrant attr_accessor :box attr_accessor :box_ovf attr_accessor :base_mac + attr_accessor :boot_mode attr_accessor :project_directory attr_reader :forwarded_ports attr_reader :shared_folders diff --git a/test/vagrant/actions/vm/boot_test.rb b/test/vagrant/actions/vm/boot_test.rb index 9ef61e7b2..402c6f66f 100644 --- a/test/vagrant/actions/vm/boot_test.rb +++ b/test/vagrant/actions/vm/boot_test.rb @@ -32,8 +32,10 @@ class BootActionTest < Test::Unit::TestCase end context "booting" do - should "start the VM in headless mode" do - @vm.expects(:start).with("vrdp").once + should "start the VM in specified mode" do + mode = mock("boot_mode") + @runner.env.config.vm.boot_mode = mode + @vm.expects(:start).with(mode).once @action.boot end end