How to change console resolution on Linux ( RHEL / CentOS / Fedora / etc)

If, like me, you use Linux for your server, you might not have a graphical (X) console.
So, out of the box, you’re stuck with a large screen and very big characters on it. It’s the all time standard 80×25 text console.
I wanted to make that a bit more useful for daily work, so I decided to change the resolution so I could get lots more text on the console.
This is quite simple. All you have to do is add an extra kernel parameter for the Linux kernel when booting.
On RHEL derivates this done by editing the /boot/grub/grub.conf file and adding vga=791 to the kernel line. That will give you a so called frame buffer console with a 1024×786 resolution after the next boot.

This is the part from grub.conf that you’re looking for:

title CentOS (2.6.18-53.1.19.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.1.19.el5PAE ro root=/dev/VolGroup00/LogVol00 console=ttyS0,57600 console=tty0
initrd /initrd-2.6.18-53.1.19.el5PAE.img

And you just add vga=791 to the kernel line like this:

title CentOS (2.6.18-53.1.19.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.1.19.el5PAE ro root=/dev/VolGroup00/LogVol00 console=ttyS0,57600 console=tty0 vga=791
initrd /initrd-2.6.18-53.1.19.el5PAE.img

Easy, isn’t it?
You can use some other numbers for the vga kernel parameter. A few examples are:

791 - 1024x768, 16 bit
792 - 1024x768, 24 bit
794 - 1280x1024, 16 bit
795 - 1280x1024, 24 bit

Don’t forget to reboot after you make this change!

2 thoughts on “How to change console resolution on Linux ( RHEL / CentOS / Fedora / etc)

  1. Pingback: Command Line

  2. Pingback: Tagging the Web Daily 07/20/2013 | PAB Skunkworks Weblog

Leave a Reply