11

One of my machines has a 3 TB HD setup to triple boot into Mint 14 (Ubuntu 12.10 variant), Slackware 14.1 and Arch Linux. The HD is formatted using the GPT/Guid system. The Grub2 technically "belongs" to the Linux Mint install but is used to triple boot all 3 systems. Setting it up about 1 year ago was an extremely painful procedure and required 2-3 days of wrestling with it, and tweaking it, to allow it to recognize the Slackware and Arch installs; it always recognized the Mint Linux install easily.

I need to be able to pass VGA/VESA modes to Slackware and Arch. I use Slackware and Arch from the command line and therefore console resolution and font size are important factors.

| improve this question | | | | |
  • Within your grub config are the linux...lines, why not just append what you need to these lines? – slm Jan 2 '14 at 2:37
  • @slm I tried earlier, before posting my question, to add a vga=ask entry to the command line of the grub.conf file for Slackware with and without doing an update-grub2, still it did not work. I also lost my entry for arch with the update-grub2 but fortunately I got my entry for arch back since I had backed up my unmodified grub.conf file. – haziz Jan 2 '14 at 21:04
20

In GRUB2 the preferred method of setting framebuffer resolution (to GRUB and the kernel) is to edit /etc/default/grub to contain these variables:

  • GRUB_GFXMODE sets the resolution of GRUB
  • GRUB_GFXPAYLOAD_LINUX controls whether the linux kernel will keep the resolution, and if you want the linux kernel to use different resolution than GRUB, you can set it with this variable in form widthxheight.

To show all modes you can use:

  • hwinfo --framebuffer in linux terminal
  • vbeinfo in GRUB prompt

Sample configuration of framebuffer resolution

These lines are inserted to /etc/default/grub:

GRUB_GFXMODE=1024x768x32
GRUB_GFXPAYLOAD_LINUX=keep

In order to generate the changes, run

# grub-mkconfig -o /boot/grub/grub.cfg

Excerpt from GNU GRUB Manual 2.00

‘GRUB_GFXMODE’

Set the resolution used on the ‘gfxterm’ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ‘auto’, which tries to select a preferred resolution. See gfxmode.

‘GRUB_GFXPAYLOAD_LINUX’

Set to ‘text’ to force the Linux kernel to boot in normal text mode, ‘keep’ to preserve the graphics mode set using ‘GRUB_GFXMODE’, ‘widthxheight’[‘xdepth’] to set a particular graphics mode, or a sequence of these separated by commas or semicolons to try several modes in sequence. See gfxpayload.

Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this option to ‘text’ and GRUB will tell Linux to boot in normal text mode.

References

| improve this answer | | | | |
  • It appears that instead of running grub-mkconfig, it is recommended to run update-grub (which runs grub-mkconfig). – Per Lindberg Nov 25 '16 at 9:22
  • I don't have update-grub or update-grub2 on my Fedora Server 26 installation. Instead I run sudo grub2-mkconfig -o $(sudo find /boot -name grub.cfg). One command for EFI and non-EFI systems. – Robpol86 Aug 26 '17 at 21:14
2

In legacy grub, we used to pass VGA/VESA mode in kernel line as VGA=1024x768 In grub2, same can be achieved by line gfxpayload=1024x768

Follow more info here

| improve this answer | | | | |

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.