|
|
|
|
@ -61,23 +61,23 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error
|
|
|
|
|
sshHostPort := state.Get("sshHostPort").(uint)
|
|
|
|
|
ui := state.Get("ui").(packer.Ui)
|
|
|
|
|
|
|
|
|
|
guiArgument := "sdl"
|
|
|
|
|
vnc := fmt.Sprintf("0.0.0.0:%d", vncPort-5900)
|
|
|
|
|
vmName := config.VMName
|
|
|
|
|
imgPath := filepath.Join(config.OutputDir,
|
|
|
|
|
fmt.Sprintf("%s.%s", vmName, strings.ToLower(config.Format)))
|
|
|
|
|
|
|
|
|
|
defaultArgs := make(map[string]string)
|
|
|
|
|
|
|
|
|
|
if config.Headless == true {
|
|
|
|
|
ui.Message("WARNING: The VM will be started in headless mode, as configured.\n" +
|
|
|
|
|
"In headless mode, errors during the boot sequence or OS setup\n" +
|
|
|
|
|
"won't be easily visible. Use at your own discretion.")
|
|
|
|
|
guiArgument = "none"
|
|
|
|
|
} else {
|
|
|
|
|
defaultArgs["-display"] = "sdl"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defaultArgs := make(map[string]string)
|
|
|
|
|
defaultArgs["-name"] = vmName
|
|
|
|
|
defaultArgs["-machine"] = fmt.Sprintf("type=%s,accel=%s", config.MachineType, config.Accelerator)
|
|
|
|
|
defaultArgs["-display"] = guiArgument
|
|
|
|
|
defaultArgs["-machine"] = fmt.Sprintf("type=%s", config.MachineType)
|
|
|
|
|
defaultArgs["-netdev"] = "user,id=user.0"
|
|
|
|
|
defaultArgs["-device"] = fmt.Sprintf("%s,netdev=user.0", config.NetDevice)
|
|
|
|
|
defaultArgs["-drive"] = fmt.Sprintf("file=%s,if=%s", imgPath, config.DiskInterface)
|
|
|
|
|
@ -87,6 +87,14 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error
|
|
|
|
|
defaultArgs["-redir"] = fmt.Sprintf("tcp:%v::22", sshHostPort)
|
|
|
|
|
defaultArgs["-vnc"] = vnc
|
|
|
|
|
|
|
|
|
|
// Append the accelerator to the machine type if it is specified
|
|
|
|
|
if config.Accelerator != "none" {
|
|
|
|
|
defaultArgs["-machine"] += fmt.Sprintf(",accel=%s", config.Accelerator)
|
|
|
|
|
} else {
|
|
|
|
|
ui.Message("WARNING: The VM will be started with no hardware acceleration.\n" +
|
|
|
|
|
"The installation may take considerably longer to finish.\n")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Determine if we have a floppy disk to attach
|
|
|
|
|
if floppyPathRaw, ok := state.GetOk("floppy_path"); ok {
|
|
|
|
|
defaultArgs["-fda"] = floppyPathRaw.(string)
|
|
|
|
|
|