65

When my computer goes to console mode (booting up, shutting down or Ctrl + Alt + F1)), the text is super big. I can't take a screenshot of it, but it looks like a 640 x 480 resolution. My monitor normally works at 1440 x 900.

I remember that the console text that appeared while installing from the CD was nice and small.

How can I make the console text look like it looked while booting from the CD?

10 Answers 10

40

I've found a solution that works from this forum post

In short:

Open /etc/default/grub with your favorite editor as root.

Localize the line that says GRUB_GFXMODE= ... and change it to the resolution you want. Add another line for a new variable called GRUB_GFXPAYLOAD with the same resolution. It should look similar to this:

GRUB_GFXMODE=1440x900x32
GRUB_GFXPAYLOAD=1440x900x32

Save and exit. Then edit as root /etc/grub.d/00_header

Localize the line that says if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=... . As before, change the resolution there to the one you want and add another line for payload:

if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=1440x900x32 ; fi
if [ "x${GRUB_GFXPAYLOAD}" = "x" ] ; then GRUB_GFXPAYLOAD=1440x900x32 ; fi

Finally, locate the line that says set gfxmode=${GRUB_GFXMODE} and add a line for payload below it. It should look like this:

set gfxmode=${GRUB_GFXMODE}
set gfxpayload=${GRUB_GFXPAYLOAD}

Save and exit.

Still as root, refresh grub with

update-grub2

Reboot, and both the grub menu and the console should have nicer resolutions.

Finished!

13
  • 1
    My solution will only work for grub2, I think. Are you using grub 1, maybe? If yes, try with a lower resolution first - for example 1024x768x32. Regards!
    – egarcia
    Jan 19, 2011 at 9:59
  • 1
    unfortunately didn't work for me, running 10.10
    – segfault
    May 24, 2011 at 22:12
  • 3
    Looks like that at the moment grub2 doesn't use 'GRUB_GFXPAYLOAD' option, only 'GRUB_GFXPAYLOAD_LINUX'. See the official documentation on grub2: gnu.org/software/grub/manual/grub.html#gfxpayload
    – mbaitoff
    Sep 15, 2011 at 9:16
  • 2
    It would be more interesting to see a response that is more generic, that will work with most resolutions.
    – sorin
    Nov 17, 2012 at 16:07
  • 2
    This answer is depreciated and did not work for me on Ubuntu Server 12.04 LTS. Furthermore, it involves editing a file named 00_header which really should not be edited. Jun 23, 2014 at 12:34
23

This helped me on Ubuntu 14.04 with ESXi 5.5 :

sudo vi /etc/default/grub

Change line to:

GRUB_CMDLINE_LINUX_DEFAULT="splash vga=792"

Then run:

sudo update-grub
sudo reboot -r now

Use 795 or 799 for higher resolution (More details here).

7
  • 1
    This solutions worked for me. The splash option froze the login screen and it is unnecessary in my opinion. Btw I really don't like the cryptic options like 792!
    – Kyr
    Jul 10, 2015 at 11:52
  • 1
    its deprecated in 15.04 Aug 21, 2015 at 21:57
  • works on fedora 21 too
    – Alex Jones
    Aug 31, 2015 at 12:09
  • @JiříDoubravský then what to do? other answers dont work
    – Alex Jones
    Aug 31, 2015 at 12:09
  • 1
    reboot command doesn't like the -r option, anyway.
    – Jin Kwon
    Dec 31, 2016 at 16:01
20
  1. Start in the GRUB menu
  2. Press C to go to the GRUB command line
  3. Run vbeinfo and make a decision (e.g. 1920x1200x32).
  4. Start your system again
  5. sudo nano /etc/default/grub
  6. Change GRUB_GFXMODE= (e.g. GRUB_GFXMODE=1920x1200x32)
  7. Set GRUB_GFXPAYLOAD_LINUX to GRUB_GFXPAYLOAD_LINUX=keep
  8. sudo update-grub
  9. reboot your system
