Linux – GRUB2 and kernel vga= parameter

bootgrub2linux-kernelparameter

According to the documentation, use of the vga= kernel parameter is deprecated as of GRUB2. The fact that some newer kernels don't seem to support it anymore on certain adapters is of no concern as the graphics card I have is seven to eight years old.

The problem now is that I would like to use a higher resolution text mode, such as 80×50 instead of the default 80×25 characters. Apparently all graphics (VBE/VESA) modes are out of the question for this graphics card (ATI Rage XL) – the list of available modes only shows 0 through 6. 6 is 80x60 but looks horrible, so I'd like to go with 1 (80×50).

I've seen 80×50 and 80×60 working after getting the list of available modes whenever the default mode wasn't supported (with the default commented out GRUB_TERMINAL=console) and I was prompted to choose.

How can I set the mode, if I'm not supposed to set it on the kernel command line and every use of GRUB_GFXMODE (with or without preloading vbe module) and GRUB_GFXPAYLOAD_LINUX=keep fails? Fails as in: screen stays blank because it's an invalid graphics mode for the card I have in this machine?

My idea would be to pass nomodeset to the kernel still, but the boot loader would then still have to set the graphics mode. And I can't see any options other than the vga= kernel parameter for doing that.

Note: the vbetest and videotest commands on the GRUB2 console will blank the screen and then the screen switches to sleep mode after claiming there is no video input. vbeinfo and videoinfo show a few available modes other than the above mentioned, but there is no mentioning of where this should be set. Also, when passing vga=1 (without nomodeset) on the kernel command line, I see a very brief warning about it being deprecated, but it's too long to read completely – and the output doesn't appear in dmesg.

Best Answer

Maybe it is deprecated by grub2, however it should still work and must continue to work. It works for me using grub2 and debian wheezy as well as rhel7.3 (confirmed 01-2017). Also according to the official documentation it is not deprecated:

https://www.kernel.org/doc/Documentation/x86/boot.txt

If the command line provided by the boot loader is entered by the user, the user may expect the following command line options to work. They should normally not be deleted from the kernel command line even though not all of them are actually meaningful to the kernel.

vga= here is either an integer (in C notation, either decimal, octal, or hexadecimal) or one of the strings "normal" (meaning 0xFFFF), "ext" (meaning 0xFFFE) or "ask" (meaning 0xFFFD). This value should be entered into the vid_mode field, as it is used by the kernel before the command line is parsed.

And https://www.kernel.org/doc/Documentation/svga.txt will tell you all you need to know. Below a few examples of resolutions I commonly use:

vga=0x31b --> 1280x1024x32
vga=0x34d --> 1600x900x32
vga=0x31e --> 1600x1200x32

To get a list of supported modes use:

vga=ask

For a 1024×768x24 screen which I found works on pretty much all systems and monitors I use (this time in decimal and in hex):

vga=792
vga=0x318
Related Question