Add VirtualBox headless mode.
This commit is contained in:
parent
c4c43b1252
commit
2aeb756a56
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue