Skip to content

Commit 6da360e

Browse files
committed
Add -nographic option, instead of -display none
Mostly for ancient KVM versions, where -display hadn't been invented yet (happened in 2011). I'm looking at you, RHEL6.
1 parent 4400545 commit 6da360e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Options:
2020
- `--qemu-disk-size`: Size of disk for the host in MB. Default: `20000`
2121
- `--qemu-memory`: Size of memory for the host in MB. Default: `1024`
2222
- `--qemu-program` : Name of the qemu program to run. Default: `qemu-system-x86_64`
23+
- `--qemu-nographic` : Use -nographic instead of -display none. Default: false
2324
- `--qemu-network`: Networking to be used: user, tap or bridge. Default: `user`
2425
- `--qemu-network-interface`: Name of the network interface to be used for networking. Default: `tap0`
2526
- `--qemu-network-address`: IP of the network address to be used for networking.

qemu.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type Driver struct {
3939
DiskSize int
4040
CPU int
4141
Program string
42+
Nographic bool
4243
Network string
4344
PrivateNetwork string
4445
Boot2DockerURL string
@@ -80,6 +81,10 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
8081
Usage: "Name of program to run",
8182
Value: "qemu-system-x86_64",
8283
},
84+
mcnflag.BoolFlag{
85+
Name: "qemu-nographic",
86+
Usage: "Use -nographic instead of -display none",
87+
},
8388
mcnflag.StringFlag{
8489
Name: "qemu-network",
8590
Usage: "Name of network to connect to (user, tap, bridge)",
@@ -181,6 +186,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
181186
d.DiskSize = flags.Int("qemu-disk-size")
182187
d.CPU = flags.Int("qemu-cpu-count")
183188
d.Program = flags.String("qemu-program")
189+
d.Nographic = flags.Bool("qemu-nographic")
184190
d.Network = flags.String("qemu-network")
185191
d.Boot2DockerURL = flags.String("qemu-boot2docker-url")
186192
d.NetworkInterface = flags.String("qemu-network-interface")
@@ -361,9 +367,15 @@ func (d *Driver) Start() error {
361367

362368
var startCmd []string
363369

364-
startCmd = append(startCmd,
365-
"-display", "none",
366-
)
370+
if d.Nographic {
371+
startCmd = append(startCmd,
372+
"-nographic",
373+
)
374+
} else {
375+
startCmd = append(startCmd,
376+
"-display", "none",
377+
)
378+
}
367379

368380
startCmd = append(startCmd,
369381
"-m", fmt.Sprintf("%d", d.Memory),

0 commit comments

Comments
 (0)