Tuesday, August 09, 2005

Debian console resolutions

That was one of these things I expected to be difficult and probably not worth the trouble. It turned out to be so easy, that you may wonder why I even talk about it.

The default console is 640 x 480, but that is not the resolution current LCD monitors are built for. So it would be nice to have the Linux console use the appropriate reolution for your monitor, to have more and sharper text on the screen.

Searching for things like "debian console resolution", I got the impression I would have to recompile the kernel. While not difficult, it definitely seemed like far too much trouble.

The article that discouraged me at first but then also gave me the answer is "Jazz Up Your Debian System Boot". It allows you to add a graphical boot splash, and run the console in the graphics mode of your choice.

I didn't care about the splash screen, so I just tried a tiny part of the instructions: I added vga=791 to the kernel line in /boot/grub/menu.lst and rebooted into a 1024 x 768 text console. That was it.

The number to give to the vga option depends on the resolution and color depth you want:
Colors        | 800x600   1024x768   1280x1024

256 (8bit)| 771 773 775
32K (15bit)| 787 790 793
65K (16bit)| 788 791 794
16.7 M (24bit)| 789 792 795

This is my entry in grub's menu.lst:
title           Debian GNU/Linux, kernel 2.6.8-2-686 @ 1024 x 768
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda1 ro vga=791
initrd /boot/initrd.img-2.6.8-2-686