When I booting to CentOS, the character is too small. Small character

I tried to config grub2 files following this solution, but it seems not work.

My /etc/default/grub file is :

enter image description here

So, how can I increase the font size?


Personally I would not touch your GRUB configuration files. Instead, I would add a setfont line to your shell initialization file.

For example, if you are using Bash, you could ask the following line to .bash_profile:

if [ $TERM = linux ]
    setfont sun12x22

There are lots of different fonts available; sun12x22 is just one example. See the setfont man page for more information.

| improve this answer | |
  • Thank you very much for your advising. I put your code in the /etc/profile.d/setfontsize.sh, then every user can change his font size when login. – Eric Oct 18 '17 at 8:43

The way to do this on a systemd operating system such as CentOS 7 is to edit the font settings in the /etc/vconsole.conf file. These settings are applied by the systemd-vconsole-setup service, which is essentially a glorified way of running setfont and loadkeys before the login services are brought up.

So you would have FONT=sun12x22 in that file, for example.

Note that the service program allows kernel command-line options such as vconsole.font to override /etc/vconsole.conf contents. If you are mucking around with GRUB kernel command-line options, bear this in mind.

Further reading

| improve this answer | |
  • That works! I use ls /usr/lib/kbd/consolefonts | grep 32 to find a latarcyrheb-sun32 font. Then edit the /etc/vconsole.conf file to change FONT to this font. And also edit /usr/lib/systemd/system/systemd-vconsole-setup.service file, change After=sysinit.target and Before=shutdown.target, then reboot. Then the font has changed before login. – Eric Oct 18 '17 at 9:55
  • The problem is that this approach changes the default font for all users. – fpmurphy Oct 18 '17 at 10:26

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.