Merge pull request #4293 from mitchellh/usedefaultdisplay

builder/qemu: add use_default_display option for osx compatibility
This commit is contained in:
Matthew Hooker 2016-12-19 11:41:36 -08:00 committed by GitHub
commit 9801e67fdc
3 changed files with 32 additions and 25 deletions

View File

@ -104,6 +104,7 @@ type Config struct {
ShutdownCommand string `mapstructure:"shutdown_command"`
SSHHostPortMin uint `mapstructure:"ssh_host_port_min"`
SSHHostPortMax uint `mapstructure:"ssh_host_port_max"`
UseDefaultDisplay bool `mapstructure:"use_default_display"`
VNCBindAddress string `mapstructure:"vnc_bind_address"`
VNCPortMin uint `mapstructure:"vnc_port_min"`
VNCPortMax uint `mapstructure:"vnc_port_max"`

View File

@ -124,7 +124,9 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error
}
} else {
if qemuMajor >= 2 {
if !config.UseDefaultDisplay {
defaultArgs["-display"] = "sdl"
}
} else {
ui.Message("WARNING: The version of qemu on your host doesn't support display mode.\n" +
"The display parameter will be ignored.")

View File

@ -236,6 +236,10 @@ Linux server and have not enabled X11 forwarding (`ssh -X`).
switch/value pairs. Any value specified as an empty string is ignored. All
values after the switch are concatenated with no separator.
- `use_default_display` (boolean) - If true, do not pass a `-display` option
to qemu, allowing it to choose the default. This may be needed when running
under OS X.
\~> **Warning:** The qemu command line allows extreme flexibility, so beware
of conflicting arguments causing failures of your run. For instance, using
--no-acpi could break the ability to send power signal type commands (e.g.,