I’ve installed a simple rocky 9 without a gui, to go into a DC and be used with a simple rack monitor.
The problem is when the system boots, it displays the grub menu at 800x600, but as soon as it starts loading the kernel the screen resolution changes to 1920x1200. This is far to much for my simple rack monitor. I can get onto it using IPMI but have to scroll around the screen on my laptop to see anything.
I don’t have the xwindows system, it is just the text console showing the text login: prompt so it certainly doesn’t need to be any more than 800x600. How can I change this?
I have found articles that say to change GRUB_GFXMODE and GRUB_GFXPAYLOAD_LINUX in /etc/default/grub and then run ‘grub2-mkconfig > /boot/efi/EFI/rocky/grub.cfg’ or ‘grub2-mkconfig > /boot/grub2/grub.cfg’ or to add ‘video=800x600’ to the kernel option. And of course many thing referring to xrandr and settings in xwindows that I don’t have installed. Nothing seems to have any effect. Immediately after the grub screen the resolution changes to 1920x1200 and my poor old monitor says ‘out of range’
I would be very grateful if anyone has any insights into how to change this so that when I inevitebly need to use the console I can
Thank you
Chris
Note: Some of that does not apply to Rocky 9, i.e. will probably break something. That is the danger of dated “info”.
In principle, the grub2-mkconfig computes a new grub.cfg. It does, but it does also “update grubenv file”, and could (but does not by default) “overwrite BLS cmdline args”.
The ‘video=800x600’ and ‘nomodeset’ are “BLS cmdline args” and would be in ‘GRUB_CMDLINE_LINUX’ of the /etc/default/grub. Yes, grub2-mkconfig --update-bls-cmdline could update them like the grubby --update-kernel=ALL --args="video=800x600", but there is no need to touch the grub.cfg, if BLS cmdline args are all you need to update. Hence the ‘grubby’ is more on point.
The grub2-mkconfig has also output option as alternative for the redirection:
That difference is subtle and usually should not matter.
What does matter is the /boot/efi/EFI/rocky/grub.cfg vs /boot/grub2/grub.cfg
Rocky 9 may have /boot/efi/EFI/rocky/grub.cfg, but that is not thegrub.cfg Thegrub.cfg in Rocky 9 is always (at least on x86_64) /boot/grub2/grub.cfg
Therefore, overwriting the /boot/efi/EFI/rocky/grub.cfg can cause confusion later.
I’m not expert on GRUB, but I guess that the GFXMODE and GFXPAYLOAD_LINUX affect primarily how GRUB shows its own menu and perhaps what the kernel shows initially. Hovewer, there is also a fact that kernel starts drawing messages in some mode, but at some point in boot it loads different/actual graphics driver and the mode does clearly change (with some drivers – for example Nouveau vs proprietary NVidia). It is the latter mode that you want to control and therefore the ‘video’ option (which kernel probably passes to the driver) seems more on point.
I guess to make the changes persistent across new kernel installations you also need to add the arguments to /etc/kernel/cmdline. Post install scripts of kernel packages execute kernel-install which relies on this file to create a new kernel entry (man 8 kernel-install).
I just used the command I gave in my post with the video arguments and after rebooting it was OK. That would suggest it is persistent, otherwise it wouldn’t have changed the resolution on reboot.