16

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 80x50 instead of the default 80x25 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 (80x50).

I've seen 80x50 and 80x60 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.

  • Related: How Do You Pass VGA/VESA Modes with GRUB2? – Marc.2377 Jul 27 '17 at 7:58
  • The vga parameter applies to the kernel, not to grub2. No matter how grub2 developer is trying to make simple complex, it still works as long as the kernels understand this parameter. – ajeh May 20 '18 at 0:15
9

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
  • 1
    This works for me when I edit the /etc/default/grub by appending vga=792 to the existing value of GRUB_CMDLINE_LINUX – Shashank Vyas Dec 26 '16 at 7:45
  • A Ubuntu update today installed new grub UEFI boot stuff and proposed a command line change to add vga=current along with crash dump stuff. I declined the changes but came here wondering what vga=current meant. – WinEunuuchs2Unix Jan 5 '18 at 18:42
1

The vga parameter is still supported with the linux16 and initrd16 commands, so if you change "linux" to "linux16" or "initrd" to "initrd16" you can get the old behavior. I'm not sure what other changes that causes, but it worked well enough for me. :-)

  • This is great advice! Just press e to edit in grub2, then navigate down to where it says linux and put 16 at the end. Then you can put vga=ask at the end of the line. If framebuffer is still enabled in the kernel, it'll probably switch away from fast VGA text to that mode fairly soon though. – Alex Cannon Feb 21 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.