9
  • among all the answers on this question, this is the one that worked for me with Ubuntu 16.04 server (and it's the simplest one) Aug 9, 2016 at 7:57
  • Wrt step 2 above: I find one should press 'c' for a command-line (not 'E')
    – kaiwan
    Oct 12, 2016 at 7:57
  • Doesn't work on VMware Workstation Player with Ubuntu 16.10
    – Sebi2020
    Nov 2, 2016 at 23:33
  • 1
    @0xC0000022L VMWare Workstation 10
    – Sebi2020
    Dec 8, 2017 at 11:22
  • 2
    For Ubuntu 18.04 and later, use videoinfo instead of vbeinfo.
    – robocat
    Dec 6, 2018 at 4:00
15

Set the graphics mode with GRUB_GFXPAYLOAD_LINUX

First, install xrandr and run it:

$ sudo apt-get install xrandr
$ xrandr

The available screen modes are listed.

Now, edit /etc/default/grub:

$ sudo nano /etc/default/grub

Assuming a previously unedited file, make the following changes:

The variable GRUB_CMDLINE_LINUX_DEFAULT should contain at least nomodeset, perhaps in addition to quiet and splash on desktop systems.

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"

On server systems, uncomment GRUB_TERMINAL=console to see more messages passing during boot before entering in the graphics console.

Leave this line as a comment:

#GRUB_GFXMODE=640x480

At the end of the file, add a line:

GRUB_GFXPAYLOAD_LINUX=1280x1024x16

or replace the value by any other (comma separated) mode(s) that is(are) supported by your hardware. The values text, keep, auto, vga and ask should also work.

Finally, after saving the edited /etc/default/grub with Ctrl+O and exiting it with Ctrl+X, issue the following commands:

$ sudo update-grub
$ sudo reboot

This answer will also work to decrease the resolution and/or refresh rate or frame buffer frequency on down-clocked systems. CRT monitors typically show flickering stripes when the refresh frequency is too high.

7
  • 2
    there is no hwinfo anymore
    – obayhan
    Feb 12, 2016 at 10:05
  • 1
    @obayhan Well noted! You may use xrandr instead. Feb 13, 2016 at 15:26
  • 1
    Works with 16.04.
    – Jin Kwon
    Dec 31, 2016 at 16:22
  • 1
    THIS. This is the only thing that worked for me on 16.10.
    – Siguza
    Mar 7, 2017 at 23:58
  • blurred text :-(
    – daGo
    Apr 14, 2020 at 18:44
5

Why i answer this threat even if it's very old? The answer is pretty easy, because so many other threat refer to it.

If vbeinfo or hwinfo --framebuffer doesn't show the native resolution of your display, then disable vesa, to do so remove vga= options in:

sudo nano /etc/default/grub

Search for GRUB_CMDLINE_LINUX_DEFAULT= and remove vga= if you find it.

If you have remove the option don't forget to generate a new grub.cfg:

sudo update-grub

If you don't know you did it well, then just reboot and open a terminal:

grep vga /proc/cmdline
grep -ir vga /etc/modprobe.d/

If grep doesn't show anything, then you removed the vga= option.

Now install uvesafb:

sudo apt-get install v86d

Make sure the uvesafb module is included into your initrd. Add it to the end of /etc/initramfs-tools/modules:

sudo sh -c "echo uvesafb >> /etc/initramfs-tools/modules"

To see what modes are available:

sudo modprobe uvesafb
cat /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes

Now configure uvesafb mode_option=YOURxResoultion-BitColorMode e.g. 1280x1024-32:

sudo sh -c "echo options uvesafb mode_option=1280x1024-32 scroll=ywrap > /etc/modprobe.d/uvesafb.conf"

Don't forget to rebuild your initrd:

sudo update-initramfs -k all -u

Now you can reboot!

See this for more details. It is for debian, but it also works for ubuntu. I hope it helped you and it should be more generic than using grub2.

1
  • +1 no need to change the grub config and uvesafb works for me on Ubuntu 16.04 with a proprietary nvidia driver (recommended in other places KMS is unsupported in this case)
    – jfs
    Sep 14, 2016 at 13:31
4

Just some personal background: in my other computer I have no problem with that fancy mode (it's 160 cols x 60 rows, but it has a 4:3 CRT monitor). It's equipped with a TNT2 (yes, I swear), and that mode was promptly displayed on first boot. Problem is, it does this by loading the nouveau driver, and this guy is still a bit faulty (in my case, it hangs the whole system when trying to move windows). So, to have an usable system, I had to downgrade to the old and stable nv driver, and also disabling mode-setting ('cause the kernel would always load nouveau when enabled). Note that I'm not using nVidia proprietary drivers, but like you, I was switched back to 80x25 in console mode.

This is because the nv driver doesn't use kernel mode-setting. Now, I don't know about the proprietary drivers, but I'm guessing they might have changed your configuration in order to be usable, and possibly that's why you're seeing that "big" mode. Possibly they disabled mode-setting when installed. That's why you see the "small" text mode when booting from the Live CD.

You could try booting up with a different VESA mode, but that depends a lot on your hardware. For that, please check http://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers. For example, if you'd like to try booting your text mode on 1024x640, you'll find that the mode ID is 877.

So, when booting, hold the SHIFT key (in case you don't have a GRUB timeout) to bring up GRUB's menu. Select the mode which you wish to boot and press 'e' (to edit the commands). At the end of the "kernel" command, add vga=877. The number is the mode ID, if you want to try other modes, replace it with the desired number.

Also, at that same Wikipedia page, you could also try the helpful "Universal format" right below the modes table. That hwinfo command is quite useful.

2
  • 1
    I use grub2, not grub. I didn't know that grub was responsible for the console, so I didn't mention that in my question. Sorry. I've found a solution with grub2. Regards!
    – egarcia
    Dec 22, 2010 at 4:55
  • To be true, the solution you found also seem simpler. Glad you sorted it out, and thanks for sharing! Dec 22, 2010 at 7:03
3

Ubuntu 18 console mode:

Edit

GRUB_CMDLINE_LINUX_DEFAULT="splash quite"

in

/etc/default/grub

so new line looks like:

GRUB_CMDLINE_LINUX_DEFAULT="splash quiet vga=XXX nomodeset"

where XXX comes from

https://www.pendrivelinux.com/vga-boot-modes-to-set-screen-resolution/

then reload grub config and reboot

update-grub2
reboot
3
  • It seems like this question has already a many similar answers. Perhaps you could clarify what motivated you to add your answer (i.e. what information was missing from previously posted answers).
    – cauon
    Mar 24, 2019 at 11:34
  • 1
    It's just simple. And suitable for newest Ubuntu 18
    – Paul Paku
    Mar 24, 2019 at 14:21
  • 1
    "splash quite" is a typo for "splash quiet" - this worthless editor won't let me change just that without making unnecessary changes elsewhere, so maybe you need to add your reasoning in the main body of the answer.
    – Rich
    Dec 17, 2019 at 19:09
1

This will not change the font on boot, but for the console on Ctrl+Alt+F[1-6]

Install the custom Ubuntu fonts for your console:

sudo apt-get install fonts-ubuntu-font-family-console

And create a script /usr/local/bin/fontset with this command:

#!/bin/sh
setfont /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz

(choose the desired fon out of the folder /usr/share/consolefonts/)

You can either call fontset each time on your console after using Ctrl+Alt+F1

or add this line to your /root/.profile

[ ! -t 0 ] && sleep 1 & /usr/local/bin/fontset

(don't add this to your users .profile or you get an error on a graphical boot)

source: Resize font on boot message screen and console

1

I was able to increase the console resolution on an Ubuntu server 20.04.2 VM by editing /etc/default/grub and setting GRUB_GFXMODE to the desired resolution (in my case, setting GRUB_GFXMODE=1152x864), and then by running sudo update-grub2. I was able to find the available resolution modes by running sudo hwinfo --framebuffer. I'm using grub 2.04.

0

The following worked for me on Debian Stretch 4.9.51-1.
No GUI, only console mode:

Edit /etc/default/grub and add the following line

GRUB_CMDLINE_LINUX_DEFAULT="splash vga=795 nomodeset"

For a list of vga= codes see http://pierre.baudu.in/other/grub.vga.modes.html

The nomodeset prevents the resolution from changing again after grub initializes [thanks How do I increase console-mode resolution? ]

EDIT: As mentioned by @Videonauth : Afterwards do: sudo update-grub

1
  • To make changes in /etc/default/grub is not enough, you as well need to run afterwards sudo update-grub to make it happen
    – Videonauth
    Oct 26, 2017 at 15:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .