The issue of being unable to use gfxmode in GRUB2, resulting in a console-only display, typically stems from a lack of compatible video modes supported by your hardware's firmware (BIOS/UEFI) or a misconfiguration in the GRUB settings. GRUB uses VESA BIOS Extensions (VBE) to display graphics, and the maximum resolution might be lower than expected. Troubleshooting Steps: Here are the steps to diagnose and fix the issue in Ubuntu:
-
Check Supported Video Modes in GRUB You need to determine which resolutions your system's firmware actually supports. Reboot your computer and enter the GRUB menu (you might need to hold down the Shift key or press the Esc key repeatedly during boot, depending on your setup). At the GRUB menu, press c to enter the command line interface. Type videoinfo or vbeinfo and press Enter (the exact command depends on the GRUB version; videoinfo is more common in recent Ubuntu versions). Note down the list of supported resolutions (e.g., 1024x768, 800x600). Press Esc to return to the menu and boot into Ubuntu.
-
Edit the GRUB Configuration File Once you know a supported resolution, you can configure GRUB to use it. Open a terminal in Ubuntu. Open the GRUB configuration file /etc/default/grub with a text editor using sudo:
sudo nano /etc/default/grub
Find the line #GRUB_GFXMODE=640x480 and uncomment it (remove the #). Change the resolution to one you found in the videoinfo list (e.g., 1024x768):
GRUB_GFXMODE=1024x768
You can also list multiple resolutions separated by commas, and GRUB will use the first one it can support:
GRUB_GFXMODE=1024x768,800x600,auto
Ensure the following line is also present and set to keep so the resolution carries over to the Linux kernel boot process:
GRUB_GFXPAYLOAD_LINUX=keep
Alternatively, if you only want the text console and no graphical mode, you can set GRUB_TERMINAL=console. Save the file (Ctrl+O, then Enter) and exit the editor (Ctrl+X). 3. Update and Reboot GRUB Apply the changes and restart your system. Update the GRUB configuration using the update-grub command:
sudo update-grub
Reboot your system to see if the changes took effect:
sudo reboot