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
‘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
linux...
lines, why not just append what you need to these lines?vga=ask
entry to the command line of the grub.conf file for Slackware with and without doing anupdate-grub2
, still it did not work. I also lost my entry for arch with theupdate-grub2
but fortunately I got my entry for arch back since I had backed up my unmodified grub.conf file.