Commit 2aeb756a authored by Steven Merrill's avatar Steven Merrill

Add VirtualBox headless mode.

parent c4c43b12
......@@ -30,6 +30,7 @@ type config struct {
DiskSize uint `mapstructure:"disk_size"`
GuestAdditionsPath string `mapstructure:"guest_additions_path"`
GuestOSType string `mapstructure:"guest_os_type"`
Headless bool `mapstructure:"headless"`
HTTPDir string `mapstructure:"http_directory"`
HTTPPortMin uint `mapstructure:"http_port_min"`
HTTPPortMax uint `mapstructure:"http_port_max"`
......
......@@ -23,7 +23,11 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
vmName := state["vmName"].(string)
ui.Say("Starting the virtual machine...")
command := []string{"startvm", vmName, "--type", "gui"}
guiArgument := "gui"
if config.Headless == true {
guiArgument = "headless"
}
command := []string{"startvm", vmName, "--type", guiArgument}
if err := driver.VBoxManage(command...); err != nil {
err := fmt.Errorf("Error starting VM: %s", err)
state["error"] = err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment