Merge branch 'oracle'

This commit is contained in:
Matthew Baker 2014-08-06 02:44:39 -07:00
commit 5814b9d3c7
2 changed files with 11 additions and 5 deletions

View File

@ -26,6 +26,7 @@ var netDevice = map[string]bool{
"pcnet": true,
"virtio": true,
"virtio-net": true,
"virtio-net-pci": true,
"usb-net": true,
"i82559a": true,
"i82559b": true,

View File

@ -61,23 +61,28 @@ 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=pc-1.0,accel=%s", config.Accelerator)
defaultArgs["-display"] = guiArgument
if config.Accelerator != "none" {
defaultArgs["-machine"] = fmt.Sprintf("type=pc,accel=%s", config.Accelerator)
} else {
ui.Message("WARNING: The VM will be started with no hardware acceleration.\n" +
"The installation will take considerably longer to finish\n")
}
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)