How do I tell GRUB2 to set its resolution (and also the one passed to the kernel) to the maximum one it can detect at time of boot?
I presume the reason you are asking about this is that you use different monitors on the same Ubuntu machine and you want GRUB2 to look good on all of them. However, if you are concerned about the resolution used once Ubuntu boots, this does not address that. GRUB2 does not "pass on to the kernel" the resolution it selects for the boot menu.
(You would run that in the Terminal, which you can open by pressing Ctrl+Alt+T.)
To edit it with Gedit as
(Or if you're using Kubuntu, run
You'll get a lot of messages in the Terminal, if you run that command in the Terminal rather than with Alt+F2. You'll notice they don't say they pertain to the file you're editing, so that's fine.
You'll find that part of the file says something like this:
Uncomment (i.e., remove the leading
Save the file and quit the editor. In the Terminal, run:
(This must be run after every modification to
Now reboot, and see if that does what you want.
It might not (as it uses the "platform default" which might not be the highest possible). If that is the case, edit
You will not necessarily want to use exactly that line. You should list all the resolutions you want to be tried, in the order you want them to be tried. The resolutions I have listed are the most standard resolutions for monitors with a 4:3 aspect ratio, but widescreen monitors (including most laptop screens these days) have different form factors and use different resolutions. Wikipedia has a list of common resolutions which may help you. If you know the specific resolutions you want for each device, you can just list them (highest first). You should probably include
Then save the file again, run
If it doesn't, you may be out of luck. GRUB2 doesn't display video the same way as Ubuntu does once it's booted. GRUB2 uses VESA BIOS Extensions to display the boot menu with enhanced resolution (and color depth), and a machine's maximum resolution through VBE is not always as high as the maximum resolution supported by the video card and monitor.
[Finally, thanks to TechZilla for pointing out a serious error in the original version of this answer.]
There's also a GUI option available.
Grub Customizer allows to edit, rename, re-order or freeze Grub entries. It also allows to change the background colors of Grub menu or add a custom picture and supports BURG customization also. You can also use Grub Customizer from a Live CD/USB environment to fix your boot issues.
Hit Alt+Ctrl+T to open terminal and run following commands:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer sudo apt-get update sudo apt-get install grub-customizer
How to use:
Once installed, hit Alt+F2, type
Authenticate by giving your user password.
Once open, click on
Or specified with depth (8, 16 or 24):
To remove Grub Customizer run following commands in terminal:
sudo apt-get autoremove --purge grub-customizer sudo add-apt-repository -r ppa:danielrichter2007/grub-customizer sudo apt-get update