Permalink
Browse files

enabled -n or --nogui for fusion, vbox

  • Loading branch information...
1 parent e45801c commit e3355dba0db49b1bd174efcdfa442350fda02644 @jedi4ever committed Sep 27, 2011
View
@@ -61,7 +61,7 @@ task :iso, [:box_name] do |t,args|
if length.to_i < 10000
puts definition.iso_src
p response['content-type']
- puts uri.host,uri.port, uri.path
+ puts uri.host,uri.port, uri.path,response.code
end
rescue Exception => ex
puts "Error"+ex.to_s+definition.iso_src
@@ -50,7 +50,11 @@ def build(definition_name,box_name,options)
end
box.create(definition)
- box.start(options["gui"])
+
+ # Check the GUI mode required
+ env.logger.info "Builder asks the box to start: GUI enabled? #{!options[:nogui]}"
+ gui_enabled=options[:nogui]==true ? false : true
+ box.start(gui_enabled)
#waiting for it to boot
env.ui.info "Waiting #{definition.boot_wait.to_i} seconds for the machine to boot"
@@ -60,12 +60,13 @@ def create(definition)
end
- def start(mode)
+ def start(gui_enabled=true)
# Once assembled we start the machine
- if (mode)
- raw.start("vrdp")
- else
+ env.logger.info "Started the VM with GUI Enabled? #{gui_enabled}"
+ if (gui_enabled)
raw.start("gui")
+ else
+ raw.start("vrdp")
end
end
@@ -27,9 +27,13 @@ def create(definition)
create_disk(definition)
end
- def start(mode)
- # mode can be gui or nogui
- raw.start unless raw.nil?
+ def start(gui_enabled=true)
+ if gui_enabled
+ raw.start unless raw.nil?
+ else
+ raw.start({:headless => true}) unless raw.nil?
+ end
+
end
def stop

0 comments on commit e3355db

Please sign in to comment.