Repository navigation
build_library: use -nographic for headless amd64 qemu - #4400
Yashika0724 wants to merge 2 commits into
Conversation
QEMU defaults to GTK when the helper runs on x86_64, which fails on hosts with no display server. Pass -nographic only when DISPLAY and WAYLAND_DISPLAY are unset so a local graphical session still gets a window. Fixes flatcar/Flatcar#1687 Signed-off-by: Yashika <ssyashika1311@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
It obviously depends on the build, but I don't think the GUI toolkit is ever arch-specific in practise. I would prefer to only use |
GTK init fails on a headless amd64 host. Add -nographic when DISPLAY and WAYLAND_DISPLAY are unset, unless the user already chose a display. Leave arm64 on -nographic. Signed-off-by: Yashika <ssyashika1311@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Moved the check so it is not tied to the amd64+x86_64 line. amd64 and arm64 is unchanged and still always passes I read "when there is a display" as "when there isn't one". The other way would leave the gtk failure in place. |
Summary
build_library/qemu_template.sh(shipped asflatcar_production_qemu.sh) adds-nographicfor every host except x86_64. On a headless x86_64 host QEMU tries GTK and exits withgtk initialization failed.-nographiconly whenDISPLAYandWAYLAND_DISPLAYare both unset. A desktop session still gets a window. Arguments after--still override this.Fixes flatcar/Flatcar#1687
flatcar/scripts#2752 adds
-nographicunconditionally. Review on that PR asked for a display-server check instead: a window helps diagnose early boot, and on amd64 the default console is tty0 rather than the serial port. Early kernel messages still go to tty0 unless the guest command line includesconsole=ttyS0. This change only stops the GTK failure so the VM can boot.An LLM assisted with the patch and this description.
Test plan
bash -n build_library/qemu_template.shunset DISPLAY WAYLAND_DISPLAY), run the amd64flatcar_production_qemu.shand confirm it no longer fails withgtk initialization failedDISPLAYorWAYLAND_DISPLAYset, confirm a window still opens-- -nographicand-- -display gtkand confirm those winMade with Cursor