On Wed, 2 Dec 2020 at 16:51, Doug Evans <dje@google.com> wrote:
>
> Btw, if I may ask another dumb question, I get this:
>
> @ruffy:build-arm$ ./qemu-system-arm -M virt -monitor stdio
> Unable to init server: Could not connect: Connection refused
> QEMU 5.1.93 monitor - type 'help' for more information
> (qemu) gtk initialization failed
> <exit>
>
> If I add "-display none" then it works, but it's odd that it's trying to initialize with gtk here ($DISPLAY isn't set, there is no X present).
That's expected. By default we try to create a GUI window.
If DISPLAY is not set, then that fails, which is why
we print "gtk initialization failed" and exit.
This is the same behaviour as other GUI apps:
$ DISPLAY= xterm
xterm: Xt error: Can't open display:
xterm: DISPLAY is not set
$ DISPLAY= firefox
Unable to init server: Broadway display type not supported:
Error: cannot open display:
$ DISPLAY= evince
Unable to init server: Could not connect: Connection refused
Cannot parse arguments: Cannot open display:
If you don't want graphics you should tell QEMU you
don't want graphics (eg with '-display none').
This seems to me more helpful to most users than the
alternative (if you know you don't want the GUI then
it's easy to disable it; but most non-sophisticated
users do want it).
Thanks. That's not unreasonable.
OTOH, all those examples don't have a non-X mode.
As counterexamples there's emacs and gvim.
The present situation is fine, now that I understand it.
I can write a wrapper that DTRT.